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

/* correção em comentários em alocSisLin() */

parent 7cf4218b
No related branches found
No related tags found
No related merge requests found
......@@ -5,8 +5,7 @@
#include "utils.h"
#include "sislin.h"
// Alocaçao de memória. Matriz como vetor de ponteiros para vetores
// alocados independentemente
// Alocaçao de matriz em memória.
SistLinear_t* alocaSisLin (unsigned int n, tipoAloc_t tipo)
{
SistLinear_t *SL = (SistLinear_t *) malloc(sizeof(SistLinear_t));
......@@ -22,7 +21,8 @@ SistLinear_t* alocaSisLin (unsigned int n, tipoAloc_t tipo)
liberaSisLin(SL);
return NULL;
}
// Matriz como vetor de N ponteiros para um único vetor com N*N elementos
if (tipo == pontVet) {
SL->A[0] = (real_t *) malloc(n * n * sizeof(real_t));
if (!(SL->A[0])) {
......@@ -34,7 +34,9 @@ SistLinear_t* alocaSisLin (unsigned int n, tipoAloc_t tipo)
SL->A[i] = SL->A[i-1]+n;
}
}
else if (tipo == pontPont) {
else if (tipo == pontPont) { // Matriz como vetor de N ponteiros
// para N vetores de N elementos cada
for (int i=0; i < n; ++i)
SL->A[i] = (real_t *) malloc(n * sizeof(real_t));
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment