f_matrix.h File Reference

header file to implement classes TBCI::F_Matrix, TBCI::F_TMatrix, TBCI::F_TSMatrix. More...

#include "vector.h"
#include "matrix_sig.h"
#include "matrix.h"
#include "cscmatrix.h"

Include dependency graph for f_matrix.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  TBCI
namespace  std

Classes

class  TBCI::F_TMatrix< T >
 Temporary Base Class (non referable!) (acc. More...
class  TBCI::F_TSMatrix< T >
 Temporary object for scaled matrices. More...
class  TBCI::F_Matrix< T >

Defines

#define _VEC   vec
#define _ENDVEC   endvec
#define _DIM   dim
#define _ROW   row
#define _COL   col
#define _FAC   fac
#define F_TMFORALL_M(op)
#define F_TMFORALL_TM(op)
#define F_TMFORALL_TS(op)
#define F_TMFORALL_T(op)
#define F_STDDEF_TMM(op)
#define F_STDDEF_TMTM(op)
#define F_STDDEF_TMT(op)
#define F_STDDEF_TTM(op)
#define F_STDDEF_TM(op)
#define F_STDDEF_TSM(op)
#define F_STDDEF_TSTM(op)
#define F_STDDEF_TSTS(op)
#define F_STDDEF_TST(op)
#define F_STDDEF_TTS(op)
#define F_MSTDDEF_T(op)
#define F_MSTDDEF_M(op)
#define F_MSTDDEF_TM(op)
#define F_MSTDDEF_TS(op)

Functions

template<typename T>
F_TMatrix< T > TBCI::operator+ (const T &a, F_TMatrix< T > b)
template<typename T>
F_TMatrix< T > TBCI::operator- (const T &a, F_TMatrix< T > b)
template<typename T>
F_TSMatrix< T > TBCI::operator* (const T &a, F_TMatrix< T > b)
template<typename T>
F_TMatrix< T > TBCI::operator+ (const T &a, const F_Matrix< T > &b)
template<typename T>
F_TMatrix< T > TBCI::operator- (const T &a, const F_Matrix< T > &b)
template<typename T>
F_TSMatrix< T > TBCI::operator* (const T &a, const F_Matrix< T > &b)
template<typename T>
F_TMatrix< T > TBCI::operator+ (const T &a, F_TSMatrix< T > ts)
template<typename T>
F_TMatrix< T > TBCI::operator- (const T &a, F_TSMatrix< T > ts)
template<typename T>
F_TSMatrix< T > TBCI::operator* (const T &f, F_TSMatrix< T > ts)
template<typename T>
std::ostream & TBCI::operator<< (std::ostream &os, const F_Matrix< T > &m)
template<typename T>
std::ostream & TBCI::operator<< (std::ostream &os, F_TMatrix< T > tm)
template<typename T>
std::ostream & TBCI::operator<< (std::ostream &os, F_TSMatrix< T > ts)
template<typename T>
std::istream & TBCI::operator>> (std::istream &in, F_Matrix< T > &m)
template<typename T>
F_TMatrix< T > TBCI::transpose (const F_TMatrix< T > &ftm)
template<typename T>
double std::fabs (const TBCI::F_TMatrix< T > &ftm)
template<typename T>
double std::fabs (const TBCI::F_Matrix< T > &fm)
template<typename T>
double std::fabs (TBCI::F_TSMatrix< T > &ftsm)


Detailed Description

header file to implement classes TBCI::F_Matrix, TBCI::F_TMatrix, TBCI::F_TSMatrix.

Definition in file f_matrix.h.


Define Documentation

#define _COL   col

Definition at line 41 of file f_matrix.h.

#define _DIM   dim

Definition at line 39 of file f_matrix.h.

Referenced by TBCI::BdMatrix< T >::operator TMatrix< T >().

#define _ENDVEC   endvec

Definition at line 38 of file f_matrix.h.

#define _FAC   fac

Definition at line 42 of file f_matrix.h.

#define _ROW   row

Definition at line 40 of file f_matrix.h.

#define _VEC   vec

Definition at line 37 of file f_matrix.h.

#define F_MSTDDEF_M ( op   ) 

Value:

template <typename T>                                           \
inline F_TMatrix<T> F_Matrix<T>::operator op (const F_Matrix<T>& a) const \
{                                                               \
  F_TMatrix<T> t (this->row, this->col);                        \
  BCHK(this->dim != a.dim, MatErr, Operator op on diff size matrices, a.dim, t); \
  for (register T *p1=t.vec, *p2=this->vec, *p3=a.vec; p2<this->endvec; ++p1, ++p2, ++p3) \
    *p1 = *p2 op *p3;                                           \
  return t;                                                     \
}

Definition at line 1413 of file f_matrix.h.

#define F_MSTDDEF_T ( op   ) 

Value:

template <typename T>                                           \
inline F_TMatrix<T> F_Matrix<T>::operator op (const T& a) const \
{                                                               \
  F_TMatrix<T> t (this->row, this->col);                        \
  for (register T *p1=t.vec, *p2=this->vec; p2<this->endvec; ++p1, ++p2) \
    *p1 = *p2 op a;                                             \
  return t;                                                     \
}

Definition at line 1388 of file f_matrix.h.

#define F_MSTDDEF_TM ( op   ) 

Value:

template <typename T>                                           \
inline F_TMatrix<T> F_Matrix<T>::operator op (F_TMatrix<T> a) const     \
{                                                               \
  BCHK(this->dim != a.dim, MatErr, Applying op on diff. size matrices, a.dim, a); \
  for (register T *p1=a.vec, *p2=this->vec; p2<this->endvec; ++p1, ++p2) \
    *p1 = *p2 op *p1;                                           \
  return a;                                                     \
}

Definition at line 1428 of file f_matrix.h.

#define F_MSTDDEF_TS ( op   ) 

Value:

template <typename T>                                           \
inline F_TMatrix<T> F_Matrix<T>::operator op (F_TSMatrix<T> ts) const \
{                                                               \
  BCHK(this->dim != ts.dim, MatErr, Applying op on diff. size matrices, ts.dim, (ts.destroy(),F_TMatrix<T> (*this)) ); \
  F_TSMatrix<T> tm (ts); tm.detach ();                          \
  for (register T *p1=tm.vec, *p2=this->vec, *p3=ts.vec; p2<this->endvec; ++p1, ++p2, ++p3) \
    *p1 = *p2 op *p3 * ts.fac;                                  \
  tm.fac = (T)1; return F_TMatrix<T> (tm);                      \
}

Definition at line 1441 of file f_matrix.h.

#define F_STDDEF_TM ( op   ) 

Value:

INST(template <typename T> class F_TMatrix friend F_TMatrix<T> operator op (const T&, const F_Matrix<T>&);)                                     \
template <typename T>                                   \
inline F_TMatrix<T> operator op (const T& a, const F_Matrix<T>& b)      \
{                                                       \
  F_TMatrix<T> c (b._ROW, b._COL);                      \
  for (register T *p1=c._VEC, *p2=b._VEC; p1<c._ENDVEC; p1++, p2++)     \
    *p1 = a op *p2;                                     \
  return c;                                             \
}

Definition at line 746 of file f_matrix.h.

#define F_STDDEF_TMM ( op   ) 

Value:

template <typename T>                                                   \
inline F_TMatrix<T>& F_TMatrix<T>::operator op (const F_Matrix<T>& a)   \
{ return this->operator op##= (a); }

Definition at line 682 of file f_matrix.h.

#define F_STDDEF_TMT ( op   ) 

Value:

template <typename T>                                           \
inline F_TMatrix<T>& F_TMatrix<T>::operator op (const T& a)     \
{ return this->operator op##= (a); }

Definition at line 700 of file f_matrix.h.

#define F_STDDEF_TMTM ( op   ) 

Value:

template <typename T>                                           \
inline F_TMatrix<T>& F_TMatrix<T>::operator op (F_TMatrix<T> a) \
{ return this->operator op##= (F_Matrix<T>(a)); }

Definition at line 691 of file f_matrix.h.

#define F_STDDEF_TSM ( op   ) 

Value:

template <typename T>                                                   \
inline F_TMatrix<T> F_TSMatrix<T>::operator op (const F_Matrix<T>& m)   \
{                                                                       \
  BCHK(row != m.row || col != m.col, MatErr, Op op on diff size Mats, m.row, F_TMatrix<T> (*this)); \
  F_TSMatrix<T> ts (*this); ts.detach ();                               \
  for (register T *p1 = ts.vec, *p2 = vec, *p3 = m.vec; p2 < endvec; p1++, p2++, p3++) \
    *p1 = *p2 * fac op *p3;                                             \
  ts.fac = (T)1; return F_TMatrix<T> (ts);                              \
}

Definition at line 975 of file f_matrix.h.

#define F_STDDEF_TST ( op   ) 

Value:

template <typename T>                                           \
inline F_TMatrix<T> F_TSMatrix<T>::operator op (const T& a)     \
{                                                               \
  F_TSMatrix<T> ts (*this); ts.detach ();                       \
  for (register T *p1 = ts.vec, *p2 = vec; p2 < endvec; p1++, p2++) \
    *p1 = *p2 * fac op a;                                       \
  ts.fac = (T)1; return F_TMatrix<T> (ts);                      \
}

Definition at line 1022 of file f_matrix.h.

#define F_STDDEF_TSTM ( op   ) 

Value:

template <typename T>                                                   \
inline F_TMatrix<T> F_TSMatrix<T>::operator op (const F_TMatrix<T>& tm) \
{                                                                       \
  BCHK(row != tm.row || col != tm.col, MatErr, Op op on diff size Mats, tm.row, tm); \
  for (register T *p1 = tm.vec, *p2 = vec; p2 < endvec; p1++, p2++)     \
    *p1 = *p2 * fac op *p1;                                             \
  destroy (); return tm;                                                \
}

Definition at line 990 of file f_matrix.h.

#define F_STDDEF_TSTS ( op   ) 

Value:

template <typename T>                                                   \
inline F_TMatrix<T> F_TSMatrix<T>::operator op (F_TSMatrix<T> ts)       \
{                                                                       \
  BCHK(row != ts.row || col != ts.col, MatErr, Op op on diff size Mats, ts.row, F_TMatrix<T> (*this)); \
  F_TSMatrix<T> tm;                                                     \
  if (!mut && ts.mut) tm = ts;                                          \
  else { tm = *this; tm.detach (); }                                    \
  for (register T *p1 = tm.vec, *p2 = vec, *p3 = ts.vec; p2 < endvec; p1++, p2++, p3++) \
    *p1 = *p2 * fac op *p3 * ts.fac;                                    \
  if (!mut && ts.mut) destroy (); else ts.destroy ();                   \
  tm.fac = (T)1; return F_TMatrix<T> (tm);                              \
}

Definition at line 1004 of file f_matrix.h.

#define F_STDDEF_TTM ( op   ) 

Value:

INST(template <typename T> class F_TMatrix friend F_TMatrix<T> operator op (const T&, F_TMatrix<T>);)                                                   \
template <typename T>                                           \
inline F_TMatrix<T> operator op (const T& a, F_TMatrix<T> b)    \
{                                                               \
  for (register T* ptr=b._VEC; ptr<b._ENDVEC; ptr++)            \
        *ptr = a op *ptr;                                       \
  return b;                                                     \
}

Definition at line 723 of file f_matrix.h.

#define F_STDDEF_TTS ( op   ) 

Value:

INST(template <typename T> class F_TSMatrix friend F_TMatrix<T> operator op (const T&, F_TSMatrix<T>);)                                         \
template <typename T>                                           \
inline F_TMatrix<T> operator op (const T& a, F_TSMatrix<T> ts)  \
{                                                               \
  F_TSMatrix<T> tm (ts); tm.detach ();                          \
  for (register T *p1 = tm._VEC, *p2 = ts._VEC; p1 < tm._ENDVEC; p1++, p2++) \
    *p1 = a op *p2 * ts._FAC;                                   \
  tm._FAC = (T)1; return F_TMatrix<T> (tm);                     \
}

Definition at line 1036 of file f_matrix.h.

#define F_TMFORALL_M ( op   ) 

Value:

template <typename T>                                                   \
inline F_TMatrix<T>& F_TMatrix<T>::operator op (const F_Matrix<T>& a)   \
{                                                                       \
  BCHK(row != a.row, MatErr, number of rows differ in op, a.row, *this ); \
  BCHK(col != a.col, MatErr, number of cols differ in op, a.col, *this ); \
  for (register T *p1 = vec, *p2 = a.vec; p1 < endvec; p1++, p2++) *p1 op *p2; \
  return *this;                                                         \
}

Definition at line 613 of file f_matrix.h.

#define F_TMFORALL_T ( op   ) 

Value:

template <typename T>                                           \
inline F_TMatrix<T>& F_TMatrix<T>::operator op (const T& a)     \
{                                                               \
  for (register T* ptr = vec; ptr < endvec; ptr++) *ptr op a;   \
  return *this;                                                 \
}

Definition at line 655 of file f_matrix.h.

#define F_TMFORALL_TM ( op   ) 

Value:

template <typename T>                                           \
inline F_TMatrix<T>& F_TMatrix<T>::operator op (F_TMatrix<T> a)\
{                                                               \
  return this->operator op (F_Matrix<T>(a));                    \
}

Definition at line 628 of file f_matrix.h.

#define F_TMFORALL_TS ( op   ) 

Value:

template <typename T>                                                   \
inline F_TMatrix<T>& F_TMatrix<T>::operator op (F_TSMatrix<T> ts)       \
{                                                                       \
  BCHK(row != ts.row, MatErr, number of rows differ in op, ts.row, (ts.destroy(),*this) ); \
  BCHK(col != ts.col, MatErr, number of cols differ in op, ts.col, (ts.destroy(),*this) ); \
  for (register T *p1 = vec, *p2 = ts.vec; p1 < endvec; p1++, p2++)     \
     *p1 op##= *p2 * ts.fac;                                            \
  ts.destroy (); return *this;                                          \
}

Definition at line 639 of file f_matrix.h.


Generated on Wed Nov 20 09:27:57 2013 for TBCI Numerical high perf. C++ Library by  doxygen 1.5.6