Skip to content
Snippets Groups Projects
Commit 427b59d2 authored by Jakub Klinkovský's avatar Jakub Klinkovský
Browse files

Small fixes for the usage of the configuration system

parent 8db887a7
No related branches found
No related tags found
1 merge request!50Refactoring of the configuration system
...@@ -192,7 +192,7 @@ configSetup( Config::ConfigDescription& config ) ...@@ -192,7 +192,7 @@ configSetup( Config::ConfigDescription& config )
config.addEntryEnum( "overwrite" ); config.addEntryEnum( "overwrite" );
config.addEntry< int >( "loops", "Number of repetitions of the benchmark.", 10 ); config.addEntry< int >( "loops", "Number of repetitions of the benchmark.", 10 );
config.addEntry< int >( "verbose", "Verbose mode.", 1 ); 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 >( "euler" );
config.addEntryEnum< String >( "merson" ); config.addEntryEnum< String >( "merson" );
config.addEntryEnum< String >( "all" ); config.addEntryEnum< String >( "all" );
......
#include <iostream> #include <iostream>
#include <TNL/Config/ConfigDescription.h> #include <TNL/Config/ConfigDescription.h>
#include <TNL/String.h>
using namespace TNL; using namespace TNL;
using namespace std; using namespace std;
int main() int main()
{ {
Config::ConfigDescription confd; Config::ConfigDescription confd;
......
...@@ -42,12 +42,7 @@ StaticVector< Size, Real >::setup( const Config::ParameterContainer& parameters, ...@@ -42,12 +42,7 @@ StaticVector< Size, Real >::setup( const Config::ParameterContainer& parameters,
const String& prefix ) const String& prefix )
{ {
for( int i = 0; i < Size; i++ ) for( int i = 0; i < Size; i++ )
{ this->data[ i ] = parameters.template getParameter< double >( prefix + convertToString( i ) );
double aux;
if( ! parameters.template getParameter< double >( prefix + convertToString( i ), aux ) )
return false;
this->data[ i ] = aux;
}
return true; return true;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment