naive gass elimination

my lecturer ask to do C++ program to solve naive gauss elimination,
and he give me some hintof the header, declaration part and subroutine.
however, i still dont understand what? to put where?,
i also dont understand the use of void function there......

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include <iostream>
#include <fstream.h>
#include <math.h>
using namespace std
int er,i,j,ij,k,n;
double tol,factor,sum;
double *a, *b, *x;
int *li;
void input(); void......
int main()
{
input();
…...
eliminate();
if (er!=-1)
{ substitute();
ofstream fileout; fileout.open (“Tutorial2.out”); …...
}
return 0;
}
void input()
{
ifstream filein; filein.open(“Tutorial2.inp”);
….
a = new double [n*n]; b = new double [n]; x = …...; li = new int [n]
for (i=1;i<=n;i++) {li[i]=(i-1)*n;}
…...
}




need someone to help me, and explain it..
Topic archived. No new replies allowed.