Пример #1
0
	float mat::det(const mat & b)const
	{
		float rez = 0;
		if (b.dim == 2) {
			rez += det2x(b);
		}else{
			for (int i = 0; i < b.dim; i++) {
				mat aux = b.getMat(i);
				if ((i + 1) % 2 == 0) {
					rez += +b.m[0][i] * det(aux);
				}
				else {
					rez -= +b.m[0][i] * det(aux);
				}
			}
		}
		return rez;
	}