23 #ifndef SELDON_FILE_FUNCTIONS_VECTOR_HXX
25 #define SELDON_FILE_FUNCTIONS_VECTOR_HXX
69 class T1,
class Storage1,
class Allocator1>
71 Vector<T1, Storage1, Allocator1>& X)
throw();
83 class T1,
class Storage1,
class Allocator1,
84 class T2,
class Storage2,
class Allocator2>
86 const Vector<T1, Storage1, Allocator1>& X,
87 Vector<T2, Storage2, Allocator2>& Y);
90 class T1,
class Storage1,
class Allocator1,
91 class T2,
class Storage2,
class Allocator2>
93 const Vector<T1, Storage1, Allocator1>& X,
95 Vector<T2, Storage2, Allocator2>& Y);
98 class T1,
class Allocator1,
99 class T2,
class Allocator2>
101 const Vector<T1, PETScSeq, Allocator1>& X,
102 Vector<T2, PETScSeq, Allocator2>& Y);
105 class T1,
class Allocator1,
106 class T2,
class Allocator2>
108 const Vector<T1, PETScPar, Allocator1>& X,
109 Vector<T2, PETScPar, Allocator2>& Y);
112 class T1,
class Allocator1,
113 class T2,
class Allocator2>
115 const Vector<T1, VectSparse, Allocator1>& X,
116 Vector<T2, VectSparse, Allocator2>& Y);
119 class T1,
class Allocator1,
120 class T2,
class Allocator2>
122 const Vector<T1, VectSparse, Allocator1>& X,
123 Vector<T2, VectFull, Allocator2>& Y);
126 class T1,
class Allocator1,
127 class T2,
class Allocator2>
129 const Vector<T1, Collection, Allocator1>& X,
130 Vector<T2, Collection, Allocator2>& Y);
133 class T1,
template <
class U1>
class Allocator1,
134 class T2,
template <
class U2>
class Allocator2>
137 Vector<FloatDouble, DenseSparseCollection, Allocator1<T1> >& X,
138 Vector<FloatDouble, DenseSparseCollection, Allocator2<T2> >& Y);
141 class T1,
template <
class U1>
class Allocator1,
142 class T2,
class Storage2,
class Allocator2>
145 Vector<FloatDouble, DenseSparseCollection, Allocator1<T1> >& X,
146 Vector<T2, Storage2, Allocator2>& Y);
156 template <
class T1,
class Storage1,
class Allocator1,
157 class T2,
class Storage2,
class Allocator2>
158 void CopyVector(
const Vector<T1, Storage1, Allocator1>& X,
159 Vector<T2, Storage2, Allocator2>& Y);
161 template <
class T1,
class Allocator1,
162 class T2,
class Allocator2>
163 void CopyVector(
const Vector<T1, Collection, Allocator1>& X,
164 Vector<T2, VectFull, Allocator2>& Y);
166 template<
class T,
class Alloc1,
class Alloc2>
167 void CopyVector(
const Vector<T, PETScPar, Alloc1>& A,
168 Vector<T, VectFull, Alloc2>& B);
170 template<
class T,
class Alloc1,
class Alloc2>
171 void CopyVector(
const Vector<T, VectFull, Alloc1>& A,
172 Vector<T, PETScPar, Alloc2>& B);
183 template <
class T,
class Storage,
class Allocator>
184 void Swap(Vector<T, Storage, Allocator>& X,
185 Vector<T, Storage, Allocator>& Y);
187 template <
class T,
class Allocator>
188 void Swap(Vector<T, VectSparse, Allocator>& X,
189 Vector<T, VectSparse, Allocator>& Y);
203 template<
class T1,
class Storage1,
class Allocator1,
204 class T2,
class Storage2,
class Allocator2>
206 const Vector<T2, Storage2, Allocator2>& Y);
208 template<
class T1,
class Allocator1,
209 class T2,
class Allocator2>
210 typename T1::value_type
212 const Vector<T2, Collection, Allocator2>& Y);
214 template<
class T1,
template <
class U1>
class Allocator1,
215 class T2,
template <
class U2>
class Allocator2>
218 Vector<FloatDouble, DenseSparseCollection, Allocator1<T1> >& X,
220 Vector<FloatDouble, DenseSparseCollection, Allocator2<T2> >& Y);
222 template<
class T1,
class Storage1,
class Allocator1,
223 class T2,
class Storage2,
class Allocator2>
225 const Vector<T2, Storage2, Allocator2>& Y);
227 template<
class T1,
class Allocator1,
228 class T2,
class Allocator2>
229 T1
DotProdVector(
const Vector<T1, VectSparse, Allocator1>& X,
230 const Vector<T2, VectSparse, Allocator2>& Y);
232 template<
class T1,
class Allocator1,
233 class T2,
class Allocator2>
234 T1
DotProdVector(
const Vector<T1, VectSparse, Allocator1>& X,
235 const Vector<T2, VectFull, Allocator2>& Y);
237 template<
class T1,
class Allocator1,
238 class T2,
class Allocator2>
240 const Vector<T2, VectSparse, Allocator2>& Y);
242 template<
class T1,
class Allocator1,
243 class T2,
class Allocator2>
246 const Vector<T2, VectSparse, Allocator2>& Y);
248 template<
class T1,
class Allocator1,
249 class T2,
class Allocator2>
252 const Vector<T2, VectFull, Allocator2>& Y);
263 template<
class T1,
class Storage1,
class Allocator1>
264 typename ClassComplexType<T1>::Treal
265 Norm1(
const Vector<T1, Storage1, Allocator1>& X);
267 template<
class T1,
class Allocator1>
268 typename ClassComplexType<T1>::Treal
269 Norm1(
const Vector<T1, VectSparse, Allocator1>& X);
280 template<
class T1,
class Storage1,
class Allocator1>
281 T1
Norm2(
const Vector<T1, Storage1, Allocator1>& X);
283 template<
class T1,
class Storage1,
class Allocator1>
284 T1
Norm2(
const Vector<complex<T1>, Storage1, Allocator1>& X);
286 template<
class T1,
class Allocator1>
287 T1
Norm2(
const Vector<T1, VectSparse, Allocator1>& X);
289 template<
class T1,
class Allocator1>
290 T1
Norm2(
const Vector<complex<T1>, VectSparse, Allocator1>& X);
301 template<
class T,
class Storage,
class Allocator>
314 void GenRot(T& a_in, T& b_in, T& c_, T& s_);
317 void GenRot(complex<T>& a_in, complex<T>& b_in, T& c_, complex<T>& s_);
320 void ApplyRot(T& x, T& y,
const T& c_,
const T& s_);
323 void ApplyRot(complex<T>& x, complex<T>& y,
324 const T& c_,
const complex<T>& s_);
326 template<
class T,
class Allocator1,
class Allocator2>
327 void ApplyRot(Vector<T, VectFull, Allocator1>& X,
328 Vector<T, VectFull, Allocator2>& Y,
329 const T& c,
const T& s);
331 template<
class T,
class Allocator1,
class Allocator2>
332 void ApplyRot(Vector<T, VectSparse, Allocator1>& X,
333 Vector<T, VectFull, Allocator2>& Y,
334 const T& c,
const T& s);
345 template <
class T0,
class Storage0,
class Allocator0,
346 class T1,
class Storage1,
class Allocator1>
347 void CheckDim(
const Vector<T0, Storage0, Allocator0>& X,
348 const Vector<T1, Storage1, Allocator1>& Y,
349 string function =
"",
string op =
"X + Y");
351 template <
class T0,
class Allocator0,
352 class T1,
class Allocator1>
353 void CheckDim(
const Vector<T0, VectSparse, Allocator0>& X,
354 const Vector<T1, VectSparse, Allocator1>& Y,
355 string function =
"",
string op =
"X + Y");
357 template <
class T0,
class Allocator0,
358 class T1,
class Allocator1>
359 void CheckDim(
const Vector<T0, Collection, Allocator0>& X,
360 const Vector<T1, Collection, Allocator1>& Y,
361 string function =
"",
string op =
"X + Y");
363 template <
class T0,
class Allocator0,
class Allocator00,
364 class T1,
class Allocator1,
class Allocator11>
365 void CheckDim(
const Vector<Vector<T0, VectSparse, Allocator0>,
366 Collection, Allocator00>& X,
367 const Vector<Vector<T1, VectSparse, Allocator1>,
368 Collection, Allocator11>& Y,
369 string function =
"",
string op =
"X + Y");
371 template <
class T0,
class Allocator0,
372 class T1,
class Allocator1>
373 void CheckDim(
const Vector<T0, VectFull, Allocator0>& X,
374 Vector<T1, Collection, Allocator1>& Y,
375 string function =
"",
string op =
"X + Y");
377 template <
class T0,
template <
class U0>
class Allocator0,
378 class T1,
template <
class U1>
class Allocator1>
381 Vector<FloatDouble, DenseSparseCollection, Allocator0<T0> >& X,
383 Vector<FloatDouble, DenseSparseCollection, Allocator1<T1> >& Y,
384 string function =
"",
string op =
"X + Y");
395 template<
class T,
class Allocator1,
class Allocator2>
396 void GatherSparseEntry(
const Vector<T, VectFull, Allocator1>& y,
397 Vector<T, VectSparse, Allocator2>& x);
399 template<
class T,
class Allocator1,
class Allocator2>
400 void GatherSparseEntryZero(Vector<T, VectFull, Allocator1>& y,
401 Vector<T, VectSparse, Allocator2>& x);
403 template<
class T,
class Allocator1,
class Allocator2>
404 void ScatterSparseEntry(
const Vector<T, VectSparse, Allocator1>& x,
405 Vector<T, VectFull, Allocator2>& y);
416 template<
class T,
class Prop,
class Allocator>
417 void Conjugate(Vector<T, Prop, Allocator>& X);
419 template<
class T,
class Allocator>
420 void Conjugate(Vector<T, VectSparse, Allocator>& X);