英特尔C++编译器和Eigen
Intel C++ Compiler and Eigen
我正试图用英特尔C++编译器编译我的代码,它具有矩阵乘法。对于矩阵乘法,我使用的是特征库。这是示例代码。我将VS2013与最新版本的Eigen库一起使用。
#define EIGEN_USE_MKL_ALL
#include <Eigen/Dense>
using namespace Eigen;
int main()
{
Matrix<double, 1, 200, RowMajor> y_pred;
y_pred.setRandom(); // Eigen library function
double learning_rate = 0.5;
cout << learning_rate * y_pred << endl;
return 1;
}
当我使用英特尔C++编译器时,我会得到以下错误:
1>error : more than one operator "*" matches these operands:
1> function "Eigen::operator*(const double &, const Eigen::MatrixBase<Eigen::Matrix<double, 1, 200, 1, 1, 200>> &)"
1> function "Eigen::operator*(const std::complex<double> &, const Eigen::MatrixBase<Eigen::Matrix<double, 1, 200, 1, 1, 200>> &)"
1> function "Eigen::internal::operator*(const float &, const Eigen::Matrix<std::complex<float>, -1, -1, 0, -1, -1> &)"
1> function "Eigen::internal::operator*(const float &, const Eigen::Matrix<std::complex<float>, -1, 1, 0, -1, 1> &)"
1> function "Eigen::internal::operator*(const float &, const Eigen::Matrix<std::complex<float>, 1, -1, 1, 1, -1> &)"
1> function "Eigen::internal::operator*(const float &, const Eigen::Matrix<Eigen::scomplex, -1, -1, 1, -1, -1> &)"
1> operand types are: float * Eigen::Matrix<double, 1, 200, 1, 1, 200>
1> y_pred = learning_rate * y_pred;
您可以显式执行标量计算:
cout << learning_rate * y_pred.array() << endl;
相关文章:
- C/C++编译器通常会删除重复的库吗
- 模板-模板参数推导:三个不同的编译器三种不同的行为
- Win32编译器选项和内存分配
- Eigen如何在容器循环中干净地附加矩阵
- MSVC多行宏编译器错误
- 静态数据成员的问题-修复链接错误会导致编译器错误
- 当在带有Eigen的C++中使用GDB时,我如何才能看到更多的大矩阵
- C++,我收到一个无法理解的编译器错误
- 在线编译器中的分段C++没有打印消息
- 如何解决gcc编译器优化导致的centos双编译器设置中的分段错误
- C/C++预处理器是否可以检测一些编译器选项
- 是否有C++编译器选项允许激进地删除所有函数调用,并将参数传递给具有空体的函数
- C++错误C2600:无法定义编译器生成的特殊成员函数(必须首先在类中声明)
- 我需要知道编译器如何在cpp中使用析构函数
- 使用Pybind11向Python公开Eigen::张量
- 编译器如何区分std::vector的构造函数
- 如何将 Eigen 库安装到 IAR c/c++ 编译器
- 如何使用 g++ 编译器和 Eigen 库在 Windows 上进行编译
- 英特尔C++编译器和Eigen
- 在linux上使用intel编译器编译Eigen库时出现错误