Armadillo spärliche reelle Matrixmultiplikation mit komplexem Vektor

Ich versuche, eine spärliche reelle Matrix mit einem komplexen Vektor zu multiplizieren, aber das Programm kompiliert nicht. Wenn ich den Vektor auf reell oder die Matrix auf dicht ändere, geht alles durch. Ein Beispielcode lautet:

#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;

}

Haben Sie Empfehlungen für eine Lösung? Ich verwende Armadillo Version 5.200.1.

Antworten auf die Frage(2)

Ihre Antwort auf die Frage