STXXL
1.4.0
|
External matrix container.
Introduction to matrix container: see STXXL Matrix tutorial.
Design and Internals of matrix container: see Matrix.
ValueType | type of contained objects (POD with no references to internal memory) |
BlockSideLength | side length of a matrix block |
Divides the matrix in square submatrices (blocks). Blocks can be swapped individually to and from external memory. They are only swapped if necessary to minimize I/O.
Public Types | |
typedef matrix_col_major_iterator < ValueType, BlockSideLength > | col_major_iterator |
typedef column_vector< ValueType > | column_vector_type |
typedef const_matrix_col_major_iterator < ValueType, BlockSideLength > | const_col_major_iterator |
typedef const_matrix_iterator < ValueType, BlockSideLength > | const_iterator |
typedef const_matrix_row_major_iterator < ValueType, BlockSideLength > | const_row_major_iterator |
typedef matrix_iterator < ValueType, BlockSideLength > | iterator |
typedef matrix_row_major_iterator < ValueType, BlockSideLength > | row_major_iterator |
typedef row_vector< ValueType > | row_vector_type |
Public Member Functions | |
Constructors/Destructors | |
matrix (block_scheduler_type &bs, const elem_size_type height, const elem_size_type width) | |
Creates a new matrix of given dimensions. Elements' values are set to zero. More... | |
matrix (block_scheduler_type &bs, const column_vector_type &left, const row_vector_type &right) | |
~matrix () | |
Capacity | |
const elem_size_type & | get_height () const |
const elem_size_type & | get_width () const |
Iterators | |
iterator | begin () |
const_iterator | begin () const |
const_iterator | cbegin () const |
iterator | end () |
const_iterator | end () const |
const_iterator | cend () const |
const_iterator | operator() (const elem_size_type row, const elem_size_type col) const |
iterator | operator() (const elem_size_type row, const elem_size_type col) |
Modifiers | |
void | transpose () |
void | set_zero () |
Operations | |
matrix_type | operator+ (const matrix_type &right) const |
matrix_type | operator- (const matrix_type &right) const |
matrix_type | operator* (const matrix_type &right) const |
matrix_type | operator* (const ValueType scalar) const |
matrix_type & | operator+= (const matrix_type &right) |
matrix_type & | operator-= (const matrix_type &right) |
matrix_type & | operator*= (const matrix_type &right) |
matrix_type & | operator*= (const ValueType scalar) |
column_vector_type | operator* (const column_vector_type &right) const |
row_vector_type | multiply_from_left (const row_vector_type &left) const |
matrix_type | multiply (const matrix_type &right, const int_type multiplication_algorithm=1, const int_type scheduling_algorithm=2) const |
multiply with another matrix More... | |
matrix_type | multiply_internal (const matrix_type &right, const int_type scheduling_algorithm=2) const |
Use internal memory multiplication. Designated for testing. May exceed memory limitations. More... | |
Protected Types | |
typedef swappable_block_matrix_type::block_scheduler_type | block_scheduler_type |
typedef swappable_block_matrix_type::size_type | block_size_type |
typedef swappable_block_matrix_type::elem_size_type | elem_size_type |
typedef matrix< ValueType, BlockSideLength > | matrix_type |
typedef matrix_local::matrix_operations < ValueType, BlockSideLength > | Ops |
typedef counting_ptr < swappable_block_matrix_type > | swappable_block_matrix_pointer_type |
typedef swappable_block_matrix < ValueType, BlockSideLength > | swappable_block_matrix_type |
typedef matrix_swappable_block < ValueType, BlockSideLength > | swappable_block_type |
Protected Member Functions | |
void | multiply_internal (const matrix_type &right, matrix_type &res) const |
Protected Attributes | |
swappable_block_matrix_pointer_type | data |
elem_size_type | height |
elem_size_type | width |
|
protected |
|
protected |
typedef matrix_col_major_iterator<ValueType, BlockSideLength> stxxl::matrix< ValueType, BlockSideLength >::col_major_iterator |
typedef column_vector<ValueType> stxxl::matrix< ValueType, BlockSideLength >::column_vector_type |
typedef const_matrix_col_major_iterator<ValueType, BlockSideLength> stxxl::matrix< ValueType, BlockSideLength >::const_col_major_iterator |
typedef const_matrix_iterator<ValueType, BlockSideLength> stxxl::matrix< ValueType, BlockSideLength >::const_iterator |
typedef const_matrix_row_major_iterator<ValueType, BlockSideLength> stxxl::matrix< ValueType, BlockSideLength >::const_row_major_iterator |
|
protected |
typedef matrix_iterator<ValueType, BlockSideLength> stxxl::matrix< ValueType, BlockSideLength >::iterator |
|
protected |
|
protected |
typedef matrix_row_major_iterator<ValueType, BlockSideLength> stxxl::matrix< ValueType, BlockSideLength >::row_major_iterator |
typedef row_vector<ValueType> stxxl::matrix< ValueType, BlockSideLength >::row_vector_type |
|
protected |
|
protected |
|
protected |
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 1107 of file matrix.h.
Referenced by stxxl::matrix< ValueType, BlockSideLength >::multiply_internal().
|
inline |
|
inline |
Definition at line 1114 of file matrix.h.
Referenced by stxxl::matrix< ValueType, BlockSideLength >::multiply_internal().
|
inline |
Definition at line 1123 of file matrix.h.
Referenced by stxxl::matrix< ValueType, BlockSideLength >::multiply_internal().
|
inline |
Definition at line 1116 of file matrix.h.
Referenced by stxxl::matrix< ValueType, BlockSideLength >::multiply_internal().
|
inline |
|
inline |
|
inline |
|
inline |
multiply with another matrix
right | matrix to multiply with |
multiplication_algorithm | allows to choose the applied algorithm |
scheduling_algorithm | allows to choose the applied algorithm |
Available algorithms are:
0: naive_multiply_and_add (I/O inefficient, slow)
1: recursive_multiply_and_add (recommended, default, stable time and I/O complexity)
2: strassen_winograd_multiply_and_add (sometimes fast but unstable time and I/O complexity)
3: multi_level_strassen_winograd_multiply_and_add (sometimes fast but unstable time and I/O complexity)
4: strassen_winograd_multiply, optimized pre- and postadditions (sometimes fast but unstable time and I/O complexity)
5: strassen_winograd_multiply_and_add_interleaved, optimized preadditions (sometimes fast but unstable time and I/O complexity)
6: multi_level_strassen_winograd_multiply_and_add_block_grained (sometimes fast but unstable time and I/O complexity)
Definition at line 1239 of file matrix.h.
References stxxl::swappable_block_matrix< ValueType, BlockSideLength >::bs, stxxl::matrix< ValueType, BlockSideLength >::data, stxxl::matrix< ValueType, BlockSideLength >::height, STXXL_ERRMSG, and stxxl::matrix< ValueType, BlockSideLength >::width.
|
inline |
Definition at line 1217 of file matrix.h.
References stxxl::row_vector< ValueType >::set_zero(), and stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::size().
Referenced by stxxl::row_vector< ValueType >::operator*().
|
inline |
Use internal memory multiplication. Designated for testing. May exceed memory limitations.
Definition at line 1333 of file matrix.h.
References stxxl::swappable_block_matrix< ValueType, BlockSideLength >::bs, stxxl::matrix< ValueType, BlockSideLength >::data, stxxl::matrix< ValueType, BlockSideLength >::height, STXXL_ERRMSG, and stxxl::matrix< ValueType, BlockSideLength >::width.
|
inlineprotected |
Definition at line 1376 of file matrix.h.
References stxxl::matrix< ValueType, BlockSideLength >::begin(), stxxl::swappable_block_matrix< ValueType, BlockSideLength >::bs, stxxl::matrix< ValueType, BlockSideLength >::cbegin(), stxxl::matrix< ValueType, BlockSideLength >::cend(), stxxl::matrix< ValueType, BlockSideLength >::data, stxxl::matrix< ValueType, BlockSideLength >::end(), stxxl::matrix< ValueType, BlockSideLength >::height, stxxl::block_scheduler< SwappableBlockType >::is_simulating(), and stxxl::matrix< ValueType, BlockSideLength >::width.
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 1175 of file matrix.h.
References stxxl::matrix< ValueType, BlockSideLength >::data.
|
inline |
Definition at line 1208 of file matrix.h.
References stxxl::column_vector< ValueType >::set_zero(), and stxxl::vector< ValueType, PageSize, PagerType, BlockSize, AllocStr, SizeType >::size().
|
inline |
|
inline |
|
inline |
Definition at line 1156 of file matrix.h.
References stxxl::matrix< ValueType, BlockSideLength >::data, stxxl::matrix< ValueType, BlockSideLength >::height, and stxxl::matrix< ValueType, BlockSideLength >::width.
|
inline |
Definition at line 1182 of file matrix.h.
References stxxl::matrix< ValueType, BlockSideLength >::data, stxxl::matrix< ValueType, BlockSideLength >::height, and stxxl::matrix< ValueType, BlockSideLength >::width.
|
inline |
Definition at line 1164 of file matrix.h.
References stxxl::matrix< ValueType, BlockSideLength >::data, stxxl::matrix< ValueType, BlockSideLength >::height, and stxxl::matrix< ValueType, BlockSideLength >::width.
|
inline |
Definition at line 1190 of file matrix.h.
References stxxl::matrix< ValueType, BlockSideLength >::data, stxxl::matrix< ValueType, BlockSideLength >::height, and stxxl::matrix< ValueType, BlockSideLength >::width.
|
inline |
Definition at line 1144 of file matrix.h.
References stxxl::div_ceil().
|
inline |
|
protected |
Definition at line 1069 of file matrix.h.
Referenced by stxxl::matrix< ValueType, BlockSideLength >::multiply(), stxxl::matrix< ValueType, BlockSideLength >::multiply_internal(), stxxl::matrix< ValueType, BlockSideLength >::operator*(), stxxl::matrix< ValueType, BlockSideLength >::operator+(), stxxl::matrix< ValueType, BlockSideLength >::operator+=(), stxxl::matrix< ValueType, BlockSideLength >::operator-(), and stxxl::matrix< ValueType, BlockSideLength >::operator-=().
|
protected |
Definition at line 1067 of file matrix.h.
Referenced by stxxl::matrix< ValueType, BlockSideLength >::multiply(), stxxl::matrix< ValueType, BlockSideLength >::multiply_internal(), stxxl::matrix< ValueType, BlockSideLength >::operator+(), stxxl::matrix< ValueType, BlockSideLength >::operator+=(), stxxl::matrix< ValueType, BlockSideLength >::operator-(), and stxxl::matrix< ValueType, BlockSideLength >::operator-=().
|
protected |
Definition at line 1067 of file matrix.h.
Referenced by stxxl::matrix< ValueType, BlockSideLength >::multiply(), stxxl::matrix< ValueType, BlockSideLength >::multiply_internal(), stxxl::matrix< ValueType, BlockSideLength >::operator+(), stxxl::matrix< ValueType, BlockSideLength >::operator+=(), stxxl::matrix< ValueType, BlockSideLength >::operator-(), and stxxl::matrix< ValueType, BlockSideLength >::operator-=().