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

provides basic Vector functionality but arithmetic operators (+=, - , *, /...). More...

#include <bvector.h>

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

Public Types

typedef Titerator
 STL-like iterator support.
typedef const Tconst_iterator

Public Member Functions

 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

Static Public Member Functions

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

Protected Types

typedef T value_type
typedef T element_type
typedef T aligned_value_type TALIGN(MIN_ALIGN2)

Protected Attributes

Tvec
unsigned long dim
bool keep

Friends

class TMatrix< T >
class F_TMatrix< T >
class F_Matrix< T >
template<typename U>
class BVector
NOINST BVector< T > &FRIEND_TBCI2__ bvfillm FGD (BVector< T > &, const Matrix< T > &m)
STD__ ostream & operator<<FGD (STD__ ostream &, const BVector< T > &)
STD__ istream & operator>>FGD (STD__ istream &, BVector< T > &)

Detailed Description

template<typename T>
class BVector< T >

provides basic Vector functionality but arithmetic operators (+=, - , *, /...).

Mainly useful for storage.

Definition at line 67 of file bvector.h.

Member Typedef Documentation

◆ const_iterator

template<typename T>
typedef const T* BVector< T >::const_iterator

Definition at line 156 of file bvector.h.

◆ element_type

template<typename T>
typedef T BVector< T >::element_type
protected

Definition at line 71 of file bvector.h.

◆ iterator

template<typename T>
typedef T* BVector< T >::iterator

STL-like iterator support.

The vector data are in the range [begin,end) In case vector operations exist (addition, ...), do use these in preference over the iterators.

Definition at line 153 of file bvector.h.

◆ TALIGN

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

Definition at line 72 of file bvector.h.

◆ value_type

template<typename T>
typedef T BVector< T >::value_type
protected

Definition at line 70 of file bvector.h.

Constructor & Destructor Documentation

◆ BVector() [1/5]

template<typename T>
INLINE BVector< T >::BVector ( const unsigned long c = 0)
explicit

Definition at line 235 of file bvector.h.

References c, dim, false, INLINE, keep, NEW, T, UNLIKELY, and vec.

◆ BVector() [2/5]

template<typename T>
INLINE BVector< T >::BVector ( const T & value,
const unsigned long c )

Definition at line 296 of file bvector.h.

References c, dim, false, INLINE, keep, LIKELY, NEW, T, TBCIFILL, and vec.

◆ BVector() [3/5]

template<typename T>
INLINE BVector< T >::BVector ( const BVector< T > & v)

copy constructor

Definition at line 282 of file bvector.h.

References BVector, dim, false, INLINE, keep, LIKELY, T, and vec.

◆ BVector() [4/5]

template<typename T>
INLINE BVector< T >::BVector ( const vararg va,
... )

Definition at line 247 of file bvector.h.

References dim, false, i, INLINE, keep, LIKELY, NEW, T, UNLIKELY, and vec.

◆ ~BVector()

template<typename T>
INLINE BVector< T >::~BVector ( )

Definition at line 275 of file bvector.h.

References destroy(), INLINE, keep, and UNLIKELY.

◆ BVector() [5/5]

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

Definition at line 201 of file bvector.h.

References BVector, dim, i, keep, LIKELY, NEW, T, UNLIKELY, and vec.

Member Function Documentation

◆ alias()

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

Definition at line 171 of file bvector.h.

References BVector, destroy(), dim, keep, and vec.

◆ append() [1/2]

template<typename T>
INLINE BVector< T > & BVector< T >::append ( const BVector< T > & v)

Definition at line 423 of file bvector.h.

References append(), BCHK, BVector, dim, INLINE, REALLOC, T, TBCICOPY, and vec.

◆ append() [2/2]

template<typename T>
INLINE BVector< T > & BVector< T >::append ( const T & val)

performs poorly

Definition at line 412 of file bvector.h.

References append(), BCHK, BVector, dim, INLINE, REALLOC, T, and vec.

Referenced by append(), append(), Tensor< T >::cntrmul(), ctrmul(), dctmul(), Tensor< T >::drctmul(), and push_back().

◆ begin() [1/2]

template<typename T>
iterator BVector< T >::begin ( )
inline

Definition at line 154 of file bvector.h.

References vec.

◆ begin() [2/2]

template<typename T>
const_iterator BVector< T >::begin ( ) const
inline

Definition at line 157 of file bvector.h.

References vec.

◆ bubble_sort()

template<typename T>
BVector< T > & BVector< T >::bubble_sort ( )

Definition at line 394 of file bvector.h.

References BVector, dim, i, REGISTER, T, and vec.

◆ cheapdownsize()

template<typename T>
BVector< T > & BVector< T >::cheapdownsize ( const unsigned long nd)

Definition at line 308 of file bvector.h.

References BCHK, BVector, cheapdownsize(), dim, resize(), and UNLIKELY.

Referenced by cheapdownsize().

◆ clear()

template<typename T>
BVector< T > & BVector< T >::clear ( )
inline

Definition at line 112 of file bvector.h.

References BVector, fill(), and T.

◆ concat()

template<typename T>
BVector< T > BVector< T >::concat ( const BVector< T > & b2) const

Definition at line 593 of file bvector.h.

References BVector, c, dim, T, TBCICOPY, and vec.

Referenced by concat().

◆ contains()

template<typename T>
bool BVector< T >::contains ( const T & val,
unsigned long * ind = 0 ) const
inline

Definition at line 580 of file bvector.h.

References dim, i, REGISTER, T, UNLIKELY, and vec.

Referenced by Vector< T >::contains(), operator<<(), and operator>>().

◆ copy()

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

copy does a resize, if necessary

Definition at line 484 of file bvector.h.

References a, BVector, and resize().

Referenced by lu_solve(), and lu_solve().

◆ destroy()

template<typename T>
void BVector< T >::destroy ( )
inline

Definition at line 268 of file bvector.h.

References dim, LIKELY, T, TBCIDELETE, and vec.

Referenced by alias(), TVector< T >::operator()(), TSMatrix< T >::operator*(), ~BVector(), and Vector< T >::~Vector().

◆ end() [1/2]

template<typename T>
iterator BVector< T >::end ( )
inline

Definition at line 155 of file bvector.h.

References dim, and vec.

Referenced by TVector< T >::FGD, and TVector< T >::FGD.

◆ end() [2/2]

template<typename T>
const_iterator BVector< T >::end ( ) const
inline

Definition at line 158 of file bvector.h.

References dim, and vec.

◆ fill()

template<typename T>
INLINE BVector< T > & BVector< T >::fill ( const T & val)

Definition at line 378 of file bvector.h.

References BVector, dim, INLINE, T, TBCIFILL, and vec.

Referenced by clear(), Vector< T >::fill(), operator=(), and resize().

◆ get()

◆ get_fortran_vector()

template<typename T>
T *const & BVector< T >::get_fortran_vector ( ) const
inline

Definition at line 164 of file bvector.h.

References T, and vecptr().

Referenced by eig(), eig(), eig(), eig(), eig(), eig(), eig(), eig(), inv(), inv(), inv(), lu_solve(), lu_solve(), lu_solve(), lu_solve(), lu_solve(), lu_solve(), and lu_solve_expert().

◆ getcref()

template<typename T>
const T & BVector< T >::getcref ( const unsigned long idx) const
inline

Definition at line 129 of file bvector.h.

References T, and vec.

Referenced by do_bdmat_vec_dotmult(), do_bdmat_vec_mult_lnw_opt(), and do_bdmat_vec_transmult_lnw_opt().

◆ init_0()

template<typename T>
BVector< T > & BVector< T >::init_0 ( )
inline

Definition at line 99 of file bvector.h.

References BVector, dim, T, TBCICLEAR, UNLIKELY, and vec.

◆ operator!=()

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

Definition at line 178 of file bvector.h.

References BVector.

◆ operator()() [1/2]

template<typename T>
tbci_traits< T >::const_refval_type BVector< T >::operator() ( const unsigned long i) const
inline

Definition at line 462 of file bvector.h.

References dim, EXPCHK, i, index, and vec.

◆ operator()() [2/2]

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

Definition at line 469 of file bvector.h.

References dim, EXPCHK, i, index, T, and vec.

Referenced by Vector< T >::operator()(), Vector< T >::operator()(), operator[](), and operator[]().

◆ operator<()

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

Definition at line 181 of file bvector.h.

References BVector.

◆ operator<=()

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

Definition at line 509 of file bvector.h.

References BCHK, BVector, dim, i, UNLIKELY, and vec.

Referenced by Vector< T >::operator<=().

◆ operator=() [1/2]

template<typename T>
INLINE BVector< T > & BVector< T >::operator= ( const BVector< T > & a)

Note that the assignment op does NEVER resize the target BVector.

Definition at line 476 of file bvector.h.

References a, BCHK, BVector, dim, INLINE, T, TBCICOPY, and vec.

◆ operator=() [2/2]

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

Definition at line 168 of file bvector.h.

References a, BVector, fill(), and T.

Referenced by TVector< T >::operator=(), and TVector< T >::operator=().

◆ operator==()

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

KG, 2001-06-29: Strange: If we don't inline this, we seems to get better performance in our solver benchmark (iPIII).

Definition at line 495 of file bvector.h.

References BVector, dim, LIKELY, T, TBCICOMP, and vec.

Referenced by Vector< T >::operator==().

◆ operator>()

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

Definition at line 182 of file bvector.h.

References BVector.

◆ operator>=()

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

Definition at line 520 of file bvector.h.

References BCHK, BVector, dim, i, UNLIKELY, and vec.

Referenced by Vector< T >::operator>=().

◆ operator[]() [1/2]

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

Definition at line 140 of file bvector.h.

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

◆ operator[]() [2/2]

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

Definition at line 142 of file bvector.h.

References i, and operator()().

◆ push_back()

template<typename T>
BVector< T > & BVector< T >::push_back ( const T & value)
inline

performs poorly

Definition at line 116 of file bvector.h.

References append(), BVector, and T.

◆ remove()

template<typename T>
BVector< T > & BVector< T >::remove ( const unsigned long i)

Definition at line 435 of file bvector.h.

References BCHK, BVector, dim, i, NEW, remove(), T, TBCICOPY, TBCIDELETE, UNLIKELY, and vec.

Referenced by remove().

◆ resize() [1/3]

◆ resize() [2/3]

template<typename T>
BVector< T > & BVector< T >::resize ( const T & value,
const unsigned long c )

Definition at line 342 of file bvector.h.

References BVector, c, dim, fill(), LIKELY, NEW, T, TBCIDELETE, UNLIKELY, and vec.

◆ resize() [3/3]

template<typename T>
BVector< T > & BVector< T >::resize ( const unsigned long c)

Definition at line 321 of file bvector.h.

References BCHK, BVector, c, dim, LAPACK_INLINE, LIKELY, NEW, REALLOC, resize(), T, TBCIDELETE, UNLIKELY, and vec.

◆ revert()

template<typename T>
INLINE BVector< T > & BVector< T >::revert ( )

Definition at line 385 of file bvector.h.

References BVector, dim, INLINE, REGISTER, and vec.

◆ set() [1/2]

template<typename T>
T & BVector< T >::set ( const T & val,
unsigned long idx )
inline

Definition at line 136 of file bvector.h.

References set(), and T.

◆ set() [2/2]

template<typename T>
T & BVector< T >::set ( const unsigned long idx)
inline

◆ set_fortran_vector()

template<typename T>
void BVector< T >::set_fortran_vector ( T * pointer)
inline

Definition at line 165 of file bvector.h.

References setptr(), and T.

◆ setptr()

template<typename T>
BVector< T > & BVector< T >::setptr ( T * pointer)
inline

Definition at line 161 of file bvector.h.

References BVector, T, and vec.

Referenced by cediv(), cediv(), cediv(), cemul(), cemul(), cemul(), ediv(), ediv(), ediv(), emul(), emul(), emul(), and set_fortran_vector().

◆ setsize()

template<typename T>
BVector< T > & BVector< T >::setsize ( const unsigned long size)
inline

Definition at line 162 of file bvector.h.

References BVector, dim, and size().

Referenced by cediv(), cediv(), cediv(), cemul(), cemul(), cemul(), ediv(), ediv(), ediv(), emul(), emul(), and emul().

◆ size()

◆ swap()

template<typename T>
INLINE BVector< T > & BVector< T >::swap ( BVector< T > & v)

Definition at line 451 of file bvector.h.

References BVector, dim, INLINE, keep, and vec.

◆ vec_info()

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

Definition at line 195 of file bvector.h.

◆ vecptr()

template<typename T>
T *const & BVector< T >::vecptr ( ) const
inline

Definition at line 147 of file bvector.h.

References T, and vec.

Referenced by FS_Vector< dims, T >::FS_Vector(), and get_fortran_vector().

◆ BVector

◆ F_Matrix< T >

template<typename T>
friend class F_Matrix< T >
friend

Definition at line 75 of file bvector.h.

References BVector, HOT, keep, and T.

◆ F_TMatrix< T >

template<typename T>
friend class F_TMatrix< T >
friend

Definition at line 75 of file bvector.h.

◆ FGD

template<typename T>
NOINST BVector< T > &FRIEND_TBCI2__ bvfillm FGD ( BVector< T > & ,
const Matrix< T > & m )
friend

References BVector, bvfillm(), FRIEND_TBCI2__, and NOINST.

◆ operator<<FGD

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

References BVector, and STD__.

◆ operator>>FGD

template<typename T>
STD__ istream & operator>>FGD ( STD__ istream & ,
BVector< T > &  )
friend

References BVector, and STD__.

◆ TMatrix< T >

template<typename T>
friend class TMatrix< T >
friend

Definition at line 75 of file bvector.h.

Member Data Documentation

◆ dim

template<typename T>
unsigned long BVector< T >::dim
protected

Definition at line 74 of file bvector.h.

Referenced by TSVector< T >::add_t_tsv(), alias(), append(), append(), bubble_sort(), BVector(), BVector(), BVector(), BVector(), BVector(), bvfillm(), cheapdownsize(), concat(), contains(), destroy(), end(), end(), fill(), TMatrix< T >::fill(), TVector< T >::incr(), init_0(), operator()(), operator()(), TVector< T >::operator*=(), TSVector< T >::operator+(), TSVector< T >::operator+(), TSVector< T >::operator+(), TSVector< T >::operator+(), TVector< T >::operator+(), TVector< T >::operator+(), Vector< T >::operator+(), Vector< T >::operator+(), Vector< T >::operator+(), TVector< T >::operator+=(), TVector< T >::operator+=(), TVector< T >::operator+=(), TSVector< T >::operator-(), TSVector< T >::operator-(), TSVector< T >::operator-(), TSVector< T >::operator-(), TVector< T >::operator-(), TVector< T >::operator-(), Vector< T >::operator-(), Vector< T >::operator-(), Vector< T >::operator-(), TVector< T >::operator-=(), TVector< T >::operator-=(), TVector< T >::operator-=(), operator<<(), operator<=(), operator=(), TSVector< T >::operator=(), TVector< T >::operator=(), TVector< T >::operator=(), operator==(), TSVector< T >::operator==(), operator>=(), operator>>(), remove(), resize(), resize(), resize(), revert(), F_TMatrix< T >::set_col(), TMatrix< T >::set_col(), TMatrix< T >::set_col_partial(), TMatrix< T >::set_row(), TMatrix< T >::set_row_partial(), setsize(), size(), TVector< T >::size(), TVector< T >::slice(), Vector< T >::slice(), TSVector< T >::sub_t_tsv(), swap(), TVector< T >::TVector(), and TVector< T >::TVector().

◆ keep

◆ vec

template<typename T>
T* BVector< T >::vec
protected

Definition at line 73 of file bvector.h.

Referenced by TSVector< T >::add_t_tsv(), alias(), append(), append(), begin(), begin(), bubble_sort(), BVector(), BVector(), BVector(), BVector(), BVector(), bvfillm(), concat(), contains(), destroy(), end(), end(), F_TMatrix< T >::F_TMatrix(), TVector< T >::FGD, fill(), TMatrix< T >::fill(), get(), TVector< T >::get(), F_TMatrix< T >::get_col(), TMatrix< T >::get_col(), F_TMatrix< T >::get_row(), TMatrix< T >::get_row(), getcref(), TVector< T >::getcref(), TSVector< T >::incr(), TVector< T >::incr(), Vector< T >::incr(), init_0(), operator()(), operator()(), Matrix< T >::operator()(), TVector< T >::operator()(), BdMatrix< T >::operator*(), Matrix< T >::operator*(), TVector< T >::operator*=(), TSVector< T >::operator+(), TSVector< T >::operator+(), TSVector< T >::operator+(), TSVector< T >::operator+(), TVector< T >::operator+(), TVector< T >::operator+(), Vector< T >::operator+(), Vector< T >::operator+(), Vector< T >::operator+(), Vector< T >::operator+(), TVector< T >::operator+=(), TVector< T >::operator+=(), TVector< T >::operator+=(), TSVector< T >::operator-(), TSVector< T >::operator-(), TSVector< T >::operator-(), TSVector< T >::operator-(), TVector< T >::operator-(), TVector< T >::operator-(), Vector< T >::operator-(), Vector< T >::operator-(), Vector< T >::operator-(), Vector< T >::operator-(), Vector< T >::operator-(), TVector< T >::operator-=(), TVector< T >::operator-=(), TVector< T >::operator-=(), operator<<(), operator<=(), operator=(), TSVector< T >::operator=(), TVector< T >::operator=(), TVector< T >::operator=(), operator==(), TSVector< T >::operator==(), TVector< T >::operator==(), operator>=(), operator>>(), remove(), resize(), resize(), resize(), revert(), set(), TVector< T >::set(), F_TMatrix< T >::set_col(), TMatrix< T >::set_col(), TMatrix< T >::set_col_partial(), F_TMatrix< T >::set_row(), TMatrix< T >::set_row(), TMatrix< T >::set_row_partial(), setptr(), TVector< T >::setval(), TVector< T >::setval(), TVector< T >::slice(), Vector< T >::slice(), TSVector< T >::sub_t_tsv(), swap(), TMatrix< T >::TMatrix(), BdMatrix< T >::transMult(), TVector< T >::TVector(), TVector< T >::TVector(), and vecptr().


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