ug4
sparsematrix_interface.h File Reference

Go to the source code of this file.

Classes

class  SparseMatrix< T >
 

Typedefs

typedef T value_type
 

Functions

const_row_iterator begin_row (size_t row) const
 
template<typename AB_type , typename A_type , typename B_type >
void CreateAsMultiplyOf (AB_type &M, const A_type &A, const B_type &B)
 Calculates M = A*B. More...
 
template<typename T >
class SparseMatrix CreateAsProductOf (ABC_type &M, const A_type &A, const B_type &B, const C_type &C)
 
void defragment ()
 
const_row_iterator end_row (size_t row) const
 
const_row_iterator get_connection (size_t r, size_t c) const
 
const_row_iterator get_connection (size_t r, size_t c, bool &bFound) const
 
template<typename matrix_type >
void MatAdd (matrix_type &M, number &alpha1, const matrix_type &A, number &alpha2, const matrix_type &B)
 Calculates M = A + B. More...
 
size_t num_cols () const
 
size_t num_connections (size_t row) const
 
size_t num_rows () const
 
value_typeoperator() (size_t r, size_t c)
 
bool resize (size_t newRows, size_t newCols)
 
 SparseMatrix ()
 
size_t total_num_connections () const
 
virtual ~SparseMatrix ()
 

Variables

class SparseMatrix A_type
 
class SparseMatrix ABC_type
 Calculates M = A*B*C. More...
 
class SparseMatrix B_type
 

Typedef Documentation

◆ value_type

typedef T value_type

Function Documentation

◆ begin_row()

◆ CreateAsMultiplyOf()

template<typename AB_type , typename A_type , typename B_type >
void CreateAsMultiplyOf ( AB_type &  M,
const A_type A,
const B_type B 
)

Calculates M = A*B.

Parameters
M(out) Matrix M, M = A*B$
A(in) Matrix A
B(in) Matrix B

◆ CreateAsProductOf()

template<typename T >
class SparseMatrix CreateAsProductOf ( ABC_type M,
const A_type A,
const B_type B,
const C_type &  C 
)

◆ defragment()

void CreateAsProductOf::defragment ( )

◆ end_row()

◆ get_connection() [1/2]

row_iterator get_connection ( size_t  r,
size_t  c 
) const

◆ get_connection() [2/2]

row_iterator get_connection ( size_t  r,
size_t  c,
bool &  bFound 
) const

◆ MatAdd()

template<typename matrix_type >
void MatAdd ( matrix_type M,
number alpha1,
const matrix_type A,
number alpha2,
const matrix_type B 
)

Calculates M = A + B.

Parameters
M(out) Matrix M, M = A + B
A(in) Matrix A
B(in) Matrix B note: A and/or B may be equal to M.

◆ num_cols()

◆ num_connections()

◆ num_rows()

size_t CreateAsProductOf::num_rows ( ) const

Referenced by ug::Jacobi< TAlgebra >::apply(), ug::AssembledLinearOperator< TAlgebra >::apply(), ug::SparseMatrix< TValueType >::apply_ignore_zero_rows(), ug::AssembledLinearOperator< TAlgebra >::apply_sub(), ug::SparseMatrix< TValueType >::apply_transposed_ignore_zero_rows(), ug::GPUSparseMatrix< TValueType >::axpy(), ug::SparseMatrix< TValueType >::axpy(), ug::MapSparseMatrix< TValueType >::axpy(), ug::SparseMatrix< TValueType >::axpy_transposed(), ug::MapSparseMatrix< TValueType >::axpy_transposed(), ug::BlockGaussSeidel< TAlgebra, backward, forward >::block_preprocess(), ug::SparseBlockGaussSeidel< TAlgebra, backward, forward >::block_preprocess(), ug::SparseBlockGaussSeidel2< TAlgebra, backward, forward >::block_preprocess(), ug::GPUSparseMatrix< TValueType >::copyToNewSize(), ug::SparseMatrix< TValueType >::get_nnz_max_cols(), ug::GPUSparseMatrix< TValueType >::get_nnz_max_cols(), ug::SparseMatrix< TValueType >::is_isolated(), ug::GPUSparseMatrix< TValueType >::is_isolated(), ug::MapSparseMatrix< TValueType >::is_isolated(), ug::Table< std::string >::num_cols(), ScalarMatrixAdapter< AT, ST >::operator()(), ug::Table< T >::operator()(), ug::DenseMatrix< VariableArray2< LocalCplMatrix > >::operator*(), ug::DenseMatrix< TStorage >::operator*(), ug::DenseMatrix< VariableArray2< LocalCplMatrix > >::operator*=(), ug::DenseMatrix< TStorage >::operator+(), ug::DenseMatrix< TStorage >::operator-(), ug::DenseMatrix< VariableArray2< LocalCplMatrix > >::operator-=(), ug::DenseMatrix< TStorage >::operator-=(), ug::DenseMatrix< TStorage >::operator/=(), ug::DenseMatrix< TStorage >::operator=(), ug::DenseMatrix< TStorage >::operator==(), ug::PILUTPreconditioner< TAlgebra >::preprocess(), ug::GPUSparseMatrix< TValueType >::print(), ug::MapSparseMatrix< TValueType >::print(), ug::bridge::RegisterBridge_Util(), ug::GPUSparseMatrix< TValueType >::resize_and_keep_values(), ug::SparseMatrix< TValueType >::scale(), ug::GPUSparseMatrix< TValueType >::scale(), ug::MapSparseMatrix< TValueType >::scale(), ug::SparseMatrix< TValueType >::set(), ug::GPUSparseMatrix< TValueType >::set(), ug::MapSparseMatrix< TValueType >::set(), ug::SparseMatrix< TValueType >::set_as_transpose_of2(), ug::Table< T >::stream(), ug::DenseMatrix< TStorage >::subassign(), ug::DenseMatrix< TStorage >::T(), ug::Table< T >::to_csv(), and ug::Table< T >::to_latex().

◆ operator()()

const value_type & operator() ( size_t  r,
size_t  c 
)

operator() (size_t r, size_t c) const access connection (r, c)

Parameters
rrow
ccolumn
Note
it is assert'ed that connection (r,c) is there use operator()(r,c,bConnectionFound) to check.
Returns
SparseMat(r, c)

operator() (size_t r, size_t c) const access or create connection (r, c)

Parameters
rrow
ccolumn
Note
(r,c) is added to sparsity pattern if not already there use operator()(r,c,bConnectionFound) to prevent
Returns
SparseMat(r, c)=0.0 if connection created, otherwise SparseMat(r, c)

Referenced by ug::DenseMatrix< TStorage >::entry(), ug::GPUSparseMatrix< TValueType >::set_as_copy_of(), ug::MapSparseMatrix< TValueType >::set_as_copy_of(), ug::SparseMatrix< TValueType >::set_as_copy_of(), ug::GPUSparseMatrix< TValueType >::set_as_transpose_of(), ug::MapSparseMatrix< TValueType >::set_as_transpose_of(), and ug::TestHorizontalAlgebraLayouts().

◆ resize()

◆ SparseMatrix()

CreateAsProductOf::SparseMatrix ( )

◆ total_num_connections()

size_t CreateAsProductOf::total_num_connections ( ) const

◆ ~SparseMatrix()

virtual CreateAsProductOf::~SparseMatrix ( )
virtual

Variable Documentation

◆ A_type

class SparseMatrix A_type

◆ ABC_type

class SparseMatrix ABC_type

Calculates M = A*B*C.

Parameters
M(out) Matrix M, M = A*B*C$
A(in) Matrix A
B(in) Matrix B
C(in) Matrix C

◆ B_type

class SparseMatrix B_type