Stxxl  1.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions
stxxl::swappable_block_matrix< ValueType, BlockSideLength > Class Template Reference

External container for a (sub)matrix. Not intended for direct use. More...

#include <matrix.h>

Inheritance diagram for stxxl::swappable_block_matrix< ValueType, BlockSideLength >:
Inheritance graph
[legend]
Collaboration diagram for stxxl::swappable_block_matrix< ValueType, BlockSideLength >:
Collaboration graph
[legend]

List of all members.

Public Types

typedef int_type size_type
typedef int_type elem_size_type
typedef block_scheduler
< matrix_swappable_block
< ValueType, BlockSideLength > > 
block_scheduler_type
typedef
block_scheduler_type::swappable_block_identifier_type 
swappable_block_identifier_type
typedef std::vector
< swappable_block_identifier_type
blocks_type
typedef matrix_operations
< ValueType, BlockSideLength > 
Ops

Public Member Functions

 swappable_block_matrix (block_scheduler_type &bs, const size_type height_in_blocks, const size_type width_in_blocks, const bool transposed=false)
 Create an empty swappable_block_matrix of given dimensions.
 swappable_block_matrix (const swappable_block_matrix &supermatrix, const size_type height_in_blocks, const size_type width_in_blocks, const size_type from_row_in_blocks, const size_type from_col_in_blocks)
 Create swappable_block_matrix of given dimensions that represents the submatrix of supermatrix starting at (from_row_in_blocks, from_col_in_blocks).
 swappable_block_matrix (const swappable_block_matrix &ul, const swappable_block_matrix &ur, const swappable_block_matrix &dl, const swappable_block_matrix &dr)
 Create swappable_block_matrix that represents the combination matrix ul ur dl dr.
 swappable_block_matrix (const swappable_block_matrix &other)
 ~swappable_block_matrix ()
int_type elem_index_in_block_from_elem (elem_size_type row, elem_size_type col) const
swappable_block_identifier_type block (const size_type row, const size_type col) const
swappable_block_identifier_type operator() (const size_type row, const size_type col) const
const size_typeget_height () const
const size_typeget_width () const
const bool & is_transposed () const
 if the elements inside the blocks are in transposed order i.e. column-major
void transpose ()
void set_zero ()

Static Public Member Functions

static size_type block_index_from_elem (elem_size_type index)
static int_type elem_index_in_block_from_elem (elem_size_type index)

Public Attributes

block_scheduler_typebs

Protected Member Functions

swappable_block_identifier_typebl (const size_type row, const size_type col)
 get identifier of the block at (row, col)

Protected Attributes

size_type height
 height of the matrix in blocks
size_type width
 width of the matrix in blocks
size_type height_from_supermatrix
 height copied from supermatrix in blocks
size_type width_from_supermatrix
 width copied from supermatrix in blocks
blocks_type blocks
 the matrice's blocks in row-major
bool elements_in_blocks_transposed
 if the elements in each block are in col-major instead of row-major

Private Member Functions

swappable_block_matrixoperator= (const swappable_block_matrix &other)

Detailed Description

template<typename ValueType, unsigned BlockSideLength>
class stxxl::swappable_block_matrix< ValueType, BlockSideLength >

External container for a (sub)matrix. Not intended for direct use.

Template Parameters:
ValueTypetype of contained objects (POD with no references to internal memory)
BlockSideLengthside length of a matrix block

Stores blocks only, so all measures (height, width, row, col) are in blocks.

Definition at line 227 of file matrix.h.


Member Typedef Documentation

template<typename ValueType , unsigned BlockSideLength>
typedef block_scheduler< matrix_swappable_block<ValueType, BlockSideLength> > stxxl::swappable_block_matrix< ValueType, BlockSideLength >::block_scheduler_type

Definition at line 232 of file matrix.h.

template<typename ValueType , unsigned BlockSideLength>
typedef std::vector<swappable_block_identifier_type> stxxl::swappable_block_matrix< ValueType, BlockSideLength >::blocks_type

Definition at line 234 of file matrix.h.

template<typename ValueType , unsigned BlockSideLength>
typedef int_type stxxl::swappable_block_matrix< ValueType, BlockSideLength >::elem_size_type

Definition at line 231 of file matrix.h.

template<typename ValueType , unsigned BlockSideLength>
typedef matrix_operations<ValueType, BlockSideLength> stxxl::swappable_block_matrix< ValueType, BlockSideLength >::Ops

Definition at line 235 of file matrix.h.

template<typename ValueType , unsigned BlockSideLength>
typedef int_type stxxl::swappable_block_matrix< ValueType, BlockSideLength >::size_type

Definition at line 230 of file matrix.h.

template<typename ValueType , unsigned BlockSideLength>
typedef block_scheduler_type::swappable_block_identifier_type stxxl::swappable_block_matrix< ValueType, BlockSideLength >::swappable_block_identifier_type

Definition at line 233 of file matrix.h.


Constructor & Destructor Documentation

template<typename ValueType , unsigned BlockSideLength>
stxxl::swappable_block_matrix< ValueType, BlockSideLength >::swappable_block_matrix ( block_scheduler_type bs,
const size_type  height_in_blocks,
const size_type  width_in_blocks,
const bool  transposed = false 
) [inline]

Create an empty swappable_block_matrix of given dimensions.

Definition at line 262 of file matrix.h.

References stxxl::block_scheduler< SwappableBlockType >::allocate_swappable_block().

template<typename ValueType , unsigned BlockSideLength>
stxxl::swappable_block_matrix< ValueType, BlockSideLength >::swappable_block_matrix ( const swappable_block_matrix< ValueType, BlockSideLength > &  supermatrix,
const size_type  height_in_blocks,
const size_type  width_in_blocks,
const size_type  from_row_in_blocks,
const size_type  from_col_in_blocks 
) [inline]

Create swappable_block_matrix of given dimensions that represents the submatrix of supermatrix starting at (from_row_in_blocks, from_col_in_blocks).

If supermatrix is not large enough, the submatrix is padded with empty blocks. The supermatrix must not be destructed or transposed before the submatrix is destructed.

Definition at line 281 of file matrix.h.

References stxxl::swappable_block_matrix< ValueType, BlockSideLength >::block().

template<typename ValueType , unsigned BlockSideLength>
stxxl::swappable_block_matrix< ValueType, BlockSideLength >::swappable_block_matrix ( const swappable_block_matrix< ValueType, BlockSideLength > &  ul,
const swappable_block_matrix< ValueType, BlockSideLength > &  ur,
const swappable_block_matrix< ValueType, BlockSideLength > &  dl,
const swappable_block_matrix< ValueType, BlockSideLength > &  dr 
) [inline]

Create swappable_block_matrix that represents the combination matrix ul ur dl dr.

The submatrices are assumed to be of fitting dimensions and equal transposition. The submatrices must not be destructed or transposed before the matrix is destructed.

Definition at line 309 of file matrix.h.

References stxxl::swappable_block_matrix< ValueType, BlockSideLength >::block(), stxxl::swappable_block_matrix< ValueType, BlockSideLength >::height, and stxxl::swappable_block_matrix< ValueType, BlockSideLength >::width.

template<typename ValueType , unsigned BlockSideLength>
stxxl::swappable_block_matrix< ValueType, BlockSideLength >::swappable_block_matrix ( const swappable_block_matrix< ValueType, BlockSideLength > &  other) [inline]

Definition at line 335 of file matrix.h.

template<typename ValueType , unsigned BlockSideLength>
stxxl::swappable_block_matrix< ValueType, BlockSideLength >::~swappable_block_matrix ( ) [inline]

Definition at line 352 of file matrix.h.


Member Function Documentation

template<typename ValueType , unsigned BlockSideLength>
swappable_block_identifier_type& stxxl::swappable_block_matrix< ValueType, BlockSideLength >::bl ( const size_type  row,
const size_type  col 
) [inline, protected]

get identifier of the block at (row, col)

Definition at line 257 of file matrix.h.

template<typename ValueType , unsigned BlockSideLength>
swappable_block_identifier_type stxxl::swappable_block_matrix< ValueType, BlockSideLength >::block ( const size_type  row,
const size_type  col 
) const [inline]
template<typename ValueType , unsigned BlockSideLength>
static size_type stxxl::swappable_block_matrix< ValueType, BlockSideLength >::block_index_from_elem ( elem_size_type  index) [inline, static]

Definition at line 364 of file matrix.h.

template<typename ValueType , unsigned BlockSideLength>
static int_type stxxl::swappable_block_matrix< ValueType, BlockSideLength >::elem_index_in_block_from_elem ( elem_size_type  index) [inline, static]

Definition at line 367 of file matrix.h.

template<typename ValueType , unsigned BlockSideLength>
int_type stxxl::swappable_block_matrix< ValueType, BlockSideLength >::elem_index_in_block_from_elem ( elem_size_type  row,
elem_size_type  col 
) const [inline]

Definition at line 371 of file matrix.h.

template<typename ValueType , unsigned BlockSideLength>
const size_type& stxxl::swappable_block_matrix< ValueType, BlockSideLength >::get_height ( ) const [inline]

Definition at line 384 of file matrix.h.

Referenced by stxxl::matrix_operations< ValueType, BlockSideLength >::choose_level_for_feedable_sw(), stxxl::matrix_operations< ValueType, BlockSideLength >::element_op(), stxxl::matrix_operations< ValueType, BlockSideLength >::element_op_twice_nontransposed(), stxxl::feedable_strassen_winograd_block_grained< ValueType, BlockSideLength, Level, AExists, BExists >::feed_a(), stxxl::feedable_strassen_winograd_block_grained< ValueType, BlockSideLength, 0, AExists, BExists >::feed_a(), stxxl::feedable_strassen_winograd_block_grained< ValueType, BlockSideLength, Level, AExists, BExists >::feed_b(), stxxl::feedable_strassen_winograd_block_grained< ValueType, BlockSideLength, 0, AExists, BExists >::feed_b(), stxxl::matrix_to_quadtree< ValueType, BlockSideLength, Level >::matrix_to_quadtree(), stxxl::matrix_to_quadtree_block_grained< ValueType, BlockSideLength, Level, Granularity >::matrix_to_quadtree_block_grained(), stxxl::matrix_to_quadtree_block_grained< ValueType, BlockSideLength, 0, Granularity >::matrix_to_quadtree_block_grained(), stxxl::matrix_operations< ValueType, BlockSideLength >::multi_level_strassen_winograd_multiply_and_add(), stxxl::matrix_operations< ValueType, BlockSideLength >::multi_level_strassen_winograd_multiply_and_add_block_grained(), stxxl::matrix_operations< ValueType, BlockSideLength >::naive_matrix_col_vector_multiply_and_add(), stxxl::matrix_operations< ValueType, BlockSideLength >::naive_matrix_from_vectors(), stxxl::matrix_operations< ValueType, BlockSideLength >::naive_matrix_row_vector_multiply_and_add(), stxxl::matrix_operations< ValueType, BlockSideLength >::naive_multiply_and_add(), stxxl::feedable_strassen_winograd_block_grained< ValueType, BlockSideLength, Level, AExists, BExists >::read_and_add(), stxxl::feedable_strassen_winograd_block_grained< ValueType, BlockSideLength, 0, AExists, BExists >::read_and_add(), stxxl::matrix_operations< ValueType, BlockSideLength >::recursive_matrix_col_vector_multiply_and_add(), stxxl::matrix_operations< ValueType, BlockSideLength >::recursive_matrix_from_vectors(), stxxl::matrix_operations< ValueType, BlockSideLength >::recursive_matrix_row_vector_multiply_and_add(), stxxl::matrix_operations< ValueType, BlockSideLength >::recursive_multiply_and_add(), stxxl::matrix_operations< ValueType, BlockSideLength >::strassen_winograd_multiply(), stxxl::matrix_operations< ValueType, BlockSideLength >::strassen_winograd_multiply_and_add(), stxxl::matrix_operations< ValueType, BlockSideLength >::strassen_winograd_multiply_and_add_interleaved(), stxxl::matrix_operations< ValueType, BlockSideLength >::strassen_winograd_postaddition(), stxxl::matrix_operations< ValueType, BlockSideLength >::strassen_winograd_preaddition_a(), stxxl::matrix_operations< ValueType, BlockSideLength >::strassen_winograd_preaddition_b(), stxxl::matrix_operations< ValueType, BlockSideLength >::swappable_block_matrix_quarterer::swappable_block_matrix_quarterer(), stxxl::matrix_operations< ValueType, BlockSideLength >::use_feedable_sw(), and stxxl::matrix_operations< ValueType, BlockSideLength >::use_feedable_sw_block_grained().

template<typename ValueType , unsigned BlockSideLength>
const size_type& stxxl::swappable_block_matrix< ValueType, BlockSideLength >::get_width ( ) const [inline]

Definition at line 387 of file matrix.h.

Referenced by stxxl::matrix_operations< ValueType, BlockSideLength >::choose_level_for_feedable_sw(), stxxl::matrix_operations< ValueType, BlockSideLength >::element_op(), stxxl::matrix_operations< ValueType, BlockSideLength >::element_op_twice_nontransposed(), stxxl::feedable_strassen_winograd_block_grained< ValueType, BlockSideLength, Level, AExists, BExists >::feed_a(), stxxl::feedable_strassen_winograd_block_grained< ValueType, BlockSideLength, 0, AExists, BExists >::feed_a(), stxxl::feedable_strassen_winograd_block_grained< ValueType, BlockSideLength, Level, AExists, BExists >::feed_b(), stxxl::feedable_strassen_winograd_block_grained< ValueType, BlockSideLength, 0, AExists, BExists >::feed_b(), stxxl::matrix_to_quadtree< ValueType, BlockSideLength, Level >::matrix_to_quadtree(), stxxl::matrix_to_quadtree_block_grained< ValueType, BlockSideLength, Level, Granularity >::matrix_to_quadtree_block_grained(), stxxl::matrix_to_quadtree_block_grained< ValueType, BlockSideLength, 0, Granularity >::matrix_to_quadtree_block_grained(), stxxl::matrix_operations< ValueType, BlockSideLength >::multi_level_strassen_winograd_multiply_and_add(), stxxl::matrix_operations< ValueType, BlockSideLength >::multi_level_strassen_winograd_multiply_and_add_block_grained(), stxxl::matrix_operations< ValueType, BlockSideLength >::naive_matrix_col_vector_multiply_and_add(), stxxl::matrix_operations< ValueType, BlockSideLength >::naive_matrix_from_vectors(), stxxl::matrix_operations< ValueType, BlockSideLength >::naive_matrix_row_vector_multiply_and_add(), stxxl::matrix_operations< ValueType, BlockSideLength >::naive_multiply_and_add(), stxxl::feedable_strassen_winograd_block_grained< ValueType, BlockSideLength, Level, AExists, BExists >::read_and_add(), stxxl::feedable_strassen_winograd_block_grained< ValueType, BlockSideLength, 0, AExists, BExists >::read_and_add(), stxxl::matrix_operations< ValueType, BlockSideLength >::recursive_matrix_col_vector_multiply_and_add(), stxxl::matrix_operations< ValueType, BlockSideLength >::recursive_matrix_from_vectors(), stxxl::matrix_operations< ValueType, BlockSideLength >::recursive_matrix_row_vector_multiply_and_add(), stxxl::matrix_operations< ValueType, BlockSideLength >::recursive_multiply_and_add(), stxxl::matrix_operations< ValueType, BlockSideLength >::strassen_winograd_multiply(), stxxl::matrix_operations< ValueType, BlockSideLength >::strassen_winograd_multiply_and_add(), stxxl::matrix_operations< ValueType, BlockSideLength >::strassen_winograd_multiply_and_add_interleaved(), stxxl::matrix_operations< ValueType, BlockSideLength >::strassen_winograd_postaddition(), stxxl::matrix_operations< ValueType, BlockSideLength >::strassen_winograd_preaddition_a(), stxxl::matrix_operations< ValueType, BlockSideLength >::strassen_winograd_preaddition_b(), stxxl::matrix_operations< ValueType, BlockSideLength >::swappable_block_matrix_quarterer::swappable_block_matrix_quarterer(), stxxl::matrix_operations< ValueType, BlockSideLength >::use_feedable_sw(), and stxxl::matrix_operations< ValueType, BlockSideLength >::use_feedable_sw_block_grained().

template<typename ValueType , unsigned BlockSideLength>
const bool& stxxl::swappable_block_matrix< ValueType, BlockSideLength >::is_transposed ( ) const [inline]
template<typename ValueType , unsigned BlockSideLength>
swappable_block_identifier_type stxxl::swappable_block_matrix< ValueType, BlockSideLength >::operator() ( const size_type  row,
const size_type  col 
) const [inline]

Definition at line 381 of file matrix.h.

template<typename ValueType , unsigned BlockSideLength>
swappable_block_matrix& stxxl::swappable_block_matrix< ValueType, BlockSideLength >::operator= ( const swappable_block_matrix< ValueType, BlockSideLength > &  other) [private]
template<typename ValueType , unsigned BlockSideLength>
void stxxl::swappable_block_matrix< ValueType, BlockSideLength >::set_zero ( ) [inline]
template<typename ValueType , unsigned BlockSideLength>
void stxxl::swappable_block_matrix< ValueType, BlockSideLength >::transpose ( ) [inline]

Definition at line 394 of file matrix.h.

References std::swap().


Member Data Documentation

template<typename ValueType , unsigned BlockSideLength>
blocks_type stxxl::swappable_block_matrix< ValueType, BlockSideLength >::blocks [protected]

the matrice's blocks in row-major

Definition at line 253 of file matrix.h.

template<typename ValueType , unsigned BlockSideLength>
block_scheduler_type& stxxl::swappable_block_matrix< ValueType, BlockSideLength >::bs

Definition at line 237 of file matrix.h.

Referenced by stxxl::matrix_operations< ValueType, BlockSideLength >::element_op(), stxxl::matrix_operations< ValueType, BlockSideLength >::element_op_twice_nontransposed(), stxxl::feedable_strassen_winograd_block_grained< ValueType, BlockSideLength, Level, AExists, BExists >::feed_a(), stxxl::feedable_strassen_winograd_block_grained< ValueType, BlockSideLength, Level, AExists, BExists >::feed_b(), stxxl::matrix< ValueType, BlockSideLength >::multiply(), stxxl::matrix< ValueType, BlockSideLength >::multiply_internal(), stxxl::matrix_operations< ValueType, BlockSideLength >::naive_matrix_col_vector_multiply_and_add(), stxxl::matrix_operations< ValueType, BlockSideLength >::naive_matrix_from_vectors(), stxxl::matrix_operations< ValueType, BlockSideLength >::naive_matrix_row_vector_multiply_and_add(), stxxl::matrix_operations< ValueType, BlockSideLength >::naive_multiply_and_add(), stxxl::matrix_operations< ValueType, BlockSideLength >::op_swappable_block_nontransposed(), stxxl::feedable_strassen_winograd_block_grained< ValueType, BlockSideLength, Level, AExists, BExists >::read_and_add(), stxxl::matrix_operations< ValueType, BlockSideLength >::strassen_winograd_multiply(), stxxl::matrix_operations< ValueType, BlockSideLength >::strassen_winograd_multiply_and_add(), stxxl::matrix_operations< ValueType, BlockSideLength >::strassen_winograd_multiply_and_add_interleaved(), stxxl::matrix_operations< ValueType, BlockSideLength >::use_feedable_sw(), and stxxl::matrix_operations< ValueType, BlockSideLength >::use_feedable_sw_block_grained().

template<typename ValueType , unsigned BlockSideLength>
bool stxxl::swappable_block_matrix< ValueType, BlockSideLength >::elements_in_blocks_transposed [protected]

if the elements in each block are in col-major instead of row-major

Definition at line 255 of file matrix.h.

template<typename ValueType , unsigned BlockSideLength>
size_type stxxl::swappable_block_matrix< ValueType, BlockSideLength >::height [protected]

height of the matrix in blocks

Definition at line 245 of file matrix.h.

Referenced by stxxl::swappable_block_matrix< ValueType, BlockSideLength >::swappable_block_matrix().

template<typename ValueType , unsigned BlockSideLength>
size_type stxxl::swappable_block_matrix< ValueType, BlockSideLength >::height_from_supermatrix [protected]

height copied from supermatrix in blocks

Definition at line 245 of file matrix.h.

template<typename ValueType , unsigned BlockSideLength>
size_type stxxl::swappable_block_matrix< ValueType, BlockSideLength >::width [protected]

width of the matrix in blocks

Definition at line 245 of file matrix.h.

Referenced by stxxl::swappable_block_matrix< ValueType, BlockSideLength >::swappable_block_matrix().

template<typename ValueType , unsigned BlockSideLength>
size_type stxxl::swappable_block_matrix< ValueType, BlockSideLength >::width_from_supermatrix [protected]

width copied from supermatrix in blocks

Definition at line 245 of file matrix.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines