GEOS
Classes | Public Types | Public Member Functions | List of all members
geos::TableData2D Class Reference

Class for managing 2D table m_data. More...

#include <TableData.hpp>

Classes

struct  TableDataHolder
 Struct containing conversion informations. More...
 

Public Types

using RowType = real64
 Type real64 for a row.
 
using ColumnType = real64
 Type real64 for a column.
 

Public Member Functions

template<typename T >
void addCell (RowType rowValue, ColumnType columnValue, T const &value)
 Add a cell to the table. If necessary, create automatically the containing column & row. More...
 
void collectTableValues (arrayView1d< real64 const > dim0AxisCoordinates, arrayView1d< real64 const > dim1AxisCoordinates, arrayView1d< real64 const > values, bool columnMajorValues)
 Collects all the values needed to build the table. More...
 
TableData2D::TableDataHolder convertTable2D (arrayView1d< real64 const > coordX, arrayView1d< real64 const > coordY, string_view rowAxisDescription, string_view columnAxisDescription, arrayView1d< real64 const > const values, bool columnMajorValues, string_view valueDescription)
 Convert from 2D axis/values a structure the information needed to build a TableFormatter. More...
 
TableDataHolder buildTableData (string_view dataDescription, string_view rowFmt="{}", string_view columnFmt="{}") const
 
void clear ()
 Clear all data stored in TableData.
 

Detailed Description

Class for managing 2D table m_data.

Definition at line 169 of file TableData.hpp.

Member Function Documentation

◆ addCell()

template<typename T >
void geos::TableData2D::addCell ( RowType  rowValue,
ColumnType  columnValue,
T const &  value 
)

Add a cell to the table. If necessary, create automatically the containing column & row.

Template Parameters
TThe value passed to addCell (can be any type).
Parameters
valueCellData value to be added.
rowValueThe value of the row containing the cell.
columnValueThe value of the column containing the cell.

Definition at line 291 of file TableData.hpp.

◆ buildTableData()

TableDataHolder geos::TableData2D::buildTableData ( string_view  dataDescription,
string_view  rowFmt = "{}",
string_view  columnFmt = "{}" 
) const
Returns
Convert and return a struct containing a 1D Table, the column names list from a TableData2D and any errors related to the table
Parameters
dataDescriptionThe table dataDescription shown at the top left side
rowFmtThe y axis units of the table.
columnFmtThe x axis units of the table.
Note
The rows and columns FMT can be customized. The bracket "{}" will be replaced by the axis value. By default it displays the axis value. I.E to display a customized axis to show the pressures in y axis, a rowFmt value can be : "pressure [K] = {}"

◆ collectTableValues()

void geos::TableData2D::collectTableValues ( arrayView1d< real64 const >  dim0AxisCoordinates,
arrayView1d< real64 const >  dim1AxisCoordinates,
arrayView1d< real64 const >  values,
bool  columnMajorValues 
)

Collects all the values needed to build the table.

Parameters
dim0AxisCoordinatesVector containing all row axis values
dim1AxisCoordinatesVector containing all column axis values
valuesArray containing all table values contiguously
columnMajorValuesSet the row/column major convention

◆ convertTable2D()

TableData2D::TableDataHolder geos::TableData2D::convertTable2D ( arrayView1d< real64 const >  coordX,
arrayView1d< real64 const >  coordY,
string_view  rowAxisDescription,
string_view  columnAxisDescription,
arrayView1d< real64 const > const  values,
bool  columnMajorValues,
string_view  valueDescription 
)

Convert from 2D axis/values a structure the information needed to build a TableFormatter.

Parameters
coordXArray containing row axis values
coordYArray containing column axis values
rowAxisDescriptionThe description for a row unit value
columnAxisDescriptionThe description for a column unit value
valuesVector containing all table values
columnMajorValuesSet the row/column major convention
valueDescriptionThe description of the value (typically, the value unit description)
Returns
A struct containing the tableData converted and all header values ;

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