DOLFINx
0.3.0
DOLFINx C++ interface
|
This class provides storage and pretty-printing for tables. Example usage: More...
#include <Table.h>
Public Types | |
enum class | Reduction { average , max , min } |
Types of MPI reduction available for Table, to get the max, min or average values over an MPI_Comm. | |
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 (std::string row, std::string col, std::variant< std::string, int, double > value) |
Set table entry. More... | |
std::variant< std::string, int, double > | get (std::string row, std::string col) const |
Get value of table entry. More... | |
Table | reduce (MPI_Comm comm, Reduction reduction) const |
Do MPI reduction on Table. More... | |
std::string | str () const |
Return string representation of the table. | |
Public Attributes | |
std::string | name |
Table name. | |
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("PETSc", "Assemble", 0.011); table.set("PETSc", "Solve", 0.019);
std::variant< std::string, int, double > Table::get | ( | std::string | row, |
std::string | col | ||
) | const |
Get value of table entry.
[in] | row | Row name |
[in] | col | Column name |
Table Table::reduce | ( | MPI_Comm | comm, |
Table::Reduction | reduction | ||
) | const |
void Table::set | ( | std::string | row, |
std::string | col, | ||
std::variant< std::string, int, double > | value | ||
) |
Set table entry.
[in] | row | Row name |
[in] | col | Column name |
[in] | value | The value to set |