59 explicit Table (
int dim,
int connections_per_row = 3);
67 Table (
int nrows,
int *partitioning);
70 void MakeI (
int nrows);
79 void SetSize(
int dim,
int connections_per_row);
83 void SetDims(
int rows,
int nnz);
109 const int *
GetI()
const {
return I; }
110 const int *
GetJ()
const {
return J; }
115 void SetIJ(
int *newI,
int *newJ,
int newsize = -1);
122 int Push(
int i,
int j );
144 void Print(std::ostream & out = std::cout,
int width = 4)
const;
147 void Save(std::ostream & out)
const;
166 void Transpose (
const Table &A, Table &At,
int _ncols_A = -1);
170 void Transpose(
const Array<int> &A, Table &At,
int _ncols_A = -1);
173 void Mult (
const Table &A,
const Table &B, Table &C);
174 Table *
Mult (
const Table &A,
const Table &B);
185 STable (
int dim,
int connections_per_row = 3);
197 int Push(
int i,
int j );
214 int NumRows, NumEntries;
216 #ifdef MFEM_USE_MEMALLOC
220 int Push_(
int r,
int c);
221 int Index(
int r,
int c)
const;
228 {
return ((a <= b) ? Push_(a, b) : Push_(b, a)); }
230 {
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.
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.
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).
void Print(std::ostream &out=std::cout, int width=4) const
Prints the table to stream out.
int operator()(int i, int j) const
void MakeFromList(int nrows, const Array< Connection > &list)
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 PrintMatlab(std::ostream &out) const
STable(int dim, int connections_per_row=3)
Creates table with fixed number of connections.
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 SetIJ(int *newI, int *newJ, int newsize=-1)
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
void Copy(Table ©) const
Table()
Creates an empty table.