Graph

 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
29
30
31
public void solution()
{
_Yarray = new double[_Barray.Length];
_Xarray = new double[_Barray.Length];
for (int i = 0; i < _Barray.Length; i++)
{
_Yarray[i] = 0;
_Xarray[i] = 0;
}
for (int i = 0; i < _Lmatrix.GetLength(0); ++i)
{
double sum = 0;
for (int k = 0; k < i; ++k)
{
sum += _Lmatrix[i, k] * _Yarray[k];
}
_Yarray[i] = (_Barray[i] - sum) / _Lmatrix[i, i];
}
for (int i = _Umatrix.GetLength(0) - 1; i >= 0; i--)
{
double sum = 0;
for (int k = _Umatrix.GetLength(0) - 1; k >= i; k--)
{
sum += _Umatrix[i, k] * _Xarray[k];
}
_Xarray[i] = (_Yarray[i] - sum) / _Umatrix[i, i];
}
}