Commit d13a9cbb authored by oliver.sander_at_tu-dresden.de's avatar oliver.sander_at_tu-dresden.de
Browse files

Merge branch 'minor-updates' into 'master'

Minor updates

See merge request !14
parents 30d94fd6 1d61f88b
Pipeline #28052 passed with stage
in 4 minutes and 18 seconds
......@@ -4,7 +4,7 @@
#Name of the module
Module: dune-tnnmg
Version: 0.9
Version: 2.8-git
Maintainer: graeser@mi.fu-berlin.de
#depending on
Depends: dune-common dune-istl dune-solvers
Depends: dune-common (>=2.7) dune-istl (>=2.7) dune-solvers (>=2.7)
......@@ -76,7 +76,11 @@ void testConvexity(const Functional& functional,
*/
template <class Functional>
void testHomogeneity(const Functional& functional,
#ifdef USE_OLD_TNNMG
const std::vector<typename Functional::VectorType>& testDirections)
#else
const std::vector<typename Functional::Vector>& testDirections)
#endif
{
for (auto&& testDirection : testDirections)
{
......@@ -105,12 +109,20 @@ void testHomogeneity(const Functional& functional,
*/
template <class Functional>
void testGradient(Functional& functional,
const std::vector<typename Functional::VectorType>& testPoints)
#ifdef USE_OLD_TNNMG
const std::vector<typename Functional::VectorType>& testPoints)
#else
const std::vector<typename Functional::Vector>& testPoints)
#endif
{
for (auto&& testPoint : testPoints)
{
// Get the gradient at the current test point as computed by 'functional'
#ifdef USE_OLD_TNNMG
typename Functional::VectorType gradient(testPoint.size());
#else
typename Functional::Vector gradient(testPoint.size());
#endif
gradient = 0;
functional.addGradient(testPoint, gradient);
......@@ -158,7 +170,11 @@ void testGradient(Functional& functional,
*/
template <class Functional>
void testHessian(Functional& functional,
#ifdef USE_OLD_TNNMG
const std::vector<typename Functional::VectorType>& testPoints)
#else
const std::vector<typename Functional::Vector>& testPoints)
#endif
{
for (auto&& testPoint : testPoints)
{
......@@ -251,7 +267,11 @@ void testHessian(Functional& functional,
*/
template <class Functional>
void testDirectionalSubdifferential(const Functional& functional,
#ifdef USE_OLD_TNNMG
const std::vector<typename Functional::VectorType>& testPoints)
#else
const std::vector<typename Functional::Vector>& testPoints)
#endif
{
// Step size. Best value: square root of the machine precision
const double eps = std::sqrt(std::numeric_limits<double>::epsilon());
......@@ -300,7 +320,11 @@ void testDirectionalSubdifferential(const Functional& functional,
*/
template <class Functional>
void testSubDiff(Functional& functional,
#ifdef USE_OLD_TNNMG
const std::vector<typename Functional::VectorType>& testPoints)
#else
const std::vector<typename Functional::Vector>& testPoints)
#endif
{
for (auto&& testPoint : testPoints)
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment