Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
Arcane::SimpleTableInternalComparator Class Reference
Inheritance diagram for Arcane::SimpleTableInternalComparator:
Collaboration diagram for Arcane::SimpleTableInternalComparator:

Public Member Functions

 SimpleTableInternalComparator (const Ref< SimpleTableInternal > &sti_ref, const Ref< SimpleTableInternal > &sti_to_compare)
bool compare (bool compare_dimension_too) override
 Method allowing comparison of the values of the two STIs.
bool compareElem (const String &column_name, const String &row_name) override
 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).
bool compareElem (Real elem, const String &column_name, const String &row_name) override
 Method allowing comparison of a value with a value from the reference table. This method does not use the internal 'toCompare'.
void clearComparator () override
 Method allowing the clearing of comparison arrays and regular expressions. Does not affect the STIs.
bool addColumnForComparing (const String &column_name) override
 Method allowing the addition of a column to the list of columns to compare.
bool addRowForComparing (const String &row_name) override
 Method allowing the addition of a row to the list of rows to compare.
void isAnArrayExclusiveColumns (bool is_exclusive) override
 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).
void isAnArrayExclusiveRows (bool is_exclusive) override
 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).
void editRegexColumns (const String &regex_column) override
 Method allowing the addition of a regular expression to determine the columns to compare.
void editRegexRows (const String &regex_row) override
 Method allowing the addition of a regular expression to determine the rows to compare.
void isARegexExclusiveColumns (bool is_exclusive) override
 Method allowing specification that the regular expression excludes columns instead of including them.
void isARegexExclusiveRows (bool is_exclusive) override
 Method allowing specification that the regular expression excludes rows instead of including them.
bool addEpsilonColumn (const String &column_name, Real epsilon) override
 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.
bool addEpsilonRow (const String &row_name, Real epsilon) override
 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.
Ref< SimpleTableInternalinternalRef () override
 Method allowing retrieval of a reference to the used "reference" SimpleTableInternal object.
void setInternalRef (const Ref< SimpleTableInternal > &simple_table_internal) override
 Method allowing definition of a reference to a "reference" SimpleTableInternal.
Ref< SimpleTableInternalinternalToCompare () override
 Method allowing retrieval of a reference to the used "to compare" SimpleTableInternal object.
void setInternalToCompare (const Ref< SimpleTableInternal > &simple_table_internal) override
 Method allowing definition of a reference to the "to compare" SimpleTableInternal.

Protected Member Functions

bool _exploreColumn (const String &column_name)
 Method to determine whether the column named column_name should be explored or not.
bool _exploreRows (const String &row_name)
 Method to determine whether the row named column_name should be explored or not.

Protected Attributes

Ref< SimpleTableInternalm_simple_table_internal_reference
Ref< SimpleTableInternalm_simple_table_internal_to_compare
SimpleTableInternalMng m_simple_table_internal_mng_reference
SimpleTableInternalMng m_simple_table_internal_mng_to_compare
String m_regex_rows
bool m_is_excluding_regex_rows
String m_regex_columns
bool m_is_excluding_regex_columns
StringUniqueArray m_rows_to_compare
bool m_is_excluding_array_rows
StringUniqueArray m_columns_to_compare
bool m_is_excluding_array_columns
std::map< String, Realm_epsilons_column
std::map< String, Realm_epsilons_row

Detailed Description

Definition at line 36 of file SimpleTableInternalComparator.h.

Constructor & Destructor Documentation

◆ SimpleTableInternalComparator() [1/2]

Arcane::SimpleTableInternalComparator::SimpleTableInternalComparator ( const Ref< SimpleTableInternal > & sti_ref,
const Ref< SimpleTableInternal > & sti_to_compare )
inline

Definition at line 41 of file SimpleTableInternalComparator.h.

◆ SimpleTableInternalComparator() [2/2]

Arcane::SimpleTableInternalComparator::SimpleTableInternalComparator ( )
inline

Definition at line 59 of file SimpleTableInternalComparator.h.

Member Function Documentation

◆ _exploreColumn()

bool Arcane::SimpleTableInternalComparator::_exploreColumn ( const String & column_name)
protected

Method to determine whether the column named column_name should be explored or not.

Parameters
column_nameThe name of the column to check.
Returns
true If the column should be checked.
false If the column should not be checked.

Definition at line 267 of file SimpleTableInternalComparator.cc.

References Arcane::String::localstr().

Referenced by compare().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _exploreRows()

bool Arcane::SimpleTableInternalComparator::_exploreRows ( const String & row_name)
protected

Method to determine whether the row named column_name should be explored or not.

Parameters
column_nameThe name of the row to check.
Returns
true If the row should be checked.
false If the row should not be checked.

Definition at line 305 of file SimpleTableInternalComparator.cc.

References Arcane::String::localstr().

Referenced by compare().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ addColumnForComparing()

bool Arcane::SimpleTableInternalComparator::addColumnForComparing ( const String & column_name)
overridevirtual

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.

Implements Arcane::ISimpleTableInternalComparator.

Definition at line 160 of file SimpleTableInternalComparator.cc.

◆ addEpsilonColumn()

bool Arcane::SimpleTableInternalComparator::addEpsilonColumn ( const String & column_name,
Real epsilon )
overridevirtual

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.

Implements Arcane::ISimpleTableInternalComparator.

Definition at line 209 of file SimpleTableInternalComparator.cc.

◆ addEpsilonRow()

bool Arcane::SimpleTableInternalComparator::addEpsilonRow ( const String & row_name,
Real epsilon )
overridevirtual

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.

Implements Arcane::ISimpleTableInternalComparator.

Definition at line 216 of file SimpleTableInternalComparator.cc.

◆ addRowForComparing()

bool Arcane::SimpleTableInternalComparator::addRowForComparing ( const String & row_name)
overridevirtual

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.

Implements Arcane::ISimpleTableInternalComparator.

Definition at line 166 of file SimpleTableInternalComparator.cc.

◆ clearComparator()

void Arcane::SimpleTableInternalComparator::clearComparator ( )
overridevirtual

Method allowing the clearing of comparison arrays and regular expressions. Does not affect the STIs.

Implements Arcane::ISimpleTableInternalComparator.

Definition at line 144 of file SimpleTableInternalComparator.cc.

◆ compare()

bool Arcane::SimpleTableInternalComparator::compare ( bool compare_dimension_too)
overridevirtual

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.

Implements Arcane::ISimpleTableInternalComparator.

Definition at line 32 of file SimpleTableInternalComparator.cc.

References _exploreColumn(), _exploreRows(), Arcane::math::isNearlyEqual(), Arcane::math::isNearlyEqualWithEpsilon(), and Arcane::math::max().

Here is the call graph for this function:

◆ compareElem() [1/2]

bool Arcane::SimpleTableInternalComparator::compareElem ( const String & column_name,
const String & row_name )
overridevirtual

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.

Implements Arcane::ISimpleTableInternalComparator.

Definition at line 105 of file SimpleTableInternalComparator.cc.

References compareElem().

Referenced by compareElem().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ compareElem() [2/2]

bool Arcane::SimpleTableInternalComparator::compareElem ( Real elem,
const String & column_name,
const String & row_name )
overridevirtual

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.

Implements Arcane::ISimpleTableInternalComparator.

Definition at line 116 of file SimpleTableInternalComparator.cc.

References Arcane::math::isNearlyEqual(), Arcane::math::isNearlyEqualWithEpsilon(), and Arcane::math::max().

Here is the call graph for this function:

◆ editRegexColumns()

void Arcane::SimpleTableInternalComparator::editRegexColumns ( const String & regex_column)
overridevirtual

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

Parameters
regex_columnThe regular expression (ECMAScript format).

Implements Arcane::ISimpleTableInternalComparator.

Definition at line 184 of file SimpleTableInternalComparator.cc.

◆ editRegexRows()

void Arcane::SimpleTableInternalComparator::editRegexRows ( const String & regex_row)
overridevirtual

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

Parameters
regex_rowThe regular expression (ECMAScript format).

Implements Arcane::ISimpleTableInternalComparator.

Definition at line 189 of file SimpleTableInternalComparator.cc.

◆ internalRef()

Ref< SimpleTableInternal > Arcane::SimpleTableInternalComparator::internalRef ( )
overridevirtual

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

Returns
Ref<SimpleTableInternal> A copy of the reference.

Implements Arcane::ISimpleTableInternalComparator.

Definition at line 226 of file SimpleTableInternalComparator.cc.

◆ internalToCompare()

Ref< SimpleTableInternal > Arcane::SimpleTableInternalComparator::internalToCompare ( )
overridevirtual

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

Returns
Ref<SimpleTableInternal> A copy of the reference.

Implements Arcane::ISimpleTableInternalComparator.

Definition at line 241 of file SimpleTableInternalComparator.cc.

◆ isAnArrayExclusiveColumns()

void Arcane::SimpleTableInternalComparator::isAnArrayExclusiveColumns ( bool is_exclusive)
overridevirtual

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.

Implements Arcane::ISimpleTableInternalComparator.

Definition at line 173 of file SimpleTableInternalComparator.cc.

◆ isAnArrayExclusiveRows()

void Arcane::SimpleTableInternalComparator::isAnArrayExclusiveRows ( bool is_exclusive)
overridevirtual

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.

Implements Arcane::ISimpleTableInternalComparator.

Definition at line 178 of file SimpleTableInternalComparator.cc.

◆ isARegexExclusiveColumns()

void Arcane::SimpleTableInternalComparator::isARegexExclusiveColumns ( bool is_exclusive)
overridevirtual

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

Parameters
is_exclusiveIf the regular expression is exclusionary.

Implements Arcane::ISimpleTableInternalComparator.

Definition at line 195 of file SimpleTableInternalComparator.cc.

◆ isARegexExclusiveRows()

void Arcane::SimpleTableInternalComparator::isARegexExclusiveRows ( bool is_exclusive)
overridevirtual

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

Parameters
is_exclusiveIf the regular expression is exclusionary.

Implements Arcane::ISimpleTableInternalComparator.

Definition at line 200 of file SimpleTableInternalComparator.cc.

◆ setInternalRef()

void Arcane::SimpleTableInternalComparator::setInternalRef ( const Ref< SimpleTableInternal > & simple_table_internal)
overridevirtual

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

Parameters
simple_table_internalThe reference to a SimpleTableInternal.

Implements Arcane::ISimpleTableInternalComparator.

Definition at line 232 of file SimpleTableInternalComparator.cc.

References ARCANE_FATAL, and Arcane::RefImpl< InstanceType, RefClassType, ImplTagId >::isNull().

Here is the call graph for this function:

◆ setInternalToCompare()

void Arcane::SimpleTableInternalComparator::setInternalToCompare ( const Ref< SimpleTableInternal > & simple_table_internal)
overridevirtual

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

Parameters
simple_table_internalThe reference to a SimpleTableInternal.

Implements Arcane::ISimpleTableInternalComparator.

Definition at line 247 of file SimpleTableInternalComparator.cc.

References ARCANE_FATAL, and Arcane::RefImpl< InstanceType, RefClassType, ImplTagId >::isNull().

Here is the call graph for this function:

Member Data Documentation

◆ m_columns_to_compare

StringUniqueArray Arcane::SimpleTableInternalComparator::m_columns_to_compare
protected

Definition at line 129 of file SimpleTableInternalComparator.h.

◆ m_epsilons_column

std::map<String, Real> Arcane::SimpleTableInternalComparator::m_epsilons_column
protected

Definition at line 132 of file SimpleTableInternalComparator.h.

◆ m_epsilons_row

std::map<String, Real> Arcane::SimpleTableInternalComparator::m_epsilons_row
protected

Definition at line 133 of file SimpleTableInternalComparator.h.

◆ m_is_excluding_array_columns

bool Arcane::SimpleTableInternalComparator::m_is_excluding_array_columns
protected

Definition at line 130 of file SimpleTableInternalComparator.h.

◆ m_is_excluding_array_rows

bool Arcane::SimpleTableInternalComparator::m_is_excluding_array_rows
protected

Definition at line 127 of file SimpleTableInternalComparator.h.

◆ m_is_excluding_regex_columns

bool Arcane::SimpleTableInternalComparator::m_is_excluding_regex_columns
protected

Definition at line 124 of file SimpleTableInternalComparator.h.

◆ m_is_excluding_regex_rows

bool Arcane::SimpleTableInternalComparator::m_is_excluding_regex_rows
protected

Definition at line 121 of file SimpleTableInternalComparator.h.

◆ m_regex_columns

String Arcane::SimpleTableInternalComparator::m_regex_columns
protected

Definition at line 123 of file SimpleTableInternalComparator.h.

◆ m_regex_rows

String Arcane::SimpleTableInternalComparator::m_regex_rows
protected

Definition at line 120 of file SimpleTableInternalComparator.h.

◆ m_rows_to_compare

StringUniqueArray Arcane::SimpleTableInternalComparator::m_rows_to_compare
protected

Definition at line 126 of file SimpleTableInternalComparator.h.

◆ m_simple_table_internal_mng_reference

SimpleTableInternalMng Arcane::SimpleTableInternalComparator::m_simple_table_internal_mng_reference
protected

Definition at line 117 of file SimpleTableInternalComparator.h.

◆ m_simple_table_internal_mng_to_compare

SimpleTableInternalMng Arcane::SimpleTableInternalComparator::m_simple_table_internal_mng_to_compare
protected

Definition at line 118 of file SimpleTableInternalComparator.h.

◆ m_simple_table_internal_reference

Ref<SimpleTableInternal> Arcane::SimpleTableInternalComparator::m_simple_table_internal_reference
protected

Definition at line 114 of file SimpleTableInternalComparator.h.

◆ m_simple_table_internal_to_compare

Ref<SimpleTableInternal> Arcane::SimpleTableInternalComparator::m_simple_table_internal_to_compare
protected

Definition at line 115 of file SimpleTableInternalComparator.h.


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