#include #include "lupack.h" #define ORDER 1000 /* maksimalna mo"zna velikost linearnega sistema */ #define TINY 1e-5 /**************************************************************************/ /*+ This function replaces the matrix m by the LU decomposition of a rowwise permutation of itself. indx is an output vector which records the row permutation effected by the partial pivoting. d is output as 1 or -1 depending on whether the number of row interchanges was even or odd. Vrne -1 ob napaki; -*/ /**************************************************************************/ int ludcmp( float *m, /* (I/O) input matrix and its decomp.*/ int n, /* velikost sistema */ int indx[], /* (O) permutation vector */ float *d) /* (O) 1 or -1 */ { int i, imax=0, j, k; float big, dum, sum, temp; float vv[ORDER]; *d = 1.0; for (i=0; ibig) big = temp; if (big==0.0) return -1; vv[i] = 1.0/big; } for (j=0; j=big) { big = dum; imax = i; } } if (j!=imax) { for (k=0; k=0; i--) { sum = b[i]; for (j=i+1; j