Skip to content

Commit eb2fae3

Browse files
add CHOLMOD:Utility
1 parent fefbd51 commit eb2fae3

File tree

370 files changed

+19096
-6091
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

370 files changed

+19096
-6091
lines changed

CHOLMOD/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
timelog.m
2+
_*.tex

CHOLMOD/CMakeLists.txt

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
# cmake 3.22 is required to find the BLAS/LAPACK
1313
cmake_minimum_required ( VERSION 3.22 )
1414

15-
set ( CHOLMOD_DATE "Oct 15, 2023" )
16-
set ( CHOLMOD_VERSION_MAJOR 4 )
17-
set ( CHOLMOD_VERSION_MINOR 2 )
18-
set ( CHOLMOD_VERSION_SUB 2 )
15+
set ( CHOLMOD_DATE "Oct 23, 2023" )
16+
set ( CHOLMOD_VERSION_MAJOR 5 )
17+
set ( CHOLMOD_VERSION_MINOR 0 )
18+
set ( CHOLMOD_VERSION_SUB 0 )
1919

2020
message ( STATUS "Building CHOLMOD version: v"
2121
${CHOLMOD_VERSION_MAJOR}.
@@ -78,22 +78,22 @@ else ( )
7878
find_package ( OpenMP )
7979
endif ( )
8080

81-
find_package ( SuiteSparse_config 7.2.0
81+
find_package ( SuiteSparse_config 7.3.0
8282
PATHS ${CMAKE_SOURCE_DIR}/../SuiteSparse_config/build NO_DEFAULT_PATH )
8383
if ( NOT TARGET SuiteSparse::SuiteSparseConfig )
8484
find_package ( SuiteSparse_config 7.2.0 REQUIRED )
8585
endif ( )
8686

87-
find_package ( COLAMD 3.2.0
87+
find_package ( COLAMD 3.2.1
8888
PATHS ${CMAKE_SOURCE_DIR}/../COLAMD/build NO_DEFAULT_PATH )
8989
if ( NOT TARGET SuiteSparse::COLAMD )
90-
find_package ( COLAMD 3.2.0 REQUIRED )
90+
find_package ( COLAMD 3.2.1 REQUIRED )
9191
endif ( )
9292

93-
find_package ( AMD 3.2.0
93+
find_package ( AMD 3.2.1
9494
PATHS ${CMAKE_SOURCE_DIR}/../AMD/build NO_DEFAULT_PATH )
9595
if ( NOT TARGET SuiteSparse::AMD )
96-
find_package ( AMD 3.2.0 REQUIRED )
96+
find_package ( AMD 3.2.1 REQUIRED )
9797
endif ( )
9898

9999
#-------------------------------------------------------------------------------
@@ -196,16 +196,16 @@ endif ( )
196196

197197
if ( NOT NCAMD )
198198
# find CAMD and CCOLAMD
199-
find_package ( CAMD 3.2.0
199+
find_package ( CAMD 3.2.1
200200
PATHS ${CMAKE_SOURCE_DIR}/../CAMD/build NO_DEFAULT_PATH )
201201
if ( NOT TARGET SuiteSparse::CAMD )
202-
find_package ( CAMD 3.2.0 )
202+
find_package ( CAMD 3.2.1 )
203203
endif ( )
204204

205-
find_package ( CCOLAMD 3.2.0
205+
find_package ( CCOLAMD 3.2.1
206206
PATHS ${CMAKE_SOURCE_DIR}/../CCOLAMD/build NO_DEFAULT_PATH )
207207
if ( NOT TARGET SuiteSparse::CCOLAMD )
208-
find_package ( CCOLAMD 3.2.0 )
208+
find_package ( CCOLAMD 3.2.1 )
209209
endif ( )
210210

211211
if ( NOT CAMD_FOUND OR NOT CCOLAMD_FOUND )
@@ -290,15 +290,15 @@ configure_file ( "Config/cholmod_version.tex.in"
290290
# include directories
291291
#-------------------------------------------------------------------------------
292292

293-
include_directories ( Check Cholesky Core MatrixOps Modify Partition
293+
include_directories ( Check Cholesky Utility MatrixOps Modify Partition
294294
Supernodal Include ${CMAKE_SOURCE_DIR} )
295295

296296
#-------------------------------------------------------------------------------
297297
# dynamic cholmod library properties
298298
#-------------------------------------------------------------------------------
299299

300300
file ( GLOB CHOLMOD_SOURCES "Check/cholmod_*.c" "Cholesky/cholmod_*.c"
301-
"Core/cholmod_*.c" "MatrixOps/cholmod_*.c" "Modify/cholmod_*.c"
301+
"Utility/cholmod_*.c" "MatrixOps/cholmod_*.c" "Modify/cholmod_*.c"
302302
"Partition/cholmod_*.c" "Supernodal/cholmod_*.c" )
303303

304304
add_library ( CHOLMOD SHARED ${CHOLMOD_SOURCES} )

CHOLMOD/Check/cholmod_check.c

Lines changed: 32 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
/* === printing definitions ================================================= */
7070
/* ========================================================================== */
7171

72-
#if ( ITYPE == CHOLMOD_LONG )
72+
#if defined ( CHOLMOD_INT64 )
7373
#define I8 "%8ld"
7474
#define I_8 "%-8ld"
7575
#else
@@ -204,7 +204,7 @@ static int check_common
204204
)
205205
{
206206
double fl, lnz ;
207-
double *Xwork ;
207+
uint8_t *Xwork ;
208208
Int *Flag, *Head ;
209209
int64_t mark ;
210210
Int i, nrow, nmethods, ordering, xworksize, amd_backup, init_print ;
@@ -502,9 +502,15 @@ static int check_common
502502
}
503503

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

509+
P4 (" sbound: LDL' diagonal threshold: % .5g\n Entries with abs. value"
510+
" less than sbound are replaced with +/- sbound.\n"
511+
" (for single precision case)\n",
512+
Common->sbound) ;
513+
508514
P4 (" grow0: memory reallocation: % .5g\n", Common->grow0) ;
509515
P4 (" grow1: memory reallocation: % .5g\n", Common->grow1) ;
510516
P4 (" grow2: memory reallocation: %g\n", (double) (Common->grow2)) ;
@@ -552,7 +558,8 @@ static int check_common
552558
}
553559
}
554560
}
555-
xworksize = Common->xworksize ;
561+
562+
xworksize = Common->xworkbytes ;
556563
Xwork = Common->Xwork ;
557564
if (xworksize > 0)
558565
{
@@ -564,7 +571,7 @@ static int check_common
564571
{
565572
if (Xwork [i] != 0.)
566573
{
567-
PRINT0 (("Xwork ["ID"] = %g\n", i, Xwork [i])) ;
574+
PRINT0 (("Xwork ["ID"] = %d\n", i, Xwork [i])) ;
568575
ERR ("workspace corrupted (Xwork)") ;
569576
}
570577
}
@@ -742,7 +749,6 @@ static int64_t check_sparse
742749
switch (A->itype)
743750
{
744751
case CHOLMOD_INT: P4 ("%s", "\n scalar types: int, ") ; break ;
745-
case CHOLMOD_INTLONG: ERR ("mixed int/long type unsupported") ;
746752
case CHOLMOD_LONG: P4 ("%s", "\n scalar types: int64_t, ");
747753
break ;
748754
default: ERR ("unknown itype") ;
@@ -760,13 +766,13 @@ static int64_t check_sparse
760766
switch (A->dtype)
761767
{
762768
case CHOLMOD_DOUBLE: P4 ("%s", ", double\n") ; break ;
763-
case CHOLMOD_SINGLE: ERR ("float unsupported") ;
769+
case CHOLMOD_SINGLE: P4 ("%s", ", single\n") ; break ;
764770
default: ERR ("unknown dtype") ;
765771
}
766772

767-
if (A->itype != ITYPE || A->dtype != DTYPE)
773+
if (A->itype != ITYPE)
768774
{
769-
ERR ("integer and real type must match routine") ;
775+
ERR ("integer type must match routine") ;
770776
}
771777

772778
if (A->stype && nrow != ncol)
@@ -1009,7 +1015,7 @@ static int check_dense
10091015
switch (X->dtype)
10101016
{
10111017
case CHOLMOD_DOUBLE: P4 ("%s", ", double\n") ; break ;
1012-
case CHOLMOD_SINGLE: ERR ("single unsupported") ;
1018+
case CHOLMOD_SINGLE: P4 ("%s", ", single\n") ; break ;
10131019
default: ERR ("unknown dtype") ;
10141020
}
10151021

@@ -1542,7 +1548,6 @@ static int check_factor
15421548
switch (L->itype)
15431549
{
15441550
case CHOLMOD_INT: P4 ("%s", "\n scalar types: int, ") ; break ;
1545-
case CHOLMOD_INTLONG: ERR ("mixed int/long type unsupported") ;
15461551
case CHOLMOD_LONG: P4 ("%s", "\n scalar types: int64_t, ");
15471552
break ;
15481553
default: ERR ("unknown itype") ;
@@ -1560,13 +1565,13 @@ static int check_factor
15601565
switch (L->dtype)
15611566
{
15621567
case CHOLMOD_DOUBLE: P4 ("%s", ", double\n") ; break ;
1563-
case CHOLMOD_SINGLE: ERR ("single unsupported") ;
1568+
case CHOLMOD_SINGLE: P4 ("%s", ", single\n") ; break ;
15641569
default: ERR ("unknown dtype") ;
15651570
}
15661571

1567-
if (L->itype != ITYPE || L->dtype != DTYPE)
1572+
if (L->itype != ITYPE)
15681573
{
1569-
ERR ("integer and real type must match routine") ;
1574+
ERR ("integer type must match routine") ;
15701575
}
15711576

15721577
if (L->is_super)
@@ -2118,7 +2123,6 @@ static int check_triplet
21182123
switch (T->itype)
21192124
{
21202125
case CHOLMOD_INT: P4 ("%s", "\n scalar types: int, ") ; break ;
2121-
case CHOLMOD_INTLONG: ERR ("mixed int/long type unsupported") ;
21222126
case CHOLMOD_LONG: P4 ("%s", "\n scalar types: int64_t, ");
21232127
break ;
21242128
default: ERR ("unknown itype") ;
@@ -2136,13 +2140,13 @@ static int check_triplet
21362140
switch (T->dtype)
21372141
{
21382142
case CHOLMOD_DOUBLE: P4 ("%s", ", double\n") ; break ;
2139-
case CHOLMOD_SINGLE: ERR ("single unsupported") ;
2143+
case CHOLMOD_SINGLE: P4 ("%s", ", single\n") ; break ;
21402144
default: ERR ("unknown dtype") ;
21412145
}
21422146

2143-
if (T->itype != ITYPE || T->dtype != DTYPE)
2147+
if (T->itype != ITYPE)
21442148
{
2145-
ERR ("integer and real type must match routine") ;
2149+
ERR ("integer type must match routine") ;
21462150
}
21472151

21482152
if (T->stype && nrow != ncol)
@@ -2450,7 +2454,7 @@ int CHOLMOD(dump_parent)
24502454
void CHOLMOD(dump_real)
24512455
(
24522456
const char *name,
2453-
Real *X, int64_t nrow, int64_t ncol, int lower,
2457+
double *X, int64_t nrow, int64_t ncol, int lower,
24542458
int xentry, cholmod_common *Common
24552459
)
24562460
{
@@ -2654,16 +2658,19 @@ int CHOLMOD(dump_work) (int flag, int head, int64_t wsize,
26542658
W = Common->Xwork ;
26552659
mark = Common->mark ;
26562660

2661+
#if 0
2662+
// FIXME: need float and double
26572663
if (wsize < 0)
26582664
{
26592665
/* check all of Xwork */
2660-
wsize = Common->xworksize ;
2666+
wsize = Common->xworkbytes ;
26612667
}
26622668
else
26632669
{
26642670
/* check on the first wsize doubles in Xwork */
2665-
wsize = MIN (wsize, (Int) (Common->xworksize)) ;
2671+
wsize = MIN (wsize, (Int) (Common->xworkbytes)) ;
26662672
}
2673+
#endif
26672674

26682675
if (flag)
26692676
{
@@ -2673,7 +2680,6 @@ int CHOLMOD(dump_work) (int flag, int head, int64_t wsize,
26732680
{
26742681
PRINT0 (("Flag invalid, Flag ["ID"] = "ID", mark = "ID"\n",
26752682
k, Flag [k], mark)) ;
2676-
ASSERT (0) ;
26772683
return (FALSE) ;
26782684
}
26792685
}
@@ -2686,23 +2692,25 @@ int CHOLMOD(dump_work) (int flag, int head, int64_t wsize,
26862692
if (Head [k] != EMPTY)
26872693
{
26882694
PRINT0 (("Head invalid, Head ["ID"] = "ID"\n", k, Head [k])) ;
2689-
ASSERT (0) ;
26902695
return (FALSE) ;
26912696
}
26922697
}
26932698
}
26942699

2700+
#if 0
2701+
// FIXME: need float and double
26952702
for (k = 0 ; k < wsize ; k++)
26962703
{
26972704
if (W [k] != 0.)
26982705
{
26992706
PRINT0 (("W invalid, W ["ID"] = %g\n", k, W [k])) ;
2700-
ASSERT (0) ;
27012707
return (FALSE) ;
27022708
}
27032709
}
2710+
#endif
27042711

27052712
return (TRUE) ;
27062713
}
27072714
#endif
27082715
#endif
2716+

CHOLMOD/Check/cholmod_l_check.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88

99
//------------------------------------------------------------------------------
1010

11-
#define DLONG
11+
#define CHOLMOD_INT64
1212
#include "cholmod_check.c"
1313

CHOLMOD/Check/cholmod_l_read.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88

99
//------------------------------------------------------------------------------
1010

11-
#define DLONG
11+
#define CHOLMOD_INT64
1212
#include "cholmod_read.c"
1313

CHOLMOD/Check/cholmod_l_write.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88

99
//------------------------------------------------------------------------------
1010

11-
#define DLONG
11+
#define CHOLMOD_INT64
1212
#include "cholmod_write.c"
1313

CHOLMOD/Check/cholmod_read.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
* complex symmetric matrices are always returned with both upper and lower
4949
* triangular parts present, with an stype of zero, since CHOLMOD does not
5050
* have a method for representing skew-symmetric and complex symmetric
51-
* matrices. Real symmetric and complex Hermitian matrices may optionally
51+
* matrices. real symmetric and complex Hermitian matrices may optionally
5252
* be returned with both parts present.
5353
*
5454
* Any other lines starting with "%" are treated as comments, and are ignored.

CHOLMOD/Check/cholmod_write.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ static int print_value
140140
/* ---------------------------------------------------------------------- */
141141

142142
/* change -inf to -HUGE_DOUBLE, and change +inf and nan to +HUGE_DOUBLE */
143-
if (CHOLMOD_IS_NAN (x) || x >= HUGE_DOUBLE)
143+
if (isnan (x) || x >= HUGE_DOUBLE)
144144
{
145145
x = HUGE_DOUBLE ;
146146
}
@@ -341,7 +341,7 @@ static Int ntriplets
341341
* as A.
342342
*
343343
* Returns the symmetry in which the matrix was printed (1 to 7, see the
344-
* CHOLMOD_MM_* codes in CHOLMOD/Include/cholmod_core.h), or -1 on failure.
344+
* CHOLMOD_MM_* codes in CHOLMOD/Include/cholmod.h), or -1 on failure.
345345
*
346346
* If A and Z are sorted on input, and either unsymmetric (stype = 0) or
347347
* symmetric-lower (stype < 0), and if A and Z do not overlap, then the triplets

CHOLMOD/Cholesky/cholmod_amd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ int CHOLMOD(amd)
166166
Control [AMD_AGGRESSIVE] = Common->method [Common->current].aggressive ;
167167
}
168168

169-
#if ( ITYPE == CHOLMOD_LONG )
169+
#if defined ( CHOLMOD_INT64 )
170170
amd_l2 (n, C->p, C->i, Len, C->nzmax, cnz, Nv, Next, Perm, Head, Elen,
171171
Degree, Wi, Control, Info) ;
172172
#else

0 commit comments

Comments
 (0)