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
     44
     45
     46
#include <flens/flens.cxx>

using namespace flens;
using namespace std;

int
main()
{
    typedef GbMatrix<BandStorage<double> >  RealGbMatrix;
    typedef GeMatrix<FullStorage<double> >  RealGeMatrix;
    typedef DenseVector<Array<double> >     RealVector;

    RealGbMatrix    A(5,511);
    RealVector      x(5);

    A.diag0) =  3,  4,  5,  6,  7;
    A.diag1) =  8,  9,  1,  2;
    A.diag(-1) = -3, -4, -5, -6;

    x = 1, 2, 3, 4, 5;

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

    A += 2;
    cout << "A = " << A << endl;


    Underscore<int>  _;

    RealGeMatrix   B(35, -11);

    B(-1,_) =  -1;
    B0,_) = 666;
    B1,_) =   1;


    typedef BandStorageView<double>  BSV;

    RealGbMatrix::View  A_ = BSV(5511, B.data(), B.leadingDimension());

    cout << "A_ = " << A_ << endl;

    B += 2;
    cout << "A_ = " << A_ << endl;
}