mirror of
https://github.com/OPM/opm-simulators.git
synced 2026-09-05 04:40:19 -05:00
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:
+12
-14
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user