void nlEndMatrix() { nlTransition(NL_STATE_MATRIX, NL_STATE_MATRIX_CONSTRUCTED) ; nlRowColumnDestroy(&nlCurrentContext->af) ; nlCurrentContext->alloc_af = NL_FALSE ; nlRowColumnDestroy(&nlCurrentContext->al) ; nlCurrentContext->alloc_al = NL_FALSE ; nlRowColumnDestroy(&nlCurrentContext->xl) ; nlCurrentContext->alloc_al = NL_FALSE ; if(!nlCurrentContext->least_squares) { nl_assert( nlCurrentContext->current_row == nlCurrentContext->n ) ; } if((nlCurrentContext->solver == NL_CHOLMOD_EXT || // or any other direct solver nlCurrentContext->solver == NL_SUPERLU_EXT || nlCurrentContext->solver == NL_PERM_SUPERLU_EXT || nlCurrentContext->solver == NL_SYMMETRIC_SUPERLU_EXT) && nlCurrentContext->direct_solver_context == NULL) { nlCurrentContext->factorize_func() ; } }
void nlEndMatrix() { nlTransition(NL_STATE_MATRIX, NL_STATE_MATRIX_CONSTRUCTED) ; nlRowColumnDestroy(&nlCurrentContext->af) ; nlCurrentContext->alloc_af = NL_FALSE ; nlRowColumnDestroy(&nlCurrentContext->al) ; nlCurrentContext->alloc_al = NL_FALSE ; nlRowColumnDestroy(&nlCurrentContext->xl) ; nlCurrentContext->alloc_al = NL_FALSE ; if(!nlCurrentContext->least_squares) { nl_assert( nlCurrentContext->current_row == nlCurrentContext->n ) ; } }
void nlSparseMatrixDestroy(NLSparseMatrix* M) { NLuint i ; NL_DELETE_ARRAY(M->diag) ; if(M->storage & NL_MATRIX_STORE_ROWS) { for(i=0; i<M->m; i++) { nlRowColumnDestroy(&(M->row[i])) ; } NL_DELETE_ARRAY(M->row) ; } if(M->storage & NL_MATRIX_STORE_COLUMNS) { for(i=0; i<M->n; i++) { nlRowColumnDestroy(&(M->column[i])) ; } NL_DELETE_ARRAY(M->column) ; } #ifdef NL_PARANOID NL_CLEAR(M) ; #endif }