64 const Table &table2,
int offset2);
66 const Table &table2,
int offset2,
67 const Table &table3,
int offset3);
73 explicit Table (
int dim,
int connections_per_row = 3);
81 Table (
int nrows,
int *partitioning);
84 void MakeI (
int nrows);
93 void SetSize(
int dim,
int connections_per_row);
97 void SetDims(
int rows,
int nnz);
123 const int *
GetI()
const {
return I; }
124 const int *
GetJ()
const {
return J; }
131 const int *
ReadI(
bool on_dev =
true)
const
144 const int *
ReadJ(
bool on_dev =
true)
const
162 void SetIJ(
int *newI,
int *newJ,
int newsize = -1);
169 int Push(
int i,
int j );
194 void Save(std::ostream &
out)
const;
195 void Load(std::istream &in);
215void Transpose (
const Table &A, Table &At,
int ncols_A_ = -1);
224void Transpose(
const Array<int> &A, Table &At,
int ncols_A_ = -1);
227void Mult (
const Table &A,
const Table &B, Table &C);
228Table *
Mult (
const Table &A,
const Table &B);
238 STable (
int dim,
int connections_per_row = 3);
250 int Push(
int i,
int j );
267 int NumRows, NumEntries;
269#ifdef MFEM_USE_MEMALLOC
270 MemAlloc <Node, 1024> NodesMem;
273 int Push_(
int r,
int c);
274 int Index(
int r,
int c)
const;
281 {
return ((
a <=
b) ? Push_(
a,
b) : Push_(
b,
a)); }
283 {
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)