Skip to content
Snippets Groups Projects
Commit 19acd35a authored by Armando Luiz Nicolini Delgado's avatar Armando Luiz Nicolini Delgado :nerd:
Browse files

/* Alterada a forma de gerar matrizes diagonalmente dominantes ns função 'iniSisLin()' */

parent f00c8ebf
No related branches found
No related tags found
No related merge requests found
...@@ -128,7 +128,10 @@ void iniSisLin (SistLinear_t *SL, tipoSistLinear_t tipo, real_t coef_max) ...@@ -128,7 +128,10 @@ void iniSisLin (SistLinear_t *SL, tipoSistLinear_t tipo, real_t coef_max)
else if (tipo == diagDominante) { else if (tipo == diagDominante) {
// aumenta o expoente dos termos da diagonal principal // aumenta o expoente dos termos da diagonal principal
for (unsigned int i=0; i<n; ++i) { for (unsigned int i=0; i<n; ++i) {
SL->A[i][i] *= (real_t)n; real_t soma = 0.0;
for (unsigned int j=0; j < i; ++j) soma += SL->A[i][j];
for (unsigned int j=i+1; j < n; ++j) soma += SL->A[i][j];
SL->A[i][i] += soma;
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment