Composyx
Table of Contents
- 1. General overview
- 2. The composyx library
- 3. Coding tools
- 4. Matrix interface
- 5. Datatypes
- 6. MPI wrapper
- 7. Parallel domain decomposition
- 8. Solvers
- 9. Preconditioners
- 10. I/O
- 11. Linear algebra tools
- 12. Kernels
- 13. Graph and partitioning
- 14. Unit test matrices
- 15. Benchmark results
1. General overview
Go upstream.
See the pdf version.
Composyx
(previsouly Compose
, or Maphys++
) is a linear
algebra C++ library focused on composability. Its purpose is to
allow the user to express a large pannel of algorithms using a
high-level interface to range from laptop prototypes to many node
supercomputer parallel computations.
See tutorial for more information on how to use the library.
2. The composyx library
2.1. Introduction
composyx
provides its own basic linear algebra datatypes for matrices, vector,
… It is also possible to use external datatypes with composyx
tools.
2.2. Namespace
The C++ namespace used by Composyx is composyx
.
using namespace composyx;
2.3. Scalar types
In the rest of the documentation, we refer to Scalar
for the following C++ types:
float
: single precision (32 bits) real;double
: double precision (64 bits) real;std::complex<float>
: single precision (64 bits) complex;std::complex<double>
: double precision (128 bits) complex.
Those are the types supported by composyx
datatypes, in other words the types
of data that can be stored in a vector or a matrix.
We may also refer to Real
as the real type associated to the Scalar
type. It
is for example the type you should use for a norm or a tolerance criterion for
an iterative method. For real types (float
and double
), Scalar
and Real
are the same, but not for complex types. For instance, the Real
type
associated to std::complex<float>
is float
.
In composyx
, one can access the Real
type associated to a Scalar
as follows:
using Real = typename composyx::arithmetic_real<Scalar>::type;
See Arithmetic for more details.
2.4. Linear algebra conventions
2.4.1. Functions on vector
With two vectors \(u, v\)
composyx::dot(u, v)
is the scalar product of \(u\) and \(v\).composyx::size(u)
is the size of the vector \(u\).
2.4.2. Functions on matrices
For a matrix A
, when it's relevant to do so, we define the following
functions in the namespace composyx
:
n_rows(A)
andn_cols(A)
respectively the number of rows and columns of the matrix.transpose(A)
the transpose ofA
. IfA
has complex coefficients, the imaginary part is kept the same. For objects defined incomposyx
type, we can also useA.t()
.adjoint(A)
the conjugate transpose ofA
. IfA
has real coefficients, it is equivalent astranspose(A)
. For objects defined incomposyx
type, we can also useA.h()
.
2.4.3. Arithmetic operators
The usual operators (\(+, -, *\)) should be defined for vectors and matrices. If dimensions are not consistent an exception will be thrown. The operator \(/\) can also be used for division by a scalar value.
2.4.4. Special operators for pseudo-inverses
On composyx
objects, operators ~
and %
have special semantics.
2.4.4.1. Operator~
The unary operator ~
is used as an equivalent of the
pseudo-inverse \(A^+\) of a matrix \(A\). When it's possible and
relevant, writing
auto A_pi = ~A;
will create an instance of an operator pseudo-inverse of A
in
A_pi
. For example, if A
is a square matrix, A_pi
will be a
linear solver that can be called on a vector b
to return x
such
that \(A x = b\), in other word you can see A_pi
as the operator
\(A^{-1}\).
2.4.4.2. Operator%
The binary operator %
is inspired from matlab's \
operator:
auto x = A % b;
is equivalent computing \(x = A^+ b\). It's also equivalent of writing:
auto x = ~A * b;
It is recommended to use ~A
rather than this operator, especially if
you want to use several times the solver instance ~A
. For example,
if you want to solve a system with successive right-hand sides, using
~A
to keep an instance of the solver is better. It will possibly
store a factorization of \(A\) or some data about \(A\) to accelerate the
solving phase. If you use the %
operator, this information will be
computed again at every solve.
2.4.4.3. Choosing dense kernels and solvers
For the selection of the dense kernels and solvers used by default with these operators, see Dense kernel selection
3. Coding tools
3.1. Arithmetics
3.2. Error management
3.3. Algorithms for 1D arrays
3.4. Cross product iterator
3.5. Macros
3.6. SZ compressor wrapper
4. Matrix interface
4.1. Basic concepts
4.2. Linear algebra concepts
4.3. Common traits and definitions
4.4. Dense kernels static and dynamic selection
4.5. Eigen wrapper
4.6. Eigen dense solver
4.7. Eigen sparse solver
4.8. Armadillo wrapper
5. Datatypes
5.1. Matrix properties
5.2. Dense vectors and matrices
5.2.1. Dense data
5.2.2. Dense matrix
5.2.3. Expression templates for dense matrices
5.3. Diagonal matrices
5.4. Sparse matrices
5.4.1. Base sparse matrix class
5.4.2. Sparse matrix COO
5.4.3. Sparse matrix CSC
5.4.4. Sparse matrix LIL
5.5. Partitioned vectors and matrices
5.5.1. Partitioned base class
5.5.2. Partitioned operator
5.5.3. Partitioned vector
5.5.4. Partitioned matrix (domain decomposition style)
5.5.5. Partitioned dense matrix
Experimental feature. Interface is expected to change.