27 std::unique_ptr<std::unique_ptr<double[]>[]>
A(
new std::unique_ptr<
double[]>);
29 for (
int row = 0; row <
N; row++)
31 A[row].reset(
new double[
N]);
40 std::unique_ptr<double[]>
B(
new double[
N]);
42 for (
int row = 0; row <
N; row++)
49 std::unique_ptr<int[]> indxc(
new int[
n] );
52 std::unique_ptr<int[]> indxr(
new int[
n] );
56 std::unique_ptr<int[]> ipiv(
new int[
n] );
66 for (j = 0; j <
n; j++)
69 for (
i = 0;
i <
n;
i++)
72 for (j = 0; j <
n; j++)
76 for (k = 0; k <
n; k++)
80 if ( fabs(
a[j][k]) >=
big )
87 else if ( ipiv[k] > 1 )
98 std::swap(
a[irow],
a[icol]);
107 if (
a[icol][icol] == 0 )
112 double pivinv = 1/
a[icol][icol];
114 for (k = 0; k <
n; k++)
115 a[icol][k] *= pivinv;
118 for (j = 0; j <
n; j++)
124 for (k = 0; k <
n; k++)
125 a[j][k] -=
a[icol][k]*save;
126 b[j] -= b[icol]*save;
131 for (j =
n-1; j >= 0; j--)
133 if ( indxr[j] != indxc[j] )
135 for (k = 0; k <
n; k++)
137 save =
a[k][indxr[j]];
138 a[k][indxr[j]] =
a[k][indxc[j]];
139 a[k][indxc[j]] = save;
static bool Solve(int N, std::unique_ptr< std::unique_ptr< double[]>[]> const &A, double *b)
static std::unique_ptr< double[]> NewVector(int N)
static std::unique_ptr< std::unique_ptr< double[]>[]> NewMatrix(int N)
RttiCompleteObjectLocator col