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; }
128 void SetIJ(
int *newI,
int *newJ,
int newsize = -1);
135 int Push(
int i,
int j );
160 void Save(std::ostream &
out)
const;
161 void Load(std::istream &in);
181 void Transpose (
const Table &A, Table &At,
int _ncols_A = -1);
185 void Transpose(
const Array<int> &A, Table &At,
int _ncols_A = -1);
188 void Mult (
const Table &A,
const Table &B, Table &C);
189 Table *
Mult (
const Table &A,
const Table &B);
199 STable (
int dim,
int connections_per_row = 3);
211 int Push(
int i,
int j );
228 int NumRows, NumEntries;
230 #ifdef MFEM_USE_MEMALLOC
234 int Push_(
int r,
int c);
235 int Index(
int r,
int c)
const;
242 {
return ((a <= b) ? Push_(a, b) : Push_(b, a)); }
244 {
return ((a <= b) ? Index(a, b) : Index(b, a)); }
Table(int nrows, Array< Connection > &list)
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 AddColumnsInRow(int r, int ncol)
int operator()(int i, int j) const
void MakeI(int nrows)
Next 7 methods are used together with the default constructor.
void Swap< Table >(Table &a, Table &b)
Specialization of the template function Swap<> for class Table.
void SortRows()
Sort the column (TYPE II) indices in each row.
bool operator<(const Connection &rhs) const
void Mult(const Table &A, const Table &B, Table &C)
C = A * B (as boolean matrices)
void SetDims(int rows, int nnz)
void GetRow(int i, Array< int > &row) const
Return row i in array row (the Table must be finalized)
void Save(std::ostream &out) const
void LoseData()
Call this if data has been stolen.
const Memory< int > & GetIMemory() const
int Size_of_connections() const
RowIterator(const DSTable &t, int r)
void AddConnections(int r, const int *c, int nc)
int Width() const
Returns the number of TYPE II elements (after Finalize() is called).
int operator()(int i, int j) const
void Print(std::ostream &out=mfem::out, int width=4) const
Prints the table to stream out.
void MakeFromList(int nrows, const Array< Connection > &list)
Table & operator=(const Table &rhs)
Assignment operator: deep copy.
Memory< int > & GetJMemory()
void AddConnection(int r, int c)
void Transpose(const Table &A, Table &At, int _ncols_A)
Transpose a Table.
int Size() const
Returns the number of TYPE I elements.
Connection(int from, int to)
void Reset()
Reset the memory to be empty, ensuring that Delete() will be a no-op.
void PrintMatlab(std::ostream &out) const
STable(int dim, int connections_per_row=3)
Creates table with fixed number of connections.
void SetIndex(int new_idx)
Memory< int > & GetIMemory()
int size
size is the number of TYPE I elements.
void AddAColumnInRow(int r)
Helper struct for defining a connectivity table, see Table::MakeFromList.
void Load(std::istream &in)
void SetIJ(int *newI, int *newJ, int newsize=-1)
Replace the I and J arrays with the given newI and newJ arrays.
bool operator==(const Connection &rhs) const
const int * GetRow(int i) const
~STable()
Destroys STable.
int operator()(int a, int b) const
int NumberOfEntries() const
OutStream out(std::cout)
Global stream used by the library for standard output. Initially it uses the same std::streambuf as s...
void Copy(Table ©) const
Table()
Creates an empty table.