jlt lib is a C++ and Matlab library of various utility functions that I found useful over the years, and which are used in many of my other projects.
jlt lib was written and is maintained by Jean-Luc Thiffeault.
There isn't any. In fact this library should really not be used by anyone, and I've mostly uploaded it so I can easily include it in other projects. If you feel brave, many functions have comments documenting their use, and there are examples in the testsuite folder.
Here is a list of some of the more useful C++ functions and classes, in the folder jlt. They can be included as #include "jlt/<filename>.hpp", so the folder containing jlt must be in the include files search path. The programs in testsuite are readily compiled with the SCONS build tool, but unless linking to external libraries is required g++ -O <prog>.cpp -o <prog> -I.. is usually sufficient.
-
jlt::vectoris derived fromstd::vector. Bounds-checking can be turned on or off at compile time, and the vectors have aprintMatlabFormmember function to output to Matlab format (text or MAT file), and aprintMathematicaFormto output in Mathematica text format. See alsojlt/matlab.hppbelow. -
jlt::matrixis a matrix class for 2D data. It is fairly efficient and implements similar output functions described forjlt::vectorabove. -
jlt::mathvectorandjlt::mathmatriximplement vectors and matrices with mathematical operations. Many operations can then be performed, such as eigenvalues and eigenvectors (injlt/eigensystem.hpp), LU and QR decomposition (jlt/matrixutil.hpp), and SVD (jlt/svdecomp.hpp). Many of these functions use LAPACK behind the scenes, so must be linked with-lblas -llapack. See the testsuite programsmathvector_test.cpp,eigensystem_test.cpp,qrdecomp_test.cpp, andsvdecomp_test.cpp. -
jlt/csparse.hppprovides wrappers for Timothy A. Davis's CSparse library, in particular conversion to and fromjlt::mathmatrix, wrapping CSparse functions in a namespacecsparse, and a typejlt::cs_unique_ptrderived fromstd::unique_ptrthat deallocates pointers automatically. Link with-lcsparse. See the testsuite programcsparse_test.cpp. -
jlt/lapack.handjlt/lapack.hppare wrappers for selected functions in the Fortran LAPACK libraries. Link with-lblas -llapack. -
jlt/matlab.hppprovidesprintMatlabFormfor exporting variables in Matlab MAT-file format or in formatted ASCII text. Some of this functionality is provided in-class byjlt::matrixandjlt::vectoras well, and is compiled in ifJLT_MATLAB_LIB_SUPPORTis defined. See the testsuite programmatlab_test.cpp, which writes amathmatrixandmathvectorto a MAT file. -
jlt/stlio.hppdefines simple iostream printing for some STL containers. -
jlt::polynomialis a polynomial class. See the testsuite programpolynomial_test.cpp. -
jlt::reciprocal_polynomialis specialized for monic reciprocal polynomials. -
jlt/prompt.hppis helpful for quick-and-dirty terminal prompts. -
jlt/exceptions.hppprovides some exceptions tailored to numerical problems, such asstepsize_too_small,failed_to_converge,too_many_steps. It also defines macros such asJLT_THROW, etc, which can be selectively redefined to compile out exception testing. (In the old days exceptions were a much bigger performance hit than they are now, I suspect, so it made sense to test a code and then remove exceptions completely.) -
jlt::tictocworks a bit like Matlab'sticandtocto time programs. It usesboost/timer/timer.hpp. See the testsuite programtictoc_test.cpp. -
jlt/vcs.hppprovides functions for extracting commit info from Version Control Systems, using Subversion keyword strings or dynamically in the case of Mercurial and Git. Seevcs_test.cppfor an example. Note that this is a bit fragile: if you run a command from outside the repo then the version information won't be detected. In that caseprintVCSBannersimply does nothing. -
Other
.hppfiles you might find in there are a bit dodgy and maybe haven't been tested in a while.
The folder matlab contains Matlab functions.
jlt lib is released under the MIT License. The Fourier differentiation matrix function fourdif.m was written by S. C. Reddy and J. A. C. Weideman.