yat
0.20.3pre
|
#include <yat/utility/MatrixMutable.h>
Public Types | |
typedef double & | reference |
typedef Container2DIterator< MatrixMutable, double, double & > | iterator |
typedef StrideIterator< double * > | column_iterator |
typedef StrideIterator< double * > | row_iterator |
typedef double | value_type |
typedef const double & | const_reference |
typedef Container2DIterator< const MatrixBase, const double, const double & > | const_iterator |
typedef StrideIterator< const double * > | const_column_iterator |
typedef StrideIterator< const double * > | const_row_iterator |
typedef MatrixBase | derived_type |
Public Member Functions | |
MatrixMutable (const MatrixMutable &)=delete | |
The copy constructor. | |
virtual | ~MatrixMutable (void) |
The destructor. | |
void | all (const double value) |
iterator | begin (void) |
column_iterator | begin_column (size_t i) |
row_iterator | begin_row (size_t i) |
VectorView | column_view (size_t i) |
void | div (const MatrixBase &b) |
iterator | end (void) |
column_iterator | end_column (size_t i) |
row_iterator | end_row (size_t i) |
virtual gsl_matrix * | gsl_matrix_p (void)=0 |
virtual const gsl_matrix * | gsl_matrix_p (void) const =0 |
void | mul (const MatrixBase &b) |
VectorView | row_view (size_t) |
void | swap_columns (const size_t i, const size_t j) |
Swap columns i and j. More... | |
void | swap_rowcol (const size_t i, const size_t j) |
Swap row i and column j. More... | |
void | swap_rows (const size_t i, const size_t j) |
Swap rows i and j. More... | |
double & | operator() (size_t row, size_t column) |
Element access operator. More... | |
MatrixMutable & | operator= (const MatrixMutable &other) |
The assignment operator. More... | |
MatrixMutable & | operator= (const MatrixBase &other) |
The assignment operator. | |
template<class T > | |
MatrixMutable & | operator= (const MatrixExpression< T > &rhs) |
MatrixMutable & | operator= (MatrixMutable &&other) |
Move assignment operator. | |
template<class T > | |
MatrixMutable & | operator= (MatrixExpression< T > &&rhs) |
const MatrixMutable & | operator+= (const MatrixBase &b) |
Add and assign operator. More... | |
template<class T > | |
MatrixMutable & | operator+= (const MatrixExpression< T > &rhs) |
Addition and assign operator. More... | |
const MatrixMutable & | operator+= (const double d) |
Add and assign operator. More... | |
const MatrixMutable & | operator-= (const MatrixBase &) |
Subtract and assign operator. More... | |
template<class T > | |
MatrixMutable & | operator-= (const MatrixExpression< T > &rhs) |
Subtraction and assign operator. More... | |
const MatrixMutable & | operator-= (const double d) |
Subtract and assign operator. More... | |
const MatrixMutable & | operator*= (double d) |
Multiply and assignment operator. More... | |
const_iterator | begin (void) const |
const_column_iterator | begin_column (size_t i) const |
const_row_iterator | begin_row (size_t i) const |
const_iterator | end (void) const |
const_column_iterator | end_column (size_t i) const |
const_row_iterator | end_row (size_t i) const |
virtual const gsl_matrix * | gsl_matrix_p (void) const=0 |
const_iterator | begin (void) const |
const_column_iterator | begin_column (size_t i) const |
const_row_iterator | begin_row (size_t i) const |
const VectorConstView | column_const_view (size_t) const |
size_t | columns (void) const |
const_iterator | end (void) const |
const_column_iterator | end_column (size_t i) const |
const_row_iterator | end_row (size_t i) const |
bool | equal (const MatrixBase &, const double precision=0) const |
Check whether matrices are equal within a user defined precision, set by precision. More... | |
size_t | rows (void) const |
const VectorConstView | row_const_view (size_t) const |
const double & | operator() (size_t row, size_t column) const |
Element access operator. More... | |
bool | operator== (const MatrixBase &other) const |
Comparison operator. Takes squared time. More... | |
bool | operator!= (const MatrixBase &other) const |
Comparison operator. Takes squared time. More... | |
Protected Member Functions | |
void | copy_assign (const MatrixBase &other) |
Behaves like operator=(const MatrixBase&) | |
virtual void | copy_assign (const gsl_matrix *rhs)=0 |
Behaves like operator=(const MatrixBase&) | |
virtual void | move_assign (MatrixMutable &&other) |
virtual void | move_assign (gsl_matrix *&&rhs)=0 |
gsl_matrix * | create_gsl_matrix_copy (void) const |
Create a new copy of the internal GSL matrix. More... | |
Protected Attributes | |
gsl_matrix * | blas_result_ |
Friends | |
class | detail::Mover |
Related Functions | |
(Note that these are not member functions.) | |
void | swap (MatrixMutable &, MatrixMutable &) |
Exchange all elements between the matrices by copying. More... | |
void | minmax_index (const MatrixBase &M, std::pair< size_t, size_t > &min, std::pair< size_t, size_t > &max) |
Locate the maximum and minimum element in the matrix, M. More... | |
std::ostream & | operator<< (std::ostream &s, const MatrixBase &) |
The output operator for the MatrixBase class. | |
Interface class for mutable matrices including Matrix and view. The interface allows altering elements of the matrix data but not alter the dimensions.
typedef StrideIterator<double*> theplu::yat::utility::MatrixMutable::column_iterator |
Mutable iterator that iterates over one column
|
inherited |
Read-only iterator that iterates over one column
|
inherited |
Read-only iterator that iterates over all elements
|
inherited |
const_reference type is const double&
|
inherited |
Read-only iterator that iterates over one row
|
inherited |
Class that inherits from BasicMatrix
typedef Container2DIterator<MatrixMutable, double, double&> theplu::yat::utility::MatrixMutable::iterator |
Mutable iterator that iterates over all elements
typedef double& theplu::yat::utility::MatrixMutable::reference |
reference type is double&
typedef StrideIterator<double*> theplu::yat::utility::MatrixMutable::row_iterator |
Mutable iterator that iterates over one row
|
inherited |
value_type is double
void theplu::yat::utility::MatrixMutable::all | ( | const double | value | ) |
Set all elements to value.
const_iterator theplu::yat::utility::MatrixBase::begin |
Iterator iterates along a row. When end of row is reached it jumps to beginning of next row.
iterator theplu::yat::utility::MatrixMutable::begin | ( | void | ) |
Iterator iterates along a row. When end of row is reached it jumps to beginning of next row.
|
inherited |
Iterator iterates along a row. When end of row is reached it jumps to beginning of next row.
const_column_iterator theplu::yat::utility::MatrixBase::begin_column |
Iterator iterates along a column.
column_iterator theplu::yat::utility::MatrixMutable::begin_column | ( | size_t | i | ) |
Iterator iterates along a column.
|
inherited |
Iterator iterates along a column.
const_row_iterator theplu::yat::utility::MatrixBase::begin_row |
Iterator iterates along a row.
row_iterator theplu::yat::utility::MatrixMutable::begin_row | ( | size_t | i | ) |
Iterator iterates along a row.
|
inherited |
Iterator iterates along a row.
|
inherited |
VectorView theplu::yat::utility::MatrixMutable::column_view | ( | size_t | i | ) |
|
inherited |
|
protectedinherited |
Create a new copy of the internal GSL matrix.
Necessary memory for the new GSL matrix is allocated and the caller is responsible for freeing the allocated memory.
GSL_error | if memory cannot be allocated for the new copy, or if dimensions mismatch. |
void theplu::yat::utility::MatrixMutable::div | ( | const MatrixBase & | b | ) |
Elementwise division of the elements of the calling matrix by the elements of matrix b, . The result is stored into the calling matrix.
GSL_error | if dimensions mismatch. |
const_iterator theplu::yat::utility::MatrixBase::end |
|
inherited |
iterator theplu::yat::utility::MatrixMutable::end | ( | void | ) |
const_column_iterator theplu::yat::utility::MatrixBase::end_column |
|
inherited |
column_iterator theplu::yat::utility::MatrixMutable::end_column | ( | size_t | i | ) |
const_row_iterator theplu::yat::utility::MatrixBase::end_row |
|
inherited |
row_iterator theplu::yat::utility::MatrixMutable::end_row | ( | size_t | i | ) |
|
inherited |
Check whether matrices are equal within a user defined precision, set by precision.
virtual const gsl_matrix* theplu::yat::utility::MatrixBase::gsl_matrix_p |
|
pure virtual |
Implemented in theplu::yat::utility::Matrix, and theplu::yat::utility::MatrixView.
|
pure virtual |
Implements theplu::yat::utility::MatrixBase.
Implemented in theplu::yat::utility::Matrix, and theplu::yat::utility::MatrixView.
|
protectedvirtual |
Behaves like operator=(MatrixMutable&&)
Reimplemented in theplu::yat::utility::Matrix, and theplu::yat::utility::MatrixView.
|
protectedpure virtual |
Behaves like operator=(MatrixMutable&&)
Implemented in theplu::yat::utility::Matrix, and theplu::yat::utility::MatrixView.
void theplu::yat::utility::MatrixMutable::mul | ( | const MatrixBase & | b | ) |
|
inherited |
Comparison operator. Takes squared time.
Checks are performed with exact matching, i.e., rounding off effects may destroy comparison. Use the equal function for comparing elements within a user defined precision.
|
inherited |
Element access operator.
If | GSL range checks are enabled in the underlying GSL library a GSL_error exception is thrown if either index is out of range. |
double& theplu::yat::utility::MatrixMutable::operator() | ( | size_t | row, |
size_t | column | ||
) |
Element access operator.
If | GSL range checks are enabled in the underlying GSL library a GSL_error exception is thrown if either index is out of range. |
const MatrixMutable& theplu::yat::utility::MatrixMutable::operator*= | ( | double | d | ) |
const MatrixMutable& theplu::yat::utility::MatrixMutable::operator+= | ( | const MatrixBase & | b | ) |
|
inline |
Addition and assign operator.
const MatrixMutable& theplu::yat::utility::MatrixMutable::operator+= | ( | const double | d | ) |
Add and assign operator.
Add the scalar value d to the left hand side Matrix, .
const MatrixMutable& theplu::yat::utility::MatrixMutable::operator-= | ( | const MatrixBase & | ) |
|
inline |
Subtraction and assign operator.
const MatrixMutable& theplu::yat::utility::MatrixMutable::operator-= | ( | const double | d | ) |
Subtract and assign operator.
Subtract the scalar value d to the left hand side Matrix, .
MatrixMutable& theplu::yat::utility::MatrixMutable::operator= | ( | const MatrixMutable & | other | ) |
The assignment operator.
|
inline |
Assignment from a matrix expression. A matrix expression is the result of operator+
, operator-
, and operator*, or combinations of them.
A typical usage looks like
where A, B, C, and D are all instances of class Matrix.
Typically MatrixExpression only exists as rvalue, and this operator is not called but the rvalue version, operator=(MatrixExpression<T>&&)
Invalidates, references, iterators and views.
|
inline |
Move assignment from a matrix expression. A matrix expression is the result of operator+
, operator-
, and operator*, or combinations of them.
A typical usage looks like
where B, C, and D are all instances of class Matrix.
Invalidates references, iterators, and views.
|
inherited |
Comparison operator. Takes squared time.
Checks are performed with exact matching, i.e., rounding off effects may destroy comparison. Use the equal function for comparing elements within a user defined precision.
|
inherited |
VectorView theplu::yat::utility::MatrixMutable::row_view | ( | size_t | ) |
|
inherited |
void theplu::yat::utility::MatrixMutable::swap_columns | ( | const size_t | i, |
const size_t | j | ||
) |
Swap columns i and j.
GSL_error | if either index is out of bounds. |
void theplu::yat::utility::MatrixMutable::swap_rowcol | ( | const size_t | i, |
const size_t | j | ||
) |
void theplu::yat::utility::MatrixMutable::swap_rows | ( | const size_t | i, |
const size_t | j | ||
) |
Swap rows i and j.
GSL_error | if either index is out of bounds. |
|
related |
Locate the maximum and minimum element in the matrix, M.
The indices to the element with the minimum and maximum values of the matrix are returned through parameters min and max, respectively.
|
related |
Exchange all elements between the matrices by copying.
This function swaps element by element and matrices must have the same size. References and iterators are not invalidated.
If you do not care about iterators and references, std::swap is typically faster (only swapping a couple of pointers).
GSL_error | if sizes are not equal. |
|
protected |
blas_result_ is used to temporarily store result in BLAS calls. Memory is not allocated for blas_result_ until it is needed.