public static void dec(double a[][], int n, double aux[], int p[]) {

		int i, k, k1, pk, d;
		double r, s, eps;
		double v[] = new double[n + 1];

		pk = 0;
		r = -1.0;
		for (i = 1; i <= n; i++) {
			s = Math.sqrt(Basic.mattam(1, n, i, i, a, a));
			if (s > r)
				r = s;
			v[i] = 1.0 / s;
		}
		eps = aux[2] * r;
		d = 1;
		for (k = 1; k <= n; k++) {
			r = -1.0;
			k1 = k - 1;
			for (i = k; i <= n; i++) {
				a[i][k] -= Basic.matmat(1, k1, i, k, a, a);
				s = Math.abs(a[i][k]) * v[i];
				if (s > r) {
					r = s;
					pk = i;
				}
			}
			p[k] = pk;
			v[pk] = v[k];
			s = a[pk][k];
			if (Math.abs(s) < eps)
				break;
			if (s < 0.0)
				d = -d;
			if (pk != k) {
				d = -d;
				Basic.ichrow(1, n, k, pk, a);
			}
			for (i = k + 1; i <= n; i++)
				a[k][i] = (a[k][i] - Basic.matmat(1, k1, k, i, a, a)) / s;
		}
		aux[1] = d;
		aux[3] = k - 1;

	}