--- ogdi/c-api/matrix.c 2007-02-19 20:31:33.000000000 +0100 +++ ogdi/c-api/matrix.c 2007-02-25 12:28:21.000000000 +0100 @@ -42,6 +42,9 @@ /* initialize loop iterators */ int i=0, j=0, k=0; + + /* initialise result matrix */ + mat_init( matrix_result, width_a, width_b ); /* compute multiply of each elements into destination matrix */ for ( i = 0 ; i< height_a; i++ ) @@ -65,14 +68,17 @@ double **matrix_result; { /* initialize loop iterators */ - int i=0, j=0, k=0; + int i=0, j=0, k=0; + + /* initialise result matrix */ + mat_init( matrix_result, width_a, width_b ); /* compute multiply of each elements into destination matrix */ - for ( i = 0 ; i< height_a; i++ ) - for ( j = 0 ; j< width_b; j++ ) - for ( k = 0 ; k< width_a; k++ ) - matrix_result[i][j] += matrix_a[i][k]*matrix_b[j][k]; - return; + for( i=0; i