atlas
Public Member Functions | Friends | List of all members
atlas::array::Table Class Reference

Table. More...

#include <Table.h>

Inheritance diagram for atlas::array::Table:
Inheritance graph
[legend]
Collaboration diagram for atlas::array::Table:
Collaboration graph
[legend]

Public Member Functions

 Table (const std::string &name="")
 Construct connectivity table that needs resizing a-posteriori Data is owned.
 
const std::string & name () const
 Name associated to this Connetivity.
 
void rename (const std::string &name)
 Rename this Connectivity.
 
size_t rows () const
 Number of rows in the connectivity table.
 
size_t cols (size_t row_idx) const
 Number of columns for specified row in the connectivity table.
 
size_t maxcols () const
 Maximum value for number of columns over all rows.
 
size_t mincols () const
 Minimum value for number of columns over all rows.
 
idx_t missing_value () const
 Value that is given to unassigned entries.
 
size_t size () const
 Number of values stored in the table.
 
virtual size_t footprint () const
 Return memory footprint of table.
 
virtual void updateDevice () const
 Clone data to device.
 
virtual void updateHost () const
 Clone data from device.
 
virtual void syncHostDevice () const
 Synchronise data between host and device.
 
virtual bool valid () const
 Check if data is valid.
 
virtual bool hostNeedsUpdate () const
 Check if data is present on host.
 
virtual bool deviceNeedsUpdate () const
 Check if data is present on device.
 
void dump (std::ostream &) const
 Print all values unformatted to output stream.
 
bool owns ()
 Check if data is owned or wrapped.
 
virtual void add (size_t rows, size_t cols, const idx_t values[], bool fortran_array=false)
 – Modifiers More...
 
virtual void add (size_t rows, size_t cols)
 Resize connectivity, and add given rows with missing values. More...
 
virtual void add (size_t rows, const size_t cols[])
 Resize connectivity, and add given rows with missing values. More...
 
virtual void insert (size_t position, size_t rows, size_t cols, const idx_t values[], bool fortran_array=false)
 Resize connectivity, and insert given rows. More...
 
virtual void insert (size_t position, size_t rows, size_t cols)
 Resize connectivity, and insert given rows with missing values. More...
 
virtual void insert (size_t position, size_t rows, const size_t cols[])
 Resize connectivity, and insert given rows with missing values. More...
 
virtual void clear ()
 Resize connectivity, and insert given rows with missing values. More...
 

Friends

template<bool ReadOnly>
class TableView
 

Detailed Description

Table.

Author
Willem Deconinck

Container for tables. This is e.g. for a node-to-X connectivity. connectivity = [ 1 2 3 4 5 6 # node 1 7 8 # node 2 9 10 11 12 # node 3 13 14 15 # node 4 16 17 18 19 20 21 # node 5 ] There are 2 modes of construction:

In case ATLAS_HAVE_FORTRAN is defined (which is usually the case), the raw data will be stored with base 1 for Fortran interoperability. The operator(row,col) in C++ will then do the conversion to base 0.

In the first mode of construction, the connectivity table cannot be resized. In the second mode of construction, resizing is possible

Member Function Documentation

◆ add() [1/3]

void atlas::array::Table::add ( size_t  rows,
size_t  cols,
const idx_t  values[],
bool  fortran_array = false 
)
virtual

– Modifiers

Resize connectivity, and add given rows

Note
Can only be used when data is owned.

◆ add() [2/3]

void atlas::array::Table::add ( size_t  rows,
size_t  cols 
)
virtual

Resize connectivity, and add given rows with missing values.

Note
Can only be used when data is owned.

◆ add() [3/3]

void atlas::array::Table::add ( size_t  rows,
const size_t  cols[] 
)
virtual

Resize connectivity, and add given rows with missing values.

Note
Can only be used when data is owned.

◆ clear()

void atlas::array::Table::clear ( )
virtual

Resize connectivity, and insert given rows with missing values.

Note
Invalidates non-owned Table

◆ insert() [1/3]

void atlas::array::Table::insert ( size_t  position,
size_t  rows,
size_t  cols,
const idx_t  values[],
bool  fortran_array = false 
)
virtual

Resize connectivity, and insert given rows.

Note
Can only be used when data is owned.

◆ insert() [2/3]

void atlas::array::Table::insert ( size_t  position,
size_t  rows,
size_t  cols 
)
virtual

Resize connectivity, and insert given rows with missing values.

Note
Can only be used when data is owned.

◆ insert() [3/3]

void atlas::array::Table::insert ( size_t  position,
size_t  rows,
const size_t  cols[] 
)
virtual

Resize connectivity, and insert given rows with missing values.

Note
Can only be used when data is owned.

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