c++ - 如何将 Armadillo vec/mat 作为 ref 参数传递给另一种方法?

标签 c++ armadillo

我很抱歉,因为这可能是一个愚蠢的问题,但是: 我想使用一个函数来填充我的矩阵,但很难将其作为参数传递。 谁能帮忙?

最佳答案

void FillMyMatrix(MyMatrixType& thisIsTheNameOfTheLocalVariableInTheFoo)
{
  // fill your matrix called thisIsTheNameOfTheLocalVariableInTheFoo
  // let's say the MyMatrixType has an Insert(int, int, int) method.
  thisIsTheNameOfTheLocalVariableInTheFoo.Insert(1, 2, 3);
}

关于c++ - 如何将 Armadillo vec/mat 作为 ref 参数传递给另一种方法?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30125478/

相关文章:

c++ - 使用 C/C++ 以外的语言构建共享库,特别是序言

c# - 为 C# COM 服务器创建 C++ COM 客户端

c++ - 在 Qt 中创建套接字

r - 使用 List 将 R 矩阵转换为 arma::mat

c++ - Armadillo 和 C++ - 使用二维数组进行矩阵初始化

c++ - Armadillo C++ expmat 堆栈

c++ - 奇怪的 bool 重载

c++ - 如何在linux上安装c++库

c++ 自动覆盖有符号/无符号

c++ - 如何在 C++ 中使用枚举