I have the following:
#include <vector>
#include <complex>
using namespace std;
vector<vector<complex> > matrix;
which is meant to be a 2D vector with complex values. The size of the structure is not known at compile time so I think a vector is a reasonable choice?
I’m using Qt.. a search didn’t reveal any matrix classes. Is there an alternative I should use? Assuming a 2D vector is a good choice. How come this happens on build:
I get the following error:
error: type/value mismatch at argument 1 in template parameter list for
'template<class _Tp, class _Alloc> class std::vector'
error: expected a type, got 'complex'
Many thanks.
complexis a templated class, so you need to specialize it. I guess that you want eitherfloatordouble: