LinearOperator::FooMultiply -> LinearOperator::FooMultiplyAndAccumulate

These methods were historically poorly named and every time I read code
I get confused whether they are just multiplying or multiplying and
adding. Clarifying them also gives us the changce to introduce
RightMultiply and LeftMultiply methods in the base class which will
simplify a number call sites in a subsequent CL.

Fixes https://github.com/ceres-solver/ceres-solver/issues/855

Change-Id: Ice4fb483f1acd02527a6dd753ef0c5a66037f4b0
This commit is contained in:
Sameer Agarwal
2022-08-10 09:55:43 -07:00
parent 288a3fde6b
commit 04899645cc
55 changed files with 221 additions and 210 deletions
+4 -4
View File
@@ -70,8 +70,8 @@ class BlockRandomAccessSparseMatrixAdapter
virtual ~BlockRandomAccessSparseMatrixAdapter() final {}
void RightMultiply(const Vector& x, Vector& y) final {
m_.SymmetricRightMultiply(x.data(), y.data());
void RightMultiplyAndAccumulate(const Vector& x, Vector& y) final {
m_.SymmetricRightMultiplyAndAccumulate(x.data(), y.data());
}
private:
@@ -88,8 +88,8 @@ class BlockRandomAccessDiagonalMatrixAdapter final
virtual ~BlockRandomAccessDiagonalMatrixAdapter() final {}
// y = y + Ax;
void RightMultiply(const Vector& x, Vector& y) final {
m_.RightMultiply(x.data(), y.data());
void RightMultiplyAndAccumulate(const Vector& x, Vector& y) final {
m_.RightMultiplyAndAccumulate(x.data(), y.data());
}
private: