This is my hobby C++ header-only math library including Analysis, Linear Algebra, Signal Processing. This library is utilized and tested in my several private projects.
- C++14 or above compiler
Unit test relies on several build tools. If you just want to use this library, you do not have to run test cases and setup the following tools.
-
CMake
-
Following pages and shell-scripts will help you install Google Test framework.
You just have to copy header files into your workspace and include them.
On Linux
./scripts/doDebugBuild.sh
./scripts/doTest.sh
On Windows Power Shell
./scripts/doDebugBuild.bat
./scripts/doTest.bat
You can clean output files by running doClean.sh
/ doClean.bat
, or simply deleting ./build
directory.
file | description |
---|---|
include/common.hpp | common settings
|
include/analysis.hpp | Analysis library
|
include/linAlg.hpp | Linear Algebra library
|
include/sigProc.hpp | Signal Processing library
|
include/RlsFilter.hpp | Recursive Least Square filter |
- It is assumed that the entries of any matrix are aligned on memory in row-oriented order (so called C-style array).
include/common.hpp
has a macro constant MATH_LIB_INLINE_AGGRESSIVELY
, which is defined as true
in default.
When this macro is defined as true
, some relatively-small functions are FORCIBLY in-line expanded.
You can find which functions are expanded by searching #if MATH_LIB_INLINE_AGGRESSIVELY
in MathLib include
directory.
You may have to switch this macro to false
when you have to keep the program size small due to lack of memory space.
include/common.hpp
has a macro constant MATH_LIB_ENABLE_CANARY_MODE
, which is defined as false
in default.
When this macro is defined as true
, some functions in MathLib performs costly parameter validations such as range check, and when encounter invalid parameters, the functions print error message to std::cerr
and exit with EXIT_FAILURE
.
When the validity of parameters are guaranteed, parameter validations are just waste of time. It is recommended to enable Canary Mode in experimental stage, and disable when the application becomes stable.