Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Eigen 3.2.4を使用して、列ベクトルの中心データを取得しています。
Eigen::Matrix<double, 4, 1> a1, a2; a1 << 1, 2, 3, 4; a2 = a1 - a1.mean(); // error no match for operator -
しかし、gccは演算子に一致しないというエラーを出しています - ... ここでのエラーは何ですか?
私は純粋にドキュメントから答えているので、間違っているかもしれませんが。
固有値は を許可しませんがMatrix - scalar、許可しますArray - scalar
Matrix - scalar
Array - scalar
どちらかを試してください。
a2 = a1.array() - a1.mean();
または
a2.array() = a1.array() - a1.mean();
どちらも機能しない場合でも、うまくいけば、正しい方向に向けることができます。