Gün*_*ter 6 c c++ blas
我已经分配了一个大的双向量,让我们说100000元素.在我的代码中的某个时刻,我想将所有元素设置为常量非零值.如果不对所有元素使用for循环,我该怎么做?我也在使用blas包,如果有帮助的话.
col*_*fix 9
你可以使用std::fill(#include <algorithm>):
std::fill
#include <algorithm>
std::fill(v.begin(), v.end(), 1);
这当然也只是一个循环..
归档时间:
14 年,12 月 前
查看次数:
1880 次
最近记录: