For detailed description on intervals, vectors and matrices see sections
Defined types and data structures
The main header file
defines the following types for computation in double (D), long double (LD) precision and interval (I) arithmetics.
- DVector, LDVector, IVector - elements of in double and long double precision, and interval vectors
- DMatrix, LDMatrx, IMatrix - matrices, elements and/or subsets of
- DEuclNorm, LDEuclNorm, IEuclNorm - classes that compute Euclidean norm of vectors and matrices (operator norm).
- DMaxNorm, LDMaxNorm, IMaxNorm - classes that compute max norm of vectors and matrices (operator norm)
- DSumNorm, LDSumNorm, ISumNorm - classes that compute norm of vectors and matrices (operator norm)
Vectors and matrices
Vectors and matrices are defined by a simple constructor calls
Initialization of vectors and matrices:
cout << v << endl;
double mcoeff[] = {1,2,3,4,5,6};
cout << m << endl;
long double xcoeff[] = {1,2,3,4,5};
cout << x << endl;
intervals::DoubleInterval interval
Definition: DoubleInterval.h:36
- Note
- Contructors of vectors and matrices assume that arrays of coefficients contain enough elements
Indexing of vectors and matrices
Vectors and matrices are indexed from zero by means of overloaded operator[].
- Note
- Indexing of vectors and matrices starts from zero.
Arrays of vectors and matrices
When constructing arrays of matrices one has to provide two informations:
- what is the length of array
- what are dimensions of matrices/vectors in the array
If one wish to define array of matrices or vectors of the same dimensions we strongly encourage to use the following static funcitons
int dimension = 6;
int rows = 2, columns = 5;
int length = 3;
delete []t;
delete []p;
delete []m;
static Matrix * makeArray(size_type N, size_type r, size_type c)
Definition: Matrix.hpp:99
static Vector * makeArray(size_type N, size_type _dim)
Definition: Vector.hpp:63
Basic operations on vectors and matrices
Mathematical operators are overloaded wherever it is intuitive, like multiplications, additions, subtractions
Basic algorithms of linear algebra.
Among others we provide algorithms for
- transposition of matrices
- solving linear systems
- computing inverse matrices (inverting should be avoided if possible)
- QR decomposition
MatrixType gaussInverseMatrix(const MatrixType &A)
Definition: floatMatrixAlgorithms.hpp:748
MatrixType krawczykInverse(const MatrixType &A)
Definition: Matrix_Interval.hpp:53
void QR_decompose(const MatrixType &A, MatrixType &Q, MatrixType &R)
Definition: floatMatrixAlgorithms.hpp:368
void gauss(MatrixType a, ResultType b, ResultType &result)
Definition: floatMatrixAlgorithms.hpp:103
Matrix< Scalar, cols, rows > transpose(const Matrix< Scalar, rows, cols > &)
Definition: Matrix.hpp:147
- Note
- both functions
gaussInverseMatrix
and krawczykInverse
compute enclosure of inverse of an interval matrix M. We recommend to use krawczykInverse as it always produces tighter enclosures.
- Attention
- In principle linear system could be solved by but this is much slower.
- Note
- The above functions throw an exception (object of type std::runtime_error) when they cannot finish operation.
Eigenvectors and eigenvalues of matrices
These functions are implemented for non-interval matrices only!. More information on this topic is given in section Non-rigorous computations of eigenvalues and eigenvectors.