Class xlifepp::VectorEntry#
-
class VectorEntry#
-
Collaboration diagram for xlifepp::VectorEntry:
small class handling current types of Vector shadowing template parameter of Vector
Public Functions
-
VectorEntry()#
-
default constructor
default constructor: real vector of size 0
-
VectorEntry(const complex_t&, number_t n)#
-
constructor from constant complex_t value and vector size
-
VectorEntry(const Vector<complex_t>&)#
-
constructor from a complex vector
constructor from a vector of complexes
-
VectorEntry(const Vector<complex_t>&, number_t n)#
-
constructor from constant Vector<complex_t> value and vector size
-
VectorEntry(const Vector<real_t>&)#
-
constructor from a real vector
constructor from a vector of reals
-
VectorEntry(const Vector<real_t>&, number_t n)#
-
constructor from constant Vector<real_t> value and vector size
-
VectorEntry(const VectorEntry&)#
-
copy constructor
-
VectorEntry(ValueType, number_t nv, number_t n = 0)#
-
constructor from explicit vector type and vector size
constructor from explicit vector type and vector size n
-
VectorEntry(ValueType, StrucType, number_t n = 0, number_t nv = 1)#
-
constructor from explicit vector type and vector size
-
~VectorEntry()#
-
destructor
-
void add(const VectorEntry&, complex_t)#
-
add to current entry an entry multiplied by a complex scalar
-
void add(const VectorEntry&, const std::vector<number_t>&, complex_t)#
-
add to current entry at given positions an entry multiplied by a complex scalar
-
void add(const VectorEntry&, const std::vector<number_t>&, real_t)#
-
add to current entry at given positions an entry multiplied by a real scalar
add to current entry, at the positions given by pos, the entry ve multiplied by the constant a pos is the vector giving the position of the n-th (>=1) coefficients of ve in the current entry
-
void add(const VectorEntry&, real_t)#
-
add to current entry an entry multiplied by a real scalar
add to current entry the entry v multiplied by the constant a it is assumed that structure types and value types are consistent
-
Vector<complex_t> &asVector(Vector<complex_t>&) const#
-
return as Vector<complex_t>
-
Vector<real_t> &asVector(Vector<real_t>&) const#
-
return as Vector<real_t>
-
Vector<Vector<complex_t>> &asVector(Vector<Vector<complex_t>>&) const#
-
return as Vector<Vector<complex_t> >
-
inline Vector<Vector<complex_t>>::const_iterator begincv() const#
-
const iterator to the first complex vector value
-
inline Vector<Vector<real_t>>::const_iterator beginrv() const#
-
const iterator to the first real vector value
-
void clear()#
-
deallocate memory used by a VectorEntry
-
string_t encodeFileName(const string_t &fn) const#
-
encode file name with some additional informations
-
template<>
Vector<real_t> *entriesp() const#
-
specialization (no check of null pointer, do it before!)
-
void extractComponent(const VectorEntry&, dimen_t)#
-
extract component i from vector entry of type vector<vector<K> >
-
void getEntry(number_t, Vector<complex_t>&) const#
-
get (i) complex matrix value (indices start from 1)
-
Value getValue(number_t) const#
-
get (i) as value (indices start from 1)
get (i) and set (i) as value (indices start from 1)
-
bool isEmpty() const#
-
true if no one of pointers allocated
-
complex_t maxValAbs() const#
-
return the value (in complex) of component being the largest one in absolute value
-
void moveColumns(const std::vector<number_t>&)#
-
move columns according to a map
move columns according to a map m between current entries and a vector entries of dim n=size(m) the map m= (m1, …, mk, …) gives the displacement of columns in set {1,2,…n} : the column mk moves at position k mk=0 means that the column k is 0 example: m=[0 2 1] : [col1, col2, …] –> [0 col2 col1] Numbering starts at 1
-
real_t norm2() const#
-
intern norm2
-
VectorEntry &operator*=(const complex_t&)#
-
operation U*=c
-
VectorEntry &operator*=(const real_t&)#
-
operation U*=r
-
VectorEntry &operator+=(const VectorEntry&)#
-
operation U+=V (same size, but value types may be different)
-
VectorEntry &operator-=(const VectorEntry&)#
-
operation U+=V (same size, but value types may be different)
-
VectorEntry &operator/=(const complex_t&)#
-
operation U/=c
-
VectorEntry &operator/=(const real_t&)#
-
operation U/=r
-
VectorEntry &operator=(const VectorEntry&)#
-
assign operator (full copy)
-
void print(std::ostream&) const#
-
print entries on ostream
-
void printFirst(std::ostream&, number_t, std::vector<string_t> comment = std::vector<string_t>()) const#
-
print first n entries
-
void printLast(std::ostream&, number_t, std::vector<string_t> comment = std::vector<string_t>()) const#
-
print last n entries
-
VectorEntry &round(real_t prec = 0.)#
-
round with a given precision (0 no round)
-
VectorEntry &roundToZero(real_t aszero = std::sqrt(theEpsilon))#
-
round to zero all coefficients close to 0 (|.
| < aszero)
-
inline void saveToFile(const string_t &fn, bool encode) const#
-
save VectorEntry to file
-
void saveToFile(const string_t &fn, number_t prec = fullPrec, bool encode = false) const#
-
save VectorEntry to file
-
void setEntry(number_t, const Vector<complex_t>&)#
-
set (i) complex matrix value (indices start from 1)
-
VectorEntry &toAbs()#
-
v -> abs(v) (modify current entries to real entries)
transform current data to abs, real and imaginary part in any case, these functions transform entries v to real entries
-
VectorEntry &toComplex()#
-
modify current entries to complex entries if they are not
-
VectorEntry &toConj()#
-
v -> conjugate of v (modify current entries), if real nothing is done
-
VectorEntry &toImag()#
-
v -> imaginary part of v (modify current entries to real entries)
-
VectorEntry &toReal()#
-
v -> real part of v (modify current entries to real entries)
-
VectorEntry *toScalar()#
-
create new scalar vector entry from non scalar vector entry
-
VectorEntry &toVector(dimen_t n, dimen_t i)#
-
if scalar entries, modify current scalar entries to vector entries (1<=i<=n)
Public Members
Friends
-
friend std::ostream &operator<<(std::ostream&, const VectorEntry&)#
-
output VectorEntry on stream
-
VectorEntry()#