A dense matrix of values of type T
.
More...
#include <shark/LinAlg/BLAS/cpu/matrix.hpp>
Public Types | |
typedef array_type::const_reference | const_reference |
typedef array_type::reference | reference |
typedef elementwise< dense_tag > | evaluation_category |
typedef L | orientation |
typedef iterators::dense_storage_iterator< value_type > | row_iterator |
typedef iterators::dense_storage_iterator< value_type > | column_iterator |
typedef iterators::dense_storage_iterator< value_type const > | const_row_iterator |
typedef iterators::dense_storage_iterator< value_type const > | const_column_iterator |
typedef major_iterator< self_type >::type | major_iterator |
Public Member Functions | |
matrix () | |
Default dense matrix constructor. Make a dense matrix of size (0,0) More... | |
matrix (std::initializer_list< std::initializer_list< T > > list) | |
Constructor from a nested initializer list. More... | |
matrix (size_type size1, size_type size2) | |
Dense matrix constructor with defined size. More... | |
matrix (size_type size1, size_type size2, value_type const &init) | |
Dense matrix constructor with defined size a initial value for all the matrix elements. More... | |
matrix (matrix const &m)=default | |
Copy-constructor of a dense matrix. More... | |
matrix (matrix &&m) | |
Move-constructor of a dense matrix. More... | |
template<class E > | |
matrix (matrix_expression< E, cpu_tag > const &e) | |
Constructor of a dense matrix from a matrix expression. More... | |
matrix & | operator= (matrix const &m)=default |
Assigns m to this. More... | |
matrix & | operator= (matrix &&m) |
Move-Assigns m to this. More... | |
template<class C > | |
matrix & | operator= (matrix_container< C, cpu_tag > const &m) |
Assigns m to this. More... | |
template<class E > | |
matrix & | operator= (matrix_expression< E, cpu_tag > const &e) |
Assigns e to this. More... | |
size_type | size1 () const |
Returns the number of rows of the matrix. More... | |
size_type | size2 () const |
Returns the number of columns of the matrix. More... | |
storage_type | raw_storage () |
Returns the underlying storage structure for low level access. More... | |
const_storage_type | raw_storage () const |
Returns the underlying storage structure for low level access. More... | |
device_traits< cpu_tag >::queue_type & | queue () |
void | resize (size_type size1, size_type size2) |
Resize a matrix to new dimensions. If resizing is performed, the data is not preserved. More... | |
void | clear () |
const_reference | operator() (size_type i, size_type j) const |
reference | operator() (size_type i, size_type j) |
void | set_element (size_type i, size_type j, value_type t) |
void | swap (matrix &m) |
void | swap_rows (size_type i, size_type j) |
void | swap_columns (size_type i, size_type j) |
const_row_iterator | row_begin (size_type i) const |
const_row_iterator | row_end (size_type i) const |
row_iterator | row_begin (size_type i) |
row_iterator | row_end (size_type i) |
const_row_iterator | column_begin (std::size_t j) const |
const_column_iterator | column_end (std::size_t j) const |
column_iterator | column_begin (std::size_t j) |
column_iterator | column_end (std::size_t j) |
major_iterator | set_element (major_iterator pos, size_type index, value_type value) |
major_iterator | clear_element (major_iterator elem) |
major_iterator | clear_range (major_iterator start, major_iterator end) |
void | reserve (size_type non_zeros) |
void | reserve_row (std::size_t, std::size_t) |
void | reserve_column (std::size_t, std::size_t) |
template<class Archive > | |
void | serialize (Archive &ar, const unsigned int) |
Public Member Functions inherited from remora::matrix_container< matrix< T, L, cpu_tag >, cpu_tag > | |
const container_type & | operator() () const |
container_type & | operator() () |
Public Member Functions inherited from remora::matrix_expression< matrix< T, L, cpu_tag >, cpu_tag > | |
const expression_type & | operator() () const |
expression_type & | operator() () |
Friends | |
void | swap (matrix &m1, matrix &m2) |
void | swap_rows (matrix &a, size_type i, matrix &b, size_type j) |
void | swap_columns (matrix &a, size_type i, matrix &b, size_type j) |
A dense matrix of values of type T
.
For a \((m \times n)\)-dimensional matrix and \( 0 \leq i < m, 0 \leq j < n\), every element \( m_{i,j} \) is mapped to the \((i.n + j)\)-th element of the container for row major orientation or the \( (i + j.m) \)-th element of the container for column major orientation. In a dense matrix all elements are represented in memory in a contiguous chunk of memory by definition.
Orientation can also be specified, otherwise a row_major
is used.
T | the type of object stored in the matrix (like double, float, complex, etc...) |
L | the storage organization. It can be either row_major or column_major . Default is row_major |
Definition at line 53 of file matrix.hpp.
typedef iterators::dense_storage_iterator<value_type> remora::matrix< T, L, cpu_tag >::column_iterator |
Definition at line 274 of file matrix.hpp.
typedef iterators::dense_storage_iterator<value_type const> remora::matrix< T, L, cpu_tag >::const_column_iterator |
Definition at line 276 of file matrix.hpp.
typedef array_type::const_reference remora::matrix< T, L, cpu_tag >::const_reference |
Definition at line 58 of file matrix.hpp.
typedef iterators::dense_storage_iterator<value_type const> remora::matrix< T, L, cpu_tag >::const_row_iterator |
Definition at line 275 of file matrix.hpp.
typedef elementwise<dense_tag> remora::matrix< T, L, cpu_tag >::evaluation_category |
Definition at line 66 of file matrix.hpp.
typedef major_iterator<self_type>::type remora::matrix< T, L, cpu_tag >::major_iterator |
Definition at line 304 of file matrix.hpp.
typedef L remora::matrix< T, L, cpu_tag >::orientation |
Definition at line 67 of file matrix.hpp.
typedef array_type::reference remora::matrix< T, L, cpu_tag >::reference |
Definition at line 59 of file matrix.hpp.
typedef iterators::dense_storage_iterator<value_type> remora::matrix< T, L, cpu_tag >::row_iterator |
Definition at line 273 of file matrix.hpp.
|
inline |
Default dense matrix constructor. Make a dense matrix of size (0,0)
Definition at line 72 of file matrix.hpp.
|
inline |
Constructor from a nested initializer list.
Constructs a matrix like this: m = {{1,2},{3,4}}.
list | The nested initializer list storing the values of the matrix. |
Definition at line 78 of file matrix.hpp.
|
inline |
Dense matrix constructor with defined size.
size1 | number of rows |
size2 | number of columns |
Definition at line 92 of file matrix.hpp.
|
inline |
Dense matrix constructor with defined size a initial value for all the matrix elements.
size1 | number of rows |
size2 | number of columns |
init | initial value assigned to all elements |
Definition at line 101 of file matrix.hpp.
|
default |
Copy-constructor of a dense matrix.
m | is a dense matrix |
|
inline |
Move-constructor of a dense matrix.
m | is a dense matrix |
Definition at line 113 of file matrix.hpp.
|
inline |
Constructor of a dense matrix from a matrix expression.
Constructs the matrix by evaluating the expression and assigning the results to the newly constructed matrix using a call to assign.
e | is a matrix expression |
Definition at line 122 of file matrix.hpp.
References remora::assign().
|
inline |
Definition at line 207 of file matrix.hpp.
|
inline |
Definition at line 313 of file matrix.hpp.
|
inline |
Definition at line 318 of file matrix.hpp.
|
inline |
Definition at line 291 of file matrix.hpp.
|
inline |
Definition at line 297 of file matrix.hpp.
|
inline |
Definition at line 294 of file matrix.hpp.
|
inline |
Definition at line 300 of file matrix.hpp.
|
inline |
Definition at line 212 of file matrix.hpp.
|
inline |
Definition at line 217 of file matrix.hpp.
|
default |
Assigns m to this.
|
inline |
Move-Assigns m to this.
Definition at line 136 of file matrix.hpp.
|
inline |
Assigns m to this.
evaluates the expression and assign the results to this using a call to assign. As containers are assumed to not overlap, no temporary is created
m | is a matrix expression |
Definition at line 152 of file matrix.hpp.
References remora::assign().
|
inline |
Assigns e to this.
evaluates the expression and assign the results to this using a call to assign. A temporary is created to prevent aliasing.
e | is a matrix expression |
Definition at line 165 of file matrix.hpp.
References shark::swap().
|
inline |
Definition at line 189 of file matrix.hpp.
|
inline |
Returns the underlying storage structure for low level access.
Definition at line 181 of file matrix.hpp.
|
inline |
Returns the underlying storage structure for low level access.
Definition at line 186 of file matrix.hpp.
|
inline |
Definition at line 323 of file matrix.hpp.
|
inline |
Definition at line 325 of file matrix.hpp.
|
inline |
Definition at line 324 of file matrix.hpp.
|
inline |
Resize a matrix to new dimensions. If resizing is performed, the data is not preserved.
size1 | the new number of rows |
size2 | the new number of colums |
Definition at line 201 of file matrix.hpp.
|
inline |
Definition at line 278 of file matrix.hpp.
|
inline |
Definition at line 284 of file matrix.hpp.
|
inline |
Definition at line 281 of file matrix.hpp.
|
inline |
Definition at line 287 of file matrix.hpp.
|
inline |
Definition at line 329 of file matrix.hpp.
|
inline |
Definition at line 223 of file matrix.hpp.
|
inline |
Definition at line 307 of file matrix.hpp.
|
inline |
Returns the number of rows of the matrix.
Definition at line 172 of file matrix.hpp.
|
inline |
Returns the number of columns of the matrix.
Definition at line 176 of file matrix.hpp.
|
inline |
Definition at line 230 of file matrix.hpp.
References shark::swap().
|
inline |
Definition at line 265 of file matrix.hpp.
References shark::swap().
|
inline |
Definition at line 248 of file matrix.hpp.
References shark::swap().
|
friend |
Definition at line 235 of file matrix.hpp.
|
friend |
Definition at line 256 of file matrix.hpp.
|
friend |
Definition at line 239 of file matrix.hpp.