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
     47
     48
     49
     50
     51
#include <iostream>
#include <flens/flens.cxx>

using namespace flens;

#ifndef FLOAT_TYPE
#define FLOAT_TYPE std::complex<float>
#endif

int
main()
{
    typedef FLOAT_TYPE                           T;

    typedef GeMatrix<FullStorage<T> >   TGeMatrix;
    typedef TGeMatrix::IndexType        IndexType;

    Underscore<IndexType>   _;

    TGeMatrix  A(3,3);
    TGeMatrix  B(3,3);
    TGeMatrix  C(3,3);

    T alpha = 1;
    T beta  = 0;

    A = 1, 2, 3,
        4, 5, 6,
        7, 8, 9;

    B = 9, 8, 7,
        6, 5, 4,
        3, 2, 1;

    blas::mm(NoTrans, NoTrans, alpha, A, B, beta, C);

    std::cout << "A = " << A << std::endl;
    std::cout << "B = " << B << std::endl;
    std::cout << "C = " << C << std::endl;

    blas::sm(Left, NoTrans, alpha, A.upperUnit(), B);
    std::cout << "B = " << B << std::endl;

    blas::r(alpha, B(_,1), B(1,_), A);
    std::cout << "A = " << A << std::endl;

    A(_,1) *= T(2);
    std::cout << "A = " << A << std::endl;


}