IGLib 1.4
The IGLib base library for development of numerical, technical and business applications.

IG::Num::SampledDataCsv Class Reference

Base class for CSV (comma separated files) representation, importer and exporter of sampled data and data definitions. More...

Inheritance diagram for IG::Num::SampledDataCsv:
Collaboration diagram for IG::Num::SampledDataCsv:

List of all members.

Classes

class  DataColumnDefinition
 Used to define which columns in a data table correspond to which input or output elements. More...

Public Member Functions

 SampledDataCsv ()
 Construct a new CSV representation of sampled data and data definitions.
 SampledDataCsv (int inputLength, int outputLength)
 Construct a new CSV representation of sampled data and data definitions, with numbers of input parameters and output values specified.
bool IsKey (string str, string keyString)
 Returns true if the specified string represents the specified keyword. Always use this method to verify if the string represents a specific key, sice it takes into account relevant internal parameters such as case sensitivity.
bool IsSingleValueKey (string str)
 Returns a value indicating whether the specified string is a keyword for a field that has a single value (e.g. number of parameters or number of output values).
bool IsElementTypeKey (string str)
 Returns a value indicating whether the specified string is a keyword indicating a specific value (e.g. KeyElementTypeInput or KeyElementTypeOutput).
bool IsDefinitionKey (string str)
 Returns a value indicating whether the specified string is a keyword for a field that is a part of the data definition.
bool IsDataKey (string str)
 Returns a value indicating whether the specified string is a keyword for a data field.
bool IsDefinitionOrDataKey (string str)
 Returns a value indicating whether the specified string is a keyword for some field, either a part of data definition or a keyword that introduces data.
bool IsKeyData (string str)
 Whether the specified string is a keyword introducing the sampled data.
bool IsKeyElementTypeInput (string str)
 Whether the specified string is a keyword that marks the input data type.
bool IsKeyElementTypeOutput (string str)
 Whether the specified string is a keyword that marks the output data type.
bool IsKeyComment (string str)
 Whether the specified string is a keyword introducing a comment in the line that contains it.
bool IsKeyNumInputParameters (string str)
 Whether the specified string is a keyword introducing the number of input parameters.
bool IsKeyNumOutputValues (string str)
 Whether the specified string is a keyword introducing the number of output parameters.
bool IsKeyNames (string str)
 Whether the specified string is a keyword introducing variable names.
bool IsKeyTitles (string str)
 Whether the specified string is a keyword introducing variable titles.
bool IsKeyDescriptions (string str)
 Whether the specified string is a keyword introducing variable descriptions.
bool IsKeyElementTypes (string str)
 Whether the specified string is a keyword introducing variable element types (e.g. input/output).
bool IsKeyElementIndices (string str)
 Whether the specified string is a keyword introducing variable element indices names.
bool IsKeyMinimalValues (string str)
 Whether the specified string is a keyword introducing variable minimal values.
bool IsKeyMaximalValues (string str)
 Whether the specified string is a keyword introducing variable maximal values.
bool IsKeyScalingLengths (string str)
 Whether the specified string is a keyword introducing variable scaling lengths.
bool IsKeyDefaultValues (string str)
 Whether the specified string is a keyword introducing variable default values.
bool IsKeyDiscretizationSteps (string str)
 Whether the specified string is a keyword introducing variable discretization steps.
bool IsKeyTargetValues (string str)
 Whether the specified string is a keyword introducing variable target values.
bool IsKeyOptimizationIndices (string str)
 Whether the specified string is a keyword introducing variable optimization indices.
string GetPositionString ()
 Returns the string indicating the current position in the form (row, column), e.g. "(23, 55)". Rows and columns are counted form 1.
string GetPositionString (int rowNum, int columnNum)
 Returns the string indicating the specified position position in the form (row, column), e.g. "(23, 55)". Rows and columns are counted form 1.
bool CheckIfDataColumnsDefined ()
 Returns a flag defining whether all data columns in the data table are defined.
void UpdateDataColumnDefinitions ()
 Updates index lists for data column definitions for inputs (InputColumnDefinitions) and outputs (OutputColumnDefinitions), and sets the IsDataColumnDefinitionsUpdated flag to true if successful.
void StoreDefinition ()
 Stores data definitions to the data table. The table is cleared first.
void StoreData ()
 Stores sampled data to the data table. The table is cleared first.
void StoreDefinitionAndData ()
 Stores data definitions AND sampled data to the data table. The table is cleared first.
void SaveDefinition (string filePath)
 Saves data definitions to the specified file. The file is overridden if it already exists.
void SaveData (string filePath)
 Saves sampled data to the specified file. The file is overridden if it already exists.
void SaveDefinitionAndData (string filePath)
 Saves data definitions AND sampled data to the specified file. The file is overridden if it already exists.
void RestoreDefinition (bool resetPosition)
 Restores data definition from the data table. Data definition is assigned to the DataDefinition property.
void RestoreDefinition ()
 Restores data definition from the data table. Position is reset before the operation begins. Data definition is assigned to the DataDefinition property.
void RestoreData (bool resetPosition)
 Restores sampled data from the data table, starting from the current position, i.e. (CurrentRow, CurrentColumn). Data is assigned to the SampledData property.
void RestoreData ()
 Restores sampled data definition from the data table. Position is reset before the operation begins. Data is assigned to the SampledData property.
void RestoreDefinitionAndData (bool resetPosition)
 Restores data definition AND sampled data definition from the data table. Data definition is assigned to the DataDefinition property.Data is assigned to the SampledData property.
void RestoreDefinitionAndData ()
 Restores data definition AND sampled data definition from the data table. Position is reset before the operation begins. Data definition is assigned to the DataDefinition property.Data is assigned to the SampledData property.
void LoadDefinition (string filePath)
 Loads data definition form the specified CSV file. Data definition is assigned to the DataDefinition property.
void LoadData (string filePath)
 Loads sampled data form the specified CSV file. Data is assigned to the SampledData property.
void LoadDefinitionAndData (string filePath)
 Loads data definition AND sampled data form the specified CSV file. Data definition is assigned to the DataDefinition property.

Public Attributes

bool _throwExceptionsOnDataErrors = false

Protected Member Functions

void ClearDataColumnDefinitions ()
 Clears data column definitions.
void StoreDefinition (bool clearFirst)
 Stores definition data to the data table.
void StoreData (bool clearFirst)
 Stores the samples data to the data table.
void StoreDefinitionAndData (bool clearFirst)
 Stores data definitions AND sampled data to the data table.
InputElementDefinition GetInputElementDefinition (int whichElement)
 Gets the specified input element definition from DataDefinition. If data definition is not defined then it is created, and if it has less input elements than the required element index plus one, then new element definitions are created and added to it. Method does not check whether element index is out of range with respect to InputLength.
OutputElementDefinition GetOutputElementDefinition (int whichElement)
 Gets the specified output element definition from DataDefinition. If data definition is not defined then it is created, and if it has less output elements than the required element index plus one, then new element definitions are created and added to it. Method does not check whether element index is out of range with respect to OutputLength.
DataColumnDefinition GetDataColumnDefinition (int dataColumnIndex)
 Returns the specified data column definition by its sequential number on the list of columns DataColumnDefinitions.
bool ReadSingleInt (ref int value)
 Reads a single integer value. Current line and column must be set to its key.
void FindFirstDataCell (int keyRow, int keyColumn, out int row, out int column)
 Finds the first data cell for data inroduced by a key, provided that the key that introduces the data is located at (keyRow , keyColumn ).
void FindFirstDataCell (out int row, out int column)
 Finds the first data cell for data inroduced by a key, provided that the key that introduces the data is located at (CurrentRow, CurrentColumn).
void GetDataColumnDefinitionsFromData (int keyRow, int keyColumn, bool isDouble, bool isInt)
 Extracts information about data columns from the data.
void GetDataColumnDefinitionsFromData (bool isDouble, bool isInt)
 Extracts information about data columns from the data.
void ReadElementTypes ()
 Reads types of elements from the CSV-like string table, from the current position on (inclusively).
void ReadElementIndices ()
 Reads types of elements from the CSV, from the current position on (inclusively).
void ReadStringData (ref string[] dataArray)
 Reads string values from the CSV-like string table, from the current position on (inclusively), and stores them into the provided array. Array is sorted in such a way that values corresponding to input elements are included first, followed by values corresponding to output elements, both sorted by element indices.After reading, current cell position is set to the first column after the last cell in the data.If element positions are not yet known then they are established (if possible, otherwise exception is thrown).
void ReadDoubleData (ref double[] dataArray)
 Reads double values from the CSV-like string table, from the current position on (inclusively), and stores them into the provided array. Array is sorted in such a way that values corresponding to input elements are included first, followed by values corresponding to output elements, both sorted by element indices.double.NaN is stored to positions for which data cells were empty.After reading, current cell position is set to the first column after the last cell in the data.If element positions are not yet known then they are established (if possible, otherwise exception is thrown).
void ReadIntData (ref int[] dataArray)
 Reads integer values from the CSV-like string table, from the current position on (inclusively), and stores them into the provided array. Array is sorted in such a way that values corresponding to input elements are included first, followed by values corresponding to output elements, both sorted by element indices.int.MinValue is stored to positions for which data cells were empty.After reading, current cell position is set to the first column after the last cell in the data.If element positions are not yet known then they are established (if possible, otherwise exception is thrown).
void ReadElementNames ()
 Reads names of input and output data elements from the CSV, from the current position on (inclusively).
void ReadElementTitles ()
 Reads titles of input and output data elements from the CSV, from the current position on (inclusively).
void ReadElementDescriptions ()
 Reads descriptions of input and output data elements from the CSV, from the current position on (inclusively).
void ReadElementMinimalValues ()
 Reads minimal values of input and output data elements from the CSV, from the current position on (inclusively).
void ReadElementMaximalValues ()
 Reads maximal values of input and output data elements from the CSV, from the current position on (inclusively).
void ReadElementScalingLengths ()
 Reads scaling lengths of input and output data elements from the CSV, from the current position on (inclusively).
void ReadElementDefaultValues ()
 Reads default values of input and output data elements from the CSV, from the current position on (inclusively).
void ReadElementDiscretizationSteps ()
 Reads discretization steps of input data elements from the CSV, from the current position on (inclusively).
void ReadElementTargetValues ()
 Reads target values of input and output data elements from the CSV, from the current position on (inclusively).
void ReadElementOptimizationIndices ()
 Reads optimization indices of input and output data elements from the CSV, from the current position on (inclusively).

Protected Attributes

bool _isKeysCaseSensitive = DefaultIsKeysCaseSensitive
string _keyData = DefaultKeyData
string _keyElementTypeInput = DefaultKeyElementTypeInput
string _keyElementTypeOutput = DefaultKeyElementTypeOutput
string _keyComment = DefaultKeyComment
string _keyNumInputParameters = DefaultKeyNumInputParameters
string _keyNumOutputValues = DefaultKeyNumOutputValues
string _keyNames = DefaultKeyNames
string _keyTitles = DefaultKeyTitles
string _keyDescriptions = DefaultKeyDescriptions
string _keyElementTypes = DefaultKeyElementTypes
string _keyElementIndices = DefaultKeyElementIndices
string _keyMinimalValues = DefaultKeyMinimalValues
string _keyMaximalValues = DefaultKeyMaximalValues
string _keyScalingLengths = DefaultKeyScalingLengths
string _keyDefaultValues = DefaultKeyDefaultValues
string _keyDiscretizationSteps = DefaultKeyDiscretizationSteps
string _keyTargetValues = DefaultKeyTargetValues
string _keyOptimizationIndices = DefaultKeyOptimizationIndices
int _currentRow = 0
int _currentColumn = 0
List< DataColumnDefinition_dataColumnDefinitions = new List<DataColumnDefinition>()
List< DataColumnDefinition_inputColumnDefinitions = new List<DataColumnDefinition>()
bool IsDataColumnDefinitionsDefined = false
 Whether a full list of data columns is defined.
bool _keyAndDataInSameRow = false
int _indentation = 0
string[] AuxStringArray = null
 Auxiliary array for temporary storage of strings.
double[] AuxDoubleArray = null
 Auxiliary array for temporary storage of double numbers.
int[] AuxIntArray = null
 Auxiliary array for temporary storage of integer numbers.

Properties

static bool DefaultIsKeysCaseSensitive [get, set]
 Default value for the flag indicating whether keys should be treated as case sensitive.
static string DefaultKeyData [get, set]
 Default key for introduction of sampled data.
static string DefaultKeyElementTypeInput [get, set]
 Default element type keyword for input element.
static string DefaultKeyElementTypeOutput [get, set]
 Default element type keyword for output element.
static string DefaultKeyComment [get, set]
 Default key for comment in the current line.
static string DefaultKeyNumInputParameters [get, set]
 Default key for introduction of number of input parameters.
static string DefaultKeyNumOutputValues [get, set]
 Default key for introduction of number of output parameters.
static string DefaultKeyNames [get, set]
 Default key for introduction of names of input and output data elements.
static string DefaultKeyTitles [get, set]
 Default key for introduction of titles of input and output data elements.
static string DefaultKeyDescriptions [get, set]
 Default key for introduction of descriptions of input and output data elements.
static string DefaultKeyElementTypes [get, set]
 Default key for introduction of element types of input and output data elements (e.g. input/output).
static string DefaultKeyElementIndices [get, set]
 Default key for introduction of element indices of input and output data elements.
static string DefaultKeyMinimalValues [get, set]
 Default key for introduction of minimal values of input and output data elements.
static string DefaultKeyMaximalValues [get, set]
 Default key for introduction of maximal values of input and output data elements.
static string DefaultKeyDefaultValues [get, set]
 Default key for introduction of default values of input data elements.
static string DefaultKeyScalingLengths [get, set]
 Default key for introduction of scaling lengths of input and output data elements.
static string DefaultKeyDiscretizationSteps [get, set]
 Default key for introduction of discretization steps of input and output data elements.
static string DefaultKeyTargetValues [get, set]
 Default key for introduction of target values of input and output data elements.
static string DefaultKeyOptimizationIndices [get, set]
 Default key for introduction of optimization indices of input and output data elements.
bool IsKeysCaseSensitive [get, set]
 Whether keywords are case sensitive.
string KeyData [get, set]
 Keyword that introduces the sampled data.
string KeyElementTypeInput [get, set]
 A keyword string for input element type in the CSV file containing sampled data and / or data definitions.
string KeyElementTypeOutput [get, set]
 A keyword string for output element type in the CSV file containing sampled data and / or data definitions.
string KeyComment [get, set]
 A keyword string that introduces a commet in the containing line.
string KeyNumInputParameters [get, set]
 A keyword string that introduces the number of input parameters in the CSV file containing sampled data and / or data definitions.
string KeyNumOutputValues [get, set]
 A keyword string that introduces the number of output parameters in the CSV file containing sampled data and / or data definitions.
string KeyNames [get, set]
 A keyword string that introduces variable names in the CSV file containing sampled data and / or data definitions.
string KeyTitles [get, set]
 A keyword string that introduces variable titles in the CSV file containing sampled data and / or data definitions.
string KeyDescriptions [get, set]
 A keyword string that introduces variable descriptions in the CSV file containing sampled data and / or data definitions.
string KeyElementTypes [get, set]
 A keyword string that introduces variable element types in the CSV file containing sampled data and / or data definitions.
string KeyElementIndices [get, set]
 A keyword string that introduces variable element indices in the CSV file containing sampled data and / or data definitions.
string KeyMinimalValues [get, set]
 A keyword string that introduces variable minimal values in the CSV file containing sampled data and / or data definitions.
string KeyMaximalValues [get, set]
 A keyword string that introduces variable maximal values in the CSV file containing sampled data and / or data definitions.
string KeyScalingLengths [get, set]
 A keyword string that introduces variable scaling lengths in the CSV file containing sampled data and / or data definitions.
string KeyDefaultValues [get, set]
 A keyword string that introduces variable default values in the CSV file containing sampled data and / or data definitions.
string KeyDiscretizationSteps [get, set]
 A keyword string that introduces variable discretization steps in the CSV file containing sampled data and / or data definitions.
string KeyTargetValues [get, set]
 A keyword string that introduces variable target values in the CSV file containing sampled data and / or data definitions.
string KeyOptimizationIndices [get, set]
 A keyword string that introduces variable optimization indices in the CSV file containing sampled data and / or data definitions.
InputOutputDataDefiniton DataDefinition [get, set]
SampledDataSet SampledData [get, set]
int InputLength [get, set]
 Number of input elements.
int OutputLength [get, set]
 Number of output values in the data.
int CurrentRow [get, set]
int CurrentColumn [get, set]
List< DataColumnDefinitionDataColumnDefinitions [get]
 Contains definitions of data columns within the data table. Definitions follow in the same order as the corresponding columns, but there may be gaps between them.
List< DataColumnDefinitionInputColumnDefinitions [get]
 Contains definitions for input data columns, sorted by element indices.
List< DataColumnDefinitionOutputColumnDefinitions [get]
 Contains definitions for output data columns, sorted by element indices.
bool IsDataColumnDefinitionsUpdated [get, set]
 Whether complete information about data column definitions is up to date, including auciliary lists with sorted input and output definitions.
bool KeyAndDataInSameRow [get, set]
 Whether keys and data are in the same row in data definition section wnen writing to CSV format.
int Indentation [get, set]
 Offset - specifies in which column data columns begin when writing tyo CSV format.
bool ThrowExceptionsOnDataErrors [get, set]

Private Attributes

InputOutputDataDefiniton _dataDefinition
SampledDataSet _sampledData
int _inputLength = -1
int _outputLength = -1
List< DataColumnDefinition_outputColumnDefinitions = new List<DataColumnDefinition>()
bool _isDataColumnDefinitionsUpdated = false

Static Private Attributes

static bool _defaultIsKeysCaseSensitive = false
static string _defaultKeyData = "Data"
static string _defaultKeyElementTypeInput = "Input"
static string _defaultKeyElementTypeOutput = "Output"
static string _defaultKeyComment = "Comment"
static string _defaultKeyNumInputParameters = "NumInputs"
static string _defaultKeyNumOutputParameters = "NumOutputs"
static string _defaultKeyNames = "Names"
static string _defaultKeyTitles = "Titles"
static string _defaultKeyDescriptions = "Descriptions"
static string _defaultKeyElementTypes = "ElementTypes"
static string _defaultKeyElementIndices = "ElementIndices"
static string _defaultKeyMinimalValues = "MinimalValues"
static string _defaultKeyMaximalValues = "MaximalValues"
static string _defaultKeyDefaultValues = "DefaultValues"
static string _defaultKeySclaingLengths = "ScalingLengths"
static string _defaultKeyDiscretizationSteps = "DiscretizationSteps"
static string _defaultKeyTargetValues = "TargetValues"
static string _defaultKeyOptimizationIndices = "OptimizationIndices"

Detailed Description

Base class for CSV (comma separated files) representation, importer and exporter of sampled data and data definitions.

$A Igo Oct08 Jul13;


Constructor & Destructor Documentation

IG::Num::SampledDataCsv::SampledDataCsv ( ) [inline]

Construct a new CSV representation of sampled data and data definitions.

IG::Num::SampledDataCsv::SampledDataCsv ( int  inputLength,
int  outputLength 
) [inline]

Construct a new CSV representation of sampled data and data definitions, with numbers of input parameters and output values specified.

Parameters:
inputLengthNumber of input parameters.
outputLengthNumber of output values.

Member Function Documentation

bool IG::Num::SampledDataCsv::IsKey ( string  str,
string  keyString 
) [inline]

Returns true if the specified string represents the specified keyword. Always use this method to verify if the string represents a specific key, sice it takes into account relevant internal parameters such as case sensitivity.

Parameters:
strString that is checked against the specified keyword.
keyStringKeyword ageinst which the string is checked.
bool IG::Num::SampledDataCsv::IsSingleValueKey ( string  str) [inline]

Returns a value indicating whether the specified string is a keyword for a field that has a single value (e.g. number of parameters or number of output values).

Parameters:
strString that is queried.
bool IG::Num::SampledDataCsv::IsElementTypeKey ( string  str) [inline]

Returns a value indicating whether the specified string is a keyword indicating a specific value (e.g. KeyElementTypeInput or KeyElementTypeOutput).

Parameters:
strString that is queried.
bool IG::Num::SampledDataCsv::IsDefinitionKey ( string  str) [inline]

Returns a value indicating whether the specified string is a keyword for a field that is a part of the data definition.

Parameters:
strString that is queried.
bool IG::Num::SampledDataCsv::IsDataKey ( string  str) [inline]

Returns a value indicating whether the specified string is a keyword for a data field.

Parameters:
strString that is queried.
bool IG::Num::SampledDataCsv::IsDefinitionOrDataKey ( string  str) [inline]

Returns a value indicating whether the specified string is a keyword for some field, either a part of data definition or a keyword that introduces data.

Parameters:
strString that is queried.
bool IG::Num::SampledDataCsv::IsKeyData ( string  str) [inline]

Whether the specified string is a keyword introducing the sampled data.

Parameters:
strString that is checked.
bool IG::Num::SampledDataCsv::IsKeyElementTypeInput ( string  str) [inline]

Whether the specified string is a keyword that marks the input data type.

Parameters:
strString that is checked.
bool IG::Num::SampledDataCsv::IsKeyElementTypeOutput ( string  str) [inline]

Whether the specified string is a keyword that marks the output data type.

Parameters:
strString that is checked.
bool IG::Num::SampledDataCsv::IsKeyComment ( string  str) [inline]

Whether the specified string is a keyword introducing a comment in the line that contains it.

Parameters:
strString that is checked.
bool IG::Num::SampledDataCsv::IsKeyNumInputParameters ( string  str) [inline]

Whether the specified string is a keyword introducing the number of input parameters.

Parameters:
strString that is checked.
bool IG::Num::SampledDataCsv::IsKeyNumOutputValues ( string  str) [inline]

Whether the specified string is a keyword introducing the number of output parameters.

Parameters:
strString that is checked.
bool IG::Num::SampledDataCsv::IsKeyNames ( string  str) [inline]

Whether the specified string is a keyword introducing variable names.

Parameters:
strString that is checked.
bool IG::Num::SampledDataCsv::IsKeyTitles ( string  str) [inline]

Whether the specified string is a keyword introducing variable titles.

Parameters:
strString that is checked.
bool IG::Num::SampledDataCsv::IsKeyDescriptions ( string  str) [inline]

Whether the specified string is a keyword introducing variable descriptions.

Parameters:
strString that is checked.
bool IG::Num::SampledDataCsv::IsKeyElementTypes ( string  str) [inline]

Whether the specified string is a keyword introducing variable element types (e.g. input/output).

Parameters:
strString that is checked.
bool IG::Num::SampledDataCsv::IsKeyElementIndices ( string  str) [inline]

Whether the specified string is a keyword introducing variable element indices names.

Parameters:
strString that is checked.
bool IG::Num::SampledDataCsv::IsKeyMinimalValues ( string  str) [inline]

Whether the specified string is a keyword introducing variable minimal values.

Parameters:
strString that is checked.
bool IG::Num::SampledDataCsv::IsKeyMaximalValues ( string  str) [inline]

Whether the specified string is a keyword introducing variable maximal values.

Parameters:
strString that is checked.
bool IG::Num::SampledDataCsv::IsKeyScalingLengths ( string  str) [inline]

Whether the specified string is a keyword introducing variable scaling lengths.

Parameters:
strString that is checked.
bool IG::Num::SampledDataCsv::IsKeyDefaultValues ( string  str) [inline]

Whether the specified string is a keyword introducing variable default values.

Parameters:
strString that is checked.
bool IG::Num::SampledDataCsv::IsKeyDiscretizationSteps ( string  str) [inline]

Whether the specified string is a keyword introducing variable discretization steps.

Parameters:
strString that is checked.
bool IG::Num::SampledDataCsv::IsKeyTargetValues ( string  str) [inline]

Whether the specified string is a keyword introducing variable target values.

Parameters:
strString that is checked.
bool IG::Num::SampledDataCsv::IsKeyOptimizationIndices ( string  str) [inline]

Whether the specified string is a keyword introducing variable optimization indices.

Parameters:
strString that is checked.
string IG::Num::SampledDataCsv::GetPositionString ( ) [inline]

Returns the string indicating the current position in the form (row, column), e.g. "(23, 55)". Rows and columns are counted form 1.

Returns:
string IG::Num::SampledDataCsv::GetPositionString ( int  rowNum,
int  columnNum 
) [inline]

Returns the string indicating the specified position position in the form (row, column), e.g. "(23, 55)". Rows and columns are counted form 1.

Parameters:
rowNumRow number (counting from 0).
columnNumColumn number (counting from 0).
void IG::Num::SampledDataCsv::ClearDataColumnDefinitions ( ) [inline, protected]

Clears data column definitions.

bool IG::Num::SampledDataCsv::CheckIfDataColumnsDefined ( ) [inline]

Returns a flag defining whether all data columns in the data table are defined.

void IG::Num::SampledDataCsv::UpdateDataColumnDefinitions ( ) [inline]

Updates index lists for data column definitions for inputs (InputColumnDefinitions) and outputs (OutputColumnDefinitions), and sets the IsDataColumnDefinitionsUpdated flag to true if successful.

void IG::Num::SampledDataCsv::StoreDefinition ( bool  clearFirst) [inline, protected]

Stores definition data to the data table.

Parameters:
clearFirstWhether the data table is cleared before the operation begins.
void IG::Num::SampledDataCsv::StoreData ( bool  clearFirst) [inline, protected]

Stores the samples data to the data table.

Parameters:
clearFirstWhether the data table is cleared before the operation begins.
void IG::Num::SampledDataCsv::StoreDefinitionAndData ( bool  clearFirst) [inline, protected]

Stores data definitions AND sampled data to the data table.

Parameters:
clearFirstWhether the data table is cleared before the operation begins.
void IG::Num::SampledDataCsv::StoreDefinition ( ) [inline]

Stores data definitions to the data table. The table is cleared first.

void IG::Num::SampledDataCsv::StoreData ( ) [inline]

Stores sampled data to the data table. The table is cleared first.

void IG::Num::SampledDataCsv::StoreDefinitionAndData ( ) [inline]

Stores data definitions AND sampled data to the data table. The table is cleared first.

void IG::Num::SampledDataCsv::SaveDefinition ( string  filePath) [inline]

Saves data definitions to the specified file. The file is overridden if it already exists.

Parameters:
filePathPath to the file where data definitions are stored.
void IG::Num::SampledDataCsv::SaveData ( string  filePath) [inline]

Saves sampled data to the specified file. The file is overridden if it already exists.

Parameters:
filePathPath to the file where data is stored.
void IG::Num::SampledDataCsv::SaveDefinitionAndData ( string  filePath) [inline]

Saves data definitions AND sampled data to the specified file. The file is overridden if it already exists.

Parameters:
filePathPath to the file where data is stored.
InputElementDefinition IG::Num::SampledDataCsv::GetInputElementDefinition ( int  whichElement) [inline, protected]

Gets the specified input element definition from DataDefinition. If data definition is not defined then it is created, and if it has less input elements than the required element index plus one, then new element definitions are created and added to it. Method does not check whether element index is out of range with respect to InputLength.

Parameters:
whichElementSpecifies which input element definition is returned.
OutputElementDefinition IG::Num::SampledDataCsv::GetOutputElementDefinition ( int  whichElement) [inline, protected]

Gets the specified output element definition from DataDefinition. If data definition is not defined then it is created, and if it has less output elements than the required element index plus one, then new element definitions are created and added to it. Method does not check whether element index is out of range with respect to OutputLength.

Parameters:
whichElementSpecifies which output element definition is returned.
DataColumnDefinition IG::Num::SampledDataCsv::GetDataColumnDefinition ( int  dataColumnIndex) [inline, protected]

Returns the specified data column definition by its sequential number on the list of columns DataColumnDefinitions.

Parameters:
dataColumnIndexSequential number of the column data definition on the list of definitions. Definitions follow in the same order as the corresponding columns, but there may be gaps between them.
bool IG::Num::SampledDataCsv::ReadSingleInt ( ref int  value) [inline, protected]

Reads a single integer value. Current line and column must be set to its key.

After successful execution, current cell is set just after the value position.

void IG::Num::SampledDataCsv::FindFirstDataCell ( int  keyRow,
int  keyColumn,
out int  row,
out int  column 
) [inline, protected]

Finds the first data cell for data inroduced by a key, provided that the key that introduces the data is located at (keyRow , keyColumn ).

Parameters:
keyRowRow number of the cell containing the key that introduces the data.
keyColumnColumn number of the cell containing the key that introduces the data.
rowVariable where row number of the cell where data begins is stored.
columnVariable where column number of the cell where data begins is stored.
Exceptions:
When the first data cell could not be located.
void IG::Num::SampledDataCsv::FindFirstDataCell ( out int  row,
out int  column 
) [inline, protected]

Finds the first data cell for data inroduced by a key, provided that the key that introduces the data is located at (CurrentRow, CurrentColumn).

Parameters:
rowVariable where row number of the cell where data begins is stored.
columnVariable where column number of the cell where data begins is stored.
Exceptions:
When the first data cell could not be located.
void IG::Num::SampledDataCsv::GetDataColumnDefinitionsFromData ( int  keyRow,
int  keyColumn,
bool  isDouble,
bool  isInt 
) [inline, protected]

Extracts information about data columns from the data.

Parameters:
keyRowRow of the cell that contains the key that introduces the data from which information is extracted.
keyColumnColumn of the cell that contains the key that introduces the data from which information is extracted.
isDoubleWhether data elements are real numbers (e.g. of type double).
isIntWhether data elements are integer numbers.

For tis method in order to work, data must be defined for all input and output elements, and no additional cells must be nonempty.

This method is called when one encounters data whose reading would already require infomration about data columns, but this information is not yet available from the definition data already read and must be inferred from the data itself. Conditions are that data cellls are in natural order (first input and then output elements in the correct order), that there are no non-empty cells in the data row from the beginning of data that do not belong to data, that all data columns (input and output) are defined and that input and output dimensions are known.

void IG::Num::SampledDataCsv::GetDataColumnDefinitionsFromData ( bool  isDouble,
bool  isInt 
) [inline, protected]

Extracts information about data columns from the data.

Parameters:
keyRowRow of the cell that contains the key that introduces the data from which information is extracted.
keyColumnColumn of the cell that contains the key that introduces the data from which information is extracted.
isDoubleWhether data elements are real numbers (e.g. of type double).
isIntWhether data elements are integer numbers.

For tis method in order to work, data must be defined for all input and output elements, and no additional cells must be nonempty.

This method is called when one encounters data whose reading would already require infomration about data columns, but this information is not yet available from the definition data already read and must be inferred from the data itself. Conditions are that data cellls are in natural order (first input and then output elements in the correct order), that there are no non-empty cells in the data row from the beginning of data that do not belong to data, that all data columns (input and output) are defined and that input and output dimensions are known.

void IG::Num::SampledDataCsv::ReadElementTypes ( ) [inline, protected]

Reads types of elements from the CSV-like string table, from the current position on (inclusively).

After successful execution, the current cell is set just after the last read position.

void IG::Num::SampledDataCsv::ReadElementIndices ( ) [inline, protected]

Reads types of elements from the CSV, from the current position on (inclusively).

After successful execution, the current cell is set just after the last read position.

void IG::Num::SampledDataCsv::ReadStringData ( ref string[]  dataArray) [inline, protected]

Reads string values from the CSV-like string table, from the current position on (inclusively), and stores them into the provided array. Array is sorted in such a way that values corresponding to input elements are included first, followed by values corresponding to output elements, both sorted by element indices.After reading, current cell position is set to the first column after the last cell in the data.If element positions are not yet known then they are established (if possible, otherwise exception is thrown).

Exception is thrown if values are not at expected positions.

Parameters:
dataArrayArray where string values read from data columns are stored.
void IG::Num::SampledDataCsv::ReadDoubleData ( ref double[]  dataArray) [inline, protected]

Reads double values from the CSV-like string table, from the current position on (inclusively), and stores them into the provided array. Array is sorted in such a way that values corresponding to input elements are included first, followed by values corresponding to output elements, both sorted by element indices.double.NaN is stored to positions for which data cells were empty.After reading, current cell position is set to the first column after the last cell in the data.If element positions are not yet known then they are established (if possible, otherwise exception is thrown).

Exception is thrown if values are not at expected positions.

Parameters:
dataArrayArray where string values read from data columns are stored.
void IG::Num::SampledDataCsv::ReadIntData ( ref int[]  dataArray) [inline, protected]

Reads integer values from the CSV-like string table, from the current position on (inclusively), and stores them into the provided array. Array is sorted in such a way that values corresponding to input elements are included first, followed by values corresponding to output elements, both sorted by element indices.int.MinValue is stored to positions for which data cells were empty.After reading, current cell position is set to the first column after the last cell in the data.If element positions are not yet known then they are established (if possible, otherwise exception is thrown).

Exception is thrown if values are not at expected positions.

Parameters:
dataArrayArray where string values read from data columns are stored.
void IG::Num::SampledDataCsv::ReadElementNames ( ) [inline, protected]

Reads names of input and output data elements from the CSV, from the current position on (inclusively).

After successful execution, the current cell is set just after the last read position.

void IG::Num::SampledDataCsv::ReadElementTitles ( ) [inline, protected]

Reads titles of input and output data elements from the CSV, from the current position on (inclusively).

After successful execution, the current cell is set just after the last read position.

void IG::Num::SampledDataCsv::ReadElementDescriptions ( ) [inline, protected]

Reads descriptions of input and output data elements from the CSV, from the current position on (inclusively).

After successful execution, the current cell is set just after the last read position.

void IG::Num::SampledDataCsv::ReadElementMinimalValues ( ) [inline, protected]

Reads minimal values of input and output data elements from the CSV, from the current position on (inclusively).

After successful execution, the current cell is set just after the last read position.

void IG::Num::SampledDataCsv::ReadElementMaximalValues ( ) [inline, protected]

Reads maximal values of input and output data elements from the CSV, from the current position on (inclusively).

After successful execution, the current cell is set just after the last read position.

void IG::Num::SampledDataCsv::ReadElementScalingLengths ( ) [inline, protected]

Reads scaling lengths of input and output data elements from the CSV, from the current position on (inclusively).

After successful execution, the current cell is set just after the last read position.

void IG::Num::SampledDataCsv::ReadElementDefaultValues ( ) [inline, protected]

Reads default values of input and output data elements from the CSV, from the current position on (inclusively).

After successful execution, the current cell is set just after the last read position.

void IG::Num::SampledDataCsv::ReadElementDiscretizationSteps ( ) [inline, protected]

Reads discretization steps of input data elements from the CSV, from the current position on (inclusively).

After successful execution, the current cell is set just after the last read position.

void IG::Num::SampledDataCsv::ReadElementTargetValues ( ) [inline, protected]

Reads target values of input and output data elements from the CSV, from the current position on (inclusively).

After successful execution, the current cell is set just after the last read position.

void IG::Num::SampledDataCsv::ReadElementOptimizationIndices ( ) [inline, protected]

Reads optimization indices of input and output data elements from the CSV, from the current position on (inclusively).

After successful execution, the current cell is set just after the last read position.

void IG::Num::SampledDataCsv::RestoreDefinition ( bool  resetPosition) [inline]

Restores data definition from the data table. Data definition is assigned to the DataDefinition property.

Parameters:
resetPositionWhether position is reset before the restoration begins.
void IG::Num::SampledDataCsv::RestoreDefinition ( ) [inline]

Restores data definition from the data table. Position is reset before the operation begins. Data definition is assigned to the DataDefinition property.

Parameters:
resetPositionWhether position is reset before the restoration begins.
void IG::Num::SampledDataCsv::RestoreData ( bool  resetPosition) [inline]

Restores sampled data from the data table, starting from the current position, i.e. (CurrentRow, CurrentColumn). Data is assigned to the SampledData property.

Parameters:
resetPositionWhether position is reset before the restoration begins.
void IG::Num::SampledDataCsv::RestoreData ( ) [inline]

Restores sampled data definition from the data table. Position is reset before the operation begins. Data is assigned to the SampledData property.

Parameters:
resetPositionWhether position is reset before the restoration begins.
void IG::Num::SampledDataCsv::RestoreDefinitionAndData ( bool  resetPosition) [inline]

Restores data definition AND sampled data definition from the data table. Data definition is assigned to the DataDefinition property.Data is assigned to the SampledData property.

Parameters:
resetPositionWhether position is reset before the restoration begins.
void IG::Num::SampledDataCsv::RestoreDefinitionAndData ( ) [inline]

Restores data definition AND sampled data definition from the data table. Position is reset before the operation begins. Data definition is assigned to the DataDefinition property.Data is assigned to the SampledData property.

void IG::Num::SampledDataCsv::LoadDefinition ( string  filePath) [inline]

Loads data definition form the specified CSV file. Data definition is assigned to the DataDefinition property.

Parameters:
filePathPath to the file where data definition is read from.
void IG::Num::SampledDataCsv::LoadData ( string  filePath) [inline]

Loads sampled data form the specified CSV file. Data is assigned to the SampledData property.

Parameters:
filePathPath to the file where data definition is read from.
void IG::Num::SampledDataCsv::LoadDefinitionAndData ( string  filePath) [inline]

Loads data definition AND sampled data form the specified CSV file. Data definition is assigned to the DataDefinition property.

Data is assigned to the SampledData property.

Parameters:
filePathPath to the file where data definition is read from.

Member Data Documentation

string IG::Num::SampledDataCsv::_defaultKeyData = "Data" [static, private]
string IG::Num::SampledDataCsv::_defaultKeyElementTypeInput = "Input" [static, private]
string IG::Num::SampledDataCsv::_defaultKeyElementTypeOutput = "Output" [static, private]
string IG::Num::SampledDataCsv::_defaultKeyComment = "Comment" [static, private]
string IG::Num::SampledDataCsv::_defaultKeyNumInputParameters = "NumInputs" [static, private]
string IG::Num::SampledDataCsv::_defaultKeyNumOutputParameters = "NumOutputs" [static, private]
string IG::Num::SampledDataCsv::_defaultKeyNames = "Names" [static, private]
string IG::Num::SampledDataCsv::_defaultKeyTitles = "Titles" [static, private]
string IG::Num::SampledDataCsv::_defaultKeyDescriptions = "Descriptions" [static, private]
string IG::Num::SampledDataCsv::_defaultKeyElementTypes = "ElementTypes" [static, private]
string IG::Num::SampledDataCsv::_defaultKeyElementIndices = "ElementIndices" [static, private]
string IG::Num::SampledDataCsv::_defaultKeyMinimalValues = "MinimalValues" [static, private]
string IG::Num::SampledDataCsv::_defaultKeyMaximalValues = "MaximalValues" [static, private]
string IG::Num::SampledDataCsv::_defaultKeyDefaultValues = "DefaultValues" [static, private]
string IG::Num::SampledDataCsv::_defaultKeySclaingLengths = "ScalingLengths" [static, private]
string IG::Num::SampledDataCsv::_defaultKeyDiscretizationSteps = "DiscretizationSteps" [static, private]
string IG::Num::SampledDataCsv::_defaultKeyTargetValues = "TargetValues" [static, private]
string IG::Num::SampledDataCsv::_defaultKeyOptimizationIndices = "OptimizationIndices" [static, private]
bool IG::Num::SampledDataCsv::_isKeysCaseSensitive = DefaultIsKeysCaseSensitive [protected]
string IG::Num::SampledDataCsv::_keyData = DefaultKeyData [protected]
string IG::Num::SampledDataCsv::_keyElementTypeInput = DefaultKeyElementTypeInput [protected]
string IG::Num::SampledDataCsv::_keyElementTypeOutput = DefaultKeyElementTypeOutput [protected]
string IG::Num::SampledDataCsv::_keyComment = DefaultKeyComment [protected]
string IG::Num::SampledDataCsv::_keyNumInputParameters = DefaultKeyNumInputParameters [protected]
string IG::Num::SampledDataCsv::_keyNumOutputValues = DefaultKeyNumOutputValues [protected]
string IG::Num::SampledDataCsv::_keyNames = DefaultKeyNames [protected]
string IG::Num::SampledDataCsv::_keyTitles = DefaultKeyTitles [protected]
string IG::Num::SampledDataCsv::_keyDescriptions = DefaultKeyDescriptions [protected]
string IG::Num::SampledDataCsv::_keyElementTypes = DefaultKeyElementTypes [protected]
string IG::Num::SampledDataCsv::_keyElementIndices = DefaultKeyElementIndices [protected]
string IG::Num::SampledDataCsv::_keyMinimalValues = DefaultKeyMinimalValues [protected]
string IG::Num::SampledDataCsv::_keyMaximalValues = DefaultKeyMaximalValues [protected]
string IG::Num::SampledDataCsv::_keyScalingLengths = DefaultKeyScalingLengths [protected]
string IG::Num::SampledDataCsv::_keyDefaultValues = DefaultKeyDefaultValues [protected]
string IG::Num::SampledDataCsv::_keyDiscretizationSteps = DefaultKeyDiscretizationSteps [protected]
string IG::Num::SampledDataCsv::_keyTargetValues = DefaultKeyTargetValues [protected]
string IG::Num::SampledDataCsv::_keyOptimizationIndices = DefaultKeyOptimizationIndices [protected]

Whether a full list of data columns is defined.

string [] IG::Num::SampledDataCsv::AuxStringArray = null [protected]

Auxiliary array for temporary storage of strings.

double [] IG::Num::SampledDataCsv::AuxDoubleArray = null [protected]

Auxiliary array for temporary storage of double numbers.

int [] IG::Num::SampledDataCsv::AuxIntArray = null [protected]

Auxiliary array for temporary storage of integer numbers.


Property Documentation

bool IG::Num::SampledDataCsv::DefaultIsKeysCaseSensitive [static, get, set]

Default value for the flag indicating whether keys should be treated as case sensitive.

string IG::Num::SampledDataCsv::DefaultKeyData [static, get, set]

Default key for introduction of sampled data.

string IG::Num::SampledDataCsv::DefaultKeyElementTypeInput [static, get, set]

Default element type keyword for input element.

string IG::Num::SampledDataCsv::DefaultKeyElementTypeOutput [static, get, set]

Default element type keyword for output element.

string IG::Num::SampledDataCsv::DefaultKeyComment [static, get, set]

Default key for comment in the current line.

string IG::Num::SampledDataCsv::DefaultKeyNumInputParameters [static, get, set]

Default key for introduction of number of input parameters.

string IG::Num::SampledDataCsv::DefaultKeyNumOutputValues [static, get, set]

Default key for introduction of number of output parameters.

string IG::Num::SampledDataCsv::DefaultKeyNames [static, get, set]

Default key for introduction of names of input and output data elements.

string IG::Num::SampledDataCsv::DefaultKeyTitles [static, get, set]

Default key for introduction of titles of input and output data elements.

string IG::Num::SampledDataCsv::DefaultKeyDescriptions [static, get, set]

Default key for introduction of descriptions of input and output data elements.

string IG::Num::SampledDataCsv::DefaultKeyElementTypes [static, get, set]

Default key for introduction of element types of input and output data elements (e.g. input/output).

string IG::Num::SampledDataCsv::DefaultKeyElementIndices [static, get, set]

Default key for introduction of element indices of input and output data elements.

string IG::Num::SampledDataCsv::DefaultKeyMinimalValues [static, get, set]

Default key for introduction of minimal values of input and output data elements.

string IG::Num::SampledDataCsv::DefaultKeyMaximalValues [static, get, set]

Default key for introduction of maximal values of input and output data elements.

string IG::Num::SampledDataCsv::DefaultKeyDefaultValues [static, get, set]

Default key for introduction of default values of input data elements.

string IG::Num::SampledDataCsv::DefaultKeyScalingLengths [static, get, set]

Default key for introduction of scaling lengths of input and output data elements.

string IG::Num::SampledDataCsv::DefaultKeyDiscretizationSteps [static, get, set]

Default key for introduction of discretization steps of input and output data elements.

string IG::Num::SampledDataCsv::DefaultKeyTargetValues [static, get, set]

Default key for introduction of target values of input and output data elements.

string IG::Num::SampledDataCsv::DefaultKeyOptimizationIndices [static, get, set]

Default key for introduction of optimization indices of input and output data elements.

bool IG::Num::SampledDataCsv::IsKeysCaseSensitive [get, set]

Whether keywords are case sensitive.

string IG::Num::SampledDataCsv::KeyData [get, set]

Keyword that introduces the sampled data.

string IG::Num::SampledDataCsv::KeyElementTypeInput [get, set]

A keyword string for input element type in the CSV file containing sampled data and / or data definitions.

string IG::Num::SampledDataCsv::KeyElementTypeOutput [get, set]

A keyword string for output element type in the CSV file containing sampled data and / or data definitions.

string IG::Num::SampledDataCsv::KeyComment [get, set]

A keyword string that introduces a commet in the containing line.

string IG::Num::SampledDataCsv::KeyNumInputParameters [get, set]

A keyword string that introduces the number of input parameters in the CSV file containing sampled data and / or data definitions.

string IG::Num::SampledDataCsv::KeyNumOutputValues [get, set]

A keyword string that introduces the number of output parameters in the CSV file containing sampled data and / or data definitions.

string IG::Num::SampledDataCsv::KeyNames [get, set]

A keyword string that introduces variable names in the CSV file containing sampled data and / or data definitions.

string IG::Num::SampledDataCsv::KeyTitles [get, set]

A keyword string that introduces variable titles in the CSV file containing sampled data and / or data definitions.

string IG::Num::SampledDataCsv::KeyDescriptions [get, set]

A keyword string that introduces variable descriptions in the CSV file containing sampled data and / or data definitions.

string IG::Num::SampledDataCsv::KeyElementTypes [get, set]

A keyword string that introduces variable element types in the CSV file containing sampled data and / or data definitions.

string IG::Num::SampledDataCsv::KeyElementIndices [get, set]

A keyword string that introduces variable element indices in the CSV file containing sampled data and / or data definitions.

string IG::Num::SampledDataCsv::KeyMinimalValues [get, set]

A keyword string that introduces variable minimal values in the CSV file containing sampled data and / or data definitions.

string IG::Num::SampledDataCsv::KeyMaximalValues [get, set]

A keyword string that introduces variable maximal values in the CSV file containing sampled data and / or data definitions.

string IG::Num::SampledDataCsv::KeyScalingLengths [get, set]

A keyword string that introduces variable scaling lengths in the CSV file containing sampled data and / or data definitions.

string IG::Num::SampledDataCsv::KeyDefaultValues [get, set]

A keyword string that introduces variable default values in the CSV file containing sampled data and / or data definitions.

string IG::Num::SampledDataCsv::KeyDiscretizationSteps [get, set]

A keyword string that introduces variable discretization steps in the CSV file containing sampled data and / or data definitions.

string IG::Num::SampledDataCsv::KeyTargetValues [get, set]

A keyword string that introduces variable target values in the CSV file containing sampled data and / or data definitions.

string IG::Num::SampledDataCsv::KeyOptimizationIndices [get, set]

A keyword string that introduces variable optimization indices in the CSV file containing sampled data and / or data definitions.

InputOutputDataDefiniton IG::Num::SampledDataCsv::DataDefinition [get, set]
SampledDataSet IG::Num::SampledDataCsv::SampledData [get, set]
int IG::Num::SampledDataCsv::InputLength [get, set, private]

Number of input elements.

int IG::Num::SampledDataCsv::OutputLength [get, set, private]

Number of output values in the data.

int IG::Num::SampledDataCsv::CurrentRow [get, set]
int IG::Num::SampledDataCsv::CurrentColumn [get, set]
List<DataColumnDefinition> IG::Num::SampledDataCsv::DataColumnDefinitions [get, protected]

Contains definitions of data columns within the data table. Definitions follow in the same order as the corresponding columns, but there may be gaps between them.

List<DataColumnDefinition> IG::Num::SampledDataCsv::InputColumnDefinitions [get, protected]

Contains definitions for input data columns, sorted by element indices.

List<DataColumnDefinition> IG::Num::SampledDataCsv::OutputColumnDefinitions [get, protected]

Contains definitions for output data columns, sorted by element indices.

bool IG::Num::SampledDataCsv::IsDataColumnDefinitionsUpdated [get, set]

Whether complete information about data column definitions is up to date, including auciliary lists with sorted input and output definitions.

bool IG::Num::SampledDataCsv::KeyAndDataInSameRow [get, set]

Whether keys and data are in the same row in data definition section wnen writing to CSV format.

int IG::Num::SampledDataCsv::Indentation [get, set]

Offset - specifies in which column data columns begin when writing tyo CSV format.

bool IG::Num::SampledDataCsv::ThrowExceptionsOnDataErrors [get, set]

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations Properties Events