1 #include <iostream>
2
3 ///
4 /// Include header file for `mpfr::real` before `flens.cxx` and make
5 /// sure that conversion operators are enabled
6 ///
7 #define REAL_ENABLE_CONVERSION_OPERATORS
8 #include <external/real.hpp>
9 #include <flens/flens.cxx>
10
11 using namespace std;
12 using namespace flens;
13
14 ///
15 /// Make typedef for using mpfr::real
16 ///
17 typedef mpfr::real<53> T;
18
19 int
20 main()
21 {
22 typedef GeMatrix<FullStorage<T> > Matrix;
23 typedef DenseVector<Array<T> > Vector;
24 typedef Matrix::IndexType IndexType;
25 typedef DenseVector<Array<IndexType> > IndexVector;
26
27 const Underscore<IndexType> _;
28
29 const IndexType m = 4,
30 n = 5;
31
32 Matrix Ab(m, n);
33 IndexVector piv(m);
34
35 Ab = 2, 3, -1, 0, 20,
36 -6, -5, 0, 2, -33,
37 2, -5, 6, -6, -43,
38 4, 6, 2, -3, 49;
39
40 cout << "Ab = " << Ab << endl;
41
42 lapack::trf(Ab, piv);
43
44 const auto A = Ab(_,_(1,m));
45 auto B = Ab(_,_(m+1,n));
46
47 blas::sm(Left, NoTrans, T(1), A.upper(), B);
48
49 cout << "X = " << B << endl;
50 }
2
3 ///
4 /// Include header file for `mpfr::real` before `flens.cxx` and make
5 /// sure that conversion operators are enabled
6 ///
7 #define REAL_ENABLE_CONVERSION_OPERATORS
8 #include <external/real.hpp>
9 #include <flens/flens.cxx>
10
11 using namespace std;
12 using namespace flens;
13
14 ///
15 /// Make typedef for using mpfr::real
16 ///
17 typedef mpfr::real<53> T;
18
19 int
20 main()
21 {
22 typedef GeMatrix<FullStorage<T> > Matrix;
23 typedef DenseVector<Array<T> > Vector;
24 typedef Matrix::IndexType IndexType;
25 typedef DenseVector<Array<IndexType> > IndexVector;
26
27 const Underscore<IndexType> _;
28
29 const IndexType m = 4,
30 n = 5;
31
32 Matrix Ab(m, n);
33 IndexVector piv(m);
34
35 Ab = 2, 3, -1, 0, 20,
36 -6, -5, 0, 2, -33,
37 2, -5, 6, -6, -43,
38 4, 6, 2, -3, 49;
39
40 cout << "Ab = " << Ab << endl;
41
42 lapack::trf(Ab, piv);
43
44 const auto A = Ab(_,_(1,m));
45 auto B = Ab(_,_(m+1,n));
46
47 blas::sm(Left, NoTrans, T(1), A.upper(), B);
48
49 cout << "X = " << B << endl;
50 }