9.2
general documentation
cs_sdm_t Struct Reference

#include <cs_sdm.h>

+ Collaboration diagram for cs_sdm_t:

Public Member Functions

 ~_cs_sdm_t ()
 Destructor. More...
 
 _cs_sdm_t (const int n_max_rows_)
 Constructor for a square matrix. More...
 
 _cs_sdm_t (const cs_flag_t flag_, const int n_max_rows_, const int n_max_cols_)
 Constructor for a matrix. More...
 
 _cs_sdm_t (const _cs_sdm_t &other)
 Constructor by copy. More...
 
int size () const
 Return the size of the matrix. More...
 
cs_real_trow (const int row_i) const
 Return a pointer on row. More...
 
_cs_sdm_toperator= (const _cs_sdm_t &)=delete
 
cs_real_toperator() (const int i, const int j)
 Modifiy the value (i,j) of the matric. More...
 
const cs_real_toperator() (const int i, const int j) const
 Get the value (i,j) of the matric. More...
 
void init (const int nrows, const int ncols)
 Initialize matrix. More...
 
void init (const int nrows)
 Initialize square matrix. More...
 
cs_real_tdata () const
 Return a pointer on the values. More...
 
_cs_sdm_t transpose () const
 Transpose a matrix. More...
 
void symmetrize_ur ()
 Set the lower left according to the upper right part in order to get a symmetric matrix. More...
 
cs_sdm_t * get_block (const int row_block_id, const int col_block_id) const
 Get a specific block in a cs_sdm_t structure defined by block. More...
 
_cs_sdm_toperator*= (const cs_real_t &scaling)
 Multiply a matrix with the scaling factor given as parameter. More...
 
_cs_sdm_toperator+= (const _cs_sdm_t &add)
 Add two small dense matrices: loc += add. More...
 
void dot (const cs_real_t vec[], cs_real_t mv[]) const
 Compute a dense matrix-vector product for a small square matrix mv has been previously allocated. More...
 
void dump () const
 Dump a small dense matrix. More...
 
void dump (cs_lnum_t parent_id) const
 Dump a small dense matrix. More...
 
void dump (cs_lnum_t parent_id, const cs_lnum_t *row_ids, const cs_lnum_t *col_ids) const
 Dump a small dense matrix. More...
 
void dump (FILE *fp, const char *fname, cs_real_t thd) const
 Print a cs_sdm_t structure not defined by block Print into the file f if given otherwise open a new file named fname if given otherwise print into the standard output The usage of threshold allows one to compare more easier matrices without taking into account numerical roundoff. More...
 
void map_array (int n_max_rows_, int n_max_cols_, cs_real_t *array)
 Map an array into a predefined cs_sdm_t structure. This array is shared and the lifecycle of this array is not managed by the cs_sdm_t structure. More...
 

Public Attributes

cs_flag_t flag
 
int n_max_rows
 
int n_rows
 
int n_max_cols
 
int n_cols
 
cs_real_tval
 
cs_sdm_block_tblock_desc
 

Constructor & Destructor Documentation

◆ ~_cs_sdm_t()

~_cs_sdm_t ( )

Destructor.

◆ _cs_sdm_t() [1/3]

_cs_sdm_t ( const int  n_max_rows_)

Constructor for a square matrix.

Parameters
[in]n_max_rowsmax number of rows

◆ _cs_sdm_t() [2/3]

_cs_sdm_t ( const cs_flag_t  flag_,
const int  n_max_rows_,
const int  n_max_cols_ 
)

Constructor for a matrix.

Constructor for a square matrix.

Parameters
[in]flagmetadata related to a cs_sdm_t structure
[in]n_max_rowsmax number of rows
[in]n_max_colsmax number of columns

◆ _cs_sdm_t() [3/3]

_cs_sdm_t ( const _cs_sdm_t other)

Constructor by copy.

Parameters
[in]othera cs_sdm_t structure

Member Function Documentation

◆ data()

cs_real_t * data ( ) const
inline

Return a pointer on the values.

◆ dot()

void dot ( const cs_real_t  vec[],
cs_real_t  mv[] 
) const

Compute a dense matrix-vector product for a small square matrix mv has been previously allocated.

Parameters
[in]veclocal vector to use
[in,out]mvresult of the local matrix-vector product

◆ dump() [1/4]

void dump ( ) const

Dump a small dense matrix.

◆ dump() [2/4]

void dump ( cs_lnum_t  parent_id) const

Dump a small dense matrix.

Parameters
[in]parent_idid of the related parent entity

◆ dump() [3/4]

void dump ( cs_lnum_t  parent_id,
const cs_lnum_t row_ids,
const cs_lnum_t col_ids 
) const

Dump a small dense matrix.

Parameters
[in]parent_idid of the related parent entity
[in]row_idslist of ids related to associated entities (or nullptr)
[in]col_idslist of ids related to associated entities

◆ dump() [4/4]

void dump ( FILE *  fp,
const char *  fname,
cs_real_t  thd 
) const

Print a cs_sdm_t structure not defined by block Print into the file f if given otherwise open a new file named fname if given otherwise print into the standard output The usage of threshold allows one to compare more easier matrices without taking into account numerical roundoff.

Parameters
[in]fppointer to a file structure or null
[in]fnamefilename or null
[in]thdthreshold (below this value --> set 0)

◆ get_block()

cs_sdm_t * get_block ( const int  row_block_id,
const int  col_block_id 
) const
inline

Get a specific block in a cs_sdm_t structure defined by block.

Parameters
[in]row_block_idid of the block row, zero-based.
[in]col_block_idid of the block column, zero-based.
Returns
a pointer to a cs_sdm_t structure corresponfing to a block

◆ init() [1/2]

void init ( const int  nrows)

Initialize square matrix.

Parameters
[in]nrowsnumber of rows

◆ init() [2/2]

void init ( const int  nrows,
const int  ncols 
)

Initialize matrix.

Parameters
[in]nrowsnumber of rows
[in]ncolsnumber of columns

◆ map_array()

void map_array ( int  n_max_rows_,
int  n_max_cols_,
cs_real_t array 
)

Map an array into a predefined cs_sdm_t structure. This array is shared and the lifecycle of this array is not managed by the cs_sdm_t structure.

Parameters
[in]n_max_rows_max. number of rows
[in]n_max_cols_max. number of columns
[in,out]arraypointer to an array of values of size equal to n_max_rows x n_max_cols

◆ operator()() [1/2]

cs_real_t & operator() ( const int  i,
const int  j 
)

Modifiy the value (i,j) of the matric.

Parameters
[in]iindex of the row
[in]jindex of the column
Returns
value

◆ operator()() [2/2]

const cs_real_t & operator() ( const int  i,
const int  j 
) const

Get the value (i,j) of the matric.

Parameters
[in]iindex of the row
[in]jindex of the column
Returns
value

◆ operator*=()

_cs_sdm_t & operator*= ( const cs_real_t scaling)

Multiply a matrix with the scaling factor given as parameter.

Parameters
[in]scaling

◆ operator+=()

_cs_sdm_t & operator+= ( const _cs_sdm_t add)

Add two small dense matrices: loc += add.

Parameters
[in]addvalues to add to mat

◆ operator=()

_cs_sdm_t & operator= ( const _cs_sdm_t )
delete

◆ row()

cs_real_t * row ( const int  row_i) const
inline

Return a pointer on row.

Parameters
[in]row_iindex of the row
Returns
pointer on row_i

◆ size()

int size ( ) const
inline

Return the size of the matrix.

◆ symmetrize_ur()

void symmetrize_ur ( )

Set the lower left according to the upper right part in order to get a symmetric matrix.

◆ transpose()

_cs_sdm_t transpose ( ) const

Transpose a matrix.

Returns
the transposed matrix

Member Data Documentation

◆ block_desc

cs_sdm_block_t* block_desc

◆ flag

cs_flag_t flag

◆ n_cols

int n_cols

◆ n_max_cols

int n_max_cols

◆ n_max_rows

int n_max_rows

◆ n_rows

int n_rows

◆ val

cs_real_t* val

The documentation for this struct was generated from the following files: