Revision 8d80c9e1d5a8aaea123b670ff2dd04a5208d5bbe authored by Ben Hermans on 04 May 2020, 08:48:24 UTC, committed by Ben Hermans on 04 May 2020, 08:48:24 UTC
1 parent 24cf946
ldl_symbolic.c
#include "types.h"
#include "constants.h"
#include "global.h"
#include "permutation.h"
#include "etree.h"
#include "postorder.h"
#include "col_counts.h"
#ifdef DAMD
#include "amd.h"
#endif /*DAMD*/
ladel_int ladel_ldl_symbolic(ladel_sparse_matrix *M, ladel_symbolics *sym, ladel_int ordering_method, ladel_sparse_matrix *Mpp, ladel_work* work)
{
if (!M || !sym || !Mpp || !work) return FAIL;
ladel_sparse_matrix *Mwork = M;
if (ordering_method == AMD)
{
#ifdef DAMD
ladel_int status;
double Info [AMD_INFO];
#ifdef DLONG
status = amd_l_order(M->ncol, M->p, M->i, sym->p, NULL, Info);
#else /*DLONG*/
status = amd_order(M->ncol, M->p, M->i, sym->p, NULL, Info);
#endif
if (status != AMD_OK) return FAIL;
#else /*DAMD*/
sym->p = ladel_free(sym->p);
#endif
} else if (ordering_method == GIVEN_ORDERING)
{
/*do nothing, sym->p already contains the permutation*/
} else if (ordering_method == NO_ORDERING)
{
sym->p = ladel_free(sym->p);
}
if (sym->p)
{
ladel_permute_symmetric_matrix(M, sym->p, Mpp, work);
Mwork = Mpp;
}
#ifdef SIMPLE_COL_COUNTS
ladel_etree_and_col_counts(Mwork, sym, work);
#else
ladel_etree(Mwork, sym, work);
ladel_postorder(Mwork, sym, work);
ladel_col_counts(Mwork, sym, work);
#endif /*SIMPLE_COL_COUNTS*/
return SUCCESS;
}

Computing file changes ...