Skip to content

Instantly share code, notes, and snippets.

View bergolho's full-sized avatar

Lucas Arantes Berg bergolho

View GitHub Profile
# Example program
K = 0.0012;
cont = 0
r_new = 1.0
r_old = 0.79518
#r_old = 1.0
while (r_new <= 1500.0):
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <string>
#include <set>
#include <cstring>
using namespace std;
// Resolve um sistema linear pela substituição LU.
double* LU (double **A, double *b)
{
int i, j, k, p;
double *pivot = new double[n];
double Amax, t, m, r, Mult;
// 1 PASSO: Transformar a matriz A do problema em duas matrizes triangulares L e U.
for (i = 0; i < n; i++)
pivot[i] = i;
for (j = 0; j < n-1; j++)