TBCI::BVector< T > Class Template Reference

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

#include <bvector.h>

Inheritance diagram for TBCI::BVector< T >:

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

Collaboration graph
[legend]

List of all members.

Public Types

typedef T * iterator
 STL-like iterator support.
typedef const T * const_iterator

Public Member Functions

 BVector (const unsigned long=0)
 BVector (const T &, const unsigned long)
 BVector (const BVector< T > &)
 copy constructor
 BVector (const vararg va,...)
void destroy ()
 ~BVector ()
BVector< T > & init_0 ()
BVector< T > & fill (const T &)
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)
T & operator() (const unsigned long)
tbci_traits< T >::const_refval_type operator() (const unsigned long) const
const T & getcref (const unsigned long) const
T & operator[] (const unsigned long i)
tbci_traits< T >::const_refval_type operator[] (const unsigned long i) const
unsigned long size () const
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 > &)
 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
 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< T > concat (const BVector< T > &) const
template<typename U>
 BVector (const BVector< U > &bv)

Static Public Member Functions

static const char * vec_info ()

Protected Types

typedef T value_type
typedef T element_type
typedef T aligned_value_type

Protected Attributes

T * vec
unsigned long dim
bool keep

Friends

class TMatrix< T >
class F_TMatrix< T >
class F_Matrix< T >
class BVector
BVector< T > & bvfillm (BVector< T > &, const Matrix< T > &m)
std::ostream & operator<< (std::ostream &, const BVector< T > &)
std::istream & operator>> (std::istream &, BVector< T > &)


Detailed Description

template<typename T>
class TBCI::BVector< T >

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

..). Mainly useful for storage.

Definition at line 66 of file bvector.h.


Member Typedef Documentation

template<typename T>
typedef T TBCI::BVector< T >::value_type [protected]

template<typename T>
typedef T TBCI::BVector< T >::element_type [protected]

template<typename T>
typedef T TBCI::BVector< T >::aligned_value_type [protected]

template<typename T>
typedef T* TBCI::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 143 of file bvector.h.

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

Definition at line 146 of file bvector.h.


Constructor & Destructor Documentation

template<typename T>
TBCI::BVector< T >::BVector ( const unsigned long  c = 0  )  [inline, explicit]

Definition at line 225 of file bvector.h.

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

template<typename T>
TBCI::BVector< T >::BVector ( const T &  value,
const unsigned long  c 
) [inline]

Definition at line 281 of file bvector.h.

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

template<typename T>
TBCI::BVector< T >::BVector ( const BVector< T > &  v  )  [inline]

copy constructor

Definition at line 267 of file bvector.h.

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

template<typename T>
TBCI::BVector< T >::BVector ( const vararg  va,
  ... 
) [inline]

Definition at line 237 of file bvector.h.

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

template<typename T>
TBCI::BVector< T >::~BVector (  )  [inline]

Definition at line 260 of file bvector.h.

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

template<typename T>
template<typename U>
TBCI::BVector< T >::BVector ( const BVector< U > &  bv  )  [inline, explicit]

Definition at line 191 of file bvector.h.


Member Function Documentation

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

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

Definition at line 98 of file bvector.h.

template<typename T>
BVector< T > & TBCI::BVector< T >::fill ( const T &  val  )  [inline]

Reimplemented from TBCI::BVector_Sig< T >.

Reimplemented in TBCI::Vector< T >, and TBCI::Vector< unsigned >.

Definition at line 365 of file bvector.h.

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

Referenced by TBCI::BVector< T >::resize().

template<typename T>
BVector< T > & TBCI::BVector< T >::resize ( const BVector< T > &  v  )  [inline]

template<typename T>
BVector< T > & TBCI::BVector< T >::resize ( const unsigned long  c  )  [inline]

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

template<typename T>
BVector< T > & TBCI::BVector< T >::cheapdownsize ( const unsigned long  nd  )  [inline]

Definition at line 293 of file bvector.h.

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

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

Reimplemented from TBCI::BVector_Sig< T >.

Reimplemented in TBCI::Vector< T >, and TBCI::Vector< unsigned >.

Definition at line 111 of file bvector.h.

template<typename T>
BVector< T > & TBCI::BVector< T >::append ( const T &  val  )  [inline]

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

performs poorly

Definition at line 115 of file bvector.h.

template<typename T>
BVector< T > & TBCI::BVector< T >::append ( const BVector< T > &  v  )  [inline]

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

template<typename T>
BVector< T > & TBCI::BVector< T >::revert (  )  [inline]

Definition at line 372 of file bvector.h.

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

template<typename T>
BVector< T > & TBCI::BVector< T >::bubble_sort (  )  [inline]

Definition at line 381 of file bvector.h.

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

template<typename T>
BVector< T > & TBCI::BVector< T >::swap ( BVector< T > &  v  )  [inline]

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

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

Reimplemented from TBCI::BVector_Sig< T >.

Reimplemented in TBCI::Vector< T >, and TBCI::Vector< unsigned >.

Definition at line 453 of file bvector.h.

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

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

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

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

Reimplemented in TBCI::Vector< T >, and TBCI::Vector< unsigned >.

Definition at line 132 of file bvector.h.

template<typename T>
unsigned long TBCI::BVector< T >::size (  )  const [inline]

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

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

Definition at line 144 of file bvector.h.

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

Definition at line 145 of file bvector.h.

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

Definition at line 147 of file bvector.h.

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

Definition at line 148 of file bvector.h.

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

Definition at line 151 of file bvector.h.

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

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

Definition at line 152 of file bvector.h.

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

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

Definition at line 154 of file bvector.h.

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

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

Definition at line 155 of file bvector.h.

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

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

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

Definition at line 475 of file bvector.h.

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

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

Definition at line 161 of file bvector.h.

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

copy does a resize, if necessary

Definition at line 483 of file bvector.h.

References TBCI::BVector< T >::resize().

Referenced by TBCI::BdMatrix< T >::resize().

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

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

Reimplemented in TBCI::TVector< T >, and TBCI::TVector< unsigned >.

Definition at line 494 of file bvector.h.

References TBCI::BVector< T >::dim, LIKELY, T, TBCICOMP, and TBCI::BVector< T >::vec.

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

Reimplemented in TBCI::TVector< T >, and TBCI::TVector< unsigned >.

Definition at line 168 of file bvector.h.

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

Definition at line 508 of file bvector.h.

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

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

Definition at line 519 of file bvector.h.

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

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

Definition at line 171 of file bvector.h.

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

Definition at line 172 of file bvector.h.

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

template<typename T>
BVector< T > TBCI::BVector< T >::concat ( const BVector< T > &  b2  )  const [inline]

Definition at line 592 of file bvector.h.

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

Referenced by TBCI::concat().

template<typename T>
static const char* TBCI::BVector< T >::vec_info (  )  [inline, static]

Reimplemented from TBCI::BVector_Sig< T >.

Reimplemented in TBCI::TVector< T >, TBCI::Vector< T >, TBCI::TVector< unsigned >, and TBCI::Vector< unsigned >.

Definition at line 185 of file bvector.h.


Friends And Related Function Documentation

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

Definition at line 77 of file bvector.h.

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

Definition at line 78 of file bvector.h.

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

Definition at line 79 of file bvector.h.

template<typename T>
friend class BVector [friend]

Definition at line 190 of file bvector.h.

template<typename T>
BVector<T>& bvfillm ( BVector< T > &  bv,
const Matrix< T > &  m 
) [friend]

Definition at line 2221 of file matrix.h.

template<typename T>
std:: ostream& operator<< ( std::ostream &  os,
const BVector< T > &  v 
) [friend]

Definition at line 530 of file bvector.h.

template<typename T>
std:: istream& operator>> ( std::istream &  in,
BVector< T > &  v 
) [friend]

Definition at line 553 of file bvector.h.


Member Data Documentation

template<typename T>
T* TBCI::BVector< T >::vec [protected]

Definition at line 72 of file bvector.h.

Referenced by TBCI::TSVector< T >::add_t_tsv(), TBCI::BVector< T >::append(), TBCI::BVector< T >::bubble_sort(), TBCI::BVector< T >::BVector(), TBCI::BVector< unsigned >::BVector(), TBCI::bvfillm(), TBCI::BVector< T >::concat(), TBCI::BVector< T >::contains(), TBCI::BVector< T >::destroy(), TBCI::dot(), TBCI::F_TMatrix< T >::F_TMatrix(), TBCI::Vector< T >::fabssqr(), TBCI::TMatrix< T >::fill(), TBCI::BVector< T >::fill(), TBCI::TSVector< T >::get(), TBCI::TMatrix< T >::get_col(), TBCI::F_TMatrix< T >::get_col(), TBCI::TMatrix< T >::get_row(), TBCI::F_TMatrix< T >::get_row(), TBCI::TSVector< T >::getcref(), TBCI::BVector< T >::getcref(), TBCI::Vector< T >::incr(), TBCI::TSVector< T >::incr(), TBCI::TVector< T >::incr(), TBCI::Vector< T >::max(), TBCI::Vector< T >::min(), TBCI::TSVector< T >::operator()(), TBCI::Matrix< T >::operator()(), TBCI::BVector< T >::operator()(), TBCI::Vector< T >::operator*(), TBCI::Matrix< T >::operator*(), TBCI::BdMatrix< T >::operator*(), TBCI::TVector< T >::operator*=(), TBCI::Vector< T >::operator+(), TBCI::TSVector< T >::operator+(), TBCI::operator+(), TBCI::TVector< T >::operator+(), TBCI::TVector< T >::operator+=(), TBCI::Vector< T >::operator-(), TBCI::TSVector< T >::operator-(), TBCI::operator-(), TBCI::TVector< T >::operator-(), TBCI::TVector< T >::operator-=(), TBCI::BVector< T >::operator<=(), TBCI::TSVector< T >::operator=(), TBCI::TVector< T >::operator=(), TBCI::BVector< T >::operator=(), TBCI::Vector< T >::operator==(), TBCI::TSVector< T >::operator==(), TBCI::TVector< unsigned >::operator==(), TBCI::BVector< T >::operator==(), TBCI::BVector< T >::operator>=(), TBCI::operator>>(), TBCI::BVector< T >::remove(), TBCI::BVector< T >::resize(), TBCI::BVector< T >::revert(), TBCI::TMatrix< T >::set_col(), TBCI::F_TMatrix< T >::set_col(), TBCI::TMatrix< T >::set_col_partial(), TBCI::TMatrix< T >::set_row(), TBCI::F_TMatrix< T >::set_row(), TBCI::TMatrix< T >::set_row_partial(), TBCI::Vector< T >::slice(), TBCI::TVector< T >::slice(), TBCI::TSVector< T >::sub_t_tsv(), TBCI::Vector< T >::sum(), TBCI::BVector< T >::swap(), TBCI::TMatrix< T >::TMatrix(), TBCI::BdMatrix< T >::transMult(), TBCI::TVector< T >::TVector(), TBCI::TSVector< T >::vecptr(), and TBCI::Vector< T >::Vector().

template<typename T>
unsigned long TBCI::BVector< T >::dim [protected]

Definition at line 73 of file bvector.h.

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

template<typename T>
bool TBCI::BVector< T >::keep [protected]


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

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