TBCI Numerical high perf. C++ Library 2.8.0
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 >:
Collaboration diagram for FS_Vector< dims, T >:

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 62 of file fs_vector.h.

Member Typedef Documentation

◆ element_type

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

Definition at line 69 of file fs_vector.h.

◆ TALIGN

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.

◆ value_type

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

◆ FS_Vector() [1/6]

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

Definition at line 72 of file fs_vector.h.

◆ FS_Vector() [2/6]

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 fill(), and T.

◆ FS_Vector() [3/6]

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 x.

◆ FS_Vector() [4/6]

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, FS_Vector, BVector< T >::size(), T, BVector< T >::vecptr(), and x.

◆ FS_Vector() [5/6]

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, clear(), dims, i, MIN, T, and x.

◆ FS_Vector() [6/6]

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, FS_Vector, and i.

Member Function Documentation

◆ abs()

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

Definition at line 493 of file fs_vector.h.

References fabssqr(), INLINE, MATH__, sqrt(), and T.

◆ clear()

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 init_0().

Referenced by FS_Vector(), and slice().

◆ contains()

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, T, and x.

◆ fabs()

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

Definition at line 487 of file fs_vector.h.

References fabssqr(), MATH__, and sqrt().

◆ fabssqr()

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

Definition at line 481 of file fs_vector.h.

References dot(), and real.

Referenced by fabssqr(), operator<=(), and operator>=().

◆ fill()

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, FS_Vector, i, T, and x.

Referenced by FS_Vector(), and operator=().

◆ get_fortran_vector()

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 T, and vecptr().

◆ incr()

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, FS_Vector, i, T, and x.

◆ init_0()

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 x.

Referenced by clear().

◆ max()

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, INLINE, max(), MIN_ALIGN, REGISTER, T, and x.

Referenced by max(), and max().

◆ min()

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, INLINE, min(), MIN_ALIGN, REGISTER, T, and x.

Referenced by min(), and min().

◆ minus()

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.

References dims, FS_Vector, FSV_MEM_FRD, INST3, minus(), and T.

Referenced by minus(), and operator-().

◆ mult()

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.

References mult().

Referenced by mult().

◆ operator BVector< T >()

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, FS_Vector, T, and x.

◆ operator!=()

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.

References FS_Vector.

◆ operator()() [1/2]

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, FS_Vector, i, T, and x.

◆ operator()() [2/2]

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, FS_Vector, i, T, and x.

◆ operator*() [1/3]

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

Definition at line 88 of file fs_vector.h.

References T, and x.

◆ operator*() [2/3]

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

Definition at line 89 of file fs_vector.h.

References T, and x.

◆ operator*() [3/3]

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.

References dims, FSV_NOASS_T, and T.

◆ operator*=()

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.

References FSV_ASS_T.

◆ operator+() [1/2]

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.

◆ operator+() [2/2]

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.

◆ operator+=() [1/2]

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.

◆ operator+=() [2/2]

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.

◆ operator-() [1/3]

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, FS_Vector, i, and x.

◆ operator-() [2/3]

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.

References FSV_NOASS_FSV.

◆ operator-() [3/3]

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.

References FSV_NOASS_T.

◆ operator-=() [1/2]

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.

References FSV_ASS_FSV.

◆ operator-=() [2/2]

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.

References FSV_ASS_T.

◆ operator/()

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, FS_Vector, i, T, and x.

◆ operator/=()

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, FS_Vector, i, T, and x.

◆ operator<()

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.

References FS_Vector.

◆ operator<=()

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 fabssqr(), and FS_Vector.

◆ operator=() [1/2]

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, FS_Vector, T, and x.

◆ operator=() [2/2]

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 a, fill(), FS_Vector, and T.

◆ operator==()

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, and x.

◆ operator>()

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.

References FS_Vector.

◆ operator>=()

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 fabssqr(), and FS_Vector.

◆ operator[]() [1/2]

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, FS_Vector, i, T, and x.

◆ operator[]() [2/2]

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, FS_Vector, i, T, and x.

◆ plus()

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.

References FSV_MEM_FRD, and plus().

Referenced by operator+(), and plus().

◆ size()

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.

◆ sum()

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, INLINE, MIN_ALIGN, REGISTER, sum(), T, and x.

Referenced by sum(), and sum().

◆ vecptr()

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 x.

Referenced by get_fortran_vector(), and slice().

◆ FGD

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

References dims, dot(), FS_Vector, slice(), and T.

◆ FS_Vector

template<unsigned dims, typename T>
template<unsigned dm, typename U>
friend class FS_Vector
friend

◆ operator<<FGD

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

References FS_Vector, and STD__.

◆ operator>>FGD

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

References FS_Vector, STD__, and T.

Member Data Documentation

◆ x


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