Skip to content

Commit

Permalink
Revert "CHOLMOD:Utility Modules; replaces CHOLMOD:Core, for CHOLMOD 5…
Browse files Browse the repository at this point in the history
….0.0"

This reverts commit 8135892.
The commit was meant for the new branch, 'single', not the dev branch.
  • Loading branch information
DrTimothyAldenDavis committed Oct 22, 2023
1 parent 8135892 commit 51edca6
Show file tree
Hide file tree
Showing 391 changed files with 16,255 additions and 18,488 deletions.
1 change: 0 additions & 1 deletion CHOLMOD/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
timelog.m
_*.tex
30 changes: 15 additions & 15 deletions CHOLMOD/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
# cmake 3.22 is required to find the BLAS/LAPACK
cmake_minimum_required ( VERSION 3.22 )

set ( CHOLMOD_DATE "Oct 23, 2023" )
set ( CHOLMOD_VERSION_MAJOR 5 )
set ( CHOLMOD_VERSION_MINOR 0 )
set ( CHOLMOD_VERSION_SUB 0 )
set ( CHOLMOD_DATE "Oct 15, 2023" )
set ( CHOLMOD_VERSION_MAJOR 4 )
set ( CHOLMOD_VERSION_MINOR 2 )
set ( CHOLMOD_VERSION_SUB 2 )

message ( STATUS "Building CHOLMOD version: v"
${CHOLMOD_VERSION_MAJOR}.
Expand Down Expand Up @@ -78,22 +78,22 @@ else ( )
find_package ( OpenMP )
endif ( )

find_package ( SuiteSparse_config 7.3.0
find_package ( SuiteSparse_config 7.2.0
PATHS ${CMAKE_SOURCE_DIR}/../SuiteSparse_config/build NO_DEFAULT_PATH )
if ( NOT TARGET SuiteSparse::SuiteSparseConfig )
find_package ( SuiteSparse_config 7.2.0 REQUIRED )
endif ( )

find_package ( COLAMD 3.2.1
find_package ( COLAMD 3.2.0
PATHS ${CMAKE_SOURCE_DIR}/../COLAMD/build NO_DEFAULT_PATH )
if ( NOT TARGET SuiteSparse::COLAMD )
find_package ( COLAMD 3.2.1 REQUIRED )
find_package ( COLAMD 3.2.0 REQUIRED )
endif ( )

find_package ( AMD 3.2.1
find_package ( AMD 3.2.0
PATHS ${CMAKE_SOURCE_DIR}/../AMD/build NO_DEFAULT_PATH )
if ( NOT TARGET SuiteSparse::AMD )
find_package ( AMD 3.2.1 REQUIRED )
find_package ( AMD 3.2.0 REQUIRED )
endif ( )

#-------------------------------------------------------------------------------
Expand Down Expand Up @@ -196,16 +196,16 @@ endif ( )

if ( NOT NCAMD )
# find CAMD and CCOLAMD
find_package ( CAMD 3.2.1
find_package ( CAMD 3.2.0
PATHS ${CMAKE_SOURCE_DIR}/../CAMD/build NO_DEFAULT_PATH )
if ( NOT TARGET SuiteSparse::CAMD )
find_package ( CAMD 3.2.1 )
find_package ( CAMD 3.2.0 )
endif ( )

find_package ( CCOLAMD 3.2.1
find_package ( CCOLAMD 3.2.0
PATHS ${CMAKE_SOURCE_DIR}/../CCOLAMD/build NO_DEFAULT_PATH )
if ( NOT TARGET SuiteSparse::CCOLAMD )
find_package ( CCOLAMD 3.2.1 )
find_package ( CCOLAMD 3.2.0 )
endif ( )

if ( NOT CAMD_FOUND OR NOT CCOLAMD_FOUND )
Expand Down Expand Up @@ -290,15 +290,15 @@ configure_file ( "Config/cholmod_version.tex.in"
# include directories
#-------------------------------------------------------------------------------

include_directories ( Check Cholesky Utility MatrixOps Modify Partition
include_directories ( Check Cholesky Core MatrixOps Modify Partition
Supernodal Include ${CMAKE_SOURCE_DIR} )

#-------------------------------------------------------------------------------
# dynamic cholmod library properties
#-------------------------------------------------------------------------------

file ( GLOB CHOLMOD_SOURCES "Check/cholmod_*.c" "Cholesky/cholmod_*.c"
"Utility/cholmod_*.c" "MatrixOps/cholmod_*.c" "Modify/cholmod_*.c"
"Core/cholmod_*.c" "MatrixOps/cholmod_*.c" "Modify/cholmod_*.c"
"Partition/cholmod_*.c" "Supernodal/cholmod_*.c" )

add_library ( CHOLMOD SHARED ${CHOLMOD_SOURCES} )
Expand Down
56 changes: 24 additions & 32 deletions CHOLMOD/Check/cholmod_check.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
/* === printing definitions ================================================= */
/* ========================================================================== */

#if defined ( CHOLMOD_INT64 )
#if ( ITYPE == CHOLMOD_LONG )
#define I8 "%8ld"
#define I_8 "%-8ld"
#else
Expand Down Expand Up @@ -204,7 +204,7 @@ static int check_common
)
{
double fl, lnz ;
uint8_t *Xwork ;
double *Xwork ;
Int *Flag, *Head ;
int64_t mark ;
Int i, nrow, nmethods, ordering, xworksize, amd_backup, init_print ;
Expand Down Expand Up @@ -502,15 +502,9 @@ static int check_common
}

P4 (" dbound: LDL' diagonal threshold: % .5g\n Entries with abs. value"
" less than dbound are replaced with +/- dbound.\n"
" (for double precision case)\n",
" less than dbound are replaced with +/- dbound.\n",
Common->dbound) ;

P4 (" sbound: LDL' diagonal threshold: % .5g\n Entries with abs. value"
" less than sbound are replaced with +/- sbound.\n"
" (for single precision case)\n",
Common->sbound) ;

P4 (" grow0: memory reallocation: % .5g\n", Common->grow0) ;
P4 (" grow1: memory reallocation: % .5g\n", Common->grow1) ;
P4 (" grow2: memory reallocation: %g\n", (double) (Common->grow2)) ;
Expand Down Expand Up @@ -558,8 +552,7 @@ static int check_common
}
}
}

xworksize = Common->xworkbytes ;
xworksize = Common->xworksize ;
Xwork = Common->Xwork ;
if (xworksize > 0)
{
Expand All @@ -571,7 +564,7 @@ static int check_common
{
if (Xwork [i] != 0.)
{
PRINT0 (("Xwork ["ID"] = %d\n", i, Xwork [i])) ;
PRINT0 (("Xwork ["ID"] = %g\n", i, Xwork [i])) ;
ERR ("workspace corrupted (Xwork)") ;
}
}
Expand Down Expand Up @@ -749,6 +742,7 @@ static int64_t check_sparse
switch (A->itype)
{
case CHOLMOD_INT: P4 ("%s", "\n scalar types: int, ") ; break ;
case CHOLMOD_INTLONG: ERR ("mixed int/long type unsupported") ;
case CHOLMOD_LONG: P4 ("%s", "\n scalar types: int64_t, ");
break ;
default: ERR ("unknown itype") ;
Expand All @@ -766,13 +760,13 @@ static int64_t check_sparse
switch (A->dtype)
{
case CHOLMOD_DOUBLE: P4 ("%s", ", double\n") ; break ;
case CHOLMOD_SINGLE: P4 ("%s", ", single\n") ; break ;
case CHOLMOD_SINGLE: ERR ("float unsupported") ;
default: ERR ("unknown dtype") ;
}

if (A->itype != ITYPE)
if (A->itype != ITYPE || A->dtype != DTYPE)
{
ERR ("integer type must match routine") ;
ERR ("integer and real type must match routine") ;
}

if (A->stype && nrow != ncol)
Expand Down Expand Up @@ -1015,7 +1009,7 @@ static int check_dense
switch (X->dtype)
{
case CHOLMOD_DOUBLE: P4 ("%s", ", double\n") ; break ;
case CHOLMOD_SINGLE: P4 ("%s", ", single\n") ; break ;
case CHOLMOD_SINGLE: ERR ("single unsupported") ;
default: ERR ("unknown dtype") ;
}

Expand Down Expand Up @@ -1548,6 +1542,7 @@ static int check_factor
switch (L->itype)
{
case CHOLMOD_INT: P4 ("%s", "\n scalar types: int, ") ; break ;
case CHOLMOD_INTLONG: ERR ("mixed int/long type unsupported") ;
case CHOLMOD_LONG: P4 ("%s", "\n scalar types: int64_t, ");
break ;
default: ERR ("unknown itype") ;
Expand All @@ -1565,13 +1560,13 @@ static int check_factor
switch (L->dtype)
{
case CHOLMOD_DOUBLE: P4 ("%s", ", double\n") ; break ;
case CHOLMOD_SINGLE: P4 ("%s", ", single\n") ; break ;
case CHOLMOD_SINGLE: ERR ("single unsupported") ;
default: ERR ("unknown dtype") ;
}

if (L->itype != ITYPE)
if (L->itype != ITYPE || L->dtype != DTYPE)
{
ERR ("integer type must match routine") ;
ERR ("integer and real type must match routine") ;
}

if (L->is_super)
Expand Down Expand Up @@ -2123,6 +2118,7 @@ static int check_triplet
switch (T->itype)
{
case CHOLMOD_INT: P4 ("%s", "\n scalar types: int, ") ; break ;
case CHOLMOD_INTLONG: ERR ("mixed int/long type unsupported") ;
case CHOLMOD_LONG: P4 ("%s", "\n scalar types: int64_t, ");
break ;
default: ERR ("unknown itype") ;
Expand All @@ -2140,13 +2136,13 @@ static int check_triplet
switch (T->dtype)
{
case CHOLMOD_DOUBLE: P4 ("%s", ", double\n") ; break ;
case CHOLMOD_SINGLE: P4 ("%s", ", single\n") ; break ;
case CHOLMOD_SINGLE: ERR ("single unsupported") ;
default: ERR ("unknown dtype") ;
}

if (T->itype != ITYPE)
if (T->itype != ITYPE || T->dtype != DTYPE)
{
ERR ("integer type must match routine") ;
ERR ("integer and real type must match routine") ;
}

if (T->stype && nrow != ncol)
Expand Down Expand Up @@ -2454,7 +2450,7 @@ int CHOLMOD(dump_parent)
void CHOLMOD(dump_real)
(
const char *name,
double *X, int64_t nrow, int64_t ncol, int lower,
Real *X, int64_t nrow, int64_t ncol, int lower,
int xentry, cholmod_common *Common
)
{
Expand Down Expand Up @@ -2658,19 +2654,16 @@ int CHOLMOD(dump_work) (int flag, int head, int64_t wsize,
W = Common->Xwork ;
mark = Common->mark ;

#if 0
// FIXME: need float and double
if (wsize < 0)
{
/* check all of Xwork */
wsize = Common->xworkbytes ;
wsize = Common->xworksize ;
}
else
{
/* check on the first wsize doubles in Xwork */
wsize = MIN (wsize, (Int) (Common->xworkbytes)) ;
wsize = MIN (wsize, (Int) (Common->xworksize)) ;
}
#endif

if (flag)
{
Expand All @@ -2680,6 +2673,7 @@ int CHOLMOD(dump_work) (int flag, int head, int64_t wsize,
{
PRINT0 (("Flag invalid, Flag ["ID"] = "ID", mark = "ID"\n",
k, Flag [k], mark)) ;
ASSERT (0) ;
return (FALSE) ;
}
}
Expand All @@ -2692,25 +2686,23 @@ int CHOLMOD(dump_work) (int flag, int head, int64_t wsize,
if (Head [k] != EMPTY)
{
PRINT0 (("Head invalid, Head ["ID"] = "ID"\n", k, Head [k])) ;
ASSERT (0) ;
return (FALSE) ;
}
}
}

#if 0
// FIXME: need float and double
for (k = 0 ; k < wsize ; k++)
{
if (W [k] != 0.)
{
PRINT0 (("W invalid, W ["ID"] = %g\n", k, W [k])) ;
ASSERT (0) ;
return (FALSE) ;
}
}
#endif

return (TRUE) ;
}
#endif
#endif

2 changes: 1 addition & 1 deletion CHOLMOD/Check/cholmod_l_check.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@

//------------------------------------------------------------------------------

#define CHOLMOD_INT64
#define DLONG
#include "cholmod_check.c"

2 changes: 1 addition & 1 deletion CHOLMOD/Check/cholmod_l_read.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@

//------------------------------------------------------------------------------

#define CHOLMOD_INT64
#define DLONG
#include "cholmod_read.c"

2 changes: 1 addition & 1 deletion CHOLMOD/Check/cholmod_l_write.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@

//------------------------------------------------------------------------------

#define CHOLMOD_INT64
#define DLONG
#include "cholmod_write.c"

2 changes: 1 addition & 1 deletion CHOLMOD/Check/cholmod_read.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
* complex symmetric matrices are always returned with both upper and lower
* triangular parts present, with an stype of zero, since CHOLMOD does not
* have a method for representing skew-symmetric and complex symmetric
* matrices. real symmetric and complex Hermitian matrices may optionally
* matrices. Real symmetric and complex Hermitian matrices may optionally
* be returned with both parts present.
*
* Any other lines starting with "%" are treated as comments, and are ignored.
Expand Down
4 changes: 2 additions & 2 deletions CHOLMOD/Check/cholmod_write.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ static int print_value
/* ---------------------------------------------------------------------- */

/* change -inf to -HUGE_DOUBLE, and change +inf and nan to +HUGE_DOUBLE */
if (isnan (x) || x >= HUGE_DOUBLE)
if (CHOLMOD_IS_NAN (x) || x >= HUGE_DOUBLE)
{
x = HUGE_DOUBLE ;
}
Expand Down Expand Up @@ -341,7 +341,7 @@ static Int ntriplets
* as A.
*
* Returns the symmetry in which the matrix was printed (1 to 7, see the
* CHOLMOD_MM_* codes in CHOLMOD/Include/cholmod.h), or -1 on failure.
* CHOLMOD_MM_* codes in CHOLMOD/Include/cholmod_core.h), or -1 on failure.
*
* If A and Z are sorted on input, and either unsymmetric (stype = 0) or
* symmetric-lower (stype < 0), and if A and Z do not overlap, then the triplets
Expand Down
2 changes: 1 addition & 1 deletion CHOLMOD/Cholesky/cholmod_amd.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ int CHOLMOD(amd)
Control [AMD_AGGRESSIVE] = Common->method [Common->current].aggressive ;
}

#if defined ( CHOLMOD_INT64 )
#if ( ITYPE == CHOLMOD_LONG )
amd_l2 (n, C->p, C->i, Len, C->nzmax, cnz, Nv, Next, Perm, Head, Elen,
Degree, Wi, Control, Info) ;
#else
Expand Down
Loading

0 comments on commit 51edca6

Please sign in to comment.