38 #ifndef MAT_VECTORGENERAL 39 #define MAT_VECTORGENERAL 47 template<
typename Treal,
typename Tvector>
48 class VectorGeneral :
public FileWritable {
70 if (other.vectorPtr.haveDataStructureGet()) {
77 (std::vector<Treal>
const & fullVector,
80 this->
vectorPtr->assignFromFull(fullVector);
82 inline void fullvector(std::vector<Treal> & fullVector)
const {
87 if (other.vectorPtr.haveDataStructureGet()) {
109 template<
typename Tmatrix>
116 template<
typename Tmatrix>
122 template<
typename Tmatrix>
131 template<
typename Tmatrix>
138 false, mv.tA, mv.tB));
143 template<
typename Tmatrix>
149 template<
typename Tmatrix>
155 template<
typename Tmatrix>
165 template<
typename Tmatrix>
224 template<
typename Treal,
typename Tvector>
225 template<
typename Tmatrix>
226 VectorGeneral<Treal, Tvector>&
227 VectorGeneral<Treal, Tvector>::operator=
232 vectorPtr.haveDataStructureSet(
true);
233 if (
this == &smv.C ) {
237 *tmp.vectorPtr, 0, *this->vectorPtr);
241 *smv.C.vectorPtr, 0, *this->vectorPtr);
246 template<
typename Treal,
typename Tvector>
247 template<
typename Tmatrix>
254 assert(
this != &smv.C);
256 *smv.C.vectorPtr, 1, *this->vectorPtr);
262 template<
typename Treal,
typename Tvector>
263 template<
typename Tmatrix>
271 assert(!smvpsv.tC && !smvpsv.tE);
272 assert(
this != &smvpsv.C);
273 if (
this == &smvpsv.E)
275 *smvpsv.C.vectorPtr, smvpsv.D, *this->vectorPtr);
277 throw Failure(
"VectorGeneral<Treal, Tvector>::operator=" 278 "(const XYZpUV<Treal, " 279 "MatrixGeneral<Treal, Tmatrix>, " 280 "VectorGeneral<Treal, Tvector>, " 282 "VectorGeneral<Treal, Tvector> >&) : " 283 "y = alpha * op(A) * x + beta * z " 284 "not supported for z != y");
291 template<
typename Treal,
typename Tvector>
292 template<
typename Tmatrix>
299 assert(
this != &smv.C);
300 vectorPtr.haveDataStructureSet(
true);
302 *smv.C.vectorPtr, 0, *this->vectorPtr);
308 template<
typename Treal,
typename Tvector>
309 template<
typename Tmatrix>
316 assert(
this != &smv.C);
318 *smv.C.vectorPtr, 1, *this->vectorPtr);
323 template<
typename Treal,
typename Tvector>
324 template<
typename Tmatrix>
332 assert(!smvpsv.tC && !smvpsv.tE);
333 assert(
this != &smvpsv.C);
334 if (
this == &smvpsv.E)
336 *smvpsv.C.vectorPtr, smvpsv.D, *this->vectorPtr);
338 throw Failure(
"VectorGeneral<Treal, Tvector>::operator=" 339 "(const XYZpUV<Treal, " 340 "MatrixSymmetric<Treal, Tmatrix>, " 341 "VectorGeneral<Treal, Tvector>, " 343 "VectorGeneral<Treal, Tvector> >&) : " 344 "y = alpha * A * x + beta * z " 345 "not supported for z != y");
352 template<
typename Treal,
typename Tvector>
353 template<
typename Tmatrix>
360 throw Failure(
"y = A * x not supported for y != x ");
370 template<
typename Treal,
typename Tvector>
375 assert(
this != &sv.B);
386 template<
typename Treal,
typename Tvector>
391 "Xtrans<VectorGeneral<Treal, Tvector> > const &," 392 " VectorGeneral<Treal, Tvector> const &): " 393 "Dimension mismatch in vector operation");
void assign_from_full(std::vector< Treal > const &fullVector, SizesAndBlocks const &newRows)
Definition: VectorGeneral.h:77
VectorGeneral()
Definition: VectorGeneral.h:67
Normal matrix.
Definition: MatrixBase.h:49
std::string obj_type_id() const
Definition: VectorGeneral.h:195
ValidPtr< Tvector > vectorPtr
Definition: VectorGeneral.h:197
Proxy structs used by the matrix API.
void fullvector(std::vector< Treal > &fullVector) const
Definition: VectorGeneral.h:82
void readFromFileProt(std::ifstream &file)
Read object from file.
Definition: VectorGeneral.h:205
static void trmv(const char *uplo, const char *trans, const char *diag, const int *n, const T *A, const int *lda, T *x, const int *incx)
Definition: mat_gblas.h:409
Definition: MatrixBase.h:55
Definition: allocate.cc:39
XY< TX, TY > operator*(Xtrans< TX > const &trAA, Xtrans< TY > const &trBB)
Multiplication of two transposition proxys holding objects of type TX and TY respectively.
Definition: matrix_proxy.h:157
Describes dimensions of matrix and its blocks on all levels.
Definition: SizesAndBlocks.h:45
void clear_structure()
Definition: VectorGeneral.h:60
void inMemorySet(bool inMem)
Make object invalid (false) via this function when object is written to file and valid (true) when ob...
Definition: VectorGeneral.h:212
static T dot(const int *n, const T *dx, const int *incx, const T *dy, const int *incy)
Definition: mat_gblas.h:425
VectorGeneral< Treal, Tvector > & operator=(int const k)
Definition: VectorGeneral.h:183
Smart pointer class to control access to object.
bool haveDataStructureGet() const
Definition: ValidPtr.h:102
This proxy expresses the result of multiplication of three objects, of possibly different types...
Definition: matrix_proxy.h:67
This proxy expresses the result of transposition of an object of type TX.
Definition: matrix_proxy.h:118
bool is_empty() const
Definition: VectorGeneral.h:56
static void axpy(const int *n, const T *da, const T *dx, const int *incx, T *dy, const int *incy)
Definition: mat_gblas.h:431
static void symv(const char *uplo, const int *n, const T *alpha, const T *A, const int *lda, const T *x, const int *incx, const T *beta, T *y, const int *incy)
Definition: mat_gblas.h:400
void rand()
Definition: VectorGeneral.h:102
void clear()
Release memory for the information written to file.
Definition: VectorGeneral.h:94
void resetSizesAndBlocks(SizesAndBlocks const &newRows)
Definition: VectorGeneral.h:51
Write and read objects to/from file.
Definition: FileWritable.h:56
VectorGeneral< Treal, Tvector > & operator=(const VectorGeneral< Treal, Tvector > &other)
Definition: VectorGeneral.h:86
VectorGeneral(const VectorGeneral< Treal, Tvector > &other)
Definition: VectorGeneral.h:68
VectorGeneral(SizesAndBlocks const &newRows)
Definition: VectorGeneral.h:64
Treal eucl() const
Definition: VectorGeneral.h:172
static void gemv(const char *ta, const int *m, const int *n, const T *alpha, const T *A, const int *lda, const T *x, const int *incx, const T *beta, T *y, const int *incy)
Definition: mat_gblas.h:391
VectorGeneral< Treal, Tvector > & operator*=(Treal const alpha)
Definition: VectorGeneral.h:177
Tvector const & getVector() const
Definition: VectorGeneral.h:193
This proxy expresses the result of multiplication of two objects, of possibly different types...
Definition: matrix_proxy.h:51
void haveDataStructureSet(bool val)
Definition: ValidPtr.h:99
Abstract class for simple writing and reading of objects to/from file.
void writeToFileProt(std::ofstream &file) const
Write object to file.
Definition: VectorGeneral.h:199
Symmetric matrix.
Definition: MatrixBase.h:51
This proxy expresses the result of multiplication of three objects added to two other multiplied obje...
Definition: matrix_proxy.h:88
void inMemorySet(bool val)
Definition: ValidPtr.h:93