X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fadt%2Fgaussjordan.c;h=7773238ca82cfb56f8884fd9abc76af6ef3ef9fa;hb=95439e41faebfaeca2bf517718932e47dd8aaa7c;hp=c07faaa10de8728268d40a0cabf51a8d71050801;hpb=e07b61c6ed5d198a484761f8a40a4f26520d964d;p=libfirm diff --git a/ir/adt/gaussjordan.c b/ir/adt/gaussjordan.c index c07faaa10..7773238ca 100644 --- a/ir/adt/gaussjordan.c +++ b/ir/adt/gaussjordan.c @@ -32,14 +32,14 @@ /* returns 0 if successful */ /* returns -1 if ill-conditioned matrix */ /*------------------------------------------------------*/ -#ifdef HAVE_CONFIG_H #include "config.h" -#endif #include #include #include "xmalloc.h" +#include "gaussjordan.h" + #define SMALL 0.00001 int firm_gaussjordansolve(double *A, double *vec, int nsize) @@ -56,7 +56,7 @@ int firm_gaussjordansolve(double *A, double *vec, int nsize) x[i] = i; /* triangularize A */ - /* ie A has zeros below it's diagonal */ + /* ie A has zeros below its diagonal */ for (col = 0; col < nsize - 1; ++col) { big = 0; /* find the largest left in LRH box */ @@ -76,7 +76,7 @@ int firm_gaussjordansolve(double *A, double *vec, int nsize) } /* swap rows */ - for(i=0;i=0;i--) { + for (i=nsize-2;i>=0;i--) { sum = 0; - for(j=i+1;j