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 /// We turn on logging of the closure evaluation, i.e. the evaluation
29 /// of linear algebra expressions that are coded through overloaded
30 /// operators.
31 ///
32 verbose::ClosureLog::start("mylogfile");
33
34 ///
35 /// Compute $y = \beta y + \alpha A^T x + z$
36 ///
37 y = beta*y + alpha*transpose(A)*x + z;
38
39 cout << "y = " << y << endl;
40
41 ///
42 /// Stop logging.
43 ///
44 verbose::ClosureLog::stop();
45
46 return 0;
47 }
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 /// We turn on logging of the closure evaluation, i.e. the evaluation
29 /// of linear algebra expressions that are coded through overloaded
30 /// operators.
31 ///
32 verbose::ClosureLog::start("mylogfile");
33
34 ///
35 /// Compute $y = \beta y + \alpha A^T x + z$
36 ///
37 y = beta*y + alpha*transpose(A)*x + z;
38
39 cout << "y = " << y << endl;
40
41 ///
42 /// Stop logging.
43 ///
44 verbose::ClosureLog::stop();
45
46 return 0;
47 }