From 427b59d2cb00e0f152c567ab70be09ee14968f7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Klinkovsk=C3=BD?= <klinkovsky@mmg.fjfi.cvut.cz> Date: Sun, 2 Feb 2020 17:25:36 +0100 Subject: [PATCH] Small fixes for the usage of the configuration system --- src/Benchmarks/ODESolvers/tnl-benchmark-ode-solvers.h | 2 +- src/Examples/ConfigDescriptionExample.cpp | 3 ++- src/TNL/Containers/StaticVector.hpp | 7 +------ 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/Benchmarks/ODESolvers/tnl-benchmark-ode-solvers.h b/src/Benchmarks/ODESolvers/tnl-benchmark-ode-solvers.h index c9389e9220..94c452cc68 100644 --- a/src/Benchmarks/ODESolvers/tnl-benchmark-ode-solvers.h +++ b/src/Benchmarks/ODESolvers/tnl-benchmark-ode-solvers.h @@ -192,7 +192,7 @@ configSetup( Config::ConfigDescription& config ) config.addEntryEnum( "overwrite" ); config.addEntry< int >( "loops", "Number of repetitions of the benchmark.", 10 ); config.addEntry< int >( "verbose", "Verbose mode.", 1 ); - config.addList< String >( "solvers", "Comma-separated list of solvers to run benchmarks for.", "all" ); + config.addList< String >( "solvers", "List of solvers to run benchmarks for.", {"all"} ); config.addEntryEnum< String >( "euler" ); config.addEntryEnum< String >( "merson" ); config.addEntryEnum< String >( "all" ); diff --git a/src/Examples/ConfigDescriptionExample.cpp b/src/Examples/ConfigDescriptionExample.cpp index 59958f1d10..210d36750d 100644 --- a/src/Examples/ConfigDescriptionExample.cpp +++ b/src/Examples/ConfigDescriptionExample.cpp @@ -1,9 +1,10 @@ #include <iostream> #include <TNL/Config/ConfigDescription.h> +#include <TNL/String.h> using namespace TNL; using namespace std; - + int main() { Config::ConfigDescription confd; diff --git a/src/TNL/Containers/StaticVector.hpp b/src/TNL/Containers/StaticVector.hpp index 4a1b41b219..bbcf8a09f5 100644 --- a/src/TNL/Containers/StaticVector.hpp +++ b/src/TNL/Containers/StaticVector.hpp @@ -42,12 +42,7 @@ StaticVector< Size, Real >::setup( const Config::ParameterContainer& parameters, const String& prefix ) { for( int i = 0; i < Size; i++ ) - { - double aux; - if( ! parameters.template getParameter< double >( prefix + convertToString( i ), aux ) ) - return false; - this->data[ i ] = aux; - } + this->data[ i ] = parameters.template getParameter< double >( prefix + convertToString( i ) ); return true; } -- GitLab