Moved spdiag out of an anonymous namespace.

It is a function meant to be called by clients, not an implementation detail.
This commit is contained in:
Atgeirr Flø Rasmussen 2013-05-15 07:42:00 +02:00
parent e8baa4a967
commit 3c2031cd2e

View File

@ -248,21 +248,19 @@ subset(const Eigen::Array<Scalar, Eigen::Dynamic, 1>& x,
}
namespace {
AutoDiff::ForwardBlock<double>::M
spdiag(const AutoDiff::ForwardBlock<double>::V& d)
{
typedef AutoDiff::ForwardBlock<double>::M M;
AutoDiff::ForwardBlock<double>::M
spdiag(const AutoDiff::ForwardBlock<double>::V& d)
{
typedef AutoDiff::ForwardBlock<double>::M M;
const int n = d.size();
M mat(n, n);
mat.reserve(Eigen::ArrayXi::Ones(n, 1));
for (M::Index i = 0; i < n; ++i) {
mat.insert(i, i) = d[i];
}
return mat;
const int n = d.size();
M mat(n, n);
mat.reserve(Eigen::ArrayXi::Ones(n, 1));
for (M::Index i = 0; i < n; ++i) {
mat.insert(i, i) = d[i];
}
} // Anonymous namespace
return mat;
}
#endif // OPM_AUTODIFFHELPERS_HEADER_INCLUDED