71 det = a[0][0] * a[1][1] - a[1][0] * a[0][1] ;
81 for (j1 = 0 ; j1 < n ; j1++) {
83 m = (
double **) malloc((n-1)*
sizeof(
double *)) ;
85 for (i = 0 ; i < n-1 ; i++)
86 m[i] = (
double *) malloc((n-1)*
sizeof(
double)) ;
97 for (i = 1 ; i < n ; i++) {
100 for (j = 0 ; j < n ; j++) {
101 if (j == j1) continue ;
103 m[i-1][j2] = a[i][j] ;
110 det += pow(-1.0,1.0 + j1 + 1.0) * a[0][j1] *
Determinant(m,n-1) ;
116 for (i = 0 ; i < n-1 ; i++) free(m[i]) ;
double Determinant(double **a, int n)
Recursive function for calculation of determinant.
m
Bubble Growth Application Recipe.