finitediff
|
#include "../exceptions/SNexceptions.cpp"
Go to the source code of this file.
Classes | |
class | SNgeneric< T, tp_size > |
This is the base class for the other matrices types. More... | |
Functions | |
template<class U , unsigned int s, class V , unsigned int t> | |
void | checkSizeCompatibility (const SNgeneric< U, s > &A, const SNgeneric< V, t > &B) |
template<class T , class U > | |
bool | componentWiseeEquality (const T &A, const U &B) |
template<class T , class U , unsigned int s, unsigned int t> | |
T | matrixProductComponent (const SNgeneric< T, s > &A, const SNgeneric< U, t > &B, unsigned int i, unsigned int j) |
compute the component (i,j) of the matrix product A*B More... | |
template<class U , unsigned int t, class T , unsigned int tp_size> | |
void | copyFirstLines (SNgeneric< U, t > &ans, const SNgeneric< T, tp_size > &A, const m_num max_l) |
copy the first lines of a matrix in an other one. More... | |
void checkSizeCompatibility | ( | const SNgeneric< U, s > & | A, |
const SNgeneric< V, t > & | B | ||
) |
bool componentWiseeEquality | ( | const T & | A, |
const U & | B | ||
) |
void copyFirstLines | ( | SNgeneric< U, t > & | ans, |
const SNgeneric< T, tp_size > & | A, | ||
const m_num | max_l | ||
) |
copy the first lines of a matrix in an other one.
ans | the matrix in which one copies (non-const). |
A | the matrix from which one copies (const). |
max_l | the number of lines that have to be copied (const). |
Now the 5 first lines in A
are the same of the ones of B
. The previously present elements in the first 5 lines of A
are lost.
This function is useful to populate the "answer" matrix when multiplying a gaussian matrix by something else.
Remarks :
ans
and A
must have same size;ans
is SNgeneric<U,s>
and A
is SNgeneric<T,tp_size>. Obviously the conversion from T
to U
must be possible.T matrixProductComponent | ( | const SNgeneric< T, s > & | A, |
const SNgeneric< U, t > & | B, | ||
unsigned int | i, | ||
unsigned int | j | ||
) |
compute the component (i,j) of the matrix product A*B
A | a matrix |
B | a matrix |
i | the line of the element of 'A*B' to be computed |
j | the column of the element of 'A*B' to be computed |
The size compatibility is not checked since this functions is supposed to be called from something like an operator * that has already checked the compatibility.
As stated in the README.md, the type of the elements in the returned matrix is the one of the first matrix of the product.