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

Implementation of fixed sized Vectors (template argument) which is favorable for small Vectors, where the overhead of dynamically allocating and freeing memory and it's management is too expensive. More...

#include <fs_vector.h>

Inheritance diagram for FS_Vector< dims, T >:
Inheritance graph
[legend]
Collaboration diagram for FS_Vector< dims, T >:
Collaboration graph
[legend]

Public Types

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

Public Member Functions

 FS_Vector ()
 
 FS_Vector (const T v)
 
 FS_Vector (const FS_Vector< dims, T > &pc)
 
 FS_Vector (const BVector< T > &bv)
 
 FS_Vector (const vararg,...)
 
 operator BVector< T > () const
 
Toperator[] (const unsigned long i)
 
const Toperator[] (const unsigned long i) const
 
Toperator() (const unsigned long i)
 
const Toperator() (const unsigned long i) const
 
Toperator* ()
 
const Toperator* () const
 
template<typename U >
 FS_Vector (const FS_Vector< dims, U > &fsv)
 
FS_Vector< dims, T > & init_0 ()
 
FS_Vector< dims, T > & fill (const T &)
 
FS_Vector< dims, T > & clear ()
 
unsigned long size () const
 
FS_Vector< dims, T > & operator= (const T &a)
 
FS_Vector< dims, T > & operator= (const FS_Vector< dims, T > &fv)
 
bool operator== (const FS_Vector< dims, T > &) const
 
bool operator!= (const FS_Vector< dims, T > &fv) const
 
FS_Vector< dims, T > & operator+= (const FS_Vector< dims, T > &)
 
FS_Vector< dims, T > & operator-= (const FS_Vector< dims, T > &)
 
FS_Vector< dims, T > & operator+= (const T &)
 
FS_Vector< dims, T > & operator-= (const T &)
 
FS_Vector< dims, T > & operator*= (const T &)
 
FS_Vector< dims, T > & operator/= (const T &)
 
FS_Vector< dims, Toperator+ (const FS_Vector< dims, T > &) const
 
FS_Vector< dims, Toperator- (const FS_Vector< dims, T > &) const
 
FS_Vector< dims, Toperator+ (const T &) const
 
FS_Vector< dims, Toperator- (const T &) const
 
FS_Vector< dims, Toperator* (const T &) const
 
FS_Vector< dims, Toperator/ (const T &) const
 
FS_Vector< dims, Toperator- () const
 
FS_Vector< dims, Tincr (const unsigned long, const T=(T) 1) const
 
FS_Vector< dims, Tmult (const T &) const
 
FS_Vector< dims, Tplus (const T &) const
 
FS_Vector< dims, Tminus (const T &) const
 
bool contains (const T &, unsigned long *=0) const
 
T min () const
 
T max () const
 
T sum () const
 
double fabssqr () const
 
double fabs () const
 
T abs () const
 
bool operator<= (const FS_Vector< dims, T > &fv) const
 
bool operator>= (const FS_Vector< dims, T > &fv) const
 
bool operator< (const FS_Vector< dims, T > &fv) const
 
bool operator> (const FS_Vector< dims, T > &fv) const
 
Tvecptr () const
 
Tget_fortran_vector () 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
 
- 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
 

Protected Attributes

T x [dims]
 

Friends

template<unsigned dm, typename U >
class FS_Vector
 
STD__ ostream & operator<< FGD (STD__ ostream &, const FS_Vector< dims, T > &)
 
STD__ istream & operator>> FGD (STD__ istream &, FS_Vector< dims, T > &)
 
T dot FGD (const FS_Vector< dims, T > &, const FS_Vector< dims, T > &)
 

Additional Inherited Members

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

Detailed Description

template<unsigned dims, typename T>
class FS_Vector< dims, T >

Implementation of fixed sized Vectors (template argument) which is favorable for small Vectors, where the overhead of dynamically allocating and freeing memory and it's management is too expensive.

As the compiler knows the dimension of the FS_Vector at compile time, do advanced optimizations such as loop unrolling. Interface resembles the one of Vector.

Definition at line 45 of file fs_vector.h.

Member Typedef Documentation

template<unsigned dims, typename T>
typedef T FS_Vector< dims, T >::element_type

Definition at line 69 of file fs_vector.h.

template<unsigned dims, typename T>
typedef T aligned_value_type FS_Vector< dims, T >::TALIGN(MIN_ALIGN)

Definition at line 70 of file fs_vector.h.

template<unsigned dims, typename T>
typedef T FS_Vector< dims, T >::value_type

Definition at line 68 of file fs_vector.h.

Constructor & Destructor Documentation

template<unsigned dims, typename T>
FS_Vector< dims, T >::FS_Vector ( )
inline

Definition at line 72 of file fs_vector.h.

template<unsigned dims, typename T>
FS_Vector< dims, T >::FS_Vector ( const T  v)
inline

Definition at line 73 of file fs_vector.h.

References FS_Vector< dims, T >::fill().

template<unsigned dims, typename T>
FS_Vector< dims, T >::FS_Vector ( const FS_Vector< dims, T > &  pc)
inline

Definition at line 74 of file fs_vector.h.

References CSTD__, dims, T, and FS_Vector< dims, T >::x.

template<unsigned dims, typename T >
FS_Vector< dims, T >::FS_Vector ( const BVector< T > &  bv)
inline

Definition at line 197 of file fs_vector.h.

References BCHKNR, CSTD__, dims, BVector< T >::size(), T, BVector< T >::vecptr(), and x.

template<unsigned dims, typename T >
FS_Vector< dims, T >::FS_Vector ( const vararg  va,
  ... 
)
inline

Definition at line 205 of file fs_vector.h.

References BCHKNR, FS_Vector< dims, T >::clear(), dims, i, MIN, T, and x.

template<unsigned dims, typename T>
template<typename U >
FS_Vector< dims, T >::FS_Vector ( const FS_Vector< dims, U > &  fsv)
inlineexplicit

Definition at line 96 of file fs_vector.h.

References dims, and i.

Member Function Documentation

template<unsigned dims, typename T >
INLINE T FS_Vector< dims, T >::abs ( ) const

Definition at line 493 of file fs_vector.h.

References TBCI::fabssqr(), MATH__, std::sqrt(), and T.

template<unsigned dims, typename T>
FS_Vector<dims,T>& FS_Vector< dims, T >::clear ( )
inline

Definition at line 104 of file fs_vector.h.

References FS_Vector< dims, T >::init_0().

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

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

Definition at line 428 of file fs_vector.h.

References dims, i, REGISTER, and x.

template<unsigned dims, typename T >
double FS_Vector< dims, T >::fabs ( ) const
inline

Definition at line 487 of file fs_vector.h.

References TBCI::fabssqr(), MATH__, and std::sqrt().

template<unsigned dims, typename T >
double FS_Vector< dims, T >::fabssqr ( ) const
inline

Definition at line 481 of file fs_vector.h.

References CPLX__, TBCI::dot(), and real.

Referenced by fabssqr(), FS_Vector< dims, T >::operator<=(), and FS_Vector< dims, T >::operator>=().

template<unsigned dims, typename T >
FS_Vector< dims, T > & FS_Vector< dims, T >::fill ( const T v)
inline

Definition at line 255 of file fs_vector.h.

References dims, i, and x.

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

template<unsigned dims, typename T>
T* FS_Vector< dims, T >::get_fortran_vector ( ) const
inline

Definition at line 191 of file fs_vector.h.

References FS_Vector< dims, T >::vecptr().

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

Definition at line 375 of file fs_vector.h.

References BCHK, dims, i, and FS_Vector< dims, T >::x.

template<unsigned dims, typename T>
FS_Vector<dims,T>& FS_Vector< dims, T >::init_0 ( )
inline

Definition at line 100 of file fs_vector.h.

References CSTD__, dims, T, and FS_Vector< dims, T >::x.

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

template<unsigned dims, typename T >
INLINE T FS_Vector< dims, T >::max ( ) const

Definition at line 450 of file fs_vector.h.

References ALIGN, dims, max(), MIN_ALIGN, REGISTER, T, and x.

Referenced by max().

template<unsigned dims, typename T >
INLINE T FS_Vector< dims, T >::min ( ) const

Definition at line 439 of file fs_vector.h.

References ALIGN, dims, min, MIN_ALIGN, REGISTER, T, and x.

Referenced by min().

template<unsigned dims, typename T >
INLINE FS_Vector< dims, T > FS_Vector< dims, T >::minus ( const T v) const

Definition at line 564 of file fs_vector.h.

Referenced by operator-().

template<unsigned dims, typename T >
INLINE FS_Vector< dims, T > FS_Vector< dims, T >::mult ( const T v) const

Definition at line 562 of file fs_vector.h.

Referenced by operator*().

template<unsigned dims, typename T >
FS_Vector< dims, T >::operator BVector< T > ( ) const
inline

Definition at line 222 of file fs_vector.h.

References CSTD__, dims, T, and x.

template<unsigned dims, typename T>
bool FS_Vector< dims, T >::operator!= ( const FS_Vector< dims, T > &  fv) const
inline

Definition at line 115 of file fs_vector.h.

template<unsigned dims, typename T >
T & FS_Vector< dims, T >::operator() ( const unsigned long  i)
inline

Definition at line 248 of file fs_vector.h.

References BCHK, dims, i, and x.

template<unsigned dims, typename T >
const T & FS_Vector< dims, T >::operator() ( const unsigned long  i) const
inline

Definition at line 242 of file fs_vector.h.

References BCHK, dims, i, and x.

template<unsigned dims, typename T>
T& FS_Vector< dims, T >::operator* ( )
inline

Definition at line 88 of file fs_vector.h.

References FS_Vector< dims, T >::x.

template<unsigned dims, typename T>
const T& FS_Vector< dims, T >::operator* ( ) const
inline

Definition at line 89 of file fs_vector.h.

References FS_Vector< dims, T >::x.

template<unsigned dims, typename T >
FS_Vector< dims, T > FS_Vector< dims, T >::operator* ( const T v) const
inline

Definition at line 340 of file fs_vector.h.

template<unsigned dims, typename T >
FS_Vector< dims, T > & FS_Vector< dims, T >::operator*= ( const T v)
inline

Definition at line 325 of file fs_vector.h.

template<unsigned dims, typename T >
FS_Vector< dims, T > FS_Vector< dims, T >::operator+ ( const FS_Vector< dims, T > &  fv) const
inline

Definition at line 311 of file fs_vector.h.

template<unsigned dims, typename T >
FS_Vector< dims, T > FS_Vector< dims, T >::operator+ ( const T v) const
inline

Definition at line 338 of file fs_vector.h.

template<unsigned dims, typename T >
FS_Vector< dims, T > & FS_Vector< dims, T >::operator+= ( const FS_Vector< dims, T > &  fv)
inline

Definition at line 298 of file fs_vector.h.

template<unsigned dims, typename T >
FS_Vector< dims, T > & FS_Vector< dims, T >::operator+= ( const T v)
inline

Definition at line 323 of file fs_vector.h.

template<unsigned dims, typename T >
FS_Vector< dims, T > FS_Vector< dims, T >::operator- ( const FS_Vector< dims, T > &  fv) const
inline

Definition at line 312 of file fs_vector.h.

template<unsigned dims, typename T >
FS_Vector< dims, T > FS_Vector< dims, T >::operator- ( const T v) const
inline

Definition at line 339 of file fs_vector.h.

template<unsigned dims, typename T >
FS_Vector< dims, T > FS_Vector< dims, T >::operator- ( ) const
inline

Definition at line 365 of file fs_vector.h.

References dims, i, and x.

template<unsigned dims, typename T >
FS_Vector< dims, T > & FS_Vector< dims, T >::operator-= ( const FS_Vector< dims, T > &  fv)
inline

Definition at line 299 of file fs_vector.h.

template<unsigned dims, typename T >
FS_Vector< dims, T > & FS_Vector< dims, T >::operator-= ( const T v)
inline

Definition at line 324 of file fs_vector.h.

template<unsigned dims, typename T >
FS_Vector< dims, T > FS_Vector< dims, T >::operator/ ( const T v) const
inline

Definition at line 354 of file fs_vector.h.

References BCHK, dims, i, T, and x.

template<unsigned dims, typename T >
FS_Vector< dims, T > & FS_Vector< dims, T >::operator/= ( const T v)
inline

Definition at line 344 of file fs_vector.h.

References BCHK, dims, i, T, and x.

template<unsigned dims, typename T>
bool FS_Vector< dims, T >::operator< ( const FS_Vector< dims, T > &  fv) const
inline

Definition at line 164 of file fs_vector.h.

template<unsigned dims, typename T>
bool FS_Vector< dims, T >::operator<= ( const FS_Vector< dims, T > &  fv) const
inline

Definition at line 160 of file fs_vector.h.

References FS_Vector< dims, T >::fabssqr().

template<unsigned dims, typename T>
FS_Vector<dims,T>& FS_Vector< dims, T >::operator= ( const T a)
inline

Definition at line 109 of file fs_vector.h.

References FS_Vector< dims, T >::fill().

template<unsigned dims, typename T >
FS_Vector< dims, T > & FS_Vector< dims, T >::operator= ( const FS_Vector< dims, T > &  fv)
inline

Definition at line 263 of file fs_vector.h.

References CSTD__, dims, T, FS_Vector< dims, T >::x, and x.

template<unsigned dims, typename T >
bool FS_Vector< dims, T >::operator== ( const FS_Vector< dims, T > &  fv) const
inline

Definition at line 270 of file fs_vector.h.

References CSTD__, dims, T, FS_Vector< dims, T >::x, and x.

template<unsigned dims, typename T>
bool FS_Vector< dims, T >::operator> ( const FS_Vector< dims, T > &  fv) const
inline

Definition at line 166 of file fs_vector.h.

template<unsigned dims, typename T>
bool FS_Vector< dims, T >::operator>= ( const FS_Vector< dims, T > &  fv) const
inline

Definition at line 162 of file fs_vector.h.

References FS_Vector< dims, T >::fabssqr().

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

Definition at line 236 of file fs_vector.h.

References BCHK, dims, i, and x.

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

Definition at line 230 of file fs_vector.h.

References BCHK, dims, i, and x.

template<unsigned dims, typename T >
INLINE FS_Vector< dims, T > FS_Vector< dims, T >::plus ( const T v) const

Definition at line 563 of file fs_vector.h.

Referenced by operator+().

template<unsigned dims, typename T>
unsigned long FS_Vector< dims, T >::size ( ) const
inline

Definition at line 106 of file fs_vector.h.

References dims.

template<unsigned dims, typename T >
INLINE T FS_Vector< dims, T >::sum ( ) const

Definition at line 461 of file fs_vector.h.

References ALIGN, dims, MIN_ALIGN, REGISTER, sum(), T, and x.

Referenced by sum().

template<unsigned dims, typename T>
T* FS_Vector< dims, T >::vecptr ( ) const
inline

Definition at line 190 of file fs_vector.h.

References T, and FS_Vector< dims, T >::x.

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

Friends And Related Function Documentation

template<unsigned dims, typename T>
T dot FGD ( const FS_Vector< dims, T > &  ,
const FS_Vector< dims, T > &   
)
friend
template<unsigned dims, typename T>
template<unsigned dm, typename U >
friend class FS_Vector
friend

Definition at line 94 of file fs_vector.h.

template<unsigned dims, typename T>
STD__ ostream& operator<< FGD ( STD__ ostream &  ,
const FS_Vector< dims, T > &   
)
friend
template<unsigned dims, typename T>
STD__ istream& operator>> FGD ( STD__ istream &  ,
FS_Vector< dims, T > &   
)
friend

Member Data Documentation

template<unsigned dims, typename T>
T FS_Vector< dims, T >::x[dims]
protected

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