MARIA is an open-source Fortran library for working with low-rank matrices and tensors:
- truncated SVD
- truncated SVD with sketching
- adaptive cross approximation with rook pivoting
- cross approximation based on the maximum-volume principle
- cross approximation based on the maximum-projective-volume principle
- elements of Riemannian geometry of fixed-rank matrices
- tensor-train SVD
Note: MARIA will not be developed further as a Fortran library, it will be ported to Julia
MARIA is inspired by LAPACK and provides
- single- and double-precision versions of every subroutine
- maximum control over memory allocation
- written in modern Fortran 2008
- source code structured with modules and submodules
- automated build with CMake and 6 configuration presets
- automated testing with CTest
- source code documentation with FORD
The build and testing processes for MARIA are automated with CMake and CTest, respectively.
-
Navigate to the root folder of MARIA (
maria, by default)foo@bar:~$ cd <path_to_maria>/maria/
-
Choose one of the 6 available configuration presets
Preset Compiler Mode LAPACK gnu-debug-lapackgfortranDebug ObenBLAS intel-debug-mklifortDebug Intel MKL (parallel) intel-debug-mklseqifortDebug Intel MKL (sequential) gnu-release-lapackgfortranRelease ObenBLAS intel-release-mklifortRelease Intel MKL (parallel) intel-release-mklseqifortRelease Intel MKL (sequential) Note: when using one of the Intel presets, make sure that
ifortand Intel MKL are available by runningfoo@bar:~$ source /opt/intel/oneapi/setvars.sh intel64
or
foo@bar:~$ source /opt/intel/mkl/mklvars.sh intel64
In addition, it may be required to change the
-mklcompiler flag inCMakePresetes.jsonto-qmkl. -
Build the code by typing
foo@bar:~<path_to_maria>/maria$ cmake -S . --preset <preset_name> foo@bar:~<path_to_maria>/maria$ cmake --build --preset <preset_name>
This will create a folder
<path_to_maria>/maria/build/<preset_name>and put the corresponding binaries there. -
You can check that the code is built correctly by running the unit tests:
foo@bar:~<path_to_maria>/maria$ ctest --preset <preset_name>
You can generate the source code documentation with FORD and view it as an HTML page. FORD can be installed with
pip install fordThen, go to the documentation folder and run FORD:
foo@bar:~<path_to_maria>/maria$ cd ./doc
foo@bar:~<path_to_maria>/maria/doc$ ford ./ford.mdThis will create a ford_html folder with index.html inside.