1
      2
      3
      4
      5
      6
      7
      8
      9
     10
     11
     12
     13
     14
     15
     16
     17
     18
     19
     20
     21
     22
     23
     24
     25
     26
     27
     28
     29
     30
     31
     32
     33
     34
     35
     36
     37
     38
     39
     40
     41
     42
     43
#include <flens/flens.cxx>
#include <iostream>

using namespace flens;
using namespace std;

int
main()
{
    const int n = 20;

    DenseVector<Array<double> >  x(n);

    Underscore<int> _;

    for (int i=1; i<=x.length(); ++i) {
        x(i) = i;
    }

    cout << "x = " << x << endl;

    GeMatrix<FullStorageView<double, ColMajor> >  A1(45, x);
    GeMatrix<FullStorageView<double, RowMajor> >  A2(45, x);

    cout << "A1 = " << A1 << endl;
    cout << "A2 = " << A2 << endl;


    GeMatrix<FullStorageView<double, ColMajor> >  B1(25, x(_(1,2,n)));
    GeMatrix<FullStorageView<double, RowMajor> >  B2(25, x(_(1,2,n)));

    cout << "B1 = " << B1 << endl;
    cout << "B2 = " << B2 << endl;

    GeMatrix<FullStorageView<double, ColMajor> >  C1(23, x(_(1,2,n)), 22);
    GeMatrix<FullStorageView<double, RowMajor> >  C2(23, x(_(1,2,n)), 22);

    cout << "C1 = " << C1 << endl;
    cout << "C2 = " << C2 << endl;



}