public static Matrix GetCI List double xValue double double KeyValuePa

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
public static Matrix GetCI(List<double> xValue, double a, double b, KeyValuePair<double, double> beta, double sigma, double gamma) {
int size = xValue.Count;
Matrix rMatrix = new Matrix(size, 1),
lMatrix = new Matrix(size, size);
double gammaI = 0.0,
p = -2.0,
q = 2.0;
for (int i = 0; i < size; ++i)
for (int j = 0; j < size; ++j) {
gammaI = GetGammaI(j + 1, beta, a, b);
lMatrix[i, j] = GetSecondDerivative(j + 1, gammaI, a, xValue[i]) +
p * GetFirstDerivative(j + 1, gammaI, a, xValue[i]) +
q * GetPhiI(j + 1, gammaI, a, xValue[i]);
rMatrix[i, 0] = 4*Math.Pow(xValue[i],5) - xValue[i] -
GetSecondDerivative(sigma, gamma, xValue[i]) -
p * GetFirstDerivative(sigma, gamma, xValue[i]) -
q * GetPhiZero(sigma, gamma, xValue[i]);
}
Matrix retValue = Matrix.GetSolve(lMatrix, rMatrix, eps);
return retValue;
}