SAL (Stephe's Ada Library)
Current version: 3.5
SAL is a collection of stuff I've found useful in my current projects.
SAL includes several containers, similar to the Ada standard
containers, but customized for various purposes. See the history below
for a summary; see the files for the complete list.
SAL includes AUnit extensions; generic Check procedures, to allow
writing AUnit tests like this:
Check (Message => "square 2", Computed => 2**2, Expected => 4);
There are generics for access, discrete, integer, fixed point types,
arrays (1D, 2D, constrained/unconstrained, some with tolerance),
etc.
SAL includes a common set of makefile and GNAT project rules that
simplify higher level makefiles and project files.
Previous versions of SAL had other stuff; I'm no longer maintaining those.
Review the release history.
SAL is copyright 1998 - 2006, 2009, 2018 - 2021 by Stephen Leake, released
under GPL version 3 with the GNAT run time exception.
SAL may be obtained in two ways:
Development tools
If you'd like to compile SAL the way I do, here is the list of
tools I use.
History
- Version 3.5 4 Jun 2020
-
- Add sal-gen_unconstrained_array_image_aux
- Fix bug in sal-gen_unbounded_definite_vectors.adb First
- Version 3.4 9 May 2020
-
- Add sal-web_utils.ads
- Update for gnat pro 21, remove uses of Unrestricted_Access. This required spec changes in:
- sal-gen_unbounded_definite_vectors
- sal-gen_unbounded_indefinite_vectors
- sal-gen_definite_doubly_linked_lists_sorted
- sal-gen_unbounded_definite_stacks
- Version 3.3 13 Aug 2019
-
- Package sal-gen_bounded_definite_vectors-gen_sorted
re-written as sal-gen_unbounded_definite_vectors_sorted
- Convert some packages to Spark. Accessor functions returning
reference types moved to a -gen_refs.ads child package.
- sal-gen_bounded_definite_queues.ads
- sal-gen_bounded_definite_vectors.ads
- sal-gen_bounded_definite_vectors_sorted.ads
- New package sal-gen_bounded_definite_stacks.ads, in Spark
- Version 3.2 11 Jul 2019
-
- More changes for WisiToken, Emacs ada-mode
- Files that are released as Emacs ada-mode source are now copyright FSF.
- SAL.Gen_Graphs now takes graph size at runtime, provides Find_Cycles, Strongly_Connected_Components.
- Misc AUnit and Image packages.
- Version 3.1 13 Mar 2019
-
- Minor changes for WisiToken, Emacs ada-mode
- Version 3.0 15 Nov 2018
-
- Deleted lots of stuff I'm no longer using, added stuff for WisiToken
- Significant packages:
- sal-config_files
- Read and write configuration files, format similar to Java.
- sal-csv
- Read and write Comma Separated Value files, actually any delimiter.
- sal-file_names
- access parts of file names
- sal-gen_bounded_definite_queues
- sal-gen_bounded_definite_vectors
- sal-gen_bounded_definite_vectors-gen_sorted
- sal-gen_definite_doubly_linked_lists
- sal-gen_definite_doubly_linked_lists_sorted
- sal-gen_histogram
- generate gnuplot files for histograms
- sal-gen_indefinite_doubly_linked_lists
- sal-gen_stats
- Gather data points, produce mean, standard deviation
- sal-gen_unbounded_definite_min_heaps_binary
-
Wikipedia article on binary heap
- sal-gen_unbounded_definite_min_heaps_fibonacci
-
Wikipedia article on Fibonacci heap
- sal-gen_unbounded_definite_queues
- sal-gen_unbounded_definite_red_black_trees
-
Wikipedia article on red-black tree
- sal-gen_unbounded_definite_stacks
- sal-gen_unbounded_definite_vectors
- plain, comparable, and protected
- sal-gen_unbounded_indefinite_queues
- sal-memory_streams
- stream operations on memory buffers
- sal-network_order
- convert between native and network byte order
- sal-time_conversions
- conversions between various time representations
- Version 2.01 11 April 2009
-
- source tarball
- Compiles cleanly with GNAT GPL-2008, GNAT 6.2.0
- Lots of changes; it's been a while :). Not all listed here.
- spacecraft_math.tex now has examples, and more algorithms.
The notation is more consistent, and distinguishes more clearly
between active and passive rotations. New algorithms include:
- Velocity aberration
- Moment of inertia for fuel in various tank shapes.
- Articulated mechanisms.
- New code packages:
- sal-gen_math-gen_cubic : solving cubic equations
- sal-gen_math-gen_polynomials-gen_inverse : numerical polynomial inverse
- Version 2.00 18 June 2006
-
- Compiles cleanly with GNAT GPL-2006, GNAT 5.04a
- Does not compile with Cygwin release of gcc 3.4.4 Ada; that doesn't support Ada 2005.
- Lots of changes; it's been a while :). Not all listed here.
- GNAT 3.15p is no longer supported; SAL uses some Ada 2005 syntax.
- Lots more AUnit utilities.
- Lots more Config_Files features.
- Support both left- and right-multiply quaternions, via
SAL.Gen_Math.Gen_DOF_3.Gen_Left, .Gen_Wertz. See spacecraft_math.pdf.
- Add SAL.Gen_Math.Gen_Linear_Fit, SAL.Gen_Math.Gen_Polynomial_Fit.
- Add SAL.Generic_Decimal_Image_Unsigned.
- Add SAL.Intel_Hex_IO
- Add SAL.Network_Order.Arrays
- Delete SAL.Poly.Alg; it was not consitent with SAL.Gen.Alg, and not as useful.
- Version 1.70 7 August 2004
-
- Add gtk_more directory, with useful gtk widgets and test
utilities. Some of them aren't quite working.
- Change gnat project files to a standard naming convention.
- Interfaces_More renamed to SAL.Interfaces_More
- In SAL.Endianness, add better support for different length bitfields.
- In SAL.File_Names, add Replace_Environment_Variables, Resolve_Relative, special case ".".
- In SAL.Config_Files:
- use SAL.File_Names.Replace_Environment_Variables to
allow environment variables in config file names.
- Add Read_Iterator_Modular
- Add Read (Iterator) to get the current value.
- Allow nodes having a value and children.
- In AUnit, add catch all exception handler for Set_Up_Case, Tear_Down_Case.
- Add several *.AUnit children, to support AUnit tests of SAL types.
- In SAL.Time_Conversions, change Time_Type to fixed point, add extended ASIST format, other functions.
- Add Text_IO instantiations for Auto_Text_IO run time.
- Version 1.60 3 April 2004
-
- Delete sal-gen_math-gen_gauss; not a good implementation.
- New packages:
- sal-file_names
- sal-gen_sets
- sal-network_order-*
- sal-gen-queues-gen_bounded_nonlimited
- changes in Config_Files:
- Add option Read_Only on Open.
- Add option Case_Insensitive_Keys on Open.
- Add Iterator_Type for processing lists of keys.
- All errors in the config file raise
SAL.Config_File_Error, with a Gnu style error message.
- Add Is_Open.
- Add *.AUnit child packages, to aid in writing AUnit tests
of code that uses SAL.
- sal-gen_math-gen_dof_3.ads: Add "+" renaming of To_Unit_Vector.
- In spacecraft_math.tex, significantly improve discussions
of left multiply vs right multiply and passive vs active.
Add explicit references to Wertz and Kane.
- Version 1.51 16 Nov 2003
-
- Replace Build/Gnat_Debug, Build/Gnat_Release with
Build/debug_windows_x86_gnu,
Build/release_windows_x86_gnu; better organization of
compiler options.
- Delete _ROOT from all environment variable names.
- In spacecraft_math.tex, add discussion of vector, scalar
formulation of quaternions.
- Move a copy of Grace.Config_Files into SAL; easier to use
and maintain.
- In AUnit.Test_Cases, add dispatching Set_Up_Case.
- Version 1.50 2 Sept 2003
-
- Merge Auto_Text_IO run-time into SAL; SAL.Gen_Array_Text_IO is
significantly different.
- Use Auto_Text_IO to generate all Text_IO children in SAL;
they now all provide Get procedures.
- SAL.Polynomials renamed to SAL.Gen_Math.Gen_Polynomials;
test changed to an AUnit test.
- New package SAL.Gen_Math.Gen_Gauss for Gaussian distributions.
- New package SAL.Gen_Math.Gen_Stats for mean and standard deviation.
- In SAL.Poly.Lists.Double:
- add procedure Add; rename of Insert_Tail.
- add procedure Replace.
- In SAL.Poly.Alg; delete generic parameter Item_Type; only
used in lower level packages.
- generic_array_text_io_83 renamed to gen_array_text_io_83
- test_math_float_den_hart changed to an AUnit test
- In Makerules, delete standard_debug.gpr,
standard_release.gpr; simpler to use standard_common.gpr directly.
- Version 1.06 24 April 2003
-
- Updated to GNAT 3.15p
- New package: SAL.Gen_FIFO
- SAL.Gen.Alg : move generic formal parameter Item_Type to
child package where it is actually needed. (Suggested by a warning in
GNAT 5.01).
- SAL.Poly.Unbounded_Array : add generic formal parameter Index_Type.
- SAL.Poly.Stacks.Unbounded_Array : add procedure Pop (Stack, Item).
- SAL.Gen_Array_Text_IO : delete unnecessary generic formal
parameter Zero_Index_Type. Note that Auto_Text_IO has a more powerful
generic array text io package.
- Lots of files : add "constant" where GNAT 3.16a
suggests it.
- Lots of files : add "pragma Unreferenced" where GNAT 3.15p
suggests it.
- Add Maxima files for documentation derivations.
- Improve some algorithms in SAL.Gen_Math.Gen_DOF_3, Gen_DOF_6 based on Maxima results.
- Add Maxima files for documentation derivations.
- Add spacecraft_math documentation; documents algorithms in SAL.Gen_Math.Gen_DOF_3, Gen_DOF_6.
- Changed some tests to use the Aunit framework; they
generated slightly different results on different platforms, so simple
diff was no longer enough.
- Makefile "include"s are cleaned up; all now done from the top Makefile.
- Version 1.05 26 September, 2002
-
- Added Runge-Kutta 4th order integrator
(sal-gen_math-gen_runge_kutta_4th.ads), used in 6 DOF kinematic
integrator (sal-gen_math-gen_dof_6-gen_integrator.ads).
- Gen_Math.Gen_DOF_6.Inertia is no longer private; there was no real reason for it.
- Gen_Math.Gen_DOF_3.Gen_Image, Gen_Math.Gen_DOF_6.Gen_Image
provide String images of types.
- Fixed a bug in Gen_Math.Gen_DOF_3.To_Mag_Axis.
- Gen_Math.Gen_DOF_3.Inverse (inertia) is new, and optimized by Maxima code.
- Gen_Math.Gen_DOF_6.CM_Mass_Type is new; simpler mass object.
- Poly.Unbounded_Arrays now have a default Initialization,
so they are easier to use.
- Version 1.04b 26 July, 2002
-
- Add Null_List and "function None return Iterator" to
SAL.Poly.Lists.Double, for Grace.Lists implementation.
- Version 1.04 14 June, 2002
-
- Add SAL.Gen_Math.Gen_Manipulator and associated packages,
instantiations, and tests.
- Version 1.03 9 December, 2001
-
- Add missing SAL.Endianness package. Clean up SAL.Convert_Word_Order packages, add test.
- Add SAL.Gen.Math packages, instantiations, and tests.
- Add other missing tests.
- Version 1.02 17 November, 2001
-
- In sal-poly-binary_trees-sorted, change Boolean
Allow_Duplicate_Keys to enumeral Duplicate_Key_Action.
- Add helper package sal-aux-sort_indefinite_items_definite_keys.
- Add test for Gray_Code.
- Add test for Polynomials.
- Version 1.01 2 October, 2000
- Significant upgrade; refined notion of "containers", added many
containers and algorithms. Upgraded to
GNAT 3.13p. Dropped support for ObjectAda.
- Version 1.00 19 October, 1999
- First release.
Last modified: Tue Feb 16 10:36:22 Pacific Standard Time 2021