#include <vector.h>


Public Types | |
| typedef T | value_type |
| typedef T | element_type |
| typedef T | aligned_value_type |
Public Member Functions | |
| Vector (const unsigned long d=0) | |
| Vector (const T &val, const unsigned long d) | |
| Vector (const BVector< T > &bv) | |
| Vector (const Vector< T > &v) | |
| Vector (const TSVector< T > &ts) | |
| Vector (const TVector< T > &tv) | |
| Vector (const Mat_Brack< T > &) | |
| Vector (const vararg va,...) | |
| ~Vector () | |
| tbci_traits< T >::const_refval_type | operator() (const unsigned long i) const |
| tbci_traits< T >::const_refval_type | operator[] (const unsigned long i) const |
| T & | operator() (const unsigned long i) |
| T & | operator[] (const unsigned long i) |
| Vector< T > & | fill (const T &v) |
| Vector< T > & | clear () |
| TVector< T > | slice (unsigned long, unsigned long) const |
| TVector< T > | incr (const unsigned long, const T=(T) 1) const |
| Vector< T > & | operator= (const T &a) |
| Vector< T > & | operator= (const Vector< T > &v) |
| assignment operator does NOT resize the Vector! | |
| Vector< T > & | operator= (const TSVector< T > &ts) |
| Vector< T > & | operator= (const TVector< T > &tv) |
| alias | |
| bool | operator== (const Vector< T > &v) const |
| bool | operator!= (const Vector< T > &v) const |
| bool | operator== (const TSVector< T > &) const |
| bool | operator!= (const TSVector< T > &ts) const |
| bool | operator== (const TVector< T > &tv) const |
| bool | operator!= (const TVector< T > &tv) const |
| bool | operator<= (const Vector< T > &v) const |
| bool | operator>= (const Vector< T > &v) const |
| bool | operator< (const Vector< T > &v) const |
| bool | operator> (const Vector< T > &v) const |
| TVector< T > | operator+ (const Vector< T > &) const |
| TV = V + V. | |
| TVector< T > | operator- (const Vector< T > &) const |
| TV = V - V. | |
| TVector< T > | operator+ (TVector< T > tv) const |
| TV = V + TV transformed into TV += V. | |
| TVector< T > | operator- (TVector< T > tv) const |
| TV = V - TV transformed into -TV -= V. | |
| TVector< T > | operator+ (const TSVector< T > &) const |
| TV = V + TSV. | |
| TVector< T > | operator- (const TSVector< T > &) const |
| TV = V - TSV. | |
| TVector< T > | operator+ (const T &) const |
| TV = V + T. | |
| TVector< T > | operator- (const T &) const |
| TV = V - T. | |
| TSVector< T > | operator* (const T &) const |
| TSVector< T > | operator/ (const T &) const |
| TVector< T > | operator- () const |
| T | operator* (const Vector< T > &) const |
| T | operator* (TVector< T > &tv) const |
| T | operator/ (const Vector< T > &) const |
| T | min () const |
| T | max () const |
| T | min (unsigned long &pos) const |
| T | max (unsigned long &pos) const |
| T | sum () const |
| double | fabssqr () const |
| double | fabs () const |
| T | abs () const |
| bool | contains (const T &v) const |
| template<typename U> | |
| Vector (const BVector< U > &bv) | |
Static Public Member Functions | |
| static const char * | vec_info () |
Friends | |
| class | TSVector< T > |
| T | dot (const Vector< T > &, const Vector< T > &) |
Read the introduction to TBCI to understand how the Temporary Base Class Idiom helps to avoid spurious copies of data; the compiler knows that temporary objects can be aliased rather than copied, thus we copy one pointer rather than a data array. This gives us C++ semantics (operators!) with the possibility of composing operator expressions and at the same time the speed of C/FORTRAN. To achieve this the temporary base class TVector is needed as cousin for Vector.
The TSVector class is a further optimization that helps to do the composed operation Scale a x Plus y (a scalar, x, y vectors) in just one loop.
A more generic way of optimizing C++ expressions are expression templates. These however put a heavy burden on the compilers and will only be implemented in a successor project.
Definition at line 1532 of file vector.h.
| typedef T TBCI::Vector< T >::value_type |
| typedef T TBCI::Vector< T >::element_type |
| typedef T TBCI::Vector< T >::aligned_value_type |
| TBCI::Vector< T >::Vector | ( | const unsigned long | d = 0 |
) | [inline, explicit] |
| TBCI::Vector< T >::Vector | ( | const T & | val, | |
| const unsigned long | d | |||
| ) | [inline] |
| TBCI::Vector< T >::Vector | ( | const BVector< T > & | bv | ) | [inline] |
| TBCI::Vector< T >::Vector | ( | const Vector< T > & | v | ) | [inline] |
| TBCI::Vector< T >::Vector | ( | const TSVector< T > & | ts | ) | [inline] |
| TBCI::Vector< T >::Vector | ( | const TVector< T > & | tv | ) | [inline] |
| TBCI::Vector< T >::Vector | ( | const Mat_Brack< T > & | mb | ) | [inline] |
Definition at line 2313 of file matrix.h.
References TBCI::BVector< T >::dim, TBCI::Mat_Brack< T >::idx, LIKELY, NEW, T, TBCICOPY, TBCI::Mat_Brack< T >::tmat, and TBCI::BVector< T >::vec.
| TBCI::Vector< T >::Vector | ( | const vararg | va, | |
| ... | ||||
| ) | [inline] |
Definition at line 1695 of file vector.h.
References TBCI::BVector< T >::dim, TBCI::BVector< T >::keep, NEW, T, UNLIKELY, and TBCI::BVector< T >::vec.
| TBCI::Vector< T >::~Vector | ( | ) | [inline] |
| TBCI::Vector< T >::Vector | ( | const BVector< U > & | bv | ) | [inline, explicit] |
| tbci_traits<T>::const_refval_type TBCI::Vector< T >::operator() | ( | const unsigned long | i | ) | const [inline] |
| tbci_traits<T>::const_refval_type TBCI::Vector< T >::operator[] | ( | const unsigned long | i | ) | const [inline] |
| T& TBCI::Vector< T >::operator() | ( | const unsigned long | i | ) | [inline] |
| T& TBCI::Vector< T >::operator[] | ( | const unsigned long | i | ) | [inline] |
| Vector<T>& TBCI::Vector< T >::fill | ( | const T & | v | ) | [inline] |
Reimplemented from TBCI::BVector< T >.
Definition at line 1583 of file vector.h.
Referenced by TBCI::CTensor< T >::calc_indx().
| Vector<T>& TBCI::Vector< T >::clear | ( | ) | [inline] |
| TVector< T > TBCI::Vector< T >::slice | ( | unsigned long | i0, | |
| unsigned long | i1 | |||
| ) | const [inline] |
Definition at line 2282 of file vector.h.
References BCHK, TBCI::BVector< T >::dim, T, TBCICOPY, UNLIKELY, and TBCI::BVector< T >::vec.
Referenced by TBCI::Tensor< T >::cntrmul(), TBCI::ctrmul(), TBCI::dctmul(), and TBCI::Tensor< T >::drctmul().
| TVector< T > TBCI::Vector< T >::incr | ( | const unsigned long | wh, | |
| const T | i = (T)1 | |||
| ) | const [inline] |
| Vector<T>& TBCI::Vector< T >::operator= | ( | const T & | a | ) | [inline] |
| Vector<T>& TBCI::Vector< T >::operator= | ( | const Vector< T > & | v | ) | [inline] |
| Vector<T>& TBCI::Vector< T >::operator= | ( | const TSVector< T > & | ts | ) | [inline] |
| Vector<T>& TBCI::Vector< T >::operator= | ( | const TVector< T > & | tv | ) | [inline] |
| bool TBCI::Vector< T >::operator== | ( | const Vector< T > & | v | ) | const [inline] |
| bool TBCI::Vector< T >::operator!= | ( | const Vector< T > & | v | ) | const [inline] |
| bool TBCI::Vector< T >::operator== | ( | const TSVector< T > & | tsv | ) | const [inline] |
Reimplemented from TBCI::TVector< T >.
Definition at line 1721 of file vector.h.
References TBCI::TSVector< T >::destroy(), TBCI::TSVector< T >::dim, LIKELY, T, TBCICOMP, UNLIKELY, TBCI::TSVector< T >::vec, and TBCI::BVector< T >::vec.
| bool TBCI::Vector< T >::operator!= | ( | const TSVector< T > & | ts | ) | const [inline] |
| bool TBCI::Vector< T >::operator== | ( | const TVector< T > & | tv | ) | const [inline] |
| bool TBCI::Vector< T >::operator!= | ( | const TVector< T > & | tv | ) | const [inline] |
| bool TBCI::Vector< T >::operator<= | ( | const Vector< T > & | v | ) | const [inline] |
| bool TBCI::Vector< T >::operator>= | ( | const Vector< T > & | v | ) | const [inline] |
| bool TBCI::Vector< T >::operator< | ( | const Vector< T > & | v | ) | const [inline] |
| bool TBCI::Vector< T >::operator> | ( | const Vector< T > & | v | ) | const [inline] |
| TVector< T > TBCI::Vector< T >::operator+ | ( | const Vector< T > & | v | ) | const [inline] |
TV = V + V.
Definition at line 2116 of file vector.h.
References BCHK, TBCI::BVector< T >::dim, TBCI::TVector< T >::size(), STD_SMP_TEMPLATE3VV, and TBCI::BVector< T >::vec.
| TVector< T > TBCI::Vector< T >::operator- | ( | const Vector< T > & | v | ) | const [inline] |
TV = V - V.
Definition at line 2126 of file vector.h.
References BCHK, TBCI::BVector< T >::dim, TBCI::TVector< T >::size(), STD_SMP_TEMPLATE3VV, and TBCI::BVector< T >::vec.
| TVector< T > TBCI::Vector< T >::operator+ | ( | TVector< T > | tv | ) | const [inline] |
TV = V + TV transformed into TV += V.
Definition at line 2138 of file vector.h.
References BCHK, TBCI::BVector< T >::dim, TBCI::TVector< T >::size(), STD_SMP_TEMPLATE2V, and TBCI::BVector< T >::vec.
| TVector< T > TBCI::Vector< T >::operator- | ( | TVector< T > | tv | ) | const [inline] |
TV = V - TV transformed into -TV -= V.
Definition at line 2148 of file vector.h.
References BCHK, TBCI::BVector< T >::dim, TBCI::TVector< T >::size(), STD_SMP_TEMPLATE2V, and TBCI::BVector< T >::vec.
| TVector< T > TBCI::Vector< T >::operator+ | ( | const TSVector< T > & | ts | ) | const [inline] |
TV = V + TSV.
Definition at line 2160 of file vector.h.
References BCHK, TBCI::BVector< T >::dim, TBCI::TSVector< T >::dim, LIKELY, TBCI::TSVector< T >::mut, TBCI::BVector< T >::resize(), STD_SMP_TEMPLATE4V, TBCI::TSVector< T >::vec, and TBCI::BVector< T >::vec.
| TVector< T > TBCI::Vector< T >::operator- | ( | const TSVector< T > & | ts | ) | const [inline] |
TV = V - TSV.
Definition at line 2175 of file vector.h.
References BCHK, TBCI::BVector< T >::dim, TBCI::TSVector< T >::dim, LIKELY, TBCI::TSVector< T >::mut, TBCI::BVector< T >::resize(), STD_SMP_TEMPLATE4V, TBCI::TSVector< T >::vec, and TBCI::BVector< T >::vec.
| TVector< T > TBCI::Vector< T >::operator+ | ( | const T & | a | ) | const [inline] |
TV = V + T.
Definition at line 2191 of file vector.h.
References STD_SMP_TEMPLATE3VC, and TBCI::BVector< T >::vec.
| TVector< T > TBCI::Vector< T >::operator- | ( | const T & | a | ) | const [inline] |
TV = V - T.
Definition at line 2200 of file vector.h.
References STD_SMP_TEMPLATE3VC, and TBCI::BVector< T >::vec.
| TSVector< T > TBCI::Vector< T >::operator* | ( | const T & | a | ) | const [inline] |
| TSVector< T > TBCI::Vector< T >::operator/ | ( | const T & | a | ) | const [inline] |
| TVector< T > TBCI::Vector< T >::operator- | ( | ) | const [inline] |
| T TBCI::Vector< T >::operator* | ( | const Vector< T > & | a | ) | const [inline] |
Definition at line 1876 of file vector.h.
References BCHK, CACHELINE_SZ, LIKELY, PREFETCH_R, TBCI::TVector< T >::size(), SMP_VECSLICE, STD__, T, TBCI::thr_ctrl::t_res_dummy, THREAD_MAX_RES_LN, TBCI::thread_start(), TBCI::thread_wait(), TBCI::threads, TBCI::threads_avail(), and TBCI::BVector< T >::vec.
| T TBCI::Vector< T >::operator* | ( | TVector< T > & | tv | ) | const [inline] |
| T TBCI::Vector< T >::operator/ | ( | const Vector< T > & | a | ) | const [inline] |
Definition at line 2034 of file vector.h.
References ALIGN, BCHK, TBCI::Vector< T >::fabssqr(), MIN_ALIGN, std::norm(), and T.
| T TBCI::Vector< T >::min | ( | ) | const [inline] |
Definition at line 2042 of file vector.h.
References ALIGN, LIKELY, MIN_ALIGN, T, UNLIKELY, and TBCI::BVector< T >::vec.
Referenced by TBCI::Vector< T >::min(), TBCI::TSVector< T >::min(), and TBCI::TVector< unsigned >::min().
| T TBCI::Vector< T >::max | ( | ) | const [inline] |
Definition at line 2068 of file vector.h.
References ALIGN, LIKELY, MIN_ALIGN, T, UNLIKELY, and TBCI::BVector< T >::vec.
Referenced by TBCI::Vector< T >::max(), TBCI::TSVector< T >::max(), and TBCI::TVector< unsigned >::max().
| T TBCI::Vector< T >::min | ( | unsigned long & | pos | ) | const [inline] |
Definition at line 2054 of file vector.h.
References ALIGN, BCHK, LIKELY, TBCI::Vector< T >::min(), MIN_ALIGN, T, UNLIKELY, and TBCI::BVector< T >::vec.
| T TBCI::Vector< T >::max | ( | unsigned long & | pos | ) | const [inline] |
Definition at line 2080 of file vector.h.
References ALIGN, BCHK, LIKELY, TBCI::Vector< T >::max(), MIN_ALIGN, T, UNLIKELY, and TBCI::BVector< T >::vec.
| T TBCI::Vector< T >::sum | ( | ) | const [inline] |
Definition at line 2094 of file vector.h.
References ALIGN, MIN_ALIGN, T, and TBCI::BVector< T >::vec.
Referenced by TBCI::TVector< unsigned >::sum().
| double TBCI::Vector< T >::fabssqr | ( | ) | const [inline] |
Definition at line 2340 of file vector.h.
References LIKELY, LONG_DOUBLE, PREFETCH_R, TBCI::slice_offset(), SMP_VECSLICE, STD__, TBCI::thread_start(), TBCI::thread_wait_result(), TBCI::threads_avail(), and TBCI::BVector< T >::vec.
Referenced by TBCI::BiCGSTAB(), TBCI::fabssqr(), TBCI::TVector< unsigned >::fabssqr(), TBCI::operator/(), and TBCI::Vector< T >::operator/().
| double TBCI::Vector< T >::fabs | ( | ) | const [inline] |
| T TBCI::Vector< T >::abs | ( | ) | const [inline] |
| bool TBCI::Vector< T >::contains | ( | const T & | v | ) | const [inline] |
| static const char* TBCI::Vector< T >::vec_info | ( | ) | [inline, static] |
friend class TSVector< T > [friend] |
1.5.6