Blas_1.cxx
1 // Copyright (C) 2001-2009 Vivien Mallet
2 //
3 // This file is part of the linear-algebra library Seldon,
4 // http://seldon.sourceforge.net/.
5 //
6 // Seldon is free software; you can redistribute it and/or modify it under the
7 // terms of the GNU Lesser General Public License as published by the Free
8 // Software Foundation; either version 2.1 of the License, or (at your option)
9 // any later version.
10 //
11 // Seldon is distributed in the hope that it will be useful, but WITHOUT ANY
12 // WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13 // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
14 // more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public License
17 // along with Seldon. If not, see http://www.gnu.org/licenses/.
18 
19 
20 #ifndef SELDON_FILE_BLAS_1_CXX
21 
22 
23 #include "Blas_1.hxx"
24 
25 
26 namespace Seldon
27 {
28 
29 #ifndef SELDON_WITH_COMPILED_LIBRARY
30  // GenRot //
32 
33 
34  void GenRot(float& a, float& b, float& c, float& d)
35  {
36  cblas_srotg(&a, &b, &c, &d);
37  }
38 
39 
40  void GenRot(double& a, double& b, double& c, double& d)
41  {
42  cblas_drotg(&a, &b, &c, &d);
43  }
44 
45 
46  // GenRot //
48 
49 
50 
52  // GenModifRot //
53 
54 
55  void GenModifRot(float& d1, float& d2,
56  float& x1, const float& y1,
57  float* param)
58  {
59  cblas_srotmg(&d1, &d2, &x1, y1, param);
60  }
61 
62 
63  void GenModifRot(double& d1, double& d2,
64  double& x1, const double& y1,
65  double* param)
66  {
67  cblas_drotmg(&d1, &d2, &x1, y1, param);
68  }
69 
70 
71  // GenModifRot //
73 #endif
74 
75 
76 
78  // ApplyRot //
79 
80 
81  template <class Allocator>
82  void ApplyRot(Vector<float, VectFull, Allocator>& X,
83  Vector<float, VectFull, Allocator>& Y,
84  const float& c, const float& s)
85  {
86  cblas_srot(X.GetLength(), X.GetData(), 1,
87  Y.GetData(), 1, c, s);
88  }
89 
90 
91  template <class Allocator>
92  void ApplyRot(Vector<double, VectFull, Allocator>& X,
93  Vector<double, VectFull, Allocator>& Y,
94  const double& c, const double& s)
95  {
96  cblas_drot(X.GetLength(), X.GetData(), 1,
97  Y.GetData(), 1, c, s);
98  }
99 
100 
101  // ApplyRot //
103 
104 
105 
107  // ApplyModifRot //
108 
109 
110  template <class Allocator>
111  void ApplyModifRot(Vector<float, VectFull, Allocator>& X,
112  Vector<float, VectFull, Allocator>& Y,
113  const float* param)
114  {
115  cblas_srotm(X.GetLength(), X.GetData(), 1,
116  Y.GetData(), 1, param);
117  }
118 
119 
120  template <class Allocator>
121  void ApplyModifRot(Vector<double, VectFull, Allocator>& X,
122  Vector<double, VectFull, Allocator>& Y,
123  const double* param)
124  {
125  cblas_drotm(X.GetLength(), X.GetData(), 1,
126  Y.GetData(), 1, param);
127  }
128 
129 
130  // ApplyModifRot //
132 
133 
134 
136  // Swap //
137 
138 
139  template <class Allocator>
140  void Swap(Vector<float, VectFull, Allocator>& X,
141  Vector<float, VectFull, Allocator>& Y)
142  {
143 
144 #ifdef SELDON_CHECK_DIMENSIONS
145  CheckDim(X, Y, "Swap(X, Y)", "X <-> Y");
146 #endif
147 
148  cblas_sswap(X.GetLength(), X.GetData(), 1,
149  Y.GetData(), 1);
150  }
151 
152 
153  template <class Allocator>
154  void Swap(Vector<double, VectFull, Allocator>& X,
155  Vector<double, VectFull, Allocator>& Y)
156  {
157 
158 #ifdef SELDON_CHECK_DIMENSIONS
159  CheckDim(X, Y, "Swap(X, Y)", "X <-> Y");
160 #endif
161 
162  cblas_dswap(X.GetLength(), X.GetData(), 1,
163  Y.GetData(), 1);
164  }
165 
166 
167  template <class Allocator>
168  void Swap(Vector<complex<float>, VectFull, Allocator>& X,
169  Vector<complex<float>, VectFull, Allocator>& Y)
170  {
171 
172 #ifdef SELDON_CHECK_DIMENSIONS
173  CheckDim(X, Y, "Swap(X, Y)", "X <-> Y");
174 #endif
175 
176  cblas_cswap(X.GetLength(), reinterpret_cast<void*>(X.GetData()), 1,
177  reinterpret_cast<void*>(Y.GetData()), 1);
178  }
179 
180 
181  template <class Allocator>
182  void Swap(Vector<complex<double>, VectFull, Allocator>& X,
183  Vector<complex<double>, VectFull, Allocator>& Y)
184  {
185 
186 #ifdef SELDON_CHECK_DIMENSIONS
187  CheckDim(X, Y, "Swap(X, Y)", "X <-> Y");
188 #endif
189 
190  cblas_zswap(X.GetLength(), reinterpret_cast<void*>(X.GetData()), 1,
191  reinterpret_cast<void*>(Y.GetData()), 1);
192  }
193 
194 
195  // Swap //
197 
198 
199 
201  // Mlt //
202 
203 
204  template <class Allocator>
205  void MltScalar(const float& alpha,
206  Vector<float, VectFull, Allocator>& X)
207  {
208  cblas_sscal(X.GetLength(), alpha, X.GetData(), 1);
209  }
210 
211 
212  template <class Allocator>
213  void MltScalar(const double& alpha,
214  Vector<double, VectFull, Allocator>& X)
215  {
216  cblas_dscal(X.GetLength(), alpha, X.GetData(), 1);
217  }
218 
219 
220  template <class Allocator>
221  void MltScalar(const float& alpha,
222  Vector<complex<float>, VectFull, Allocator>& X)
223  {
224  cblas_csscal(X.GetLength(), alpha,
225  reinterpret_cast<void*>(X.GetData()), 1);
226  }
227 
228 
229  template <class Allocator>
230  void MltScalar(const double& alpha,
231  Vector<complex<double>, VectFull, Allocator>& X)
232  {
233  cblas_zdscal(X.GetLength(), alpha,
234  reinterpret_cast<void*>(X.GetData()), 1);
235  }
236 
237 
238  template <class Allocator>
239  void MltScalar(const complex<float>& alpha,
240  Vector<complex<float>, VectFull, Allocator>& X)
241  {
242  cblas_cscal(X.GetLength(),
243  reinterpret_cast<const void*>(&alpha),
244  reinterpret_cast<void*>(X.GetData()), 1);
245  }
246 
247 
248  template <class Allocator>
249  void MltScalar(const complex<double>& alpha,
250  Vector<complex<double>, VectFull, Allocator>& X)
251  {
252  cblas_zscal(X.GetLength(),
253  reinterpret_cast<const void*>(&alpha),
254  reinterpret_cast<void*>(X.GetData()), 1);
255  }
256 
257 
258  // Mlt //
260 
261 
262 
264  // Copy //
265 
266 
267  template <class Allocator0, class Allocator1>
268  void CopyVector(const Vector<float, VectFull, Allocator0>& X,
269  Vector<float, VectFull, Allocator1>& Y)
270  {
271 
272 #ifdef SELDON_CHECK_DIMENSIONS
273  CheckDim(X, Y, "Copy(X, Y)", "X -> Y");
274 #endif
275 
276  cblas_scopy(Y.GetLength(),
277  reinterpret_cast<const float*>(X.GetData()), 1,
278  reinterpret_cast<float*>(Y.GetData()), 1);
279  }
280 
281 
282  template <class Allocator0, class Allocator1>
283  void CopyVector(const Vector<double, VectFull, Allocator0>& X,
284  Vector<double, VectFull, Allocator1>& Y)
285  {
286 
287 #ifdef SELDON_CHECK_DIMENSIONS
288  CheckDim(X, Y, "Copy(X, Y)", "X -> Y");
289 #endif
290 
291  cblas_dcopy(Y.GetLength(),
292  reinterpret_cast<const double*>(X.GetData()), 1,
293  reinterpret_cast<double*>(Y.GetData()), 1);
294  }
295 
296 
297  template <class Allocator0, class Allocator1>
298  void CopyVector(const Vector<complex<float>, VectFull, Allocator0>& X,
299  Vector<complex<float>, VectFull, Allocator1>& Y)
300  {
301 
302 #ifdef SELDON_CHECK_DIMENSIONS
303  CheckDim(X, Y, "Copy(X, Y)", "X -> Y");
304 #endif
305 
306  cblas_ccopy(Y.GetLength(),
307  reinterpret_cast<const void*>(X.GetData()), 1,
308  reinterpret_cast<void*>(Y.GetData()), 1);
309  }
310 
311 
312  template <class Allocator0, class Allocator1>
313  void CopyVector(const Vector<complex<double>, VectFull, Allocator0>& X,
314  Vector<complex<double>, VectFull, Allocator1>& Y)
315  {
316 
317 #ifdef SELDON_CHECK_DIMENSIONS
318  CheckDim(X, Y, "Copy(X, Y)", "X -> Y");
319 #endif
320 
321  cblas_zcopy(Y.GetLength(),
322  reinterpret_cast<const void*>(X.GetData()), 1,
323  reinterpret_cast<void*>(Y.GetData()), 1);
324  }
325 
326 
327  // Copy //
329 
330 
331 
333  // Add //
334 
335 
336  template <class Allocator0, class Allocator1>
337  void AddVector(const float& alpha,
338  const Vector<float, VectFull, Allocator0>& X,
339  Vector<float, VectFull, Allocator1>& Y)
340  {
341 
342 #ifdef SELDON_CHECK_DIMENSIONS
343  CheckDim(X, Y, "Add(alpha, X, Y)");
344 #endif
345 
346  cblas_saxpy(Y.GetLength(),
347  alpha,
348  reinterpret_cast<const float*>(X.GetData()), 1,
349  reinterpret_cast<float*>(Y.GetData()), 1);
350  }
351 
352 
353  template <class Allocator0, class Allocator1>
354  void AddVector(const double& alpha,
355  const Vector<double, VectFull, Allocator0>& X,
356  Vector<double, VectFull, Allocator1>& Y)
357  {
358 
359 #ifdef SELDON_CHECK_DIMENSIONS
360  CheckDim(X, Y, "Add(alpha, X, Y)");
361 #endif
362 
363  cblas_daxpy(Y.GetLength(),
364  alpha,
365  reinterpret_cast<const double*>(X.GetData()), 1,
366  reinterpret_cast<double*>(Y.GetData()), 1);
367  }
368 
369 
370  template <class Allocator0, class Allocator1>
371  void AddVector(const complex<float>& alpha,
372  const Vector<complex<float>, VectFull, Allocator0>& X,
373  Vector<complex<float>, VectFull, Allocator1>& Y)
374  {
375 
376 #ifdef SELDON_CHECK_DIMENSIONS
377  CheckDim(X, Y, "Add(alpha, X, Y)");
378 #endif
379 
380  cblas_caxpy(Y.GetLength(),
381  reinterpret_cast<const void*>(&alpha),
382  reinterpret_cast<const void*>(X.GetData()), 1,
383  reinterpret_cast<float*>(Y.GetData()), 1);
384  }
385 
386 
387  template <class Allocator0, class Allocator1>
388  void AddVector(const complex<double>& alpha,
389  const Vector<complex<double>, VectFull, Allocator0>& X,
390  Vector<complex<double>, VectFull, Allocator1>& Y)
391  {
392 
393 #ifdef SELDON_CHECK_DIMENSIONS
394  CheckDim(X, Y, "Add(alpha, X, Y)");
395 #endif
396 
397  cblas_zaxpy(Y.GetLength(),
398  reinterpret_cast<const void*>(&alpha),
399  reinterpret_cast<const void*>(X.GetData()), 1,
400  reinterpret_cast<double*>(Y.GetData()), 1);
401  }
402 
403 
404  // Add //
406 
407 
408 
410  // DotProd //
411 
412 
413  template <class Allocator0, class Allocator1>
414  float DotProdVector(const Vector<float, VectFull, Allocator0>& X,
415  const Vector<float, VectFull, Allocator1>& Y)
416  {
417 
418 #ifdef SELDON_CHECK_DIMENSIONS
419  CheckDim(X, Y, "DotProd(X, Y)", "dot(X, Y)");
420 #endif
421 
422  return cblas_sdot(Y.GetLength(),
423  reinterpret_cast<const float*>(X.GetData()), 1,
424  reinterpret_cast<const float*>(Y.GetData()), 1);
425  }
426 
427 
428  template <class Allocator0, class Allocator1>
429  double DotProdVector(const Vector<double, VectFull, Allocator0>& X,
430  const Vector<double, VectFull, Allocator1>& Y)
431  {
432 
433 #ifdef SELDON_CHECK_DIMENSIONS
434  CheckDim(X, Y, "DotProd(X, Y)", "dot(X, Y)");
435 #endif
436 
437  return cblas_ddot(Y.GetLength(),
438  reinterpret_cast<const double*>(X.GetData()), 1,
439  reinterpret_cast<const double*>(Y.GetData()), 1);
440  }
441 
442 
443  template <class Allocator0, class Allocator1>
444  complex<float>
445  DotProdVector(const Vector<complex<float>, VectFull, Allocator0>& X,
446  const Vector<complex<float>, VectFull, Allocator1>& Y)
447  {
448 
449 #ifdef SELDON_CHECK_DIMENSIONS
450  CheckDim(X, Y, "DotProd(X, Y)", "dot(X, Y)");
451 #endif
452 
453  // not using cblas_cdotu_sub because of a bug in mkl function
454 #ifdef SELDON_WITHOUT_CBLAS_LIB
455  complex<float> dotu;
456  cblas_cdotu_sub(Y.GetLength(),
457  reinterpret_cast<const void*>(X.GetData()), 1,
458  reinterpret_cast<const void*>(Y.GetData()), 1,
459  reinterpret_cast<void*>(&dotu));
460 #else
461  complex<float> dotu;
462  int n = Y.GetLength(), inc = 1;
463  cdotusub_(&n,
464  reinterpret_cast<const void*>(X.GetData()), &inc,
465  reinterpret_cast<const void*>(Y.GetData()), &inc,
466  reinterpret_cast<void*>(&dotu));
467 #endif
468 
469  return dotu;
470  }
471 
472 
473  template <class Allocator0, class Allocator1>
474  complex<double>
475  DotProdVector(const Vector<complex<double>, VectFull, Allocator0>& X,
476  const Vector<complex<double>, VectFull, Allocator1>& Y)
477  {
478 
479 #ifdef SELDON_CHECK_DIMENSIONS
480  CheckDim(X, Y, "DotProd(X, Y)", "dot(X, Y)");
481 #endif
482 
483  // not using cblas_zdotu_sub because of a bug in mkl function
484 #ifdef SELDON_WITHOUT_CBLAS_LIB
485  complex<double> dotu;
486  cblas_zdotu_sub(Y.GetLength(),
487  reinterpret_cast<const void*>(X.GetData()), 1,
488  reinterpret_cast<const void*>(Y.GetData()), 1,
489  reinterpret_cast<void*>(&dotu));
490 #else
491  complex<double> dotu;
492  int n = Y.GetLength(), inc = 1;
493  zdotusub_(&n,
494  reinterpret_cast<const void*>(X.GetData()), &inc,
495  reinterpret_cast<const void*>(Y.GetData()), &inc,
496  reinterpret_cast<void*>(&dotu));
497 #endif
498 
499  return dotu;
500  }
501 
502 
503  // DotProd //
505 
506 
507 
509  // SCALEDDOTPROD //
510 
511 
512  template <class Allocator0, class Allocator1>
513  float ScaledDotProd(const float& alpha,
514  const Vector<float, VectFull, Allocator0>& X,
515  const Vector<float, VectFull, Allocator1>& Y)
516  {
517 
518 #ifdef SELDON_CHECK_DIMENSIONS
519  CheckDim(X, Y, "ScaledDotProd(X, Y)", "dot(X, Y)");
520 #endif
521 
522  return cblas_sdsdot(Y.GetLength(), alpha,
523  reinterpret_cast<const float*>(X.GetData()), 1,
524  reinterpret_cast<const float*>(Y.GetData()), 1);
525  }
526 
527 
528  // SCALEDDOTPROD //
530 
531 
532 
534  // DotProjConj //
535 
536 
537  template <class Allocator0, class Allocator1>
538  complex<float>
539  DotProdConjVector(const Vector<complex<float>, VectFull, Allocator0>& X,
540  const Vector<complex<float>, VectFull, Allocator1>& Y)
541  {
542 
543 #ifdef SELDON_CHECK_DIMENSIONS
544  CheckDim(X, Y, "DotProdConj(X, Y)", "dot(X, Y)");
545 #endif
546 
547  // not using cblas_cdotc_sub because of a bug in mkl function
548 #ifdef SELDON_WITHOUT_CBLAS_LIB
549  complex<float> dotc;
550  cblas_cdotc_sub(Y.GetLength(),
551  reinterpret_cast<const void*>(X.GetData()), 1,
552  reinterpret_cast<const void*>(Y.GetData()), 1,
553  reinterpret_cast<void*>(&dotc));
554 #else
555  complex<float> dotc;
556  int n = Y.GetLength(), inc = 1;
557  cdotcsub_(&n,
558  reinterpret_cast<const void*>(X.GetData()), &inc,
559  reinterpret_cast<const void*>(Y.GetData()), &inc,
560  reinterpret_cast<void*>(&dotc));
561 #endif
562 
563  return dotc;
564  }
565 
566 
567  template <class Allocator0, class Allocator1>
568  complex<double>
569  DotProdConjVector(const Vector<complex<double>, VectFull, Allocator0>& X,
570  const Vector<complex<double>, VectFull, Allocator1>& Y)
571  {
572 
573 #ifdef SELDON_CHECK_DIMENSIONS
574  CheckDim(X, Y, "DotProdConj(X, Y)", "dot(X, Y)");
575 #endif
576 
577  // not using cblas_zdotc_sub because of a bug in mkl function
578 #ifdef SELDON_WITHOUT_CBLAS_LIB
579  complex<double> dotc;
580  cblas_zdotc_sub(Y.GetLength(),
581  reinterpret_cast<const void*>(X.GetData()), 1,
582  reinterpret_cast<const void*>(Y.GetData()), 1,
583  reinterpret_cast<void*>(&dotc));
584 #else
585  complex<double> dotc;
586  int n = Y.GetLength(), inc = 1;
587  zdotcsub_(&n,
588  reinterpret_cast<const void*>(X.GetData()), &inc,
589  reinterpret_cast<const void*>(Y.GetData()), &inc,
590  reinterpret_cast<void*>(&dotc));
591 #endif
592 
593  return dotc;
594  }
595 
596 
597  // DotProdConj //
599 
600 
601 
603  // Norm1 //
604 
605 
606  template <class Allocator>
607  float Norm1(const Vector<float, VectFull, Allocator>& X)
608  {
609  return cblas_sasum(X.GetLength(),
610  reinterpret_cast<const float*>(X.GetData()), 1);
611  }
612 
613 
614  template <class Allocator>
615  double Norm1(const Vector<double, VectFull, Allocator>& X)
616  {
617  return cblas_dasum(X.GetLength(),
618  reinterpret_cast<const double*>(X.GetData()), 1);
619  }
620 
621 
622  template <class Allocator>
623  float Norm1(const Vector<complex<float>, VectFull, Allocator>& X)
624  {
625 #ifdef SELDON_WITH_LAPACK
626  // we use Lapack routine in order to have genuine absolute value
627  int n = X.GetLength(), incx = 1;
628  return scsum1_(&n,
629  reinterpret_cast<const void*>(X.GetData()), &incx);
630 #else
631  return cblas_scasum(X.GetLength(),
632  reinterpret_cast<const void*>(X.GetData()), 1);
633 #endif
634  }
635 
636 
637  template <class Allocator>
638  double Norm1(const Vector<complex<double>, VectFull, Allocator>& X)
639  {
640 #ifdef SELDON_WITH_LAPACK
641  // we use Lapack routine in order to have genuine absolute value
642  int n = X.GetLength(), incx = 1;
643  return dzsum1_(&n,
644  reinterpret_cast<const void*>(X.GetData()), &incx);
645 #else
646  return cblas_dzasum(X.GetLength(),
647  reinterpret_cast<const void*>(X.GetData()), 1);
648 #endif
649  }
650 
651 
652  // Norm1 //
654 
655 
656 
658  // Norm2 //
659 
660 
661  template <class Allocator>
662  float Norm2(const Vector<float, VectFull, Allocator>& X)
663  {
664  return cblas_snrm2(X.GetLength(),
665  reinterpret_cast<const float*>(X.GetData()), 1);
666  }
667 
668 
669  template <class Allocator>
670  double Norm2(const Vector<double, VectFull, Allocator>& X)
671  {
672  return cblas_dnrm2(X.GetLength(),
673  reinterpret_cast<const double*>(X.GetData()), 1);
674  }
675 
676 
677  template <class Allocator>
678  float Norm2(const Vector<complex<float>, VectFull, Allocator>& X)
679  {
680  return cblas_scnrm2(X.GetLength(),
681  reinterpret_cast<const void*>(X.GetData()), 1);
682  }
683 
684 
685  template <class Allocator>
686  double Norm2(const Vector<complex<double>, VectFull, Allocator>& X)
687  {
688  return cblas_dznrm2(X.GetLength(),
689  reinterpret_cast<const void*>(X.GetData()), 1);
690  }
691 
692 
693  // Norm2 //
695 
696 
697 
699  // GetMaxAbsIndex //
700 
701 
702  template <class Allocator>
703  size_t GetMaxAbsIndex(const Vector<float, VectFull, Allocator>& X)
704  {
705  return cblas_isamax(X.GetLength(),
706  reinterpret_cast<const float*>(X.GetData()), 1);
707  }
708 
709 
710  template <class Allocator>
711  size_t GetMaxAbsIndex(const Vector<double, VectFull, Allocator>& X)
712  {
713  return cblas_idamax(X.GetLength(),
714  reinterpret_cast<const double*>(X.GetData()), 1);
715  }
716 
717 
718  template <class Allocator>
719  size_t GetMaxAbsIndex(const Vector<complex<float>, VectFull, Allocator>& X)
720  {
721 #ifdef SELDON_WITH_LAPACK
722  int n = X.GetLength(), incx = 1;
723  size_t p = icmax1_(&n,
724  reinterpret_cast<void*>(X.GetData()), &incx);
725 
726  return p-1;
727 #else
728  return cblas_icamax(X.GetLength(),
729  reinterpret_cast<const void*>(X.GetData()), 1);
730 #endif
731  }
732 
733 
734  template <class Allocator>
735  size_t
736  GetMaxAbsIndex(const Vector<complex<double>, VectFull, Allocator>& X)
737  {
738 #ifdef SELDON_WITH_LAPACK
739  int n = X.GetLength(), incx = 1;
740  size_t p = izmax1_(&n,
741  reinterpret_cast<void*>(X.GetData()), &incx);
742  return p-1;
743 #else
744  return cblas_izamax(X.GetLength(),
745  reinterpret_cast<const void*>(X.GetData()), 1);
746 #endif
747  }
748 
749 
750  // GetMaxAbsIndex //
752 
753 
754 } // namespace Seldon.
755 
756 #define SELDON_FILE_BLAS_1_CXX
757 #endif
Seldon::ApplyRot
void ApplyRot(T &x, T &y, const T &c_, const T &s_)
Rotation of a point in 2-D.
Definition: Functions_Vector.cxx:776
Seldon::MltScalar
void MltScalar(const T0 &alpha, Array3D< T, Allocator > &A)
Multiplication of all elements of a 3D array by a scalar.
Definition: Array3D.cxx:539
Seldon::Norm2
ClassComplexType< T >::Treal Norm2(const VectorExpression< T, E > &X)
returns 2-norm of an expression with vectors
Definition: Functions_BaseInline.cxx:153
Seldon::Norm1
ClassComplexType< T >::Treal Norm1(const VectorExpression< T, E > &X)
returns 1-norm of an expression with vectors
Definition: Functions_BaseInline.cxx:140
Seldon::DotProdVector
T1 DotProdVector(const Vector< T1, Storage1, Allocator1 > &X, const Vector< T2, Storage2, Allocator2 > &Y)
Scalar product between two vectors.
Definition: Functions_Vector.cxx:399
Seldon::CopyVector
void CopyVector(const Vector< T1, Storage1, Allocator1 > &X, Vector< T2, Storage2, Allocator2 > &Y)
Y = X.
Definition: Functions_Vector.cxx:293
Seldon::CheckDim
void CheckDim(const Matrix< T0, Prop0, Storage0, Allocator0 > &A, const Matrix< T1, Prop1, Storage1, Allocator1 > &B, const Matrix< T2, Prop2, Storage2, Allocator2 > &C, string function)
Checks the compatibility of the dimensions.
Definition: Functions_Matrix.cxx:2132
Seldon::GetMaxAbsIndex
long GetMaxAbsIndex(const Vector< T, Storage, Allocator > &X)
returns index for which X(i) is maximal
Definition: Functions_Vector.cxx:691
Seldon
Seldon namespace.
Definition: Array.cxx:24
Seldon::DotProdConjVector
T1 DotProdConjVector(const Vector< T1, Storage1, Allocator1 > &X, const Vector< T2, Storage2, Allocator2 > &Y)
Scalar product between two vectors conj(X).Y .
Definition: Functions_Vector.cxx:461
Seldon::Swap
void Swap(Vector< T, Storage, Allocator > &X, Vector< T, Storage, Allocator > &Y)
Swaps X and Y without copying all elements.
Definition: Functions_Vector.cxx:348
Seldon::GenRot
void GenRot(T &a_in, T &b_in, T &c_, T &s_)
Computation of rotation between two points.
Definition: Functions_Vector.cxx:707
Seldon::AddVector
void AddVector(const T0 &alpha, const Vector< T1, Storage1, Allocator1 > &X, Vector< T2, Storage2, Allocator2 > &Y)
Adds two vectors Y = Y + alpha X.
Definition: Functions_Vector.cxx:94