I'm trying to multiply a sparse real matrix with a complex vector but the program does not compile. If I change the vector to real or the matrix to dense, then everything goes through. A sample code is:
#define ARMA_64BIT_WORD
#include <armadillo>
#include <iostream>
#include <stdio.h>
#include <math.h>
using namespace arma;
int main(){
size_t n(5);
vec vR(randu<vec>(n)), vI(randu<vec>(n)); //Create random complex vector 'v'
cx_vec v(vR, vI);
std::cout<<"\n\tMultiplying real matrix with complex vector:"<<std::endl;
mat R = randu<mat>(n,n);
R*v; // -------------> COMPILES
std::cout<<"\n\tMultiplying real sparse matrix with complex vector:"<<std::endl;
sp_mat Rs = sprandu<sp_mat>(n,n,0.2);
Rs*v; // ------------> DOES NOT COMPILE
return 0;
}
Any recommendations for a solution? I'm using Armadillo version 5.200.1.