Skip to content
Snippets Groups Projects
Commit 255c9185 authored by Nina Džugasová's avatar Nina Džugasová Committed by Tomáš Oberhuber
Browse files

Added ConfigDescription documentation and added small changes in Object, Math...

Added ConfigDescription documentation and added small changes in Object, Math and ParameterContainer.
parent 0c7cf446
No related branches found
No related tags found
1 merge request!15Nina
...@@ -27,8 +27,18 @@ class ConfigDescription ...@@ -27,8 +27,18 @@ class ConfigDescription
{ {
public: public:
/**
* \brief Basic constructor.
*/
ConfigDescription(); ConfigDescription();
/**
* \brief Adds new entry to the configuration description.
*
* \tparam EntryType Type of the entry.
* \param name Name of the entry.
* \param description More specific information about the entry.
*/
template< typename EntryType > template< typename EntryType >
void addEntry( const String& name, void addEntry( const String& name,
const String& description ) const String& description )
...@@ -37,6 +47,13 @@ class ConfigDescription ...@@ -37,6 +47,13 @@ class ConfigDescription
entries.Append( currentEntry ); entries.Append( currentEntry );
} }
/**
* \brief Adds new entry to the configuration description.
*
* \tparam EntryType Type of the entry.
* \param name Name of the entry.
* \param description More specific information about the entry.
*/
template< typename EntryType > template< typename EntryType >
void addRequiredEntry( const String& name, void addRequiredEntry( const String& name,
const String& description ) const String& description )
...@@ -44,7 +61,15 @@ class ConfigDescription ...@@ -44,7 +61,15 @@ class ConfigDescription
currentEntry = new ConfigEntry< EntryType >( name, description, true ); currentEntry = new ConfigEntry< EntryType >( name, description, true );
entries.Append( currentEntry ); entries.Append( currentEntry );
} }
/**
* \brief Adds new entry to the configuration description.
*
* \tparam EntryType Type of the entry.
* \param name Name of the entry.
* \param description More specific information about the entry.
* \param defaultValue Default value of the entry.
*/
template< typename EntryType > template< typename EntryType >
void addEntry( const String& name, void addEntry( const String& name,
const String& description, const String& description,
...@@ -57,6 +82,13 @@ class ConfigDescription ...@@ -57,6 +82,13 @@ class ConfigDescription
entries. Append( currentEntry ); entries. Append( currentEntry );
} }
/**
* \brief Adds new list to the configuration description.
*
* \tparam EntryType Type of the list.
* \param name Name of the list.
* \param description More specific information about the list.
*/
template< typename EntryType > template< typename EntryType >
void addList( const String& name, void addList( const String& name,
const String& description ) const String& description )
...@@ -65,6 +97,13 @@ class ConfigDescription ...@@ -65,6 +97,13 @@ class ConfigDescription
entries.Append( currentEntry ); entries.Append( currentEntry );
} }
/**
* \brief Adds new list to the configuration description.
*
* \tparam EntryType Type of the list.
* \param name Name of the list.
* \param description More specific information about the list.
*/
template< typename EntryType > template< typename EntryType >
void addRequiredList( const String& name, void addRequiredList( const String& name,
const String& description ) const String& description )
...@@ -73,6 +112,14 @@ class ConfigDescription ...@@ -73,6 +112,14 @@ class ConfigDescription
entries.Append( currentEntry ); entries.Append( currentEntry );
} }
/**
* \brief Adds new list to the configuration description.
*
* \tparam EntryType Type of the list.
* \param name Name of the list.
* \param description More specific information about the list.
* \param defaultValue Default value of the list.
*/
template< typename EntryType > template< typename EntryType >
void addList( const String& name, void addList( const String& name,
const String& description, const String& description,
...@@ -162,6 +209,9 @@ class ConfigDescription ...@@ -162,6 +209,9 @@ class ConfigDescription
//bool parseConfigDescription( const char* file_name ); //bool parseConfigDescription( const char* file_name );
/**
* \brief Basic destructor.
*/
~ConfigDescription(); ~ConfigDescription();
protected: protected:
......
...@@ -89,9 +89,9 @@ class ParameterContainer ...@@ -89,9 +89,9 @@ class ParameterContainer
* If the parameter does not have any value or has different value then the given * If the parameter does not have any value or has different value then the given
* \e value the method returns \e false and shows message when \e verbose is \e true. * \e value the method returns \e false and shows message when \e verbose is \e true.
* *
* @param name Name of parameter. * \param name Name of parameter.
* @param value Value of type T we want to check whether is assigned to the parameter. * \param value Value of type T we want to check whether is assigned to the parameter.
* @param verbose Boolean value defining whether to show error message (when true) or not (when false). * \param verbose Boolean value defining whether to show error message (when true) or not (when false).
*/ */
template< class T > bool getParameter( const String& name, template< class T > bool getParameter( const String& name,
T& value, T& value,
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
namespace TNL { namespace TNL {
/*** /**
* \brief This function returns minimum of two numbers. * \brief This function returns minimum of two numbers.
* *
* GPU device code uses the functions defined in the CUDA's math_functions.h, * GPU device code uses the functions defined in the CUDA's math_functions.h,
...@@ -43,7 +43,7 @@ ResultType min( const T1& a, const T2& b ) ...@@ -43,7 +43,7 @@ ResultType min( const T1& a, const T2& b )
} }
/*** /**
* \brief This function returns maximum of two numbers. * \brief This function returns maximum of two numbers.
* *
* GPU device code uses the functions defined in the CUDA's math_functions.h, * GPU device code uses the functions defined in the CUDA's math_functions.h,
...@@ -191,8 +191,8 @@ T sign( const T& a ) ...@@ -191,8 +191,8 @@ T sign( const T& a )
* *
* It tests whether the number \e v is in \e tolerance, in other words, whether * It tests whether the number \e v is in \e tolerance, in other words, whether
* \e v in absolute value is less then or equal to \e tolerance. * \e v in absolute value is less then or equal to \e tolerance.
* @param v Real number. * \param v Real number.
* @param tolerance Critical value which is set to 0.00001 by defalt. * \param tolerance Critical value which is set to 0.00001 by defalt.
*/ */
template< typename Real > template< typename Real >
__cuda_callable__ __cuda_callable__
...@@ -205,8 +205,8 @@ bool isSmall( const Real& v, ...@@ -205,8 +205,8 @@ bool isSmall( const Real& v,
/** /**
* \brief This function divides \e num by \e div and rounds up the result. * \brief This function divides \e num by \e div and rounds up the result.
* *
* @param num An integer considered as dividend. * \param num An integer considered as dividend.
* @param div An integer considered as divisor. * \param div An integer considered as divisor.
*/ */
__cuda_callable__ __cuda_callable__
inline int roundUpDivision( const int num, const int div ) inline int roundUpDivision( const int num, const int div )
...@@ -217,8 +217,8 @@ inline int roundUpDivision( const int num, const int div ) ...@@ -217,8 +217,8 @@ inline int roundUpDivision( const int num, const int div )
/** /**
* \brief This function rounds up \e number to the nearest multiple of number \e multiple. * \brief This function rounds up \e number to the nearest multiple of number \e multiple.
* *
* @param number Integer we want to round. * \param number Integer we want to round.
* @param multiple Integer. * \param multiple Integer.
*/ */
__cuda_callable__ __cuda_callable__
inline int roundToMultiple( int number, int multiple ) inline int roundToMultiple( int number, int multiple )
...@@ -226,12 +226,24 @@ inline int roundToMultiple( int number, int multiple ) ...@@ -226,12 +226,24 @@ inline int roundToMultiple( int number, int multiple )
return multiple*( number/ multiple + ( number % multiple != 0 ) ); return multiple*( number/ multiple + ( number % multiple != 0 ) );
} }
/**
* \brief This function checks if \e x is an integral power of two.
*
* Returns \e true if \e x is a power of two. Otherwise returns \e false.
* \param x Integer.
*/
__cuda_callable__ __cuda_callable__
inline bool isPow2( int x ) inline bool isPow2( int x )
{ {
return ( ( x & ( x - 1 ) ) == 0 ); return ( ( x & ( x - 1 ) ) == 0 );
} }
/**
* \brief This function checks if \e x is an integral power of two.
*
* Returns \e true if \e x is a power of two. Otherwise returns \e false.
* \param x Long integer.
*/
__cuda_callable__ __cuda_callable__
inline bool isPow2( long int x ) inline bool isPow2( long int x )
{ {
......
...@@ -33,7 +33,7 @@ class Object ...@@ -33,7 +33,7 @@ class Object
{ {
public: public:
/**** /**
* \brief Type getter. * \brief Type getter.
* *
* Returns the type in C++ style - for example the returned value * Returns the type in C++ style - for example the returned value
...@@ -43,7 +43,7 @@ class Object ...@@ -43,7 +43,7 @@ class Object
virtual String getTypeVirtual() const; virtual String getTypeVirtual() const;
/**** /**
* \brief This is used for load and save methods. * \brief This is used for load and save methods.
* *
* Each object is saved as if it was stored on Devices::Host. So even Vector< double, Devices::Cuda > * Each object is saved as if it was stored on Devices::Host. So even Vector< double, Devices::Cuda >
...@@ -53,21 +53,21 @@ class Object ...@@ -53,21 +53,21 @@ class Object
virtual String getSerializationTypeVirtual() const; virtual String getSerializationTypeVirtual() const;
/*** /**
* \brief Method for saving the object to a file as a binary data. * \brief Method for saving the object to a file as a binary data.
* *
* \param file Name of file object. * \param file Name of file object.
*/ */
virtual bool save( File& file ) const; virtual bool save( File& file ) const;
/*** /**
* \brief Method for restoring the object from a file. * \brief Method for restoring the object from a file.
* *
* \param file Name of file object. * \param file Name of file object.
*/ */
virtual bool load( File& file ); virtual bool load( File& file );
/*** /**
* \brief Method for restoring the object from a file. * \brief Method for restoring the object from a file.
* *
* \param file Name of file object. * \param file Name of file object.
......
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