ParMooN
 All Classes Functions Variables Friends Pages
Structure.h
1 // =======================================================================
2 // @(#)Structure.h 1.3 09/14/99
3 //
4 // Class: TStructure
5 //
6 // Purpose: build and store a matrix structure
7 //
8 // Author: Gunar Matthies
9 //
10 // History: 24.11.97 start implementation
11 //
12 // start of reimplementation 26.08.1998 (Gunar Matthies)
13 //
14 // =======================================================================
15 
16 #ifndef __STRUCTURE__
17 #define __STRUCTURE__
18 
20 {
21  protected:
23  int N_Rows;
24 
26  int N_Columns;
27 
29  int N_Entries;
30 
33 
35  int *KCol;
36 
39 
41  int *RowPtr;
42 
45 
46  public:
48  TStructure();
49 
51  TStructure(int n, int N_entries, int *col_ptr, int *row_ptr);
52 
54  TStructure(int nRows, int nCols, int N_entries, int *col_ptr, int *row_ptr);
55 
57  TStructure(int nRows, int nCols);
58 
60  ~TStructure();
61 
63  int GetN_Rows() const
64  { return N_Rows; }
65 
67  int GetN_Columns() const
68  { return N_Columns; }
69 
71  int GetN_Entries() const
72  { return N_Entries; }
73 
75  int GetHangingN_Entries() const
76  { return HangingN_Entries; }
77 
79  int *GetKCol() const
80  { return KCol; }
81 
83  int *GetHangingKCol() const
84  { return HangingKCol; }
85 
87  int *GetRowPtr() const
88  { return RowPtr; }
89 
91  int *GetHangingRowPtr() const
92  { return HangingRowPtr; }
93 
95  void setN_Rows(int n) { N_Rows = n; }
96  void setN_Columns(int n) { N_Columns = n; }
97  void setN_Entries(int n) { N_Entries = n; }
98  void setKCol(int * p) { KCol = p; }
99  void setRowPtr(int * p) { RowPtr = p; }
100 
102  void SortRow(int *BeginPtr, int *AfterEndPtr);
103 
105  void Sort();
106 
107 
118  int index_of_entry(const int i, const int j) const;
119 
127 
137  friend TStructure* get_product_structure(TStructure const * const strucA,
138  TStructure const * const strucB);
139 
145  friend bool operator==(const TStructure &lhs, const TStructure &rhs);
146  friend bool operator!=(const TStructure &lhs, const TStructure &rhs);
147 };
148 
149 #endif
~TStructure()
Definition: Structure.C:90
int * GetHangingRowPtr() const
Definition: Structure.h:91
int HangingN_Entries
Definition: Structure.h:32
int GetN_Rows() const
Definition: Structure.h:63
int N_Entries
Definition: Structure.h:29
TStructure * GetTransposed()
Definition: Structure.C:125
friend TStructure * get_product_structure(TStructure const *const strucA, TStructure const *const strucB)
return a structure for the matrix-matrix-product A*B
Definition: Structure.C:173
friend bool operator==(const TStructure &lhs, const TStructure &rhs)
Comparision Operator.
Definition: Structure.C:234
int GetHangingN_Entries() const
Definition: Structure.h:75
int N_Columns
Definition: Structure.h:26
void setN_Rows(int n)
set member variables. Careful, this can produce inconsistencies!
Definition: Structure.h:95
int index_of_entry(const int i, const int j) const
find the index of a given entry
Definition: Structure.C:98
int * RowPtr
Definition: Structure.h:41
int * GetRowPtr() const
Definition: Structure.h:87
int * GetKCol() const
Definition: Structure.h:79
int * GetHangingKCol() const
Definition: Structure.h:83
int N_Rows
Definition: Structure.h:23
int * KCol
Definition: Structure.h:35
TStructure()
Definition: Structure.C:27
int GetN_Entries() const
Definition: Structure.h:71
Definition: Structure.h:19
void SortRow(int *BeginPtr, int *AfterEndPtr)
Definition: Structure.C:57
int * HangingKCol
Definition: Structure.h:38
void Sort()
Definition: Structure.C:76
int * HangingRowPtr
Definition: Structure.h:44
int GetN_Columns() const
Definition: Structure.h:67