9 #ifndef PZMatrixMarket_hpp 10 #define PZMatrixMarket_hpp 43 int64_t nrow,ncol,nonzero=0,nsup=0,nlower=0;
45 std::ifstream
input(filename.c_str());
47 std::getline(
input,buf);
48 input >> nrow >> ncol >> nonzero;
49 fmat.
Redim(nrow,ncol);
50 for (int64_t el=0; el<nonzero; el++) {
56 if(row > col) nlower++;
61 if(nsup == 0 || nlower == 0)
63 std::ifstream
input(filename);
65 std::getline(input,buf);
66 input >> nrow >> ncol >> nonzero;
67 fmat.
Redim(nrow,ncol);
68 for (int64_t el=0; el<nonzero; el++) {
71 input >> row >> col >>
val;
85 int64_t nrow,ncol,nonzero=0,nsup=0,nlower=0, band=0;
87 std::ifstream
input(filename);
89 std::getline(input,buf);
90 input >> nrow >> ncol >> nonzero;
91 fmat.
Redim(nrow,ncol);
92 for (int64_t el=0; el<nonzero; el++) {
95 input >> row >> col >>
val;
96 if(row-col > band) band = row-col;
97 if(col-row > band) band = col-row;
100 if(row > col) nlower++;
101 if(row< col ) nsup++;
104 fmat.
Redim(nrow,ncol);
107 std::ifstream
input(filename);
109 std::getline(input,buf);
110 input >> nrow >> ncol >> nonzero;
111 for (int64_t el=0; el<nonzero; el++) {
114 input >> row >> col >>
val;
121 if (nsup == 0 || nlower == 0) {
131 int64_t nrow,ncol,nonzero=0,nsup=0,nlower=0, band=0;
133 std::ifstream
input(filename);
135 std::getline(input,buf);
136 input >> nrow >> ncol >> nonzero;
137 for (int64_t el=0; el<nonzero; el++) {
140 input >> row >> col >>
val;
141 if(row-col > band) band = row-col;
142 if(col-row > band) band = col-row;
145 if(row > col) nlower++;
146 if(row< col ) nsup++;
149 fmat.
Redim(nrow,ncol);
152 std::ifstream
input(filename);
154 std::getline(input,buf);
155 input >> nrow >> ncol >> nonzero;
156 for (int64_t el=0; el<nonzero; el++) {
159 input >> row >> col >>
val;
170 int64_t nrow,ncol,nonzero=0,nsup=0,nlower=0;
173 std::ifstream
input(filename.c_str());
175 std::getline(
input,buf);
176 input >> nrow >> ncol >> nonzero;
181 for (int64_t el=0; el<nrow; el++) {
184 fmat.
Redim(nrow,ncol);
185 for (int64_t el=0; el<nonzero; el++) {
191 if(row < skyline[col]) skyline[col] = row;
192 if(col < skyline[row]) skyline[row] = col;
193 if(row > col) nlower++;
194 if(row< col ) nsup++;
197 if (nlower && nsup) {
198 std::cout <<
"The matrix is probably not symmetric, expect trouble\n";
200 fmat.
Redim(nrow,ncol);
203 std::ifstream
input(filename.c_str());
205 std::getline(
input,buf);
206 input >> nrow >> ncol >> nonzero;
207 for (int64_t el=0; el<nonzero; el++) {
221 int64_t nrow,ncol,nonzero=0,nsup=0,nlower=0;
224 std::ifstream
input(filename);
226 std::getline(input,buf);
227 input >> nrow >> ncol >> nonzero;
233 fmat.
Redim(nrow,ncol);
234 for (int64_t el=0; el<nonzero; el++) {
237 input >> row >> col >>
val;
241 if(row > col) nlower++;
242 if(row< col ) nsup++;
245 if (nlower && nsup) {
246 std::cout <<
"The matrix is probably not symmetric, expect trouble\n";
253 for (int64_t i=0; i<nrow; i++) {
254 IA[i+1] = IA[i]+numrowel[i];
257 fmat.
Redim(nrow,ncol);
259 std::ifstream
input(filename);
261 std::getline(input,buf);
262 input >> nrow >> ncol >> nonzero;
263 for (int64_t el=0; el<nonzero; el++) {
266 input >> row >> col >>
val;
269 JA[IAcounter[row]] = col;
270 A[IAcounter[row]] =
val;
int Redim(const int64_t newDim)
Redimension the matrix and zeroes its elements.
Implements symmetric band matrices. Matrix.
Contains TPZSBMatrix class which implements symmetric band matrices(hermitian, for the complex case...
int SetBand(const int64_t newBand)
Sets band size.
virtual void resize(const int64_t newsize)
clarg::argString input("-if", "input file", "cube1.txt")
REAL val(STATE &number)
Returns value of the variable.
static void Read(std::string filename, TPZFMatrix< T > &fmat)
Implements a skyline storage format. A Skyline matrix is symmetric so square. Matrix.
virtual void SetData(const TPZVec< int64_t > &IA, const TPZVec< int64_t > &JA, const TPZVec< TVar > &A)
Sets data to the class.
void SetSkyline(const TPZVec< int64_t > &skyline)
modify the skyline of the matrix, throwing away its values skyline indicates the minimum row number w...
Contains TPZMatrixclass which implements full matrix (using column major representation).
#define DebugStop()
Returns a message to user put a breakpoint in.
int Redim(const int64_t newRows, const int64_t newCols) override
Redimension the matrix and make zero its elements.
int PutVal(const int64_t row, const int64_t col, const TVar &element) override
Put values without bounds checking This method is faster than "Put" if DEBUG is defined.
int SetBand(const int64_t newBand)
Contains TPZSkyline class which implements a skyline storage format.
virtual int Redim(const int64_t newRows, const int64_t newCols)
Redimensions the matrix reinitializing it with zero.
int PutVal(const int64_t row, const int64_t col, const TVar &value) override
Put values without bounds checking This method is faster than "Put" if DEBUG is defined.
int Redim(const int64_t newRows, const int64_t newCols) override
Redimension a matrix and ZERO your elements.
int Redim(const int64_t newDim, const int64_t) override
Redimensions the matrix reinitializing it with zero.
Contains TPZFBMatrix class which defines a non symmetric banded matrix.
int PutVal(const int64_t row, const int64_t col, const TVar &element) override
Put values without bounds checking This method is faster than "Put" if DEBUG is defined.
Implements a symmetric sparse matrix. Matrix.
Defines a non symmetric banded matrix. Matrix.
void Fill(const T ©, const int64_t from=0, const int64_t numelem=-1)
Will fill the elements of the vector with a copy object.
int PutVal(const int64_t row, const int64_t col, const TVar &value) override
Put values without bounds checking This method is faster than "Put" if DEBUG is defined.
Contains TPZSYsmpMatrix class which implements a symmetric sparse matrix. Purpose: Defines operation...