STXXL  1.4.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
stxxl::swappable_block_matrix< ValueType, BlockSideLength > Class Template Reference

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 232 of file matrix.h.

+ Inheritance diagram for stxxl::swappable_block_matrix< ValueType, BlockSideLength >:
+ Collaboration diagram for stxxl::swappable_block_matrix< ValueType, BlockSideLength >:

Public Types

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

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. More...
 
 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). More...
 
 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. More...
 
 swappable_block_matrix (const swappable_block_matrix &other)
 
 ~swappable_block_matrix ()
 
const
swappable_block_identifier_type
block (const size_type row, const size_type col) const
 get identifier of the block at (row, col) More...
 
int_type elem_index_in_block_from_elem (elem_size_type row, elem_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 More...
 
const
swappable_block_identifier_type
operator() (const size_type row, const size_type col) const
 get identifier of the block at (row, col) More...
 
void set_zero ()
 
void transpose ()
 
- Public Member Functions inherited from stxxl::atomic_counted_object
 atomic_counted_object ()
 new objects have zero reference count More...
 
 atomic_counted_object (const atomic_counted_object &)
 coping still creates a new object with zero reference count More...
 
 ~atomic_counted_object ()
 
bool dec_reference () const
 Call whenever resetting (i.e. overwriting) a pointer to the object. IMPORTANT: In case of self-assignment, call AFTER inc_reference(). More...
 
unsigned_type get_reference_count () const
 Return the number of references to this object (for debugging) More...
 
void inc_reference () const
 Call whenever setting a pointer to the object. More...
 
atomic_counted_objectoperator= (const atomic_counted_object &)
 assignment operator, leaves pointers unchanged More...
 
bool unique () const
 Test if the counted_object is referenced by only one counting_ptr. More...
 

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) More...
 

Protected Attributes

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

Private Member Functions

swappable_block_matrixoperator= (const swappable_block_matrix &other)
 

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 237 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 239 of file matrix.h.

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

Definition at line 236 of file matrix.h.

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

Definition at line 240 of file matrix.h.

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

Definition at line 235 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 238 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 268 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 287 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 314 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 340 of file matrix.h.

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

Definition at line 357 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 
)
inlineprotected

get identifier of the block at (row, col)

Definition at line 263 of file matrix.h.

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

get identifier of the block at (row, col)

Definition at line 384 of file matrix.h.

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

template<typename ValueType , unsigned BlockSideLength>
static size_type stxxl::swappable_block_matrix< ValueType, BlockSideLength >::block_index_from_elem ( elem_size_type  index)
inlinestatic

Definition at line 369 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)
inlinestatic

Definition at line 372 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 376 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 391 of file matrix.h.

Referenced by stxxl::matrix_local::matrix_operations< ValueType, BlockSideLength >::choose_level_for_feedable_sw(), stxxl::matrix_local::matrix_operations< ValueType, BlockSideLength >::element_op(), stxxl::matrix_local::matrix_operations< ValueType, BlockSideLength >::element_op_twice_nontransposed(), stxxl::matrix_local::feedable_strassen_winograd_block_grained< ValueType, BlockSideLength, Level, AExists, BExists >::feed_a(), stxxl::matrix_local::feedable_strassen_winograd_block_grained< ValueType, BlockSideLength, 0, AExists, BExists >::feed_a(), stxxl::matrix_local::feedable_strassen_winograd_block_grained< ValueType, BlockSideLength, Level, AExists, BExists >::feed_b(), stxxl::matrix_local::feedable_strassen_winograd_block_grained< ValueType, BlockSideLength, 0, AExists, BExists >::feed_b(), stxxl::matrix_local::matrix_to_quadtree< ValueType, BlockSideLength, Level >::matrix_to_quadtree(), stxxl::matrix_local::matrix_to_quadtree_block_grained< ValueType, BlockSideLength, Level, Granularity >::matrix_to_quadtree_block_grained(), stxxl::matrix_local::matrix_to_quadtree_block_grained< ValueType, BlockSideLength, 0, Granularity >::matrix_to_quadtree_block_grained(), stxxl::matrix_local::matrix_operations< ValueType, BlockSideLength >::multi_level_strassen_winograd_multiply_and_add(), stxxl::matrix_local::matrix_operations< ValueType, BlockSideLength >::multi_level_strassen_winograd_multiply_and_add_block_grained(), stxxl::matrix_local::matrix_operations< ValueType, BlockSideLength >::naive_matrix_col_vector_multiply_and_add(), stxxl::matrix_local::matrix_operations< ValueType, BlockSideLength >::naive_matrix_from_vectors(), stxxl::matrix_local::matrix_operations< ValueType, BlockSideLength >::naive_matrix_row_vector_multiply_and_add(), stxxl::matrix_local::matrix_operations< ValueType, BlockSideLength >::naive_multiply_and_add(), stxxl::matrix_local::feedable_strassen_winograd_block_grained< ValueType, BlockSideLength, Level, AExists, BExists >::read_and_add(), stxxl::matrix_local::feedable_strassen_winograd_block_grained< ValueType, BlockSideLength, 0, AExists, BExists >::read_and_add(), stxxl::matrix_local::matrix_operations< ValueType, BlockSideLength >::recursive_matrix_col_vector_multiply_and_add(), stxxl::matrix_local::matrix_operations< ValueType, BlockSideLength >::recursive_matrix_from_vectors(), stxxl::matrix_local::matrix_operations< ValueType, BlockSideLength >::recursive_matrix_row_vector_multiply_and_add(), stxxl::matrix_local::matrix_operations< ValueType, BlockSideLength >::recursive_multiply_and_add(), stxxl::matrix_local::matrix_operations< ValueType, BlockSideLength >::strassen_winograd_multiply(), stxxl::matrix_local::matrix_operations< ValueType, BlockSideLength >::strassen_winograd_multiply_and_add(), stxxl::matrix_local::matrix_operations< ValueType, BlockSideLength >::strassen_winograd_multiply_and_add_interleaved(), stxxl::matrix_local::matrix_operations< ValueType, BlockSideLength >::strassen_winograd_postaddition(), stxxl::matrix_local::matrix_operations< ValueType, BlockSideLength >::strassen_winograd_preaddition_a(), stxxl::matrix_local::matrix_operations< ValueType, BlockSideLength >::strassen_winograd_preaddition_b(), stxxl::matrix_local::matrix_operations< ValueType, BlockSideLength >::swappable_block_matrix_quarterer::swappable_block_matrix_quarterer(), stxxl::matrix_local::matrix_operations< ValueType, BlockSideLength >::use_feedable_sw(), and stxxl::matrix_local::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 394 of file matrix.h.

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

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

get identifier of the block at (row, col)

Definition at line 388 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 401 of file matrix.h.

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 258 of file matrix.h.

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

Definition at line 242 of file matrix.h.

Referenced by stxxl::matrix_local::matrix_operations< ValueType, BlockSideLength >::element_op(), stxxl::matrix_local::matrix_operations< ValueType, BlockSideLength >::element_op_twice_nontransposed(), stxxl::matrix_local::feedable_strassen_winograd_block_grained< ValueType, BlockSideLength, Level, AExists, BExists >::feed_a(), stxxl::matrix_local::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_local::matrix_operations< ValueType, BlockSideLength >::naive_matrix_col_vector_multiply_and_add(), stxxl::matrix_local::matrix_operations< ValueType, BlockSideLength >::naive_matrix_from_vectors(), stxxl::matrix_local::matrix_operations< ValueType, BlockSideLength >::naive_matrix_row_vector_multiply_and_add(), stxxl::matrix_local::matrix_operations< ValueType, BlockSideLength >::naive_multiply_and_add(), stxxl::matrix_local::matrix_operations< ValueType, BlockSideLength >::op_swappable_block_nontransposed(), stxxl::matrix_local::feedable_strassen_winograd_block_grained< ValueType, BlockSideLength, Level, AExists, BExists >::read_and_add(), stxxl::matrix_local::matrix_operations< ValueType, BlockSideLength >::strassen_winograd_multiply(), stxxl::matrix_local::matrix_operations< ValueType, BlockSideLength >::strassen_winograd_multiply_and_add(), stxxl::matrix_local::matrix_operations< ValueType, BlockSideLength >::strassen_winograd_multiply_and_add_interleaved(), stxxl::matrix_local::matrix_operations< ValueType, BlockSideLength >::use_feedable_sw(), and stxxl::matrix_local::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 260 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 250 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 250 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 250 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 250 of file matrix.h.


The documentation for this class was generated from the following file: