1 #include <flens/flens.cxx>
2 #include <iostream>
3
4 using namespace flens;
5 using namespace std;
6
7 int
8 main()
9 {
10 typedef double T;
11 typedef DenseVector<Array<T> > DEVector;
12 typedef GeMatrix<FullStorage<T, ColMajor> > GEMatrix;
13
14 const T alpha = 1.5,
15 beta = 2.5;
16
17 DEVector x(3), y(3), z(3);
18 x = 1, 2, 3;
19 y = 2, 3, 4;
20 z = 3, 4, 5;
21
22 GEMatrix A(3,3);
23 A = 1, 2, 3,
24 5, 6, 7,
25 5, 4, 3;
26
27 ///
28 /// Compute $y = \beta y + \alpha A^T x$
29 ///
30 blas::mv(Trans, alpha, A, x, beta, y);
31
32 ///
33 /// Compute the update $y = y + z$
34 ///
35 blas::axpy(T(1), z, y);
36
37 cout << "y = " << y << endl;
38
39 return 0;
40 }
2 #include <iostream>
3
4 using namespace flens;
5 using namespace std;
6
7 int
8 main()
9 {
10 typedef double T;
11 typedef DenseVector<Array<T> > DEVector;
12 typedef GeMatrix<FullStorage<T, ColMajor> > GEMatrix;
13
14 const T alpha = 1.5,
15 beta = 2.5;
16
17 DEVector x(3), y(3), z(3);
18 x = 1, 2, 3;
19 y = 2, 3, 4;
20 z = 3, 4, 5;
21
22 GEMatrix A(3,3);
23 A = 1, 2, 3,
24 5, 6, 7,
25 5, 4, 3;
26
27 ///
28 /// Compute $y = \beta y + \alpha A^T x$
29 ///
30 blas::mv(Trans, alpha, A, x, beta, y);
31
32 ///
33 /// Compute the update $y = y + z$
34 ///
35 blas::axpy(T(1), z, y);
36
37 cout << "y = " << y << endl;
38
39 return 0;
40 }