24 #ifndef __MATHUTILITIES_H__055253__ 25 #define __MATHUTILITIES_H__055253__ 27 #include "../exceptions/SNexceptions.cpp" 31 template <
class T,
unsigned int tp_size>
34 template <
class U,
unsigned int s,
class V,
unsigned int t>
44 template <
class T,
class U>
49 unsigned int s=A.getSize();
50 for (
unsigned int l=0;l<s;l++)
52 for (
unsigned int c=0;c<s;c++)
54 if (A.get(l,c)!=B.get(l,c))
77 template <
class T,
class U,
unsigned int s,
unsigned int t>
81 for (
unsigned int k=0;k<s;k++)
83 acc+=A.
get(i,k)*B.
get(k,j);
113 template <
class U,
unsigned int t,
class T,
unsigned int tp_size>
117 for (
m_num line=0;line<max_l+1;line++)
119 for (
m_num col=0; col < tp_size;++col)
121 ans.
at(line,col)=A.
get(line,col);
virtual T & at(const m_num, const m_num) final
Definition: SNgeneric.h:218
void checkSizeCompatibility(const SNgeneric< U, s > &A, const SNgeneric< V, t > &B)
Definition: MathUtilities.h:35
When trying to perform operation with matrices with incompatible sizes.
Definition: SNexceptions.cpp:43
This is the base class for the other matrices types.
Definition: MathUtilities.h:32
virtual T get(const m_num, const m_num) const final
Definition: SNgeneric.h:211
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.
Definition: MathUtilities.h:114
virtual unsigned int getSize() const final
Definition: SNgeneric.h:203
bool componentWiseeEquality(const T &A, const U &B)
Definition: MathUtilities.h:45
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
Definition: MathUtilities.h:78