19 fSymmetric=EIsNonSymmetric;
27 fSymmetric = EIsSymmetric;
44 if(name) out << name << endl;
52 for(j=
fEqStart[i]; j<aux_limit ; j++) {
53 out <<
"col = " <<
fIndex[j] <<
" ";
56 for(j=
fEqStart[i]; j<aux_limit ; j++) {
96 for(n=
fNumEq-1; n>=0; n--) {
101 for(i = index + 1; i < last_term; i++) acum -= U(
fIndex[i],0) *
fEqValues[i];
104 U(
fIndex[index],0) += acum;
112 for(n=
fNumEq-2; n>=0; n-=2) {
117 for(i = index + 1; i < last_term; i++) acum -= U(
fIndex[i],0) *
fEqValues[i];
120 U(
fIndex[index],0) += acum;
138 cout <<
"Diagonal Value = 0 >> Aborting on Index = " << index <<
" Equation = " << j << endl;
151 TVar udiag = F(
fIndex[index],0);
155 for(i = index + 1; i < last_term; i++) F(
fIndex[i],0) -= udiag *
fEqValues[i];
157 if(dec ==
ELDLt) F(
fIndex[index],0) /= fEqValues[index];
160 for(j=1; j<
fNumEq; j+=2) {
164 cout <<
"Diagonal Value = 0 >> Aborting on Index = " << index <<
" Equation = " << j << endl;
180 TVar udiag = F(
fIndex[index],0);
184 for(i = index + 1; i < last_term; i++) F(
fIndex[i],0) -= udiag *
fEqValues[i];
192 fwrite(&
fNumEq,
sizeof(
int),1,outputfile);
195 fwrite(&
fLastTerm,
sizeof(
int),1,outputfile);
201 std::cout << __PRETTY_FUNCTION__ << __LINE__ << std::endl;
203 fwrite(&aux,
sizeof(
int),1,outputfile);
204 fwrite(&
fEqStart[0],
sizeof(
int), aux ,outputfile);
210 std::cout << __PRETTY_FUNCTION__ << __LINE__ << std::endl;
212 fwrite(&aux,
sizeof(
int),1,outputfile);
213 fwrite(&
fEqNumber[0],
sizeof(
int), aux ,outputfile);
217 fwrite(&aux,
sizeof(
int),1,outputfile);
218 fwrite(&
fIndex[0],
sizeof(
int), aux ,outputfile);
222 fwrite(&aux,
sizeof(
int),1,outputfile);
223 fwrite(&
fEqValues[0],
sizeof(REAL), aux ,outputfile);
231 sizereturn = fread(&
fNumEq,
sizeof(
int),1,inputfile);
236 sizereturn = fread(&
fLastTerm,
sizeof(
int),1,inputfile);
242 sizereturn = fread(&aux,
sizeof(
int),1,inputfile);
247 sizereturn = fread(&
fEqStart[0],
sizeof(
int), aux ,inputfile);
252 sizereturn = fread(&aux,
sizeof(
int),1,inputfile);
257 sizereturn = fread(&
fEqNumber[0],
sizeof(
int), aux ,inputfile);
262 sizereturn = fread(&aux,
sizeof(
int),1,inputfile);
267 sizereturn = fread(&
fIndex[0],
sizeof(
int), aux ,inputfile);
272 sizereturn = fread(&aux,
sizeof(
int),1,inputfile);
277 sizereturn = fread(&
fEqValues[0],
sizeof(REAL), aux ,inputfile);
291 cout <<
"Entre o nome do Arquivo\n";
293 ofstream output(filename,ios::app);
300 double rnd = (random*10.)/RAND_MAX;
302 MatrixA(j,i)=MatrixA(i,j);
303 if(i==j) MatrixA(i,j)=6000.;
307 MatrixA.
Print(
"Teste 1",std::cout);
309 MatrixA.
Print(
"Decomposta",std::cout);
327 Test.
Print(
"Result", cout);
333 rhs.Print(
"FMatrix Decomposition");
334 rhs2.
Print(
"FrontalMatrix Decomposition");
TPZStack< int, 100 > fEqNumber
void EqnForward(TPZFMatrix< TVar > &F, DecomposeType dec)
Forward substitution on equations stored in EqnArray.
TPZStack< int, 100 > fEqStart
Equation start point index.
int fLastTerm
Indicates the last used position in fEqValues.
It is an equation array, generally in its decomposed form. Frontal.
static void main()
Static main function for testing.
void Write(char *outputfile)
Writes on disk.
virtual int Subst_Forward(TPZFMatrix< TVar > *b) const
Computes B = Y, where A*Y = B, A is lower triangular.
void BeginEquation(int eq)
It starts an equation storage.
virtual void Resize(const int64_t newsize, const T &object)
Resizes the vector object.
Contains the TPZEqnArray class which implements an equation array.
void Print(const char *name, std::ostream &out)
It prints all terms stored in TPZEqnArray.
void Read(char *inputfile)
Reads from disk.
void Push(const T object)
Pushes a copy of the object on the stack.
int fNumEq
Number of equations.
#define DebugStop()
Returns a message to user put a breakpoint in.
void EqnBackward(TPZFMatrix< TVar > &U, DecomposeType dec)
Backward substitution on equations stored in EqnArray.
void Reset()
Resets data structure.
void SetNonSymmetric()
Sets EqnArray to a non symmetric form.
void SetSymmetric()
Sets fSymmetric to the symmetric value.
void AddTerm(int col, TVar val)
Add a term to the current equation.
Full matrix class. Matrix.
MSymmetric fSymmetric
Indicates the symetry or not of the equationarray.
void EndEquation()
Ends the current equation.
TPZStack< TVar, 1000 > fEqValues
Equations coefficients values.
TPZEqnArray()
Simple constructor.
~TPZEqnArray()
Simple desctructor.
virtual void Print(std::ostream &out) const
virtual int Decompose_Cholesky() override
Cholesky Decomposition Optmized. for walks in the direction of the vector that composes the matrix...
int64_t NElements() const
Returns the number of elements of the vector.
Contains the declaration of TPZFlopCounter class and TPZCounter struct.
TPZStack< int, 1000 > fIndex
Line/Column number associated to each fEqValues values.
int IsSymmetric()
Gets the symetry situation of EqnArray.
DecomposeType
Defines decomposition type for any matrix classes.