From f123be63a5760782c563d81d7842de6cc3e5646b Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Mon, 11 Oct 2010 02:51:41 -0400 Subject: Support adaptive integration with equation systems. --- src/vZ/EquationSystem.hpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src') diff --git a/src/vZ/EquationSystem.hpp b/src/vZ/EquationSystem.hpp index 0963baf..6409f18 100644 --- a/src/vZ/EquationSystem.hpp +++ b/src/vZ/EquationSystem.hpp @@ -21,6 +21,8 @@ #ifndef VZ_EQUATIONSYSTEM_HPP #define VZ_EQUATIONSYSTEM_HPP +#include +#include #include namespace vZ @@ -149,6 +151,18 @@ namespace vZ } return *this; } + + template + typename EquationSystem::Scalar + abs(const EquationSystem& es) + { + typename EquationSystem::Scalar ret(0); + for (std::size_t i = 0; i < N; ++i) { + using std::abs; + ret = std::max(ret, abs(es[i])); + } + return ret; + } } #endif // VZ_EQUATIONSYSTEM_HPP -- cgit v1.2.3