gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-11-30 05:43:38 25 4
gpt4 key购买 nike

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

最佳答案

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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com