19 #ifndef __SNGENERIC_H__142708_ 20 #define __SNGENERIC_H__142708_ 31 #include "../Utilities.h" 35 template <
class T,
unsigned int tp_size>
70 template <
class T,
unsigned int tp_size>
88 virtual
unsigned int getSize() const final;
90 virtual T&
at(const
m_num,const m_num) final;
91 virtual T
get(const m_num,const m_num) const final;
100 template <class V,
unsigned int s>
102 template <class V,
unsigned int s>
118 template <class V,
unsigned int s>
137 template <
class T,
unsigned int tp_size>
140 if (l>tp_size or c>tp_size)
146 template <
class T,
unsigned int tp_size>
149 std::array<T,tp_size> al;
150 for (
m_num c=0;c<tp_size;c++)
152 al.at(c)=this->
get(l,c);
159 template <
class V,
unsigned int s>
160 std::ostream& operator<<(std::ostream& stream,const SNgeneric<V,s>& snm)
162 const unsigned int tp_size=s;
163 std::array<int,tp_size> col_size;
171 for (
m_num col=0;col<tp_size;++col)
174 for (
m_num line=0;line<tp_size;++line)
176 V value = snm.
get(line,col);
184 col_size.at(col)=acc;
188 for (
m_num l=0;l<tp_size;l++)
190 for (
m_num c=0;c<tp_size;++c)
192 V value = snm.get(l,c);
193 stream<<value<<std::string(col_size.at(c)-
value_length(value)+2,
' ');
202 template <
class T,
unsigned int tp_size>
210 template <
class T,
unsigned int tp_size>
217 template <
class T,
unsigned int tp_size>
228 template <
class T,
unsigned int tp_size>
235 template <
class T,
unsigned int tp_size>
236 template <
class V,
unsigned int s>
240 for (
m_num i=0;i<tp_size;i++)
242 for (
m_num j=0;j<tp_size;j++)
244 this->
at(i,j)-=S.
get(i,j);
249 template <
class T,
unsigned int tp_size>
250 template <
class V,
unsigned int s>
257 for (
m_num i=c+1;i<tp_size;i++)
259 this->
at(i,c)-=G.
get(i,c);
262 for (
m_num i=0;i<tp_size;i++)
268 template <
class T,
unsigned int tp_size>
269 template <
class V,
unsigned int s>
277 for (
m_num i=0;i<tp_size;i++)
279 for (
m_num j=0;j<tp_size;j++)
281 abs_diff=std::abs( this->
get(i,j)-A.
get(i,j) );
282 if (abs_diff>epsilon)
bool special
Definition: SNgeneric.h:130
void subtract(const SNgeneric< V, s > &)
Definition: SNgeneric.h:237
virtual T & at(const m_num, const m_num) final
Definition: SNgeneric.h:218
Definition: SNgaussian.h:61
void checkSizeCompatibility(const SNgeneric< U, s > &A, const SNgeneric< V, t > &B)
Definition: MathUtilities.h:35
This is the base class for the other matrices types.
Definition: MathUtilities.h:32
T get(const unsigned int i) const
Definition: SNline.h:138
SpecialValue(T v, bool s)
Definition: SNgeneric.h:131
virtual T _get(const m_num, const m_num) const =0
SNgaussian< T, tp_size > getGaussian(const m_num c) const
Definition: SNgeneric.h:229
virtual T get(const m_num, const m_num) const final
Definition: SNgeneric.h:211
Definition: SNexceptions.cpp:144
Definition: SNgaussian.h:38
m_num getColumn() const
Definition: SNgaussian.h:144
virtual SNline< T, tp_size > getSNline(m_num l) const
Definition: SNgeneric.h:147
T value
Definition: SNgeneric.h:129
virtual void checkRangeCorectness(const m_num &, const m_num &) const final
Definition: SNgeneric.h:138
virtual T & _at(const m_num, const m_num)=0
unsigned int value_length(const T &value)
Definition: Utilities.h:44
virtual unsigned int getSize() const final
Definition: SNgeneric.h:203
bool isNumericallyEqual(const SNgeneric< V, s > &A, const double &epsilon) const
Definition: SNgeneric.h:270