IGLib  1.7.2
The IGLib base library for development of numerical, technical and business applications.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
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:

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. More...
 
 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. More...
 
bool IsKey (string str, string keyString)
 Returns true if the specified string represents the specified keyword. More...
 
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). More...
 
bool IsElementTypeKey (string str)
 Returns a value indicating whether the specified string is a keyword indicating a specific value (e.g. KeyElementTypeInput or KeyElementTypeOutput). More...
 
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. More...
 
bool IsDataKey (string str)
 Returns a value indicating whether the specified string is a keyword for a data field. More...
 
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. More...
 
bool IsKeyData (string str)
 Whether the specified string is a keyword introducing the sampled data. More...
 
bool IsKeyElementTypeInput (string str)
 Whether the specified string is a keyword that marks the input data type. More...
 
bool IsKeyElementTypeOutput (string str)
 Whether the specified string is a keyword that marks the output data type. More...
 
bool IsKeyComment (string str)
 Whether the specified string is a keyword introducing a comment in the line that contains it. More...
 
bool IsKeyNumInputParameters (string str)
 Whether the specified string is a keyword introducing the number of input parameters. More...
 
bool IsKeyNumOutputValues (string str)
 Whether the specified string is a keyword introducing the number of output parameters. More...
 
bool IsKeyNames (string str)
 Whether the specified string is a keyword introducing variable names. More...
 
bool IsKeyTitles (string str)
 Whether the specified string is a keyword introducing variable titles. More...
 
bool IsKeyDescriptions (string str)
 Whether the specified string is a keyword introducing variable descriptions. More...
 
bool IsKeyElementTypes (string str)
 Whether the specified string is a keyword introducing variable element types (e.g. input/output). More...
 
bool IsKeyElementIndices (string str)
 Whether the specified string is a keyword introducing variable element indices names. More...
 
bool IsKeyMinimalValues (string str)
 Whether the specified string is a keyword introducing variable minimal values. More...
 
bool IsKeyMaximalValues (string str)
 Whether the specified string is a keyword introducing variable maximal values. More...
 
bool IsKeyScalingLengths (string str)
 Whether the specified string is a keyword introducing variable scaling lengths. More...
 
bool IsKeyDefaultValues (string str)
 Whether the specified string is a keyword introducing variable default values. More...
 
bool IsKeyNumSamplingPoints (string str)
 Whether the specified string is a keyword introducing variable for number of sampling points. More...
 
bool IsKeyDiscretizationSteps (string str)
 Whether the specified string is a keyword introducing variable discretization steps. More...
 
bool IsKeyTargetValues (string str)
 Whether the specified string is a keyword introducing variable target values. More...
 
bool IsKeyOptimizationIndices (string str)
 Whether the specified string is a keyword introducing variable optimization indices. More...
 
string GetPositionString ()
 Returns the string indicating the current position in the form (row, column), e.g. "(23, 55)". More...
 
string GetPositionString (int rowNum, int columnNum)
 Returns the string indicating the specified position position in the form (row, column), e.g. "(23, 55)". More...
 
bool CheckIfDataColumnsDefined ()
 Returns a flag defining whether all data columns in the data table are defined. More...
 
void UpdateDataColumnDefinitions ()
 Updates index lists for data column definitions for inputs (InputColumnDefinitions) and outputs (OutputColumnDefinitions), and sets the IsDataColumnDefinitionsUpdated flag to true if successful. More...
 
void StoreDefinition ()
 Stores data definitions to the data table. More...
 
void StoreData ()
 Stores sampled data to the data table. More...
 
void StoreDefinitionAndData ()
 Stores data definitions AND sampled data to the data table. More...
 
void SaveDefinition (string filePath)
 Saves data definitions to the specified file. More...
 
void SaveData (string filePath)
 Saves sampled data to the specified file. More...
 
void SaveDefinitionAndData (string filePath)
 Saves data definitions AND sampled data to the specified file. More...
 
void RestoreDefinition (bool resetPosition)
 Restores data definition from the data table. More...
 
void RestoreDefinition ()
 Restores data definition from the data table. Position is reset before the operation begins. More...
 
void RestoreData (bool resetPosition)
 Restores sampled data from the data table, starting from the current position, i.e. (CurrentRow, CurrentColumn). More...
 
void RestoreData ()
 Restores sampled data definition from the data table. Position is reset before the operation begins. More...
 
void RestoreDefinitionAndData (bool resetPosition)
 Restores data definition AND sampled data definition from the data table. More...
 
void RestoreDefinitionAndData ()
 Restores data definition AND sampled data definition from the data table. Position is reset before the operation begins. More...
 
void LoadDefinition (string filePath)
 Loads data definition form the specified CSV file. More...
 
void LoadData (string filePath)
 Loads sampled data form the specified CSV file. More...
 
void LoadDefinitionAndData (string filePath)
 Loads data definition AND sampled data form the specified CSV file. More...
 
- Public Member Functions inherited from IG.Lib.StringTable
 StringTable (bool readOnly)
 Constructs a new string table, a data structure compatible with CSV file format. More...
 
 StringTable ()
 Constructs a new string table, a data structure compatible with CSV file format. More...
 
void SetElement (int rowNumber, int columnNumber, string element)
 Sets element at the specified position to the specified value. More...
 
void SetElement< ElementType > (int rowNumber, int columnNumber, ElementType elementValue)
 Sets element at the specified position to the string representation of the specified value. More...
 
ElementType GetElement< ElementType > (int rowNumber, int columnNumber)
 Returns the element of the specified type at the specified position. More...
 
bool TryGetElement< ElementType > (int rowNumber, int columnNumber, ref ElementType elementValue)
 Tries to obtain a value of the specified type at the specified position, and returns a flag indicating whether parsing the value from a string was successful (and the element existed). More...
 
bool IsDefined< ElementType > (int rowNumber, int columnNumber)
 Returns a flag indicating whether the specified position contains a valid string representation of a element of the specified type. More...
 
bool IsDefined (int rowNumber, int columnNumber)
 Returns a flag telling whether the specified element is defined (it exists in the data table) or not. More...
 
bool IsNotNullOrEmpty (int rowNumber, int columnNumber)
 Returns a flag telling whether the specified element is defined (it exists in the data table) and is at the same time not null or empty string. More...
 
string GetElementOrNull (int rowNumber, int columnNumber, out bool isDefined)
 Returns the specified element on the data table or null if that element is not defined, and notifies the caller through isDefined whether the element is defined or not. More...
 
string GetElementOrNull (int rowNumber, int columnNumber)
 Returns the specified element on the data table or null if that element is not defined. More...
 
int FirstNonemptyRow (int startRow)
 Returns index of the first non-empty row from the specified row on (inclusively), or -1 if there is no such row. More...
 
int FirstNonemptyRow ()
 Returns index of the first non-empty row of the table, or -1 if there is no such row. More...
 
int FirstNonemptyColumn (int rowNum, int startColumn)
 Returns number of the first non-empty cell in the specified row, from the specified starting column on (inclusively), or -1 if there is no suuch column. More...
 
int FirstNonemptyColumn (int rowNum)
 Returns number of the first non-empty cell in the specified row. More...
 
void Clear ()
 Clears the data table. More...
 
void AddRow ()
 Adds a new row at the end of the data table. More...
 
void AddRow (params string[] elements)
 Adds a new row at the end of the data table. More...
 
void AddRow< ElementType > (params ElementType[] elements)
 Adds (appends) a new row with the specified elements at the end of the table. More...
 
void AddElement (int rowNum, string value)
 Adds a new element at the end of the specified row of te data table. More...
 
void AddElement (string value)
 Adds (appends) the speecified element at the end of the table, i.e. at the end of the last row. More...
 
void AddElement< ElementType > (int rowNum, ElementType value)
 Adds string representation of a new element of the specified type at the end of the specified row of te data table. More...
 
void AddElement< ElementType > (ElementType value)
 Adds (appends) string representatin of the speecified element at the end of the table, i.e. at the end of the last row. More...
 
void AddElements (int rowNum, params string[] values)
 Adds the specified elements at the end of the specified row of te data table. More...
 
void AddElements< ElementType > (int rowNum, params ElementType[] values)
 Adds string representations of the specified elements of the specified type at the end of the specified row of te data table. More...
 
void AddElements (params string[] values)
 Adds (appends ) the specified elements at the end of the table, i.e. at the end of the last row. More...
 
void AddElements< ElementType > (params ElementType[] values)
 Adds (appends ) string representations of the specified elements of the specified type at the end of the table, i.e. at the end of the last row. More...
 
void SetNumRows (int numRows)
 Change the number of rows in the data table to the specified number. More...
 
void SetNumColumns (int rowNum, int numColumns)
 Changes the number of columns of the specified row to the specified number. More...
 
void ClearRow (int rowNum)
 Clears the specified row in the data table. More...
 
int NumColumns (int rowNum)
 Returns the number of elements (columns) of the specified row. More...
 
bool IsInt (int rowNumber, int columnNumber)
 Returns a flag specified whether the specified element of the data table exists and represents an integer. More...
 
int GetInt (int rowNumber, int columnNumber)
 Returns an integer value of the element at the specified position of the data table, if it is defined, or throws an exception. More...
 
bool TryGetInt (int rowNumber, int columnNumber, out int value)
 Safely gets the integer value at the specified position of the data table, if it is defined, and notifies the caller whether it is defined. More...
 
void GetIntSafe (int rowNumber, int columnNumber, out int value, out bool isElementDefined, out bool isElementNotNullOrEmpty, out bool isInt)
 Safely gets the integer value at the specified position of the data table, if it is defined, and notifies the caller on the status. More...
 
bool IsDouble (int rowNumber, int columnNumber)
 Returns a flag specified whether the specified element of the data table exists and represents a number (of type double). More...
 
double GetDouble (int rowNumber, int columnNumber)
 Returns a double value of the element at the specified position of the data table, if such element is defined and represents a number, or throws an exception otherwise. More...
 
bool TryGetDouble (int rowNumber, int columnNumber, out double value)
 Safely gets the double value at the specified position of the data table, if it is defined, and notifies the caller whether it is defined. More...
 
void GetDoubleSafe (int rowNumber, int columnNumber, out double value, out bool isElementDefined, out bool isElementNotNullOrEmpty, out bool isDouble)
 Safely gets the numerical value (of type double) at the specified position of the data table, if it is defined, and notifies the caller about the status. More...
 
void LoadCsv (string filePath, string separator)
 Loads the specified CSV file. Reads contents of the file into the data table of the current object. More...
 
void LoadCsv (string filePath)
 Loads the specified CSV file. Reads contents of the file into the data table of the current object. More...
 
override string ToString ()
 Converts the current string table to a string in CSV form and returns the string. More...
 
void SaveCsv (string filePath, string separator, bool append)
 Saves the data of the current object to the specified CSV file. More...
 
void SaveCsv (string filePath, string separator)
 Saves the data of the current object into a CSV file. If the file already exists then its contents are overwritten. More...
 
void SaveCsv (string filePath, bool append)
 Saves the data of the current object into a CSV file. Constant UtilCsv.DefaultCsvSeparator is assumed to be a separator for the CSV format. More...
 
void SaveCsv (string filePath)
 Saves the data of the current object values into a CSV file. If the file already exists then its contents are overwritten. Constant UtilCsv.DefaultCsvSeparator is assumed to be a separator for the CSV format. More...
 

Public Attributes

bool _throwExceptionsOnDataErrors = false
 
- Public Attributes inherited from IG.Lib.StringTable
const string DefaultCsvSeparator = ","
 The default separator in the CSV files - comma (","). More...
 

Protected Member Functions

void ClearDataColumnDefinitions ()
 Clears data column definitions. More...
 
void StoreDefinition (bool clearFirst)
 Stores definition data to the data table. More...
 
void StoreData (bool clearFirst)
 Stores the samples data to the data table. More...
 
void StoreDefinitionAndData (bool clearFirst)
 Stores data definitions AND sampled data to the data table. More...
 
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. More...
 
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. More...
 
DataColumnDefinition GetDataColumnDefinition (int dataColumnIndex)
 Returns the specified data column definition by its sequential number on the list of columns DataColumnDefinitions. More...
 
bool ReadSingleInt (ref int value)
 Reads a single integer value. Current line and column must be set to its key. More...
 
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 ). More...
 
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). More...
 
void GetDataColumnDefinitionsFromData (int keyRow, int keyColumn, bool isDouble, bool isInt)
 Extracts information about data columns from the data. More...
 
void GetDataColumnDefinitionsFromData (bool isDouble, bool isInt)
 Extracts information about data columns from the data. More...
 
void ReadElementTypes ()
 Reads types of elements from the CSV-like string table, from the current position on (inclusively). More...
 
void ReadElementIndices ()
 Reads types of elements from the CSV, from the current position on (inclusively). More...
 
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. More...
 
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. More...
 
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. More...
 
void ReadElementNames ()
 Reads names of input and output data elements from the CSV, from the current position on (inclusively). More...
 
void ReadElementTitles ()
 Reads titles of input and output data elements from the CSV, from the current position on (inclusively). More...
 
void ReadElementDescriptions ()
 Reads descriptions of input and output data elements from the CSV, from the current position on (inclusively). More...
 
void ReadElementMinimalValues ()
 Reads minimal values of input and output data elements from the CSV, from the current position on (inclusively). More...
 
void ReadElementMaximalValues ()
 Reads maximal values of input and output data elements from the CSV, from the current position on (inclusively). More...
 
void ReadElementScalingLengths ()
 Reads scaling lengths of input and output data elements from the CSV, from the current position on (inclusively). More...
 
void ReadElementDefaultValues ()
 Reads default values of input and output data elements from the CSV, from the current position on (inclusively). More...
 
void ReadElementDiscretizationSteps ()
 Reads discretization steps of input data elements from the CSV, from the current position on (inclusively). More...
 
void ReadElementNumSamplingPoints ()
 Reads numberr of sampling points of input data elements from the CSV, from the current position on (inclusively). More...
 
void ReadElementTargetValues ()
 Reads target values of input and output data elements from the CSV, from the current position on (inclusively). More...
 
void ReadElementOptimizationIndices ()
 Reads optimization indices of input and output data elements from the CSV, from the current position on (inclusively). More...
 

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 _keyNumSamplingPoints = DefaultKeyNumSamplingPoints
 
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. More...
 
bool _keyAndDataInSameRow = false
 
int _indentation = 0
 
string[] AuxStringArray = null
 Auxiliary array for temporary storage of strings. More...
 
double[] AuxDoubleArray = null
 Auxiliary array for temporary storage of double numbers. More...
 
int[] AuxIntArray = null
 Auxiliary array for temporary storage of integer numbers. More...
 
- Protected Attributes inherited from IG.Lib.StringTable
readonly object _lock = new object()
 
int _outputLevel = DefaultOutputLevel
 
List< List< string > > _data = new List<List<string>>()
 
bool _isReadOnly = false
 
bool _isAutoExtend = true
 
string _csvSeparator = UtilCsv.CsvSeparator
 

Properties

static bool DefaultIsKeysCaseSensitive [get, set]
 Default value for the flag indicating whether keys should be treated as case sensitive. More...
 
static string DefaultKeyData [get, protected set]
 Default key for introduction of sampled data. More...
 
static string DefaultKeyElementTypeInput [get, protected set]
 Default element type keyword for input element. More...
 
static string DefaultKeyElementTypeOutput [get, protected set]
 Default element type keyword for output element. More...
 
static string DefaultKeyComment [get, protected set]
 Default key for comment in the current line. More...
 
static string DefaultKeyNumInputParameters [get, protected set]
 Default key for introduction of number of input parameters. More...
 
static string DefaultKeyNumOutputValues [get, protected set]
 Default key for introduction of number of output parameters. More...
 
static string DefaultKeyNames [get, protected set]
 Default key for introduction of names of input and output data elements. More...
 
static string DefaultKeyTitles [get, protected set]
 Default key for introduction of titles of input and output data elements. More...
 
static string DefaultKeyDescriptions [get, protected set]
 Default key for introduction of descriptions of input and output data elements. More...
 
static string DefaultKeyElementTypes [get, protected set]
 Default key for introduction of element types of input and output data elements (e.g. input/output). More...
 
static string DefaultKeyElementIndices [get, protected set]
 Default key for introduction of element indices of input and output data elements. More...
 
static string DefaultKeyMinimalValues [get, protected set]
 Default key for introduction of minimal values of input and output data elements. More...
 
static string DefaultKeyMaximalValues [get, protected set]
 Default key for introduction of maximal values of input and output data elements. More...
 
static string DefaultKeyDefaultValues [get, protected set]
 Default key for introduction of default values of input data elements. More...
 
static string DefaultKeyScalingLengths [get, protected set]
 Default key for introduction of scaling lengths of input and output data elements. More...
 
static string DefaultKeyDiscretizationSteps [get, protected set]
 Default key for introduction of discretization steps of input and output data elements. More...
 
static string DefaultKeyNumSamplingPoints [get, protected set]
 Default key for introduction of number of sampling points of input and output data elements. More...
 
static string DefaultKeyTargetValues [get, protected set]
 Default key for introduction of target values of input and output data elements. More...
 
static string DefaultKeyOptimizationIndices [get, protected set]
 Default key for introduction of optimization indices of input and output data elements. More...
 
bool IsKeysCaseSensitive [get, set]
 Whether keywords are case sensitive. More...
 
string KeyData [get, protected set]
 Keyword that introduces the sampled data. More...
 
string KeyElementTypeInput [get, protected set]
 A keyword string for input element type in the CSV file containing sampled data and / or data definitions. More...
 
string KeyElementTypeOutput [get, protected set]
 A keyword string for output element type in the CSV file containing sampled data and / or data definitions. More...
 
string KeyComment [get, protected set]
 A keyword string that introduces a commet in the containing line. More...
 
string KeyNumInputParameters [get, protected set]
 A keyword string that introduces the number of input parameters in the CSV file containing sampled data and / or data definitions. More...
 
string KeyNumOutputValues [get, protected set]
 A keyword string that introduces the number of output parameters in the CSV file containing sampled data and / or data definitions. More...
 
string KeyNames [get, protected set]
 A keyword string that introduces variable names in the CSV file containing sampled data and / or data definitions. More...
 
string KeyTitles [get, protected set]
 A keyword string that introduces variable titles in the CSV file containing sampled data and / or data definitions. More...
 
string KeyDescriptions [get, protected set]
 A keyword string that introduces variable descriptions in the CSV file containing sampled data and / or data definitions. More...
 
string KeyElementTypes [get, protected set]
 A keyword string that introduces variable element types in the CSV file containing sampled data and / or data definitions. More...
 
string KeyElementIndices [get, protected set]
 A keyword string that introduces variable element indices in the CSV file containing sampled data and / or data definitions. More...
 
string KeyMinimalValues [get, protected set]
 A keyword string that introduces variable minimal values in the CSV file containing sampled data and / or data definitions. More...
 
string KeyMaximalValues [get, protected set]
 A keyword string that introduces variable maximal values in the CSV file containing sampled data and / or data definitions. More...
 
string KeyScalingLengths [get, protected set]
 A keyword string that introduces variable scaling lengths in the CSV file containing sampled data and / or data definitions. More...
 
string KeyDefaultValues [get, protected set]
 A keyword string that introduces variable default values in the CSV file containing sampled data and / or data definitions. More...
 
string KeyDiscretizationSteps [get, protected set]
 A keyword string that introduces variable discretization steps in the CSV file containing sampled data and / or data definitions. More...
 
string KeyNumSamplingPoints [get, protected set]
 A keyword string that introduces variable discretization steps in the CSV file containing sampled data and / or data definitions. More...
 
string KeyTargetValues [get, protected set]
 A keyword string that introduces variable target values in the CSV file containing sampled data and / or data definitions. More...
 
string KeyOptimizationIndices [get, protected set]
 A keyword string that introduces variable optimization indices in the CSV file containing sampled data and / or data definitions. More...
 
InputOutputDataDefiniton DataDefinition [get, set]
 
SampledDataSet SampledData [get, set]
 
int InputLength [get, set]
 Number of input elements. More...
 
int OutputLength [get, set]
 Number of output values in the data. More...
 
int CurrentRow [get, protected set]
 
int CurrentColumn [get, protected set]
 
List< DataColumnDefinitionDataColumnDefinitions [get]
 Contains definitions of data columns within the data table. More...
 
List< DataColumnDefinitionInputColumnDefinitions [get]
 Contains definitions for input data columns, sorted by element indices. More...
 
List< DataColumnDefinitionOutputColumnDefinitions [get]
 Contains definitions for output data columns, sorted by element indices. More...
 
bool IsDataColumnDefinitionsUpdated [get, protected set]
 Whether complete information about data column definitions is up to date, including auciliary lists with sorted input and output definitions. More...
 
bool KeyAndDataInSameRow [get, set]
 Whether keys and data are in the same row in data definition section wnen writing to CSV format. More...
 
int Indentation [get, set]
 Offset - specifies in which column data columns begin when writing tyo CSV format. More...
 
bool ThrowExceptionsOnDataErrors [get, set]
 
- Properties inherited from IG.Lib.StringTable
object Lock [get]
 Object used for thread locking. More...
 
int OutputLevel [get, set]
 Output level, specifies the level of descriptive output on console during the operation. More...
 
List< List< string > > Data [get]
 Data behind the table - list of lists of strings. More...
 
bool IsReadOnly [get, set]
 Whether or not data table is read only. More...
 
bool IsAutoExtend [get, set]
 Whether or not data storage automatically extends when a value is set on the position that is out of range. More...
 
string this[int rowNumber, int columnNumber] [get, set]
 Index operator, gets or sets the specific element of the data table specified by row and column number. More...
 
string[][] Table [get, set]
 Gets or sets copy of the data table in form of 2D jagged array. More...
 
int NumRows [get]
 Gets number of rows in the data table. More...
 
int MaxNumColumns [get]
 Returns the maximal number of columns in any row. More...
 
bool IsRectangular [get]
 Returns true if data table is rectangular (i.e. all rows have equal number of elements) or not. More...
 
string CsvSeparator [get, set]
 Separator used in CSV files that this class loads data from or writes data to. More...
 
- Properties inherited from IG.Lib.ILockable
object Lock [get]
 

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 _defaultKeyNumSamplingPoints = "NumSamplingPoints"
 
static string _defaultKeyTargetValues = "TargetValues"
 
static string _defaultKeyOptimizationIndices = "OptimizationIndices"
 

Additional Inherited Members

- Static Public Member Functions inherited from IG.Lib.StringTable
static void ExampleWriteCsv (string filePath)
 Creates a simple string table and saves it to a CSV file. More...
 
- Static Public Attributes inherited from IG.Lib.StringTable
static int DefaultOutputLevel = 0
 Dafault output level for object of the StringTable and derived classes. More...
 

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.IsKeyNumSamplingPoints ( string  str)
inline

Whether the specified string is a keyword introducing variable for number of sampling points.

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 ( )
inlineprotected

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.StoreData ( bool  clearFirst)
inlineprotected

Stores the samples data to the data table.

Parameters
clearFirstWhether the data table is cleared before the operation begins.

References IG.Num.SampledDataElement.InputParameters, IG.Num.SampledDataElement.OutputValues, and IG.Num.IVector.ToString().

void IG.Num.SampledDataCsv.StoreDefinitionAndData ( bool  clearFirst)
inlineprotected

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.

Referenced by IG.Script.ScriptAppBase.DataStructuresFunctionTestCsvReadDefinitionAndData(), and IG.Script.ScriptAppBase.DataStructuresFunctionTestCsvWriteDefinitionAndData().

InputElementDefinition IG.Num.SampledDataCsv.GetInputElementDefinition ( int  whichElement)
inlineprotected

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)
inlineprotected

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)
inlineprotected

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)
inlineprotected

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 
)
inlineprotected

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
InvalidDataExceptionWhen the first data cell could not be located.
void IG.Num.SampledDataCsv.FindFirstDataCell ( out int  row,
out int  column 
)
inlineprotected

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
InvalidDataExceptionWhen the first data cell could not be located.
void IG.Num.SampledDataCsv.GetDataColumnDefinitionsFromData ( int  keyRow,
int  keyColumn,
bool  isDouble,
bool  isInt 
)
inlineprotected

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.

References IG.Num.SampledDataCsv.DataColumnDefinition.Column, IG.Num.SampledDataCsv.DataColumnDefinition.ColumnIndex, IG.Num.SampledDataCsv.DataColumnDefinition.ElementIndex, and IG.Num.SampledDataCsv.DataColumnDefinition.IsInput.

void IG.Num.SampledDataCsv.GetDataColumnDefinitionsFromData ( bool  isDouble,
bool  isInt 
)
inlineprotected

Extracts information about data columns from the data.

Parameters
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 ( )
inlineprotected
void IG.Num.SampledDataCsv.ReadElementIndices ( )
inlineprotected

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.

References IG.Num.SampledDataCsv.DataColumnDefinition.ElementIndex, IG.Num.SampledDataCsv.DataColumnDefinition.IsInput, IG.Num.SampledDataCsv.DataColumnDefinition.IsInputOutputDefined, and IG.Num.SampledDataCsv.DataColumnDefinition.ToStringList().

void IG.Num.SampledDataCsv.ReadStringData ( ref string[]  dataArray)
inlineprotected

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.

References IG.Num.SampledDataCsv.DataColumnDefinition.Column, and IG.Num.SampledDataCsv.DataColumnDefinition.ElementIndex.

void IG.Num.SampledDataCsv.ReadDoubleData ( ref double[]  dataArray)
inlineprotected

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.

References IG.Num.SampledDataCsv.DataColumnDefinition.Column, and IG.Num.SampledDataCsv.DataColumnDefinition.ElementIndex.

void IG.Num.SampledDataCsv.ReadIntData ( ref int[]  dataArray)
inlineprotected

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.

References IG.Num.SampledDataCsv.DataColumnDefinition.Column, and IG.Num.SampledDataCsv.DataColumnDefinition.ElementIndex.

void IG.Num.SampledDataCsv.ReadElementNames ( )
inlineprotected

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.

References IG.Num.InputOutputElementDefinition.Name.

void IG.Num.SampledDataCsv.ReadElementTitles ( )
inlineprotected

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.

References IG.Num.InputOutputElementDefinition.Title.

void IG.Num.SampledDataCsv.ReadElementDescriptions ( )
inlineprotected

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.

References IG.Num.InputOutputElementDefinition.Description.

void IG.Num.SampledDataCsv.ReadElementMinimalValues ( )
inlineprotected

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.

References IG.Num.InputOutputElementDefinition.BoundsDefined, and IG.Num.InputOutputElementDefinition.MinimalValue.

void IG.Num.SampledDataCsv.ReadElementMaximalValues ( )
inlineprotected

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.

References IG.Num.InputOutputElementDefinition.BoundsDefined, and IG.Num.InputOutputElementDefinition.MaximalValue.

void IG.Num.SampledDataCsv.ReadElementScalingLengths ( )
inlineprotected

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.

References IG.Num.InputOutputElementDefinition.ScalingLength, and IG.Num.InputOutputElementDefinition.ScalingLengthDefined.

void IG.Num.SampledDataCsv.ReadElementDefaultValues ( )
inlineprotected

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.

References IG.Num.InputElementDefinition.DefaultValue, and IG.Num.InputElementDefinition.DefaultValueDefined.

void IG.Num.SampledDataCsv.ReadElementDiscretizationSteps ( )
inlineprotected

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.

References IG.Num.InputElementDefinition.DiscretizationStep.

void IG.Num.SampledDataCsv.ReadElementNumSamplingPoints ( )
inlineprotected

Reads numberr of sampling points 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.

References IG.Num.InputElementDefinition.NumSamplingPoints.

void IG.Num.SampledDataCsv.ReadElementTargetValues ( )
inlineprotected

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.

References IG.Num.InputOutputElementDefinition.TargetValue, and IG.Num.InputOutputElementDefinition.TargetValueDefined.

void IG.Num.SampledDataCsv.ReadElementOptimizationIndices ( )
inlineprotected

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.

References IG.Num.InputElementDefinition.OptimizationIndex, and IG.Num.InputElementDefinition.OptimizationIndexSpecified.

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.

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.

References IG.Num.SampledDataSet.InputLength, IG.Num.SampledDataSet.OutputLength, and IG.Num.IVector.ToString().

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.

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.

Referenced by IG.Script.ScriptAppBase.DataStructuresFunctionTestCsvReadDefinitionAndData().

Member Data Documentation

bool IG.Num.SampledDataCsv._defaultIsKeysCaseSensitive = false
staticprivate
string IG.Num.SampledDataCsv._defaultKeyData = "Data"
staticprivate
string IG.Num.SampledDataCsv._defaultKeyElementTypeInput = "Input"
staticprivate
string IG.Num.SampledDataCsv._defaultKeyElementTypeOutput = "Output"
staticprivate
string IG.Num.SampledDataCsv._defaultKeyComment = "Comment"
staticprivate
string IG.Num.SampledDataCsv._defaultKeyNumInputParameters = "NumInputs"
staticprivate
string IG.Num.SampledDataCsv._defaultKeyNumOutputParameters = "NumOutputs"
staticprivate
string IG.Num.SampledDataCsv._defaultKeyNames = "Names"
staticprivate
string IG.Num.SampledDataCsv._defaultKeyTitles = "Titles"
staticprivate
string IG.Num.SampledDataCsv._defaultKeyDescriptions = "Descriptions"
staticprivate
string IG.Num.SampledDataCsv._defaultKeyElementTypes = "ElementTypes"
staticprivate
string IG.Num.SampledDataCsv._defaultKeyElementIndices = "ElementIndices"
staticprivate
string IG.Num.SampledDataCsv._defaultKeyMinimalValues = "MinimalValues"
staticprivate
string IG.Num.SampledDataCsv._defaultKeyMaximalValues = "MaximalValues"
staticprivate
string IG.Num.SampledDataCsv._defaultKeyDefaultValues = "DefaultValues"
staticprivate
string IG.Num.SampledDataCsv._defaultKeySclaingLengths = "ScalingLengths"
staticprivate
string IG.Num.SampledDataCsv._defaultKeyDiscretizationSteps = "DiscretizationSteps"
staticprivate
string IG.Num.SampledDataCsv._defaultKeyNumSamplingPoints = "NumSamplingPoints"
staticprivate
string IG.Num.SampledDataCsv._defaultKeyTargetValues = "TargetValues"
staticprivate
string IG.Num.SampledDataCsv._defaultKeyOptimizationIndices = "OptimizationIndices"
staticprivate
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._keyNumSamplingPoints = DefaultKeyNumSamplingPoints
protected
string IG.Num.SampledDataCsv._keyTargetValues = DefaultKeyTargetValues
protected
string IG.Num.SampledDataCsv._keyOptimizationIndices = DefaultKeyOptimizationIndices
protected
InputOutputDataDefiniton IG.Num.SampledDataCsv._dataDefinition
private
SampledDataSet IG.Num.SampledDataCsv._sampledData
private
int IG.Num.SampledDataCsv._inputLength = -1
private
int IG.Num.SampledDataCsv._outputLength = -1
private
int IG.Num.SampledDataCsv._currentRow = 0
protected
int IG.Num.SampledDataCsv._currentColumn = 0
protected
List<DataColumnDefinition> IG.Num.SampledDataCsv._dataColumnDefinitions = new List<DataColumnDefinition>()
protected
List<DataColumnDefinition> IG.Num.SampledDataCsv._inputColumnDefinitions = new List<DataColumnDefinition>()
protected
List<DataColumnDefinition> IG.Num.SampledDataCsv._outputColumnDefinitions = new List<DataColumnDefinition>()
private
bool IG.Num.SampledDataCsv.IsDataColumnDefinitionsDefined = false
protected

Whether a full list of data columns is defined.

bool IG.Num.SampledDataCsv._isDataColumnDefinitionsUpdated = false
private
bool IG.Num.SampledDataCsv._keyAndDataInSameRow = false
protected
int IG.Num.SampledDataCsv._indentation = 0
protected
bool IG.Num.SampledDataCsv._throwExceptionsOnDataErrors = false
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
staticgetset

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

string IG.Num.SampledDataCsv.DefaultKeyData
staticgetprotected set

Default key for introduction of sampled data.

string IG.Num.SampledDataCsv.DefaultKeyElementTypeInput
staticgetprotected set

Default element type keyword for input element.

string IG.Num.SampledDataCsv.DefaultKeyElementTypeOutput
staticgetprotected set

Default element type keyword for output element.

string IG.Num.SampledDataCsv.DefaultKeyComment
staticgetprotected set

Default key for comment in the current line.

string IG.Num.SampledDataCsv.DefaultKeyNumInputParameters
staticgetprotected set

Default key for introduction of number of input parameters.

string IG.Num.SampledDataCsv.DefaultKeyNumOutputValues
staticgetprotected set

Default key for introduction of number of output parameters.

string IG.Num.SampledDataCsv.DefaultKeyNames
staticgetprotected set

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

string IG.Num.SampledDataCsv.DefaultKeyTitles
staticgetprotected set

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

string IG.Num.SampledDataCsv.DefaultKeyDescriptions
staticgetprotected set

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

string IG.Num.SampledDataCsv.DefaultKeyElementTypes
staticgetprotected set

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

string IG.Num.SampledDataCsv.DefaultKeyElementIndices
staticgetprotected set

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

string IG.Num.SampledDataCsv.DefaultKeyMinimalValues
staticgetprotected set

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

string IG.Num.SampledDataCsv.DefaultKeyMaximalValues
staticgetprotected set

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

string IG.Num.SampledDataCsv.DefaultKeyDefaultValues
staticgetprotected set

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

string IG.Num.SampledDataCsv.DefaultKeyScalingLengths
staticgetprotected set

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

string IG.Num.SampledDataCsv.DefaultKeyDiscretizationSteps
staticgetprotected set

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

string IG.Num.SampledDataCsv.DefaultKeyNumSamplingPoints
staticgetprotected set

Default key for introduction of number of sampling points of input and output data elements.

string IG.Num.SampledDataCsv.DefaultKeyTargetValues
staticgetprotected set

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

string IG.Num.SampledDataCsv.DefaultKeyOptimizationIndices
staticgetprotected set

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

bool IG.Num.SampledDataCsv.IsKeysCaseSensitive
getset

Whether keywords are case sensitive.

string IG.Num.SampledDataCsv.KeyData
getprotected set

Keyword that introduces the sampled data.

string IG.Num.SampledDataCsv.KeyElementTypeInput
getprotected set

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

string IG.Num.SampledDataCsv.KeyElementTypeOutput
getprotected set

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

string IG.Num.SampledDataCsv.KeyComment
getprotected set

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

string IG.Num.SampledDataCsv.KeyNumInputParameters
getprotected 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
getprotected 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
getprotected set

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

string IG.Num.SampledDataCsv.KeyTitles
getprotected set

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

string IG.Num.SampledDataCsv.KeyDescriptions
getprotected set

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

string IG.Num.SampledDataCsv.KeyElementTypes
getprotected 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
getprotected 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
getprotected 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
getprotected 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
getprotected 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
getprotected 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
getprotected set

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

string IG.Num.SampledDataCsv.KeyNumSamplingPoints
getprotected 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
getprotected 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
getprotected set

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

int IG.Num.SampledDataCsv.InputLength
getsetprivate

Number of input elements.

int IG.Num.SampledDataCsv.OutputLength
getsetprivate

Number of output values in the data.

int IG.Num.SampledDataCsv.CurrentRow
getprotected set
int IG.Num.SampledDataCsv.CurrentColumn
getprotected set
List<DataColumnDefinition> IG.Num.SampledDataCsv.DataColumnDefinitions
getprotected

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
getprotected

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

List<DataColumnDefinition> IG.Num.SampledDataCsv.OutputColumnDefinitions
getprotected

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

bool IG.Num.SampledDataCsv.IsDataColumnDefinitionsUpdated
getprotected 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
getset

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

Referenced by IG.Script.ScriptAppBase.DataStructuresFunctionTestCsvReadDefinitionAndData(), and IG.Script.ScriptAppBase.DataStructuresFunctionTestCsvWriteDefinitionAndData().

int IG.Num.SampledDataCsv.Indentation
getset

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

Referenced by IG.Script.ScriptAppBase.DataStructuresFunctionTestCsvReadDefinitionAndData(), and IG.Script.ScriptAppBase.DataStructuresFunctionTestCsvWriteDefinitionAndData().

bool IG.Num.SampledDataCsv.ThrowExceptionsOnDataErrors
getset

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