TBCI Numerical high perf. C++ Library 2.8.0
TVector< T > Class Template Reference

Temporary Base Class Idiom: Class TVector is used for temporary variables. More...

#include <vector.h>

Inheritance diagram for TVector< T >:
Collaboration diagram for TVector< T >:

Public Types

typedef T value_type
typedef T element_type
typedef T aligned_value_type TALIGN(MIN_ALIGN2)
Public Types inherited from BVector< T >
typedef Titerator
 STL-like iterator support.
typedef const Tconst_iterator

Public Member Functions

 TVector (const unsigned long d=0)
 TVector (const T &val, const unsigned long d)
 TVector (const BVector< T > &bv)
 TVector (const Vector< T > &v)
 TVector (const TVector< T > &tv) HOT
 TVector (const TSVector< T > &ts)
 TVector (const Mat_Brack< T > &)
 ~TVector ()
unsigned long size () const
TVector< T > & operator= (const T &a)
TVector< T > & operator= (const Vector< T > &v)
TVector< T > & operator= (const TVector< T > &tv)
 alias
TVector< T > & operator= (const TSVector< T > &ts)
bool operator== (const TVector< T > &tv) const
bool operator!= (const TVector< T > &tv) const
bool operator== (const Vector< T > &v) const
bool operator!= (const Vector< T > &v) const
bool operator== (const BVector< T > &bv) const
bool operator!= (const BVector< T > &v) const
bool operator== (const TSVector< T > &tsv) const
bool operator!= (const TSVector< T > &tsv) const
TVector< T > & operator+= (const T &)
 TV += a.
TVector< T > & operator-= (const T &)
 TV -= a.
TVector< T > & operator*= (const T &)
 TV *= a.
TVector< T > & operator/= (const T &)
 TV /= a.
TVector< T > & operator+= (const Vector< T > &) HOT
 TV += V.
TVector< T > & operator-= (const Vector< T > &) HOT
 TV -= V.
TVector< T > & operator+= (const TVector< T > &tv)
TVector< T > & operator-= (const TVector< T > &tv)
TVector< T > & operator+= (const TSVector< T > &tsv) HOT
 TV += TSV.
TVector< T > & operator-= (const TSVector< T > &tsv) HOT
 TV -= TSV.
T min ()
T max ()
T sum ()
double fabssqr ()
double fabs ()
T abs ()
TVector< T > & operator+ (const Vector< T > &) HOT
TVector< T > & operator- (const Vector< T > &) HOT
TVector< T > & operator+ (const TSVector< T > &ts) HOT
 TV = TV + TSV Transformed to TV += TSV.
TVector< T > & operator- (const TSVector< T > &ts) HOT
 TV = TV - TSV Transformed to TV -= TSV.
const TVector< T > & operator+ (const TVector< T > &a) HOT
 TV = TV + TV Transformed to TV += TV.
const TVector< T > & operator- (const TVector< T > &a) HOT
 TV = TV - TV Transformed to TV -= TV.
T operator() (const unsigned long i)
T operator[] (const unsigned long i)
const Tgetcref (const unsigned long i) const
tbci_traits< T >::const_refval_type get (const unsigned long i) const
Tsetval (const unsigned long i) const
Tsetval (const T &val, const unsigned long i) const
Tset (const T &val, const unsigned long i) const
TVector< Tslice (const unsigned long, const unsigned long)
TVector< T > & incr (const unsigned long, const T=(T) 1)
TVector< T > & operator+ (const T &)
TVector< T > & operator- (const T &)
TSVector< Toperator* (const T &)
TSVector< Toperator/ (const T &)
TSVector< Toperator- ()
T operator* (const Vector< T > &v)
T operator* (TVector< T > &tv)
template<typename U>
 TVector (const BVector< U > &bv)
Public Member Functions inherited from BVector< T >
 BVector (const unsigned long=0)
 BVector (const T &, const unsigned long)
 BVector (const BVector< T > &) HOT
 copy constructor
 BVector (const vararg va,...)
void destroy ()
 ~BVector ()
BVector< T > & init_0 ()
BVector< T > & fill (const T &) HOT
BVector< T > & resize (const BVector< T > &)
 Actually it's a resize and copy (some people would expect the assignment op to do this).
BVector< T > & resize (const unsigned long)
BVector< T > & resize (const T &, const unsigned long)
BVector< T > & cheapdownsize (const unsigned long)
BVector< T > & clear ()
BVector< T > & append (const T &)
 performs poorly
BVector< T > & push_back (const T &value)
 performs poorly
BVector< T > & append (const BVector< T > &)
BVector< T > & remove (const unsigned long)
BVector< T > & revert ()
BVector< T > & bubble_sort ()
BVector< T > & swap (BVector< T > &v)
Toperator() (const unsigned long) HOT
tbci_traits< T >::const_refval_type operator() (const unsigned long) const HOT
const Tgetcref (const unsigned long idx) const
tbci_traits< T >::const_refval_type get (const unsigned long idx) const HOT
Tset (const unsigned long idx) HOT
Tset (const T &val, unsigned long idx)
Toperator[] (const unsigned long i)
tbci_traits< T >::const_refval_type operator[] (const unsigned long i) const
unsigned long size () const HOT
T *const & vecptr () const
iterator begin ()
iterator end ()
const_iterator begin () const
const_iterator end () const
BVector< T > & setptr (T *pointer)
BVector< T > & setsize (const unsigned long size)
T *const & get_fortran_vector () const
void set_fortran_vector (T *pointer)
BVector< T > & operator= (const T &a)
BVector< T > & operator= (const BVector< T > &) HOT
 Note that the assignment op does NEVER resize the target BVector.
BVector< T > & alias (const BVector< T > &bv)
BVector< T > & copy (const BVector< T > &bv)
 copy does a resize, if necessary
bool operator== (const BVector< T > &) const HOT
 KG, 2001-06-29: Strange: If we don't inline this, we seems to get better performance in our solver benchmark (iPIII).
bool operator!= (const BVector< T > &bv) const
bool operator<= (const BVector< T > &bv) const
bool operator>= (const BVector< T > &bv) const
bool operator< (const BVector< T > &bv) const
bool operator> (const BVector< T > &bv) const
bool contains (const T &, unsigned long *=0) const
BVector< Tconcat (const BVector< T > &) const
template<typename U>
 BVector (const BVector< U > &bv)
Public Member Functions inherited from BVector_Sig< T >
 BVector_Sig ()
 BVector_Sig (const unsigned long)
 ~BVector_Sig ()
Toperator() (const unsigned long)
tbci_traits< T >::const_refval_type operator() (const unsigned long) const
unsigned long size () const
BVector_Sig< T > & fill (const T &)
BVector_Sig< T > & clear ()
bool operator== (const BVector_Sig< T > &) const
bool operator!= (const BVector_Sig< T > &) const
Public Member Functions inherited from Vector_Sig< T >
 Vector_Sig ()
 Vector_Sig (const unsigned)
 ~Vector_Sig ()
Vector_Sig< Toperator+ (const Vector_Sig< T > &) const
Vector_Sig< Toperator- (const Vector_Sig< T > &) const
Vector_Sig< Toperator* (const T &) const
Vector_Sig< Toperator/ (const T &) const
Vector_Sig< T > & operator+= (const Vector_Sig< T > &)
Vector_Sig< T > & operator-= (const Vector_Sig< T > &)
Vector_Sig< T > & operator*= (const T &)
Vector_Sig< T > & operator/= (const T &)
bool operator<= (const Vector_Sig< T > &) const
bool operator>= (const Vector_Sig< T > &) const
bool operator< (const Vector_Sig< T > &) const
bool operator> (const Vector_Sig< T > &) const

Static Public Member Functions

static const char * vec_info ()
Static Public Member Functions inherited from BVector< T >
static const char * vec_info ()
Static Public Member Functions inherited from BVector_Sig< T >
static const char * vec_info ()

Friends

class Vector< T >
class TSVector< T >
class Matrix< T >
class BdMatrix< T >
TVector< T > conj FGD (const Vector< T > &)
TVector< T > real FGD (const Vector< T > &)
TVector< T > imag FGD (const Vector< T > &)
TVector< T > &conj FGD (TVector< T > &)
TVector< T > &real FGD (TVector< T > &)
TVector< T > &imag FGD (TVector< T > &)
STD__ ostream & operator<<FGD (STD__ ostream &, const TVector< T > &)
NOINST void FRIEND_TBCI2__ do_mat_vec_mult FGD (const unsigned start, const unsigned end, TVector< T > *res, const Matrix< T > *mat, const Vector< T > *vec)
NOINST void FRIEND_TBCI2__ do_mat_tsv_mult FGD (const unsigned start, const unsigned end, TVector< T > *res, const Matrix< T > *mat, const TSVector< T > *rsv)
NOINST void FRIEND_TBCI2__ do_mat_vec_transmult FGD (const unsigned start, const unsigned end, TVector< T > *res, const Matrix< T > *mat, const Vector< T > *vec)

Additional Inherited Members

Protected Types inherited from BVector< T >
typedef T value_type
typedef T element_type
typedef T aligned_value_type TALIGN(MIN_ALIGN2)
Protected Attributes inherited from BVector< T >
Tvec
unsigned long dim
bool keep

Detailed Description

template<typename T>
class TVector< T >

Temporary Base Class Idiom: Class TVector is used for temporary variables.

Unlike real Vectors it can be copied by aliasing. Never use TVectors in your programs explicitly!

Definition at line 72 of file vector.h.

Member Typedef Documentation

◆ element_type

template<typename T>
typedef T TVector< T >::element_type

Definition at line 81 of file vector.h.

◆ TALIGN

template<typename T>
typedef T aligned_value_type TVector< T >::TALIGN(MIN_ALIGN2)

Definition at line 82 of file vector.h.

◆ value_type

template<typename T>
typedef T TVector< T >::value_type

Definition at line 80 of file vector.h.

Constructor & Destructor Documentation

◆ TVector() [1/8]

◆ TVector() [2/8]

template<typename T>
TVector< T >::TVector ( const T & val,
const unsigned long d )
inline

Definition at line 85 of file vector.h.

References BVector< T >::BVector, and T.

◆ TVector() [3/8]

template<typename T>
TVector< T >::TVector ( const BVector< T > & bv)
inline

Definition at line 86 of file vector.h.

References BVector< T >::BVector, and T.

◆ TVector() [4/8]

template<typename T>
TVector< T >::TVector ( const Vector< T > & v)
inline

Definition at line 87 of file vector.h.

References BVector< T >::BVector, and T.

◆ TVector() [5/8]

template<typename T>
TVector< T >::TVector ( const TVector< T > & tv)
inline

Definition at line 89 of file vector.h.

References BVector< T >::dim, HOT, TVector(), and BVector< T >::vec.

◆ TVector() [6/8]

template<typename T>
TVector< T >::TVector ( const TSVector< T > & ts)
inlineexplicit

Definition at line 91 of file vector.h.

References BVector< T >::dim, ts, and BVector< T >::vec.

◆ TVector() [7/8]

template<typename T>
TVector< T >::TVector ( const Mat_Brack< T > & mb)
inline

Definition at line 2333 of file matrix.h.

References BVector< T >::keep.

◆ ~TVector()

template<typename T>
TVector< T >::~TVector ( )
inline

Definition at line 95 of file vector.h.

References BVector< T >::keep.

◆ TVector() [8/8]

template<typename T>
template<typename U>
TVector< T >::TVector ( const BVector< U > & bv)
inlineexplicit

Definition at line 228 of file vector.h.

References BVector< T >::BVector, and T.

Member Function Documentation

◆ abs()

template<typename T>
T TVector< T >::abs ( )
inline

Definition at line 152 of file vector.h.

References Vector< T >::abs(), and T.

◆ fabs()

template<typename T>
double TVector< T >::fabs ( )
inline

Definition at line 151 of file vector.h.

References Vector< T >::fabs().

◆ fabssqr()

template<typename T>
double TVector< T >::fabssqr ( )
inline

Definition at line 150 of file vector.h.

References Vector< T >::fabssqr().

Referenced by fabssqr().

◆ get()

◆ getcref()

◆ incr()

template<typename T>
TVector< T > & TVector< T >::incr ( const unsigned long wh,
const T i = (T)1 )
inline

Definition at line 973 of file vector.h.

References BCHK, BVector< T >::dim, i, T, TVector(), and BVector< T >::vec.

◆ max()

template<typename T>
T TVector< T >::max ( )
inline

Definition at line 147 of file vector.h.

References Vector< T >::max(), and T.

◆ min()

template<typename T>
T TVector< T >::min ( )
inline

Definition at line 146 of file vector.h.

References Vector< T >::min(), and T.

◆ operator!=() [1/4]

template<typename T>
bool TVector< T >::operator!= ( const BVector< T > & v) const
inline

Definition at line 124 of file vector.h.

References BVector< T >::BVector.

◆ operator!=() [2/4]

template<typename T>
bool TVector< T >::operator!= ( const TSVector< T > & tsv) const
inline

Definition at line 126 of file vector.h.

◆ operator!=() [3/4]

template<typename T>
bool TVector< T >::operator!= ( const TVector< T > & tv) const
inline

Definition at line 118 of file vector.h.

References TVector().

◆ operator!=() [4/4]

template<typename T>
bool TVector< T >::operator!= ( const Vector< T > & v) const
inline

Definition at line 121 of file vector.h.

◆ operator()()

template<typename T>
T TVector< T >::operator() ( const unsigned long i)
inline

Definition at line 182 of file vector.h.

References BVector< T >::destroy(), i, T, and BVector< T >::vec.

Referenced by operator[]().

◆ operator*() [1/3]

template<typename T>
TSVector< T > TVector< T >::operator* ( const T & a)
inline

Definition at line 829 of file vector.h.

References a, and T.

◆ operator*() [2/3]

template<typename T>
T TVector< T >::operator* ( const Vector< T > & v)
inline

Definition at line 205 of file vector.h.

References T.

◆ operator*() [3/3]

template<typename T>
T TVector< T >::operator* ( TVector< T > & tv)
inline

Definition at line 207 of file vector.h.

References T, and TVector().

◆ operator*=()

template<typename T>
TVector< T > & TVector< T >::operator*= ( const T & a)
inline

TV *= a.

Definition at line 680 of file vector.h.

References a, BVector< T >::dim, STD_SMP_TEMPLATE2C, T, TVector(), and BVector< T >::vec.

◆ operator+() [1/4]

template<typename T>
TVector< T > & TVector< T >::operator+ ( const T & a)
inline

Definition at line 821 of file vector.h.

References a, BdMatrix< T >::operator+=(), T, and TVector().

◆ operator+() [2/4]

template<typename T>
TVector< T > & TVector< T >::operator+ ( const TSVector< T > & ts)
inline

TV = TV + TSV Transformed to TV += TSV.

Definition at line 927 of file vector.h.

References BCHK, BVector< T >::dim, LIKELY, STD_SMP_TEMPLATE3VC, ts, TVector(), and BVector< T >::vec.

◆ operator+() [3/4]

template<typename T>
const TVector< T > & TVector< T >::operator+ ( const TVector< T > & a)

TV = TV + TV Transformed to TV += TV.

Definition at line 753 of file vector.h.

References BCHK, BdMatrix< T >::destroy(), BVector< T >::dim, STD_SMP_TEMPLATE2V, TVector(), and BVector< T >::vec.

◆ operator+() [4/4]

template<typename T>
TVector< T > & TVector< T >::operator+ ( const Vector< T > & a)
inline

Definition at line 737 of file vector.h.

References a, BdMatrix< T >::operator+=(), and TVector().

◆ operator+=() [1/4]

template<typename T>
TVector< T > & TVector< T >::operator+= ( const T & a)
inline

TV += a.

Definition at line 666 of file vector.h.

References a, BVector< T >::dim, STD_SMP_TEMPLATE2C, T, TVector(), and BVector< T >::vec.

Referenced by operator+=().

◆ operator+=() [2/4]

template<typename T>
TVector< T > & TVector< T >::operator+= ( const TSVector< T > & tsv)
inline

TV += TSV.

Definition at line 714 of file vector.h.

References a, BCHK, BVector< T >::dim, LIKELY, STD_SMP_TEMPLATE3VC, TVector(), and BVector< T >::vec.

◆ operator+=() [3/4]

template<typename T>
TVector< T > & TVector< T >::operator+= ( const TVector< T > & tv)
inline

Definition at line 136 of file vector.h.

References operator+=(), and TVector().

◆ operator+=() [4/4]

template<typename T>
TVector< T > & TVector< T >::operator+= ( const Vector< T > & a)
inline

TV += V.

Definition at line 697 of file vector.h.

References a, BCHK, BVector< T >::dim, STD_SMP_TEMPLATE2V, TVector(), and BVector< T >::vec.

◆ operator-() [1/5]

template<typename T>
TSVector< T > TVector< T >::operator- ( )
inline

Definition at line 851 of file vector.h.

References T.

◆ operator-() [2/5]

template<typename T>
TVector< T > & TVector< T >::operator- ( const T & a)
inline

Definition at line 824 of file vector.h.

References a, BdMatrix< T >::operator-=(), T, and TVector().

◆ operator-() [3/5]

template<typename T>
TVector< T > & TVector< T >::operator- ( const TSVector< T > & ts)
inline

TV = TV - TSV Transformed to TV -= TSV.

Definition at line 942 of file vector.h.

References BCHK, BVector< T >::dim, LIKELY, STD_SMP_TEMPLATE3VC, ts, TVector(), and BVector< T >::vec.

◆ operator-() [4/5]

template<typename T>
const TVector< T > & TVector< T >::operator- ( const TVector< T > & a)

TV = TV - TV Transformed to TV -= TV.

Definition at line 764 of file vector.h.

References BCHK, BdMatrix< T >::destroy(), BVector< T >::dim, STD_SMP_TEMPLATE2V, TVector(), and BVector< T >::vec.

◆ operator-() [5/5]

template<typename T>
TVector< T > & TVector< T >::operator- ( const Vector< T > & a)
inline

Definition at line 743 of file vector.h.

References a, BdMatrix< T >::operator-=(), and TVector().

◆ operator-=() [1/4]

template<typename T>
TVector< T > & TVector< T >::operator-= ( const T & a)
inline

TV -= a.

Definition at line 673 of file vector.h.

References a, BVector< T >::dim, STD_SMP_TEMPLATE2C, T, TVector(), and BVector< T >::vec.

Referenced by operator-=().

◆ operator-=() [2/4]

template<typename T>
TVector< T > & TVector< T >::operator-= ( const TSVector< T > & tsv)
inline

TV -= TSV.

Definition at line 724 of file vector.h.

References a, BCHK, BVector< T >::dim, LIKELY, STD_SMP_TEMPLATE3VC, TVector(), and BVector< T >::vec.

◆ operator-=() [3/4]

template<typename T>
TVector< T > & TVector< T >::operator-= ( const TVector< T > & tv)
inline

Definition at line 138 of file vector.h.

References operator-=(), and TVector().

◆ operator-=() [4/4]

template<typename T>
TVector< T > & TVector< T >::operator-= ( const Vector< T > & a)
inline

TV -= V.

Definition at line 705 of file vector.h.

References a, BCHK, BVector< T >::dim, STD_SMP_TEMPLATE2V, TVector(), and BVector< T >::vec.

◆ operator/()

template<typename T>
TSVector< T > TVector< T >::operator/ ( const T & a)
inline

Definition at line 836 of file vector.h.

References a, and T.

◆ operator/=()

template<typename T>
TVector< T > & TVector< T >::operator/= ( const T & a)
inline

TV /= a.

Definition at line 688 of file vector.h.

References a, BCHK, BdMatrix< T >::operator*=(), T, and TVector().

◆ operator=() [1/4]

template<typename T>
TVector< T > & TVector< T >::operator= ( const T & a)
inline

◆ operator=() [2/4]

template<typename T>
TVector< T > & TVector< T >::operator= ( const TSVector< T > & ts)
inline

◆ operator=() [3/4]

template<typename T>
TVector< T > & TVector< T >::operator= ( const TVector< T > & tv)
inline

alias

Definition at line 242 of file vector.h.

References BCHK, BdMatrix< T >::destroy(), BVector< T >::dim, LIKELY, size(), TVector(), and BVector< T >::vec.

◆ operator=() [4/4]

template<typename T>
TVector< T > & TVector< T >::operator= ( const Vector< T > & v)
inline

Definition at line 108 of file vector.h.

References BVector< T >::operator=(), and TVector().

◆ operator==() [1/4]

template<typename T>
bool TVector< T >::operator== ( const BVector< T > & bv) const
inline

Definition at line 122 of file vector.h.

References BVector< T >::BVector.

◆ operator==() [2/4]

template<typename T>
bool TVector< T >::operator== ( const TSVector< T > & tsv) const
inline

Definition at line 125 of file vector.h.

◆ operator==() [3/4]

template<typename T>
bool TVector< T >::operator== ( const TVector< T > & tv) const
inline

Definition at line 114 of file vector.h.

References LIKELY, TVector(), and BVector< T >::vec.

◆ operator==() [4/4]

template<typename T>
bool TVector< T >::operator== ( const Vector< T > & v) const
inline

Definition at line 119 of file vector.h.

◆ operator[]()

template<typename T>
T TVector< T >::operator[] ( const unsigned long i)
inline

Definition at line 185 of file vector.h.

References i, operator()(), and T.

◆ set()

◆ setval() [1/2]

template<typename T>
T & TVector< T >::setval ( const T & val,
const unsigned long i ) const
inline

Definition at line 193 of file vector.h.

References i, T, and BVector< T >::vec.

◆ setval() [2/2]

◆ size()

◆ slice()

template<typename T>
TVector< T > TVector< T >::slice ( const unsigned long i0,
const unsigned long i1 )
inline

Definition at line 956 of file vector.h.

References BCHK, BVector< T >::dim, T, TBCIDELETE, TVector(), UNLIKELY, and BVector< T >::vec.

◆ sum()

template<typename T>
T TVector< T >::sum ( )
inline

Definition at line 148 of file vector.h.

References Vector< T >::sum(), and T.

◆ vec_info()

template<typename T>
const char * TVector< T >::vec_info ( )
inlinestatic

Definition at line 219 of file vector.h.

◆ BdMatrix< T >

template<typename T>
friend class BdMatrix< T >
friend

Definition at line 2468 of file vector.h.

References a, b, BCHK, i, NAMESPACE_END, NAMESPACE_TBCI, norm(), TSVector< T >::TSVector(), and TVector().

◆ FGD [1/9]

template<typename T>
NOINST void FRIEND_TBCI2__ do_mat_tsv_mult FGD ( const unsigned start,
const unsigned end,
TVector< T > * res,
const Matrix< T > * mat,
const TSVector< T > * rsv )
friend

◆ FGD [2/9]

template<typename T>
NOINST void FRIEND_TBCI2__ do_mat_vec_transmult FGD ( const unsigned start,
const unsigned end,
TVector< T > * res,
const Matrix< T > * mat,
const Vector< T > * vec )
friend

◆ FGD [3/9]

template<typename T>
NOINST void FRIEND_TBCI2__ do_mat_vec_mult FGD ( const unsigned start,
const unsigned end,
TVector< T > * res,
const Matrix< T > * mat,
const Vector< T > * vec )
friend

◆ FGD [4/9]

template<typename T>
TVector< T > imag FGD ( const Vector< T > & )
friend

References imag(), and TVector().

◆ FGD [5/9]

template<typename T>
TVector< T > real FGD ( const Vector< T > & )
friend

References real(), and TVector().

◆ FGD [6/9]

template<typename T>
TVector< T > conj FGD ( const Vector< T > & )
friend

References conj(), and TVector().

◆ FGD [7/9]

template<typename T>
TVector< T > &imag FGD ( TVector< T > & )
friend

References imag(), and TVector().

◆ FGD [8/9]

template<typename T>
TVector< T > &real FGD ( TVector< T > & )
friend

References real(), and TVector().

◆ FGD [9/9]

template<typename T>
TVector< T > &conj FGD ( TVector< T > & )
friend

References conj(), and TVector().

◆ Matrix< T >

template<typename T>
friend class Matrix< T >
friend

Definition at line 2468 of file vector.h.

◆ operator<<FGD

template<typename T>
STD__ ostream & operator<<FGD ( STD__ ostream & ,
const TVector< T > &  )
friend

References STD__, and TVector().

◆ TSVector< T >

template<typename T>
friend class TSVector< T >
friend

Definition at line 2468 of file vector.h.

◆ Vector< T >

template<typename T>
friend class Vector< T >
friend

Definition at line 2468 of file vector.h.


The documentation for this class was generated from the following files: