Loading...
Searching...
No Matches
Auxiliary Utilities
Collaboration diagram for Auxiliary Utilities:
int bitpit::linearalgebra::linearIndexColMajor (int row, int col, int nRows, int nCols)
 
int bitpit::linearalgebra::linearIndexRowMajor (int row, int col, int nRows, int nCols)
 
int bitpit::linearalgebra::linearIndexColMajorSymmetric (int row, int col, int nRows, int nCols, char uplo)
 
int bitpit::linearalgebra::linearIndexRowMajorSymmetric (int row, int col, int nRows, int nCols, char uplo)
 
template<class T >
void bitpit::linearalgebra::complement (int, int, std::vector< std::vector< T > > &, std::vector< std::vector< T > > &)
 
template<class T , size_t m, size_t n>
void bitpit::linearalgebra::complement (int, int, std::array< std::array< T, n >, m > &, std::array< std::array< T, n-1 >, m-1 > &)
 

Detailed Description

Function Documentation

◆ complement() [1/2]

template<class T , size_t m, size_t n>
void bitpit::linearalgebra::complement ( int i,
int j,
std::array< std::array< T, n >, m > & A,
std::array< std::array< T, n-1 >, m-1 > & B )

Given an input matrix A, compute the complement of the element A[i][j]. Overloading of complement() function for container array.

Parameters
[in]irow index of element
[in]jcolumn index of element
[in]Ainput matrix
[in,out]Bcomplement of alement A[i][j].

Definition at line 312 of file matrix_utilities.tpp.

◆ complement() [2/2]

template<class T >
void bitpit::linearalgebra::complement ( int i,
int j,
std::vector< std::vector< T > > & A,
std::vector< std::vector< T > > & B )

Given an input matrix A, compute the complement of the element A[i][j].

Parameters
[in]irow index of element
[in]jcolumn index of element
[in]Ainput matrix
[in,out]Bcomplement of alement A[i][j].

Definition at line 240 of file matrix_utilities.tpp.

◆ linearIndexColMajor()

int bitpit::linearalgebra::linearIndexColMajor ( int row,
int col,
int nRows,
int nCols )

Computes the linear index of an element of a matrix stored in column-major ordering.

Parameters
[in]rowis the row
[in]colis the column
[in]nRowsis the number of rows
[in]nColsis the number of columns
Returns
The linear index of the specified element.

Definition at line 48 of file matrix_utilities.cpp.

◆ linearIndexColMajorSymmetric()

int bitpit::linearalgebra::linearIndexColMajorSymmetric ( int row,
int col,
int nRows,
int nCols,
char uplo )

Computes the linear index of an element of a symmetric matrix stored in column-major ordering when only either the upper or lower triangle is stored. E.g. if the indices (row,col) correspond to element in the lower triangle, but uplo indicates that upper triangle is stored, the symmetric index within the upper triangle is returned.

Parameters
[in]rowis the row
[in]colis the column
[in]nRowsis the number of rows
[in]nColsis the number of columns
[in]uplodefines if the matrix is an upper triangle ('U') or a lower triangle ('L')
Returns
The linear index of the specified element.

Definition at line 87 of file matrix_utilities.cpp.

◆ linearIndexRowMajor()

int bitpit::linearalgebra::linearIndexRowMajor ( int row,
int col,
int nRows,
int nCols )

Computes the linear index of an element of a matrix stored in row-major ordering.

Parameters
[in]rowis the row
[in]colis the column
[in]nRowsis the number of rows
[in]nColsis the number of columns
Returns
The linear index of the specified element.

Definition at line 65 of file matrix_utilities.cpp.

◆ linearIndexRowMajorSymmetric()

int bitpit::linearalgebra::linearIndexRowMajorSymmetric ( int row,
int col,
int nRows,
int nCols,
char uplo )

Computes the linear index of an element of a symmetric matrix stored in row-major ordering when only either the upper or lower triangle is stored. E.g. if the indices (row,col) correspond to element in the lower triangle, but uplo indicates that upper triangle is stored, the symmetric index within the upper triangle is returned.

Parameters
[in]rowis the row
[in]colis the column
[in]nRowsis the number of rows
[in]nColsis the number of columns
[in]uplodefines if the matrix is an upper triangle ('U') or a lower triangle ('L')
Returns
The linear index of the specified element.

Definition at line 113 of file matrix_utilities.cpp.

--- layout: doxygen_footer ---