36 #ifndef MAT_VECTORGENERAL
37 #define MAT_VECTORGENERAL
45 template<
typename Treal,
typename Tvector>
46 class VectorGeneral :
public FileWritable {
62 if (other.vectorPtr.haveDataStructureGet()) {
69 (std::vector<Treal>
const & fullVector,
72 this->
vectorPtr->assignFromFull(fullVector);
74 inline void fullvector(std::vector<Treal> & fullVector)
const {
79 if (other.vectorPtr.haveDataStructureGet()) {
101 template<
typename Tmatrix>
108 template<
typename Tmatrix>
114 template<
typename Tmatrix>
123 template<
typename Tmatrix>
130 false, mv.tA, mv.tB));
135 template<
typename Tmatrix>
141 template<
typename Tmatrix>
147 template<
typename Tmatrix>
157 template<
typename Tmatrix>
216 template<
typename Treal,
typename Tvector>
217 template<
typename Tmatrix>
218 VectorGeneral<Treal, Tvector>&
219 VectorGeneral<Treal, Tvector>::operator=
224 vectorPtr.haveDataStructureSet(
true);
225 if (
this == &smv.C ) {
229 *tmp.vectorPtr, 0, *this->vectorPtr);
233 *smv.C.vectorPtr, 0, *this->vectorPtr);
238 template<
typename Treal,
typename Tvector>
239 template<
typename Tmatrix>
246 assert(
this != &smv.C);
248 *smv.C.vectorPtr, 1, *this->vectorPtr);
254 template<
typename Treal,
typename Tvector>
255 template<
typename Tmatrix>
263 assert(!smvpsv.tC && !smvpsv.tE);
264 assert(
this != &smvpsv.C);
265 if (
this == &smvpsv.E)
267 *smvpsv.C.vectorPtr, smvpsv.D, *this->vectorPtr);
269 throw Failure(
"VectorGeneral<Treal, Tvector>::operator="
270 "(const XYZpUV<Treal, "
271 "MatrixGeneral<Treal, Tmatrix>, "
272 "VectorGeneral<Treal, Tvector>, "
274 "VectorGeneral<Treal, Tvector> >&) : "
275 "y = alpha * op(A) * x + beta * z "
276 "not supported for z != y");
283 template<
typename Treal,
typename Tvector>
284 template<
typename Tmatrix>
291 assert(
this != &smv.C);
292 vectorPtr.haveDataStructureSet(
true);
294 *smv.C.vectorPtr, 0, *this->vectorPtr);
300 template<
typename Treal,
typename Tvector>
301 template<
typename Tmatrix>
308 assert(
this != &smv.C);
310 *smv.C.vectorPtr, 1, *this->vectorPtr);
315 template<
typename Treal,
typename Tvector>
316 template<
typename Tmatrix>
324 assert(!smvpsv.tC && !smvpsv.tE);
325 assert(
this != &smvpsv.C);
326 if (
this == &smvpsv.E)
328 *smvpsv.C.vectorPtr, smvpsv.D, *this->vectorPtr);
330 throw Failure(
"VectorGeneral<Treal, Tvector>::operator="
331 "(const XYZpUV<Treal, "
332 "MatrixSymmetric<Treal, Tmatrix>, "
333 "VectorGeneral<Treal, Tvector>, "
335 "VectorGeneral<Treal, Tvector> >&) : "
336 "y = alpha * A * x + beta * z "
337 "not supported for z != y");
344 template<
typename Treal,
typename Tvector>
345 template<
typename Tmatrix>
352 throw Failure(
"y = A * x not supported for y != x ");
362 template<
typename Treal,
typename Tvector>
367 assert(
this != &sv.B);
378 template<
typename Treal,
typename Tvector>
383 "Xtrans<VectorGeneral<Treal, Tvector> > const &,"
384 " VectorGeneral<Treal, Tvector> const &): "
385 "Dimension mismatch in vector operation");
void assign_from_full(std::vector< Treal > const &fullVector, SizesAndBlocks const &newRows)
Definition: VectorGeneral.h:69
VectorGeneral()
Definition: VectorGeneral.h:59
Normal matrix.
Definition: MatrixBase.h:47
ValidPtr< Tvector > vectorPtr
Definition: VectorGeneral.h:189
Proxy structs used by the matrix API.
void readFromFileProt(std::ifstream &file)
Read object from file.
Definition: VectorGeneral.h:197
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: gblas.h:407
Definition: MatrixBase.h:53
bool is_empty() const
Definition: VectorGeneral.h:54
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:155
Describes dimensions of matrix and its blocks on all levels.
Definition: SizesAndBlocks.h:37
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:204
static T dot(const int *n, const T *dx, const int *incx, const T *dy, const int *incy)
Definition: gblas.h:423
VectorGeneral< Treal, Tvector > & operator=(int const k)
Definition: VectorGeneral.h:175
Smart pointer class to control access to object.
Tvector const & getVector() const
Definition: VectorGeneral.h:185
This proxy expresses the result of multiplication of three objects, of possibly different types...
Definition: matrix_proxy.h:65
void writeToFileProt(std::ofstream &file) const
Write object to file.
Definition: VectorGeneral.h:191
This proxy expresses the result of transposition of an object of type TX.
Definition: matrix_proxy.h:116
static void axpy(const int *n, const T *da, const T *dx, const int *incx, T *dy, const int *incy)
Definition: gblas.h:429
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: gblas.h:398
void rand()
Definition: VectorGeneral.h:94
void clear()
Release memory for the information written to file.
Definition: VectorGeneral.h:86
void resetSizesAndBlocks(SizesAndBlocks const &newRows)
Definition: VectorGeneral.h:49
Write and read objects to/from file.
Definition: FileWritable.h:54
VectorGeneral< Treal, Tvector > & operator=(const VectorGeneral< Treal, Tvector > &other)
Definition: VectorGeneral.h:78
VectorGeneral(const VectorGeneral< Treal, Tvector > &other)
Definition: VectorGeneral.h:60
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: gblas.h:389
VectorGeneral< Treal, Tvector > & operator*=(Treal const alpha)
Definition: VectorGeneral.h:169
Treal eucl() const
Definition: VectorGeneral.h:164
This proxy expresses the result of multiplication of two objects, of possibly different types...
Definition: matrix_proxy.h:49
std::string obj_type_id() const
Definition: VectorGeneral.h:187
void haveDataStructureSet(bool val)
Definition: ValidPtr.h:97
void fullvector(std::vector< Treal > &fullVector) const
Definition: VectorGeneral.h:74
Abstract class for simple writing and reading of objects to/from file.
bool haveDataStructureGet() const
Definition: ValidPtr.h:100
Symmetric matrix.
Definition: MatrixBase.h:49
This proxy expresses the result of multiplication of three objects added to two other multiplied obje...
Definition: matrix_proxy.h:86
void inMemorySet(bool val)
Definition: ValidPtr.h:91