我正在尝试在模板函数中进行一些 L_p 范数计算
template<typename Number>
Number foo(const Eigen::MatrixBase<Number>& matrix)
{
return matrix.lpNorm<1>();
}
但是,如果我尝试调用 foo(matrix)
,CLang 会在行尾抛出错误“expected expression”。如果我使用具体定义的(双)矩阵,lpNorm
工作得很好。我该如何处理这个案例?
最佳答案
关于c++ - 在 Eigen 中使用 lpNorm,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28585653/