46 unsigned order = smatrix.size();
47 for (
unsigned row = 0; row < order - 1; row++) {
49 for (
unsigned i = row;
i < order;
i++) {
50 if (smatrix[
i][row] != 0.0
f) {
53 smatrix[
i] = smatrix[row];
61 smatrix[row] *= (1.0f / smatrix[row][row]);
64 for (
unsigned i = row + 1;
i < order;
i++) {
66 t *= -1.0f * smatrix[
i][row];
67 smatrix[
i] = smatrix[
i] +
t;
74 for (
int row = order - 1; row >= 0; row--) {
76 ret[row] = -smatrix[row][smatrix[row].cnt()] / smatrix[row][row];
78 for (
int i = row - 1;
i >= 0;
i--) {
79 smatrix[
i][smatrix[
i].cnt()] += ret[row] * smatrix[
i][row];
80 smatrix[
i][row] = 0.0f;