我目前正在使用Ubuntu代码::blocks,在尝试做线性代数时遇到了一些问题。
在编译器设置下>搜索目录>编译器i have“/usr/include”
在编译器设置下>搜索目录>链接器i have“/user/lib”
我的liblapack dev、libblas dev、libboost dev、libarmadillo dev通过apt get安装
我评论了代码的哪一部分给了我错误。没有代码中的困难部分,我的代码运行良好,所以我认为armadillo安装得很好?为什么我不能访问它的所有功能?
#include <iostream>
#include <armadillo>
using namespace arma;
using namespace std;
int main()
{
mat A;
A<<1<<2<<endr<<3<<4;
cout<<A;
vec e=A.col(0);
vec r=A.col(1);
cout<<endl<<e<<endl<<r<<endl;//works perfectly up to here
//if only there was not more of these codes
cout<<e*r<<endl;//doesnt work from here anymore
float y=dot(A,A);//from here on i get the error message:
cout<<y<<endl;//'wrapper_ddot_' is not defined
double z=as_scalar(e*r);//and wrapper_blas.hpp file opens
double t=dot(e,r);
cout<<z<<endl;//and points me to line 185
return 0;//with an error
}