ug4
libAlgebra

For any questions, contact marti.nosp@m.n.ru.nosp@m.pp@gc.nosp@m.sc.u.nosp@m.ni-fr.nosp@m.ankf.nosp@m.urt.d.nosp@m.e .


Small Algebra


The small_algebra has two main classes:

Both are meant to work with small, dense matrices/vectors (for ex. n=1..100). You specify the storage policy by using DenseMatrix<StoragePolicy>, for example

DenseMatrix<FixedArray2<double, 2, 3, ColOrdering> >

creates a fixed 2x3 matrix of doubles in column-first-ordering,

DenseMatrix<VariableArray2<float> >

creates a variable sized float-matrix. Use resize to specify the actual size. DenseVector is similar, but uses VariableArray1 and FixedArray1, or std::vector.
Feel free to add functionality to small_algebra. Before using your own DenseMatrix class in your code, make sure it is impossible to use this one as it is or when you expand it. When you make your eigenvalue / KKT solver DenseMatrix-compatible, everyone can use your solver. See also LAPACK Integration.
You are also free to implement your own storage policy, for example a ReservingVariableArray2 policy which holds some surplus memory to avoid frequent reallocations.



Sparse CPU Algebra


The CPUAlgebra has two main classes:

Both are meant to work with very big dimensions, for example SparseMatrix A = double (1000000 x 10000000), and ug::Vector is the associated vector. If you need a matrix for discretization on a unstructured grid, choose ug::SparseMatrix, see also the doxygen docu for SparseMatrix. SparseMatrix expects a template parameter, the block matrix. It can be double or some DenseMatrix<T>. Vector needs a double or DenseVector as template. Some functions are also using SparseMatrix:


Operators


Operators are mappings from between spaces. Thus, the Operator interfaces are designed in this way. You can find the following operator interfaces:

In order to invert this operators one may use a specialization of the following interfaces:


Parallelization of Algebra


The algebra is parallelized using the Parallel Communication Layer (PCL). The main idea is to build interfaces between processes. These interfaces describe with index on the each process represent the same vector entry.


LAPACK Integration


UG4 is designed to find all LAPACK/BLAS packages via cmake. It is tested on MacOSX (vecLib Framework) and on ATLAS (atlas-dev). LAPACK integration is part of the small_algebra. In UG4ROOT/ugbase/lib_algebra/small_algebra you find a directory lapack, where all lapack-bridges are set up.