Fix bug in operator+ introduced by previous commit.

Also make documentation clearer.
This commit is contained in:
Atgeirr Flø Rasmussen 2013-10-24 00:14:32 +02:00
parent 46a17945a3
commit 1eec8b16d6

View File

@ -104,8 +104,8 @@ namespace Opm
}
/// Create an AutoDiffBlock representing a constant.
/// This variant allows to specify the block sizes used
/// for the Jacobian even though the Jacobian matrices
/// This variant requires specifying the block sizes used
/// for the Jacobians even though the Jacobian matrices
/// themselves will be zero.
/// \param[in] val values
/// \param[in] blocksizes block pattern
@ -201,7 +201,7 @@ namespace Opm
return val_ + rhs;
}
if (rhs.jac_.empty()) {
return *this - rhs.val_;
return *this + rhs.val_;
}
std::vector<M> jac = jac_;
assert(numBlocks() == rhs.numBlocks());