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");