Go to the documentation of this file.
38 #ifndef MAT_VECTORGENERAL
39 #define MAT_VECTORGENERAL
47 template<
typename Treal,
typename Tvector>
48 class VectorGeneral :
public FileWritable {
70 #if __cplusplus >= 201103L
76 if (other.vectorPtr.haveDataStructureGet()) {
83 (std::vector<Treal>
const & fullVector,
86 this->
vectorPtr->assignFromFull(fullVector);
88 inline void fullvector(std::vector<Treal> & fullVector)
const {
93 if (other.vectorPtr.haveDataStructureGet()) {
115 template<
typename Tmatrix>
122 template<
typename Tmatrix>
128 template<
typename Tmatrix>
137 template<
typename Tmatrix>
144 false, mv.tA, mv.tB));
149 template<
typename Tmatrix>
155 template<
typename Tmatrix>
161 template<
typename Tmatrix>
171 template<
typename Tmatrix>
230 template<
typename Treal,
typename Tvector>
231 template<
typename Tmatrix>
232 VectorGeneral<Treal, Tvector>&
238 vectorPtr.haveDataStructureSet(
true);
239 if (
this == &smv.C ) {
243 *tmp.vectorPtr, 0, *this->vectorPtr);
247 *smv.C.vectorPtr, 0, *this->vectorPtr);
252 template<
typename Treal,
typename Tvector>
253 template<
typename Tmatrix>
260 assert(
this != &smv.C);
262 *smv.C.vectorPtr, 1, *this->vectorPtr);
268 template<
typename Treal,
typename Tvector>
269 template<
typename Tmatrix>
277 assert(!smvpsv.tC && !smvpsv.tE);
278 assert(
this != &smvpsv.C);
279 if (
this == &smvpsv.E)
281 *smvpsv.C.vectorPtr, smvpsv.D, *this->vectorPtr);
283 throw Failure(
"VectorGeneral<Treal, Tvector>::operator="
284 "(const XYZpUV<Treal, "
285 "MatrixGeneral<Treal, Tmatrix>, "
286 "VectorGeneral<Treal, Tvector>, "
288 "VectorGeneral<Treal, Tvector> >&) : "
289 "y = alpha * op(A) * x + beta * z "
290 "not supported for z != y");
297 template<
typename Treal,
typename Tvector>
298 template<
typename Tmatrix>
305 assert(
this != &smv.C);
306 vectorPtr.haveDataStructureSet(
true);
308 *smv.C.vectorPtr, 0, *this->vectorPtr);
314 template<
typename Treal,
typename Tvector>
315 template<
typename Tmatrix>
322 assert(
this != &smv.C);
324 *smv.C.vectorPtr, 1, *this->vectorPtr);
329 template<
typename Treal,
typename Tvector>
330 template<
typename Tmatrix>
338 assert(!smvpsv.tC && !smvpsv.tE);
339 assert(
this != &smvpsv.C);
340 if (
this == &smvpsv.E)
342 *smvpsv.C.vectorPtr, smvpsv.D, *this->vectorPtr);
344 throw Failure(
"VectorGeneral<Treal, Tvector>::operator="
345 "(const XYZpUV<Treal, "
346 "MatrixSymmetric<Treal, Tmatrix>, "
347 "VectorGeneral<Treal, Tvector>, "
349 "VectorGeneral<Treal, Tvector> >&) : "
350 "y = alpha * A * x + beta * z "
351 "not supported for z != y");
358 template<
typename Treal,
typename Tvector>
359 template<
typename Tmatrix>
366 throw Failure(
"y = A * x not supported for y != x ");
376 template<
typename Treal,
typename Tvector>
381 assert(
this != &sv.B);
392 template<
typename Treal,
typename Tvector>
397 "Xtrans<VectorGeneral<Treal, Tvector> > const &,"
398 " VectorGeneral<Treal, Tvector> const &): "
399 "Dimension mismatch in vector operation");
VectorGeneral(const VectorGeneral< Treal, Tvector > &other)
Definition: VectorGeneral.h:73
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
Write and read objects to/from file.
Definition: FileWritable.h:56
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
VectorGeneral< Treal, Tvector > & operator=(const VectorGeneral< Treal, Tvector > &other)
Definition: VectorGeneral.h:92
void clear()
Definition: VectorGeneral.h:100
Treal eucl() const
Definition: VectorGeneral.h:178
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
This proxy expresses the result of multiplication of three objects, of possibly different types,...
Definition: matrix_proxy.h:67
VectorGeneral< Treal, Tvector > & operator*=(Treal const alpha)
Definition: VectorGeneral.h:183
Symmetric matrix.
Definition: MatrixBase.h:51
void resetSizesAndBlocks(SizesAndBlocks const &newRows)
Definition: VectorGeneral.h:51
void inMemorySet(bool inMem)
Definition: VectorGeneral.h:218
VectorGeneral(SizesAndBlocks const &newRows)
Definition: VectorGeneral.h:64
void haveDataStructureSet(bool val)
Definition: ValidPtr.h:99
bool is_empty() const
Definition: VectorGeneral.h:56
Definition: MatrixBase.h:55
Normal matrix.
Definition: MatrixBase.h:49
Tvector const & getVector() const
Definition: VectorGeneral.h:199
Definition: allocate.cc:39
VectorGeneral< Treal, Tvector > & operator=(int const k)
Definition: VectorGeneral.h:189
std::string obj_type_id() const
Definition: VectorGeneral.h:201
void inMemorySet(bool val)
Definition: ValidPtr.h:93
This proxy expresses the result of multiplication of three objects added to two other multiplied obje...
Definition: matrix_proxy.h:88
void readFromFileProt(std::ifstream &file)
Definition: VectorGeneral.h:211
void rand()
Definition: VectorGeneral.h:108
void fullvector(std::vector< Treal > &fullVector) const
Definition: VectorGeneral.h:88
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
void writeToFileProt(std::ofstream &file) const
Definition: VectorGeneral.h:205
This proxy expresses the result of multiplication of two objects, of possibly different types,...
Definition: matrix_proxy.h:51
This proxy expresses the result of transposition of an object of type TX.
Definition: matrix_proxy.h:118
Describes dimensions of matrix and its blocks on all levels.
Definition: SizesAndBlocks.h:45
void assign_from_full(std::vector< Treal > const &fullVector, SizesAndBlocks const &newRows)
Definition: VectorGeneral.h:83
ValidPtr< Tvector > vectorPtr
Definition: VectorGeneral.h:203
void clear_structure()
Definition: VectorGeneral.h:60
VectorGeneral()
Definition: VectorGeneral.h:67
static T dot(const int *n, const T *dx, const int *incx, const T *dy, const int *incy)
Definition: mat_gblas.h:425
bool haveDataStructureGet() const
Definition: ValidPtr.h:102
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