Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
Arcane::ISimpleTableInternalComparator Class Referenceabstract

Class interface representing a SimpleTableInternal comparator (aka STI). More...

#include <arcane/core/ISimpleTableInternalComparator.h>

Public Member Functions

virtual bool compare (bool compare_dimension_too=false)=0
 Method allowing comparison of the values of the two STIs.
virtual bool compareElem (const String &column_name, const String &row_name)=0
 Method allowing comparison of a single element. Both SimpleTableInternals are represented by Refs, so they are always up to date. This method can be used during calculation, allowing values to be compared as the calculation progresses, instead of performing a final comparison at the end (it is still possible to do both).
virtual bool compareElem (Real elem, const String &column_name, const String &row_name)=0
 Method allowing comparison of a value with a value from the reference table. This method does not use the internal 'toCompare'.
virtual void clearComparator ()=0
 Method allowing the clearing of comparison arrays and regular expressions. Does not affect the STIs.
virtual bool addColumnForComparing (const String &column_name)=0
 Method allowing the addition of a column to the list of columns to compare.
virtual bool addRowForComparing (const String &row_name)=0
 Method allowing the addition of a row to the list of rows to compare.
virtual void isAnArrayExclusiveColumns (bool is_exclusive)=0
 Method allowing definition of whether the column array represents columns to include in the comparison (false/default) or columns to exclude from the comparison (true).
virtual void isAnArrayExclusiveRows (bool is_exclusive)=0
 Method allowing definition of whether the row array represents rows to include in the comparison (false/default) or rows to exclude from the comparison (true).
virtual void editRegexColumns (const String &regex_column)=0
 Method allowing the addition of a regular expression to determine the columns to compare.
virtual void editRegexRows (const String &regex_row)=0
 Method allowing the addition of a regular expression to determine the rows to compare.
virtual void isARegexExclusiveColumns (bool is_exclusive)=0
 Method allowing specification that the regular expression excludes columns instead of including them.
virtual void isARegexExclusiveRows (bool is_exclusive)=0
 Method allowing specification that the regular expression excludes rows instead of including them.
virtual bool addEpsilonColumn (const String &column_name, Real epsilon)=0
 Method allowing the definition of an epsilon for a given column. This epsilon must be positive to be considered. If there is a conflict with a row epsilon (defined with addEpsilonRow()), the largest epsilon is taken into account.
virtual bool addEpsilonRow (const String &row_name, Real epsilon)=0
 Method allowing the definition of an epsilon for a given row. This epsilon must be positive to be considered. If there is a conflict with a column epsilon (defined with addEpsilonColumn()), the largest epsilon is taken into account.
virtual Ref< SimpleTableInternalinternalRef ()=0
 Method allowing retrieval of a reference to the used "reference" SimpleTableInternal object.
virtual void setInternalRef (const Ref< SimpleTableInternal > &simple_table_internal)=0
 Method allowing definition of a reference to a "reference" SimpleTableInternal.
virtual Ref< SimpleTableInternalinternalToCompare ()=0
 Method allowing retrieval of a reference to the used "to compare" SimpleTableInternal object.
virtual void setInternalToCompare (const Ref< SimpleTableInternal > &simple_table_internal)=0
 Method allowing definition of a reference to the "to compare" SimpleTableInternal.

Detailed Description

Class interface representing a SimpleTableInternal comparator (aka STI).

The principle is to compare the values of one STI with the values of a reference STI, using an epsilon representing the acceptable error margin.

There are two ways to configure this comparator:

  • two arrays of Strings (row/column),
  • two regular expressions (row/column).

You can add row/column names to these arrays, specify whether these rows/columns should be included in the comparison, or, conversely, if they should be excluded from the comparison.

The same applies to regular expressions: you add a row/column regular expression and specify whether these expressions include or exclude rows/columns.

If both types of methods are defined, the arrays take precedence over the regular expressions: first, we check for the presence of the row/column name in the corresponding array.

If the name is present, we include/exclude this row/column from the comparison. If the name is absent but a regular expression is defined, we search for a match within it.

If neither type is defined (empty array and empty regular expression), all rows/columns are included in the comparison.

Definition at line 62 of file ISimpleTableInternalComparator.h.

Member Function Documentation

◆ addColumnForComparing()

virtual bool Arcane::ISimpleTableInternalComparator::addColumnForComparing ( const String & column_name)
pure virtual

Method allowing the addition of a column to the list of columns to compare.

Parameters
column_nameThe name of the column to compare.
Returns
true If the name was successfully added.
false Otherwise.

◆ addEpsilonColumn()

virtual bool Arcane::ISimpleTableInternalComparator::addEpsilonColumn ( const String & column_name,
Real epsilon )
pure virtual

Method allowing the definition of an epsilon for a given column. This epsilon must be positive to be considered. If there is a conflict with a row epsilon (defined with addEpsilonRow()), the largest epsilon is taken into account.

Note
If an epsilon has already been defined for this column, the old epsilon will be replaced.
Parameters
column_nameThe name of the column where the epsilon will be taken into account.
epsilonThe epsilon error margin.
Returns
true If the epsilon could be successfully defined.
false If the epsilon could not be defined.

◆ addEpsilonRow()

virtual bool Arcane::ISimpleTableInternalComparator::addEpsilonRow ( const String & row_name,
Real epsilon )
pure virtual

Method allowing the definition of an epsilon for a given row. This epsilon must be positive to be considered. If there is a conflict with a column epsilon (defined with addEpsilonColumn()), the largest epsilon is taken into account.

Note
If an epsilon has already been defined for this row, the old epsilon will be replaced.
Parameters
row_nameThe name of the row where the epsilon will be taken into account.
epsilonThe epsilon error margin.
Returns
true If the epsilon could be successfully defined.
false If the epsilon could not be defined.

◆ addRowForComparing()

virtual bool Arcane::ISimpleTableInternalComparator::addRowForComparing ( const String & row_name)
pure virtual

Method allowing the addition of a row to the list of rows to compare.

Parameters
row_nameThe name of the row to compare.
Returns
true If the name was successfully added.
false Otherwise.

◆ compare()

virtual bool Arcane::ISimpleTableInternalComparator::compare ( bool compare_dimension_too = false)
pure virtual

Method allowing comparison of the values of the two STIs.

Parameters
compare_dimension_tooIf the STI dimensions must be compared.
Returns
true If there are no differences.
false If there is at least one difference.

◆ compareElem() [1/2]

virtual bool Arcane::ISimpleTableInternalComparator::compareElem ( const String & column_name,
const String & row_name )
pure virtual

Method allowing comparison of a single element. Both SimpleTableInternals are represented by Refs, so they are always up to date. This method can be used during calculation, allowing values to be compared as the calculation progresses, instead of performing a final comparison at the end (it is still possible to do both).

Parameters
column_nameThe name of the column where the element is located.
row_nameThe name of the row where the element is located.
Returns
true If both values are equal.
false If both values are different.

◆ compareElem() [2/2]

virtual bool Arcane::ISimpleTableInternalComparator::compareElem ( Real elem,
const String & column_name,
const String & row_name )
pure virtual

Method allowing comparison of a value with a value from the reference table. This method does not use the internal 'toCompare'.

Parameters
elemThe value to compare.
column_nameThe name of the column where the reference element is located.
row_nameThe name of the row where the reference element is located.
Returns
true If both values are equal.
false If both values are different.

◆ editRegexColumns()

virtual void Arcane::ISimpleTableInternalComparator::editRegexColumns ( const String & regex_column)
pure virtual

Method allowing the addition of a regular expression to determine the columns to compare.

Parameters
regex_columnThe regular expression (ECMAScript format).

◆ editRegexRows()

virtual void Arcane::ISimpleTableInternalComparator::editRegexRows ( const String & regex_row)
pure virtual

Method allowing the addition of a regular expression to determine the rows to compare.

Parameters
regex_rowThe regular expression (ECMAScript format).

◆ internalRef()

virtual Ref< SimpleTableInternal > Arcane::ISimpleTableInternalComparator::internalRef ( )
pure virtual

Method allowing retrieval of a reference to the used "reference" SimpleTableInternal object.

Returns
Ref<SimpleTableInternal> A copy of the reference.

◆ internalToCompare()

virtual Ref< SimpleTableInternal > Arcane::ISimpleTableInternalComparator::internalToCompare ( )
pure virtual

Method allowing retrieval of a reference to the used "to compare" SimpleTableInternal object.

Returns
Ref<SimpleTableInternal> A copy of the reference.

◆ isAnArrayExclusiveColumns()

virtual void Arcane::ISimpleTableInternalComparator::isAnArrayExclusiveColumns ( bool is_exclusive)
pure virtual

Method allowing definition of whether the column array represents columns to include in the comparison (false/default) or columns to exclude from the comparison (true).

Parameters
is_exclusivetrue if the columns must be excluded.

◆ isAnArrayExclusiveRows()

virtual void Arcane::ISimpleTableInternalComparator::isAnArrayExclusiveRows ( bool is_exclusive)
pure virtual

Method allowing definition of whether the row array represents rows to include in the comparison (false/default) or rows to exclude from the comparison (true).

Parameters
is_exclusivetrue if the rows must be excluded.

◆ isARegexExclusiveColumns()

virtual void Arcane::ISimpleTableInternalComparator::isARegexExclusiveColumns ( bool is_exclusive)
pure virtual

Method allowing specification that the regular expression excludes columns instead of including them.

Parameters
is_exclusiveIf the regular expression is exclusionary.

◆ isARegexExclusiveRows()

virtual void Arcane::ISimpleTableInternalComparator::isARegexExclusiveRows ( bool is_exclusive)
pure virtual

Method allowing specification that the regular expression excludes rows instead of including them.

Parameters
is_exclusiveIf the regular expression is exclusionary.

◆ setInternalRef()

virtual void Arcane::ISimpleTableInternalComparator::setInternalRef ( const Ref< SimpleTableInternal > & simple_table_internal)
pure virtual

Method allowing definition of a reference to a "reference" SimpleTableInternal.

Parameters
simple_table_internalThe reference to a SimpleTableInternal.

◆ setInternalToCompare()

virtual void Arcane::ISimpleTableInternalComparator::setInternalToCompare ( const Ref< SimpleTableInternal > & simple_table_internal)
pure virtual

Method allowing definition of a reference to the "to compare" SimpleTableInternal.

Parameters
simple_table_internalThe reference to a SimpleTableInternal.

The documentation for this class was generated from the following file: