Lxc
Lxc

Reputation: 1

Matrix multiplication using Matrix Template library (MTL 4)

The program is as following:

#include <iostream>
#include <boost/numeric/mtl/mtl.hpp>
using namespace mtl;
int main(int argc, char* argv[])
{
dense_vector<double> a(5,1.0);
dense_vector<double> b(5,2.0);
a * trans(b);
}

I want to calculate a * trans(b), but there is a compling error :C2893. Will someone help me? Thanks a lot!

Upvotes: 0

Views: 1355

Answers (1)

Alexandros Gezerlis
Alexandros Gezerlis

Reputation: 2262

The vector in your program above is a column vector. The constructor you make use of takes two arguments: the size and the initial value.

The reason you're getting the compiler error is probably this:

The transposition of vector is momentarily not implemented yet. It will create a row vector view on a column vector and vice versa.

Matrix Template Library 4: Transposed

Upvotes: 1

Related Questions