TBCI Numerical high perf. C++ Library  2.8.0
Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Attributes | Friends | List of all members
BVector< T > Class Template Reference

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

#include <bvector.h>

Inheritance diagram for BVector< T >:
Inheritance graph
[legend]
Collaboration diagram for BVector< T >:
Collaboration graph
[legend]

Public Types

typedef Titerator
 STL-like iterator support. More...
 
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 More...
 
 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) More...
 
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 More...
 
BVector< T > & push_back (const T &value)
 performs poorly More...
 
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. More...
 
BVector< T > & alias (const BVector< T > &bv)
 
BVector< T > & copy (const BVector< T > &bv)
 copy does a resize, if necessary More...
 
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) More...
 
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

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

Definition at line 156 of file bvector.h.

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

Definition at line 71 of file bvector.h.

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.

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

Definition at line 72 of file bvector.h.

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

Definition at line 70 of file bvector.h.

Constructor & Destructor Documentation

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

Definition at line 235 of file bvector.h.

References BVector< T >::dim, NEW, T, UNLIKELY, and BVector< T >::vec.

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

Definition at line 296 of file bvector.h.

References BVector< T >::dim, LIKELY, NEW, T, TBCIFILL, and BVector< T >::vec.

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

copy constructor

Definition at line 282 of file bvector.h.

References BVector< T >::dim, LIKELY, NEW, T, TBCICOPY, and BVector< T >::vec.

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

Definition at line 247 of file bvector.h.

References BVector< T >::dim, i, LIKELY, NEW, T, UNLIKELY, and BVector< T >::vec.

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

Definition at line 275 of file bvector.h.

References BVector< T >::destroy(), BVector< T >::keep, and UNLIKELY.

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

Definition at line 201 of file bvector.h.

Member Function Documentation

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

Definition at line 171 of file bvector.h.

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

Definition at line 423 of file bvector.h.

References BVector< T >::append(), BCHK, BVector< T >::dim, REALLOC, T, TBCICOPY, and BVector< T >::vec.

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

Definition at line 154 of file bvector.h.

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

Definition at line 157 of file bvector.h.

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

Definition at line 394 of file bvector.h.

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

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

Definition at line 308 of file bvector.h.

References BCHK, BVector< T >::dim, BVector< T >::resize(), and UNLIKELY.

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

Definition at line 112 of file bvector.h.

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

Definition at line 593 of file bvector.h.

References c, BVector< T >::dim, T, TBCICOPY, and BVector< T >::vec.

Referenced by concat().

template<typename T>
bool BVector< T >::contains ( const T val,
unsigned long *  ind = 0 
) const
inline
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 BVector< T >::resize().

Referenced by lu_solve(), and BdMatrix< T >::resize().

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

Definition at line 155 of file bvector.h.

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

Definition at line 158 of file bvector.h.

template<typename T>
INLINE BVector< T > & BVector< T >::fill ( const T val)
template<typename T>
tbci_traits<T>::const_refval_type BVector< T >::get ( const unsigned long  idx) const
inline
template<typename T>
T* const& BVector< T >::get_fortran_vector ( ) const
inline

Definition at line 164 of file bvector.h.

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

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

Definition at line 99 of file bvector.h.

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

Definition at line 178 of file bvector.h.

template<typename T >
T & BVector< T >::operator() ( const unsigned long  i)
inline
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 BVector< T >::dim, EXPCHK, i, index, and BVector< T >::vec.

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

Definition at line 181 of file bvector.h.

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

Definition at line 509 of file bvector.h.

References BCHK, BVector< T >::dim, i, UNLIKELY, and BVector< T >::vec.

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

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

Definition at line 168 of file bvector.h.

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

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 BCHK, BVector< T >::dim, T, TBCICOPY, and BVector< T >::vec.

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< T >::dim, LIKELY, T, TBCICOMP, and BVector< T >::vec.

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

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

Definition at line 182 of file bvector.h.

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

Definition at line 520 of file bvector.h.

References BCHK, BVector< T >::dim, i, UNLIKELY, and BVector< T >::vec.

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

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

Definition at line 140 of file bvector.h.

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.

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

performs poorly

Definition at line 116 of file bvector.h.

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

Definition at line 435 of file bvector.h.

References BCHK, BVector< T >::dim, NEW, T, TBCICOPY, TBCIDELETE, UNLIKELY, and BVector< T >::vec.

Referenced by BdMatrix< T >::removediag().

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

Definition at line 342 of file bvector.h.

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

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

Definition at line 385 of file bvector.h.

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

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

Definition at line 136 of file bvector.h.

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

Definition at line 165 of file bvector.h.

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

Definition at line 161 of file bvector.h.

Referenced by cediv(), cemul(), ediv(), emul(), and BVector< unsigned >::set_fortran_vector().

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

Definition at line 162 of file bvector.h.

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

template<typename T>
unsigned long BVector< T >::size ( ) const
inline
template<typename T>
INLINE BVector< T > & BVector< T >::swap ( BVector< T > &  v)

Definition at line 451 of file bvector.h.

References BVector< T >::dim, BVector< T >::keep, TBCI::SWAP(), and BVector< T >::vec.

Referenced by BdMatrix< T >::transpose().

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

Definition at line 195 of file bvector.h.

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

Friends And Related Function Documentation

template<typename T>
template<typename U >
friend class BVector
friend

Definition at line 200 of file bvector.h.

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

Definition at line 80 of file bvector.h.

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

Definition at line 79 of file bvector.h.

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

Definition at line 78 of file bvector.h.

Member Data Documentation

template<typename T>
unsigned long BVector< T >::dim
protected
template<typename T>
bool BVector< T >::keep
protected
template<typename T>
T* BVector< T >::vec
protected

Definition at line 73 of file bvector.h.

Referenced by TSVector< T >::add_t_tsv(), BVector< unsigned >::alias(), BVector< T >::append(), BVector< unsigned >::begin(), BVector< T >::bubble_sort(), BVector< T >::BVector(), BVector< unsigned >::BVector(), bvfillm(), BVector< T >::concat(), BVector< T >::contains(), BVector< T >::destroy(), dot(), BVector< unsigned >::end(), F_TMatrix< T >::F_TMatrix(), BVector< T >::fill(), TMatrix< T >::fill(), BVector< unsigned >::get(), TVector< T >::get(), F_TMatrix< T >::get_col(), TMatrix< T >::get_col(), F_TMatrix< T >::get_row(), TMatrix< T >::get_row(), BVector< unsigned >::getcref(), TVector< T >::getcref(), TSVector< T >::incr(), Vector< T >::incr(), BVector< unsigned >::init_0(), BVector< T >::operator()(), TVector< T >::operator()(), Matrix< T >::operator()(), BdMatrix< T >::operator*(), Vector< T >::operator*(), Matrix< T >::operator*(), TVector< T >::operator+(), TSVector< T >::operator+(), Vector< T >::operator+(), TVector< T >::operator+=(), TVector< T >::operator-(), TSVector< T >::operator-(), Vector< T >::operator-(), TVector< T >::operator-=(), BVector< T >::operator<=(), TVector< T >::operator=(), BVector< T >::operator=(), TSVector< T >::operator=(), TVector< T >::operator==(), BVector< T >::operator==(), TSVector< T >::operator==(), BVector< T >::operator>=(), operator>>(), BVector< T >::remove(), BVector< T >::resize(), BVector< T >::revert(), BVector< unsigned >::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(), BVector< unsigned >::setptr(), TVector< T >::setval(), Vector< T >::slice(), TSVector< T >::sub_t_tsv(), BVector< T >::swap(), TMatrix< T >::TMatrix(), BdMatrix< T >::transMult(), TVector< T >::TVector(), BVector< unsigned >::vecptr(), and Vector< unsigned >::Vector().


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