c++ - request for member ... which is of non-class type -


i error

main.cpp: in function 'int main()': main.cpp:43:16: error: request member 'getf' in 'cor', of non-class type 'cormatrixfermion(matrixv)'   myfile << cor.getf;                 ^ 

here header of class:

class matrixv{   public:     matrixv(std::string file);     matrixv(eigen::matrixxd matrix);     matrixv(double arr[], int arrsize);      eigen::matrixxd getv();     eigen::vectorxd getsigma();     int getr();      eigen::matrixxd geto1();     eigen::matrixxd geto2();     eigen::matrixxd gete();      eigen::matrixxd getvstrich();  private:     int size;     eigen::matrixxd v;     eigen::vectorxd sigma;     int r;     eigen::jacobisvd<eigen::matrixxd, eigen::noqrpreconditioner> svd; }; 

and here main.cpp

int main(){ std::srand(time(0));  datafromfile startvalues("startvalues");  double arr[4]; arr[0]  = startvalues.get(1); arr[1]  = startvalues.get(2); arr[2]  = startvalues.get(3); arr[3]  = startvalues.get(4);  matrixv v(arr, 4); cormatrixfermion cor(matrixv v);  std::ofstream myfile; myfile.open ("corfunction.txt"); myfile << cor.getf(); myfile.close(); } 

there other classes involved, dont think, cause problem. see, i'm doing wrong? if need more information please tell me. seems me, not usual "request member"-constructor-problem. maybe i'm wrong...

this looks dodgy:

cormatrixfermion cor(matrixv v); 

this declaring cor function. meant pass v cormatrixfermion constructor instead:

cormatrixfermion cor(v); 

Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -