autodiff sqr in ngcore namespace

This commit is contained in:
Christopher Lackner 2023-09-05 13:23:20 +02:00
parent e345b3f97f
commit b4dee312a4

View File

@ -321,7 +321,7 @@ inline AutoDiff<D,SCAL> operator/ (double x, const AutoDiff<D,SCAL> & y)
} // namespace netgen } // namespace netgen
namespace std namespace ngcore
{ {
/// AutoDiff times AutoDiff /// AutoDiff times AutoDiff
template<int D, typename SCAL> template<int D, typename SCAL>
@ -335,7 +335,10 @@ inline netgen::AutoDiff<D,SCAL> sqr (const netgen::AutoDiff<D,SCAL> & x) throw()
res.DValue(i) = hx*x.DValue(i); res.DValue(i) = hx*x.DValue(i);
return res; return res;
} }
} // namespace ngcore
namespace std
{
template<int D, typename SCAL> template<int D, typename SCAL>
inline netgen::AutoDiff<D,SCAL> fabs (const netgen::AutoDiff<D,SCAL> & x) inline netgen::AutoDiff<D,SCAL> fabs (const netgen::AutoDiff<D,SCAL> & x)
{ {
@ -349,8 +352,5 @@ inline netgen::AutoDiff<D,SCAL> fabs (const netgen::AutoDiff<D,SCAL> & x)
res.DValue(i) = 0.0; res.DValue(i) = 0.0;
return res; return res;
} }
} // namespace std } // namespace std
//@}
#endif #endif