forked from bartvdbraak/blender
Libmv: update ceres to latest upstream version
This brings faster BlockRandomAccessSparseMatrix::SymmetricRightMultiply.
This commit is contained in:
parent
570313d519
commit
ff53b046f2
38
extern/libmv/third_party/ceres/ChangeLog
vendored
38
extern/libmv/third_party/ceres/ChangeLog
vendored
@ -1,3 +1,25 @@
|
||||
commit 9e11cd16d09403b9270e621e839d5948b6a74b8d
|
||||
Author: Sameer Agarwal <sameeragarwal@google.com>
|
||||
Date: Mon Sep 29 14:27:58 2014 -0700
|
||||
|
||||
Faster BlockRandomAccessSparseMatrix::SymmetricRightMultiply.
|
||||
|
||||
Trade a small amount of memory to improve the cache coherency of
|
||||
the SymmetricRightMultiply operation.
|
||||
|
||||
The resulting code leads to a 10-20% speedup in the linear solver
|
||||
end to end.
|
||||
|
||||
Change-Id: I8ab2fe152099e849b211b5b19e4ef9f03d8e7f1c
|
||||
|
||||
commit 46b8461fd010c1e7ffce6bb2bdf8a84b659d5e09
|
||||
Author: Sameer Agarwal <sameeragarwal@google.com>
|
||||
Date: Mon Sep 29 15:10:58 2014 -0700
|
||||
|
||||
Various minor fixes from William Rucklidge.
|
||||
|
||||
Change-Id: Ibe731d5db374ad8ee148d62a9fdd8d726b607a3f
|
||||
|
||||
commit b44cfdef25f6bf0917a23b3fd65cce38aa6a3362
|
||||
Author: Sameer Agarwal <sameeragarwal@google.com>
|
||||
Date: Mon Sep 29 07:53:54 2014 -0700
|
||||
@ -647,19 +669,3 @@ Date: Thu Aug 7 12:19:10 2014 -0700
|
||||
construction is the right thing to do.
|
||||
|
||||
Change-Id: I3bfdc89bb0027c8d67cde937e8f2fa385d89c30c
|
||||
|
||||
commit cfb36463f9c1f806121779d651c7105ad899bb20
|
||||
Author: Sameer Agarwal <sameeragarwal@google.com>
|
||||
Date: Tue Aug 5 14:42:33 2014 -0700
|
||||
|
||||
Small fixes from William Rucklidge.
|
||||
|
||||
Change-Id: I0be52f0f1e53cedccffe4807dc664a2f3fb4a8e4
|
||||
|
||||
commit 9a41132a0523af407b53644c07900f86aa6fceac
|
||||
Author: Sameer Agarwal <sameeragarwal@google.com>
|
||||
Date: Mon Aug 4 22:45:53 2014 -0700
|
||||
|
||||
Small changes from Jim Roseborough.
|
||||
|
||||
Change-Id: Ic8b19ea5c5f4f8fd782eb4420b30514153087d18
|
||||
|
@ -102,9 +102,5 @@ void BlockJacobiPreconditioner::RightMultiply(const double* x,
|
||||
m_->RightMultiply(x, y);
|
||||
}
|
||||
|
||||
void BlockJacobiPreconditioner::LeftMultiply(const double* x, double* y) const {
|
||||
m_->RightMultiply(x, y);
|
||||
}
|
||||
|
||||
} // namespace internal
|
||||
} // namespace ceres
|
||||
|
@ -60,7 +60,6 @@ class BlockJacobiPreconditioner : public BlockSparseMatrixPreconditioner {
|
||||
|
||||
// Preconditioner interface
|
||||
virtual void RightMultiply(const double* x, double* y) const;
|
||||
virtual void LeftMultiply(const double* x, double* y) const;
|
||||
virtual int num_rows() const { return m_->num_rows(); }
|
||||
virtual int num_cols() const { return m_->num_rows(); }
|
||||
|
||||
|
@ -88,6 +88,8 @@ BlockRandomAccessSparseMatrix::BlockRandomAccessSparseMatrix(
|
||||
++it) {
|
||||
const int row_block_size = blocks_[it->first];
|
||||
const int col_block_size = blocks_[it->second];
|
||||
cell_values_.push_back(make_pair(make_pair(it->first, it->second),
|
||||
values + pos));
|
||||
layout_[IntPairToLong(it->first, it->second)] =
|
||||
new CellInfo(values + pos);
|
||||
pos += row_block_size * col_block_size;
|
||||
@ -156,20 +158,19 @@ void BlockRandomAccessSparseMatrix::SetZero() {
|
||||
|
||||
void BlockRandomAccessSparseMatrix::SymmetricRightMultiply(const double* x,
|
||||
double* y) const {
|
||||
for (LayoutType::const_iterator it = layout_.begin();
|
||||
it != layout_.end();
|
||||
++it) {
|
||||
int row;
|
||||
int col;
|
||||
LongToIntPair(it->first, &row, &col);
|
||||
|
||||
vector< pair<pair<int, int>, double*> >::const_iterator it =
|
||||
cell_values_.begin();
|
||||
for (; it != cell_values_.end(); ++it) {
|
||||
const int row = it->first.first;
|
||||
const int row_block_size = blocks_[row];
|
||||
const int row_block_pos = block_positions_[row];
|
||||
|
||||
const int col = it->first.second;
|
||||
const int col_block_size = blocks_[col];
|
||||
const int col_block_pos = block_positions_[col];
|
||||
|
||||
MatrixVectorMultiply<Eigen::Dynamic, Eigen::Dynamic, 1>(
|
||||
it->second->values, row_block_size, col_block_size,
|
||||
it->second, row_block_size, col_block_size,
|
||||
x + col_block_pos,
|
||||
y + row_block_pos);
|
||||
|
||||
@ -179,7 +180,7 @@ void BlockRandomAccessSparseMatrix::SymmetricRightMultiply(const double* x,
|
||||
// triangular multiply also.
|
||||
if (row != col) {
|
||||
MatrixTransposeVectorMultiply<Eigen::Dynamic, Eigen::Dynamic, 1>(
|
||||
it->second->values, row_block_size, col_block_size,
|
||||
it->second, row_block_size, col_block_size,
|
||||
x + row_block_pos,
|
||||
y + col_block_pos);
|
||||
}
|
||||
|
@ -111,6 +111,10 @@ class BlockRandomAccessSparseMatrix : public BlockRandomAccessMatrix {
|
||||
typedef HashMap<long int, CellInfo* > LayoutType;
|
||||
LayoutType layout_;
|
||||
|
||||
// In order traversal of contents of the matrix. This allows us to
|
||||
// implement a matrix-vector which is 20% faster than using the
|
||||
// iterator in the Layout object instead.
|
||||
vector<pair<pair<int, int>, double*> > cell_values_;
|
||||
// The underlying matrix object which actually stores the cells.
|
||||
scoped_ptr<TripletSparseMatrix> tsm_;
|
||||
|
||||
|
@ -123,7 +123,7 @@ bool TrustRegionOptionsAreValid(const Solver::Options& options, string* error) {
|
||||
if (options.linear_solver_type == ITERATIVE_SCHUR &&
|
||||
options.use_explicit_schur_complement &&
|
||||
options.preconditioner_type != SCHUR_JACOBI) {
|
||||
*error = "use_explicit_schur_complement only supports"
|
||||
*error = "use_explicit_schur_complement only supports "
|
||||
"SCHUR_JACOBI as the preconditioner.";
|
||||
return false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user