SparseMatrixFixedPattern Class Reference

#include <SparseMatrixFixedPattern.h>

Public Member Functions

 SparseMatrixFixedPattern ()
 
 ~SparseMatrixFixedPattern ()
 
int init (int num_rows, int num_nonzero_elements, sparse_entry *entry, int *key, sparse_entry_sources *source_list)
 
int init (int num_rows, int num_entries, scalar *entries, int *key, int *col_indices)
 
void build ()
 
void apply (scalar *in, scalar *result)
 
void apply (vector3 *in, vector3 *result)
 
void block_apply (vector3 *in, vector3 *result)
 
void block_apply (vector3 **in, vector3 **result)
 
void block_apply (vector3 **in)
 
SparseMatrixFixedPatternapply (SparseMatrixFixedPattern *in)
 
void calc_inverse_diagonal (scalar *inv_D)
 
void print ()
 
void print_dense ()
 
void print_dense_to_file (vector3 *a)
 
void print_row_column ()
 
void check_symmetry ()
 
void am_i_diagonally_dominant ()
 
sparse_entryget_entries ()
 
int * get_key ()
 
int get_num_nonzero_elements ()
 
int get_num_rows ()
 
int get_num_columns ()
 

Private Attributes

int num_rows
 
int num_nonzero_elements
 
sparse_entryentry
 
int * key
 
scalar ** diagonal
 
sparse_entry_sourcessource_list
 

Constructor & Destructor Documentation

◆ SparseMatrixFixedPattern()

SparseMatrixFixedPattern::SparseMatrixFixedPattern ( )

Referenced by apply().

◆ ~SparseMatrixFixedPattern()

SparseMatrixFixedPattern::~SparseMatrixFixedPattern ( )

Member Function Documentation

◆ am_i_diagonally_dominant()

void SparseMatrixFixedPattern::am_i_diagonally_dominant ( )

◆ apply() [1/3]

void SparseMatrixFixedPattern::apply ( scalar in,
scalar result 
)

◆ apply() [2/3]

void SparseMatrixFixedPattern::apply ( vector3 in,
vector3 result 
)

Applies this matrix to the given vector 'in', writing the result to 'result'. 'in' is made of 'vector3's

◆ apply() [3/3]

SparseMatrixFixedPattern * SparseMatrixFixedPattern::apply ( SparseMatrixFixedPattern in)

Applies this matrix to the given sparse matrix 'in', and returns a new sparse matrix

◆ block_apply() [1/3]

void SparseMatrixFixedPattern::block_apply ( vector3 in,
vector3 result 
)

Applies each matrix element to vector i.e. each vector3 acts as a scalar

Referenced by World::change_kinetic_state().

◆ block_apply() [2/3]

void SparseMatrixFixedPattern::block_apply ( vector3 **  in,
vector3 **  result 
)

Applies this matrix to the give vector 'in', writing the result to 'result'. 'in' is made of '*vector3's

◆ block_apply() [3/3]

void SparseMatrixFixedPattern::block_apply ( vector3 **  in)

Applies matrix to vector in and leaves result in in

◆ build()

void SparseMatrixFixedPattern::build ( )

Reconstruct the matrix by adding up all the contributions from the sources stored in the source list

Referenced by Blob::build_mass_matrix(), Blob::build_poisson_matrices(), and NoMassCGSolver::solve().

◆ calc_inverse_diagonal()

void SparseMatrixFixedPattern::calc_inverse_diagonal ( scalar inv_D)

◆ check_symmetry()

void SparseMatrixFixedPattern::check_symmetry ( )

◆ get_entries()

sparse_entry * SparseMatrixFixedPattern::get_entries ( )

Referenced by apply().

◆ get_key()

int * SparseMatrixFixedPattern::get_key ( )

Referenced by apply().

◆ get_num_columns()

int SparseMatrixFixedPattern::get_num_columns ( )

Referenced by apply().

◆ get_num_nonzero_elements()

int SparseMatrixFixedPattern::get_num_nonzero_elements ( )

◆ get_num_rows()

int SparseMatrixFixedPattern::get_num_rows ( )

Referenced by apply().

◆ init() [1/2]

int SparseMatrixFixedPattern::init ( int  num_rows,
int  num_nonzero_elements,
sparse_entry entry,
int *  key,
sparse_entry_sources source_list 
)

◆ init() [2/2]

int SparseMatrixFixedPattern::init ( int  num_rows,
int  num_entries,
scalar entries,
int *  key,
int *  col_indices 
)

◆ print()

void SparseMatrixFixedPattern::print ( )

◆ print_dense()

void SparseMatrixFixedPattern::print_dense ( )

◆ print_dense_to_file()

void SparseMatrixFixedPattern::print_dense_to_file ( vector3 a)

Prints dense matrix out to file for analysis. I suggest only letting this function run once (step = 1?)

Referenced by NoMassCGSolver::print_matrices().

◆ print_row_column()

void SparseMatrixFixedPattern::print_row_column ( )

Field Documentation

◆ diagonal

scalar** SparseMatrixFixedPattern::diagonal
private

An array of pointers to the diagonal elements of the matrix (for fast calculation of inverse diagonal)

Referenced by am_i_diagonally_dominant(), calc_inverse_diagonal(), init(), SparseMatrixFixedPattern(), and ~SparseMatrixFixedPattern().

◆ entry

◆ key

int* SparseMatrixFixedPattern::key
private

◆ num_nonzero_elements

int SparseMatrixFixedPattern::num_nonzero_elements
private

◆ num_rows

◆ source_list

sparse_entry_sources* SparseMatrixFixedPattern::source_list
private

Lists the source of contributions to each corresponding entry in the entry array

Referenced by build(), init(), SparseMatrixFixedPattern(), and ~SparseMatrixFixedPattern().


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