私がのstd ::ベクトルを持っていると私は私がやったARMA :: rowvec ::ベクトル<int>
ARMA :: rowvecに変換したい:
vector<int> x = foo();
rowvec a;
vector<int>::const_iterator iter2;
int j = 0;
for(iter2 = x.begin(); iter2 != x.end(); ++iter2) {
a(j++,0) = *iter2;
}
a.print("a");
を私取得:
error: Mat::operator(): out of bounds
terminate called after throwing an instance of 'std::logic_error'
what():
代わりa(j++,0) = *iter2;
の私は最終rowvecでa << *iter2;
を使用し、私は最後の要素を取得する場合。あなたが使用している場合
これは私が言う。「STDの不正な使用を::ベクトル> ::ポインタ」 –
nkint