CGAL 5.1 - dD Geometry Kernel
|
#include <Concepts/Matrix.h>
An instance of data type Matrix
is a matrix of variables of number type NT
. The types Matrix
and Vector
together realize many functions of basic linear algebra.
Types | |
typedef unspecified_type | NT |
the ring type of the components. More... | |
typedef unspecified_type | iterator |
bidirectional iterator for accessing all components row-wise. More... | |
typedef unspecified_type | const_iterator |
bidirectional iterator for accessing all components row-wise. More... | |
typedef unspecified_type | row_iterator |
random access iterator for accessing row entries. More... | |
typedef unspecified_type | const_row_iterator |
random access iterator for accessing row entries. More... | |
typedef unspecified_type | column_iterator |
random access iterator for accessing column entries. More... | |
typedef unspecified_type | const_column_iterator |
random access iterator for accessing column entries. More... | |
typedef unspecified_type | Identity |
a tag class for identity initialization More... | |
typedef unspecified_type | Vector |
the vector type used. More... | |
Creation | |
Matrix () | |
creates an instance M of type Matrix . More... | |
Matrix (int n) | |
creates an instance M of type Matrix of dimension \( n \times n\) initialized to the zero matrix. More... | |
Matrix (int m, int n) | |
creates an instance M of type Matrix of dimension \( m \times n\) initialized to the zero matrix. More... | |
Matrix (std::pair< int, int > p) | |
creates an instance M of type Matrix of dimension p.first \( \times\)p.second initialized to the zero matrix. More... | |
Matrix (int n, Identity, NT x=NT(1)) | |
creates an instance M of type Matrix of dimension \( n \times n\) initialized to the identity matrix (times x ). More... | |
Matrix (int m, int n, NT x) | |
creates an instance M of type Matrix of dimension \( m \times n\) initialized to the matrix with x entries. More... | |
template<class Forward_iterator > | |
Matrix (Forward_iterator first, Forward_iterator last) | |
creates an instance M of type Matrix . More... | |
Matrix (std::vector< Vector > A) | |
creates an instance M of type Matrix . More... | |
Operations | |
int | row_dimension () |
returns \( n\), the number of rows of M . More... | |
int | column_dimension () |
returns \( m\), the number of columns of M . More... | |
std::pair< int, int > | dimension () |
returns \( (m,n)\), the dimension pair of M . More... | |
Vector | row (int i) |
returns the \( i\)-th row of M (an \( m\) - vector). More... | |
Vector | column (int i) |
returns the \( i\)-th column of M (an \( n\) - vector). More... | |
NT & | operator() (int i, int j) |
returns \( M_{i,j}\). More... | |
void | swap_rows (int i, int j) |
swaps rows \( i\) and \( j\). More... | |
void | swap_columns (int i, int j) |
swaps columns \( i\) and \( j\). More... | |
row_iterator | row_begin (int i) |
an iterator pointing to the first entry of the \( i\)th row. More... | |
row_iterator | row_end (int i) |
an iterator pointing beyond the last entry of the \( i\)th row. More... | |
const_row_iterator | row_begin (int i) const |
an iterator pointing to the first entry of the \( i\)th row. More... | |
const_row_iterator | row_end (int i) const |
an iterator pointing beyond the last entry of the \( i\)th row. More... | |
column_iterator | column_begin (int i) |
an iterator pointing to the first entry of the \( i\)th column. More... | |
column_iterator | column_end (int i) |
an iterator pointing beyond the last entry of the \( i\)th column. More... | |
const_column_iterator | column_begin (int i) const |
an iterator pointing to the first entry of the \( i\)th column. More... | |
const_column_iterator | column_end (int i) const |
an iterator pointing beyond the last entry of the \( i\)th column. More... | |
iterator | begin () |
an iterator pointing to the first entry of \( M\). More... | |
terator | end () |
an iterator pointing beyond the last entry of \( M\). More... | |
const_iterator | begin () const |
an iterator pointing to the first entry of \( M\). More... | |
const_terator | end () const |
an iterator pointing beyond the last entry of \( M\). More... | |
bool | operator== (const Matrix &M1) |
Test for equality. More... | |
bool | operator!= (const Matrix &M1) |
Test for inequality. More... | |
Arithmetic Operators | |
Matrix | operator+ (const Matrix &M1) |
Addition. More... | |
Matrix | operator- (const Matrix &M1) |
Subtraction. More... | |
Matrix | operator- () |
Negation. More... | |
Matrix | operator* (const Matrix &M1) |
Multiplication. More... | |
Vector | operator* (const Vector &vec) |
Multiplication with vector. More... | |
Matrix | operator* (const NT &x, const Matrix &M) |
Multiplication of every entry with x . More... | |
Matrix | operator* (const Matrix &M, const NT &x) |
Multiplication of every entry with x . More... | |
typedef unspecified_type Matrix::column_iterator |
random access iterator for accessing column entries.
typedef unspecified_type Matrix::const_column_iterator |
random access iterator for accessing column entries.
typedef unspecified_type Matrix::const_iterator |
bidirectional iterator for accessing all components row-wise.
typedef unspecified_type Matrix::const_row_iterator |
random access iterator for accessing row entries.
typedef unspecified_type Matrix::Identity |
a tag class for identity initialization
typedef unspecified_type Matrix::iterator |
bidirectional iterator for accessing all components row-wise.
typedef unspecified_type Matrix::NT |
the ring type of the components.
typedef unspecified_type Matrix::row_iterator |
random access iterator for accessing row entries.
typedef unspecified_type Matrix::Vector |
the vector type used.
Matrix::Matrix | ( | ) |
creates an instance M
of type Matrix
.
Matrix::Matrix | ( | int | n | ) |
creates an instance M
of type Matrix
of dimension \( n \times n\) initialized to the zero matrix.
Matrix::Matrix | ( | int | m, |
int | n | ||
) |
creates an instance M
of type Matrix
of dimension \( m \times n\) initialized to the zero matrix.
Matrix::Matrix | ( | std::pair< int, int > | p | ) |
creates an instance M
of type Matrix
of dimension p.first
\( \times\)p.second
initialized to the zero matrix.
creates an instance M
of type Matrix
of dimension \( n \times n\) initialized to the identity matrix (times x
).
Matrix::Matrix | ( | int | m, |
int | n, | ||
NT | x | ||
) |
creates an instance M
of type Matrix
of dimension \( m \times n\) initialized to the matrix with x
entries.
Matrix::Matrix | ( | Forward_iterator | first, |
Forward_iterator | last | ||
) |
creates an instance M
of type Matrix
.
Let \( S\) be the ordered set of \( n\) column-vectors of common dimension \( m\) as given by the iterator range [first,last)
. M
is initialized to an \( m \times n\) matrix with the columns as specified by \( S\).
Forward_iterator
has a value type V
from which we require to provide a iterator type V::const_iterator
, to have V::value_type == NT
.Note that Vector
or std::vector<NT>
fulfill these requirements.
Matrix::Matrix | ( | std::vector< Vector > | A | ) |
creates an instance M
of type Matrix
.
Let \( A\) be an array of \( n\) column-vectors of common dimension \( m\). M
is initialized to an \( m \times n\) matrix with the columns as specified by \( A\).
iterator Matrix::begin | ( | ) |
an iterator pointing to the first entry of \( M\).
const_iterator Matrix::begin | ( | ) | const |
an iterator pointing to the first entry of \( M\).
Vector Matrix::column | ( | int | i | ) |
returns the \( i\)-th column of M
(an \( n\) - vector).
column_iterator Matrix::column_begin | ( | int | i | ) |
an iterator pointing to the first entry of the \( i\)th column.
const_column_iterator Matrix::column_begin | ( | int | i | ) | const |
an iterator pointing to the first entry of the \( i\)th column.
int Matrix::column_dimension | ( | ) |
returns \( m\), the number of columns of M
.
column_iterator Matrix::column_end | ( | int | i | ) |
an iterator pointing beyond the last entry of the \( i\)th column.
const_column_iterator Matrix::column_end | ( | int | i | ) | const |
an iterator pointing beyond the last entry of the \( i\)th column.
std::pair<int,int> Matrix::dimension | ( | ) |
returns \( (m,n)\), the dimension pair of M
.
terator Matrix::end | ( | ) |
an iterator pointing beyond the last entry of \( M\).
const_terator Matrix::end | ( | ) | const |
an iterator pointing beyond the last entry of \( M\).
bool Matrix::operator!= | ( | const Matrix & | M1 | ) |
Test for inequality.
NT& Matrix::operator() | ( | int | i, |
int | j | ||
) |
returns \( M_{i,j}\).
Multiplication.
M.column_dimension() = M1.row_dimension()
Multiplication with vector.
M.column_dimension() = vec.dimension()
Addition.
M.row_dimension() == M1.row_dimension()
M.column_dimension() == M1.column_dimension()
Matrix Matrix::operator- | ( | ) |
Negation.
Subtraction.
M.row_dimension() == M1.row_dimension()
M.column_dimension() == M1.column_dimension()
bool Matrix::operator== | ( | const Matrix & | M1 | ) |
Test for equality.
Vector Matrix::row | ( | int | i | ) |
returns the \( i\)-th row of M
(an \( m\) - vector).
row_iterator Matrix::row_begin | ( | int | i | ) |
an iterator pointing to the first entry of the \( i\)th row.
const_row_iterator Matrix::row_begin | ( | int | i | ) | const |
an iterator pointing to the first entry of the \( i\)th row.
int Matrix::row_dimension | ( | ) |
returns \( n\), the number of rows of M
.
row_iterator Matrix::row_end | ( | int | i | ) |
an iterator pointing beyond the last entry of the \( i\)th row.
const_row_iterator Matrix::row_end | ( | int | i | ) | const |
an iterator pointing beyond the last entry of the \( i\)th row.
void Matrix::swap_columns | ( | int | i, |
int | j | ||
) |
swaps columns \( i\) and \( j\).
void Matrix::swap_rows | ( | int | i, |
int | j | ||
) |
swaps rows \( i\) and \( j\).