mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-11-28 20:13:49 -06:00
Put spdiag() into an anonymous namespace.
This avoids warnings (GCC 4.6) about missing prior function declaration.
This commit is contained in:
parent
92592672fe
commit
a174d4eb51
@ -248,19 +248,21 @@ subset(const Eigen::Array<Scalar, Eigen::Dynamic, 1>& x,
|
||||
}
|
||||
|
||||
|
||||
AutoDiff::ForwardBlock<double>::M
|
||||
spdiag(const AutoDiff::ForwardBlock<double>::V& d)
|
||||
{
|
||||
typedef AutoDiff::ForwardBlock<double>::M M;
|
||||
namespace {
|
||||
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];
|
||||
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;
|
||||
}
|
||||
|
||||
return mat;
|
||||
}
|
||||
} // Anonymous namespace
|
||||
|
||||
#endif // OPM_AUTODIFFHELPERS_HEADER_INCLUDED
|
||||
|
Loading…
Reference in New Issue
Block a user