Merge remote-tracking branch 'bska/master'

This commit is contained in:
Atgeirr Flø Rasmussen 2013-05-24 09:06:50 +02:00
commit 8afdef61b6

View File

@ -381,13 +381,11 @@ collapseJacs(const AutoDiff::ForwardBlock<double>& x)
int block_col_start = 0; int block_col_start = 0;
for (int block = 0; block < nb; ++block) { for (int block = 0; block < nb; ++block) {
const ADB::M& jac = x.derivative()[block]; const ADB::M& jac = x.derivative()[block];
// ADB::M is column major for (ADB::M::Index k = 0; k < jac.outerSize(); ++k) {
for (int col = 0; col < jac.cols(); ++col) { for (ADB::M::InnerIterator i(jac, k); i ; ++i) {
for (int elem = jac.outerIndexPtr()[col]; t.push_back(Tri(i.row(),
elem < jac.outerIndexPtr()[col + 1]; i.col() + block_col_start,
++elem) { i.value()));
const int row = jac.innerIndexPtr()[elem];
t.emplace_back(row, block_col_start + col, jac.valuePtr()[elem]);
} }
} }
block_col_start += jac.cols(); block_col_start += jac.cols();