我很抱歉,因为这可能是一个愚蠢的问题,但是: 我想使用一个函数来填充我的矩阵,但很难将其作为参数传递。 谁能帮忙?
最佳答案
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/