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
     52
     53
     54
     55
     56
     57
     58
     59
     60
     61
     62
#include <cxxstd/iostream.h>
#include <flens/flens.cxx>

using namespace flens;
using namespace std;

void
foo(int *i);

int
main()
{
    const int m = 4;
    const int k = 5;
    const int n = 3;

    const complex<float> x = double(1);

    //typedef typename std::common_type<double, complex<float> >::type   T;
    //typedef typename std::common_type<complex<float>, double>::type   T;
    //typedef typename std::common_type<float, double>::type   T;

    //foo(T(0));

    GeMatrix<FullStorage<complex<float>, RowMajor> >  A(m,k);
    GeMatrix<FullStorage<double, ColMajor> >  B(k,n);
    GeMatrix<FullStorage<complex<double>, RowMajor> >  C(m,n);
    GeMatrix<FullStorage<complex<double>, RowMajor> >  C2;

    int count = 0;

    // init A
    for (int i=1; i<=m; ++i) {
        for (int j=1; j<=k; ++j) {
            A(i,j) = ++count;
        }
    }
    // init B
    for (int i=1; i<=k; ++i) {
        for (int j=1; j<=n; ++j) {
            B(i,j) = ++count;
        }
    }
    // init C
    for (int i=1; i<=m; ++i) {
        for (int j=1; j<=n; ++j) {
            C(i,j) = ++count;
        }
    }

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

    C = A*B;

    cout << "C = " << C << endl;

    C2 = transpose(B)*conjTrans(A);

    cout << "C2 = " << C2 << endl;
}