65 explicit Table (
int dim,
int connections_per_row = 3);
73 Table (
int nrows,
int *partitioning);
76 void MakeI (
int nrows);
85 void SetSize(
int dim,
int connections_per_row);
89 void SetDims(
int rows,
int nnz);
115 const int *
GetI()
const {
return I; }
116 const int *
GetJ()
const {
return J; }
123 const int *
ReadI(
bool on_dev =
true)
const
136 const int *
ReadJ(
bool on_dev =
true)
const
154 void SetIJ(
int *newI,
int *newJ,
int newsize = -1);
161 int Push(
int i,
int j );
186 void Save(std::ostream &
out)
const;
187 void Load(std::istream &in);
207void Transpose (
const Table &A, Table &At,
int ncols_A_ = -1);
216void Transpose(
const Array<int> &A, Table &At,
int ncols_A_ = -1);
219void Mult (
const Table &A,
const Table &B, Table &C);
220Table *
Mult (
const Table &A,
const Table &B);
230 STable (
int dim,
int connections_per_row = 3);
242 int Push(
int i,
int j );
259 int NumRows, NumEntries;
261#ifdef MFEM_USE_MEMALLOC
262 MemAlloc <Node, 1024> NodesMem;
265 int Push_(
int r,
int c);
266 int Index(
int r,
int c)
const;
273 {
return ((
a <=
b) ? Push_(
a,
b) : Push_(
b,
a)); }
275 {
return ((
a <=
b) ? Index(
a,
b) : Index(
b,
a)); }
RowIterator(const DSTable &t, int r)
void SetIndex(int new_idx)
int NumberOfEntries() const
int operator()(int a, int b) const
Class used by MFEM to store pointers to host and/or device memory.
int Capacity() const
Return the size of the allocated memory.
void Reset()
Reset the memory to be empty, ensuring that Delete() will be a no-op.
STable(int dim, int connections_per_row=3)
Creates table with fixed number of connections.
~STable()
Destroys STable.
int operator()(int i, int j) const
Table & operator=(const Table &rhs)
Assignment operator: deep copy.
void Save(std::ostream &out) const
void LoseData()
Call this if data has been stolen.
int size
size is the number of TYPE I elements.
const int * GetRow(int i) const
int * ReadWriteI(bool on_dev=true)
const int * HostReadI() const
const int * ReadJ(bool on_dev=true) const
Table(int nrows, Array< Connection > &list)
void AddConnections(int r, const int *c, int nc)
void PrintMatlab(std::ostream &out) const
void Load(std::istream &in)
int operator()(int i, int j) const
void SetSize(int dim, int connections_per_row)
Set the size and the number of connections for the table.
const Memory< int > & GetJMemory() const
void GetRow(int i, Array< int > &row) const
Return row i in array row (the Table must be finalized)
const Memory< int > & GetIMemory() const
void AddConnection(int r, int c)
void MakeI(int nrows)
Next 7 methods are used together with the default constructor.
void Print(std::ostream &out=mfem::out, int width=4) const
Prints the table to stream out.
void SetIJ(int *newI, int *newJ, int newsize=-1)
Replace the I and J arrays with the given newI and newJ arrays.
const int * HostReadJ() const
Table()
Creates an empty table.
int Size() const
Returns the number of TYPE I elements.
int Width() const
Returns the number of TYPE II elements (after Finalize() is called).
const int * ReadI(bool on_dev=true) const
std::size_t MemoryUsage() const
int Size_of_connections() const
void AddColumnsInRow(int r, int ncol)
void MakeFromList(int nrows, const Array< Connection > &list)
void Copy(Table ©) const
int * WriteI(bool on_dev=true)
Memory< int > & GetJMemory()
void AddAColumnInRow(int r)
void SortRows()
Sort the column (TYPE II) indices in each row.
int * WriteJ(bool on_dev=true)
int * ReadWriteJ(bool on_dev=true)
void SetDims(int rows, int nnz)
Memory< int > & GetIMemory()
const T * Read(const Memory< T > &mem, int size, bool on_dev=true)
Get a pointer for read access to mem with the mfem::Device's DeviceMemoryClass, if on_dev = true,...
void Mult(const Table &A, const Table &B, Table &C)
C = A * B (as boolean matrices)
T * Write(Memory< T > &mem, int size, bool on_dev=true)
Get a pointer for write access to mem with the mfem::Device's DeviceMemoryClass, if on_dev = true,...
OutStream out(std::cout)
Global stream used by the library for standard output. Initially it uses the same std::streambuf as s...
void Transpose(const Table &A, Table &At, int ncols_A_)
Transpose a Table.
T * ReadWrite(Memory< T > &mem, int size, bool on_dev=true)
Get a pointer for read+write access to mem with the mfem::Device's DeviceMemoryClass,...
void Swap< Table >(Table &a, Table &b)
Specialization of the template function Swap<> for class Table.
Helper struct for defining a connectivity table, see Table::MakeFromList.
bool operator==(const Connection &rhs) const
bool operator<(const Connection &rhs) const
Connection(int from, int to)