A simple demo code to read dense matrices from files and solve linear systems with them.
cmake
: Third-party CMake modulesCMakeLists.txt
: CMake configuration filedata
: Various dense matricesconfig.yml
: SIDEMADE configuration filem3.csv
: A 3x3 matrix with randomly generated entriesm10.csv
: An ill-conditioned 10x10 Hilbert matrixm50.csv
: A 50x50 FEM mass matrix for a 1D problem with Lagrange basism100.csv
: A 100x100 FEM stiffness matrix for a 1D problem with Lagrange basism250.csv
: A 250x250 matrix with randomly generated entries
LICENSE
: MIT license filesrc
: Source codeConfiguration.hpp/cpp
: A yaml configuration readerMatrixSolver.hpp/cpp
: A convenience hull to solve dense matrix system by matrix decompositionsmatrixIO.hpp/cpp
: IO methods to read Eigen matrices from or write them to csv filesmain.cpp
: Main file
tests
: Unit tests
You can build the code using CMake:
$ mkdir build
$ cd build
$ cmake ..
$ make -j
- A C++ compiler supporting at least C++11
- CMake: At least version 3.12
- Eigen: At least version 3.2
- yaml-cpp: At least version 0.6
For unit testing moreover:
- Boost Unit Test Framework: Should work with most recent versions. The code was tested with 1.71.
You need to call the code with a configuration file, e.g. config.yml
.
If you call the program from the build folder:
$ ./sidemade ../data/config.yml
An example configuration file:
DecompositionType: QR
MatrixFileName: ../data/m250.csv
MatrixSize: 250
You can format the code base using clang-format:
$ clang-format -i src/*