Loading...
Searching...
No Matches
Table Class Reference

This class provides storage and pretty-printing for tables. More...

`#include <Table.h>`

## Public Types

enum class | Reduction : std::uint8_t { average , max , min }

## Public Member Functions

| Table (std::string title="", bool right_justify=true)
| Create empty table.
| Table (const Table &table)=default
| Copy constructor.
| Table (Table &&table)=default
| Move constructor.
| ~Table ()=default
| Destructor.
Table & | operator= (const Table &table)=default
| Assignment operator.
Table & | operator= (Table &&table)=default
| Move assignment.
void | set (const std::string &row, const std::string &col, std::variant< std::string, int, double > value)
std::variant< std::string, int, double > | get (const std::string &row, const std::string &col) const
Table | reduce (MPI_Comm comm, Reduction reduction) const
std::string | str () const
| Return string representation of the table.

## Public Attributes

std::string | name
| Table name.

## Detailed Description

This class provides storage and pretty-printing for tables.

Example usage:

Table table("Timings"); table.set("Foo", "Assemble", 0.010); table.set("Foo", "Solve", 0.020); table.set("Bar", "Assemble", 0.011); table.set("Bar", "Solve", 0.019);

## Member Enumeration Documentation

## Reduction

enum class Reduction : std::uint8_t

strong

Types of MPI reduction available for Table, to get the max, min or average values over an MPI_Comm

## Member Function Documentation

## get()

std::variant< std::string, int, double > get | ( | const std::string & | row,
|  | const std::string & | col ) const

Get value of table entry

Parameters

  [in] | row | Row name
  [in] | col | Column name

Returns
  Returns the entry for requested row and columns

## reduce()

Table reduce | ( | MPI_Comm | comm,
|  | Table::Reduction | reduction ) const

Do MPI reduction on Table

Parameters

  [in] | comm | MPI communicator
  [in] | reduction | Type of reduction to perform

Returns
  Reduced Table

## set()

void set | ( | const std::string & | row,
|  | const std::string & | col,
|  | std::variant< std::string, int, double > | value )

Set table entry

Parameters

  [in] | row | Row name
  [in] | col | Column name
  [in] | value | The value to set

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

- /build/fenics-dolfinx-PdyzCE/fenics-dolfinx-0.10.0.post5/cpp/dolfinx/common/Table.h
- /build/fenics-dolfinx-PdyzCE/fenics-dolfinx-0.10.0.post5/cpp/dolfinx/common/Table.cpp