-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* agregeminombre * Agrege el nombre de Gabo * Gabo * dos2unix Co-authored-by: otreblan <[email protected]>
- Loading branch information
Showing
5 changed files
with
55 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,26 @@ | ||
function ans = Crout(A) | ||
|
||
// Obtener dimensiones de la matriz | ||
[m, n] = size(A); | ||
|
||
// Comprobar que sea cuadrada | ||
if( m ~= n ) then | ||
error("La matriz debe ser cuadrada") | ||
end | ||
|
||
// L se inicializa como una copia de A | ||
L = A | ||
|
||
// U se inicializa como una matriz identidad de mxn | ||
U = eye(m,n) | ||
|
||
for i = 1:n-1 | ||
for j = i+1:n | ||
U(i,j) = L(i,j)/L(i,i) // Se llena la matriz U con los multiplicadores | ||
L(:,j) = L(:,j) - U(i,j)*L(:,i) // Operaciones elementales por columnas | ||
end | ||
end | ||
|
||
ans = struct("L", L, "U", U) | ||
|
||
endfunction | ||
function ans = Crout(A) | ||
|
||
// Obtener dimensiones de la matriz | ||
[m, n] = size(A); | ||
|
||
// Comprobar que sea cuadrada | ||
if( m ~= n ) then | ||
error("La matriz debe ser cuadrada") | ||
end | ||
|
||
// L se inicializa como una copia de A | ||
L = A | ||
|
||
// U se inicializa como una matriz identidad de mxn | ||
U = eye(m,n) | ||
|
||
for i = 1:n-1 | ||
for j = i+1:n | ||
U(i,j) = L(i,j)/L(i,i) // Se llena la matriz U con los multiplicadores | ||
L(:,j) = L(:,j) - U(i,j)*L(:,i) // Operaciones elementales por columnas | ||
end | ||
end | ||
|
||
ans = struct("L", L, "U", U) | ||
|
||
endfunction |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,27 @@ | ||
function ans = Doolittle(A) | ||
|
||
// Obtener dimensiones de la matriz | ||
[m, n] = size(A); | ||
|
||
// Comprobar que sea cuadrada | ||
if( m ~= n ) then | ||
error("La matriz debe ser cuadrada") | ||
end | ||
|
||
// U se inicializa como una copia de A | ||
U = A | ||
|
||
// L se inicializa como una matriz identidad de mxn | ||
L = eye(m,n) | ||
|
||
for i = 1:n-1 | ||
for j = i+1:n | ||
L(j,i) = U(j,i)/U(i,i) // Se llena la matriz L con los multiplicadores | ||
U(j,:) = U(j,:) - L(j,i)*U(i,:) // Operaciones elementales por filas | ||
end | ||
end | ||
|
||
ans = struct("L", L, "U", U) | ||
|
||
endfunction | ||
function ans = Doolittle(A) | ||
|
||
// Obtener dimensiones de la matriz | ||
[m, n] = size(A); | ||
|
||
// Comprobar que sea cuadrada | ||
if( m ~= n ) then | ||
error("La matriz debe ser cuadrada") | ||
end | ||
|
||
// U se inicializa como una copia de A | ||
U = A | ||
|
||
// L se inicializa como una matriz identidad de mxn | ||
L = eye(m,n) | ||
|
||
for i = 1:n-1 | ||
for j = i+1:n | ||
L(j,i) = U(j,i)/U(i,i) // Se llena la matriz L con los multiplicadores | ||
U(j,:) = U(j,:) - L(j,i)*U(i,:) // Operaciones elementales por filas | ||
end | ||
end | ||
|
||
ans = struct("L", L, "U", U) | ||
|
||
|
||
endfunction |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,5 @@ | |
- Frings Barrueta | ||
- Alberto Oporto | ||
- Luis Carbajal | ||
- . | ||
- Renato Rodríguez | ||
- Gabriel Jimenez |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,4 +39,3 @@ if(rA == rAb) | |
else | ||
printf('Sin solución\n') | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,4 +29,3 @@ function sol = gauss(A, b) | |
sol = x | ||
|
||
endfunction | ||
|