Skip to content

Commit

Permalink
v4.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
DrTimothyAldenDavis committed Oct 19, 2019
1 parent a6ea77c commit c0c43fa
Show file tree
Hide file tree
Showing 41 changed files with 641 additions and 175 deletions.
37 changes: 37 additions & 0 deletions CHOLMOD/Core/cholmod_version.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/* ========================================================================== */
/* === Core/cholmod_version ================================================= */
/* ========================================================================== */

/* -----------------------------------------------------------------------------
* CHOLMOD/Core Module. Copyright (C) 2005-2013,
* Univ. of Florida. Author: Timothy A. Davis
* The CHOLMOD/Core Module is licensed under Version 2.1 of the GNU
* Lesser General Public License. See lesser.txt for a text of the license.
* CHOLMOD is also available under other licenses; contact authors for details.
* -------------------------------------------------------------------------- */

/* Return the current version of CHOLMOD. Unlike all other functions in
CHOLMOD, this function does not require the CHOLMOD Common. */

#include "cholmod_internal.h"
#include "cholmod_core.h"

int CHOLMOD(version) /* returns CHOLMOD_VERSION */
(
/* output, contents not defined on input. Not used if NULL.
version [0] = CHOLMOD_MAIN_VERSION ;
version [1] = CHOLMOD_SUB_VERSION ;
version [2] = CHOLMOD_SUBSUB_VERSION ;
*/
int version [3]
)
{
if (version != NULL)
{
version [0] = CHOLMOD_MAIN_VERSION ;
version [1] = CHOLMOD_SUB_VERSION ;
version [2] = CHOLMOD_SUBSUB_VERSION ;
}
return (CHOLMOD_VERSION) ;
}

46 changes: 31 additions & 15 deletions CHOLMOD/Demo/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,38 @@ default: all
include ../../SuiteSparse_config/SuiteSparse_config.mk

#-------------------------------------------------------------------------------
# the optional Partition module requires METIS, CAMD, and CCOLAMD
# the optional Partition module requires METIS, CAMD, and CCOLAMD.
# CAMD and CCOLAMD can be installed without METIS, but are optional.
I_WITH_PARTITION =
LIB_WITH_PARTITION =
CONFIG = -DNPARTITION
# check if METIS is requested and available
ifeq (,$(findstring -DNPARTITION, $(CHOLMOD_CONFIG)))
# METIS is requested. See if it is available
ifeq ($(METIS_PATH), $(wildcard $(METIS_PATH)))
ifeq (../../CAMD, $(wildcard ../../CAMD))
ifeq (../../CCOLAMD, $(wildcard ../../CCOLAMD))
# METIS, CAMD, and CCOLAMD are available
LIB_WITH_PARTITION = $(METIS) ../../CCOLAMD/Lib/libccolamd.a \
../../CAMD/Lib/libcamd.a
I_WITH_PARTITION = -I$(METIS_PATH)/Lib \
-I../../CCOLAMD/Include -I../../CAMD/Include
CONFIG =
CONFIG = -DNPARTITION -DNCAMD
# check if CAMD/CCOLAMD and METIS are requested and available
ifeq (,$(findstring -DNCAMD, $(CHOLMOD_CONFIG)))
# CAMD and CCOLAMD are requested. See if they are available
ifeq (../../CAMD, $(wildcard ../../CAMD))
ifeq (../../CCOLAMD, $(wildcard ../../CCOLAMD))
# CAMD and CCOLAMD are requested and available
LIB_WITH_PARTITION = \
../../CCOLAMD/Lib/libccolamd.a ../../CAMD/Lib/libcamd.a
I_WITH_PARTITION = \
-I../../CCOLAMD/Include -I../../CAMD/Include
CONFIG = -DNPARTITION
# check if METIS is requested and available
ifeq (,$(findstring -DNPARTITION, $(CHOLMOD_CONFIG)))
# METIS is requested. See if it is available
ifeq ($(METIS_PATH), $(wildcard $(METIS_PATH)))
# METIS is available
LIB_WITH_PARTITION = $(METIS) \
../../CCOLAMD/Lib/libccolamd.a ../../CAMD/Lib/libcamd.a
I_WITH_PARTITION = -I$(METIS_PATH)/Lib \
-I../../CCOLAMD/Include -I../../CAMD/Include
CONFIG =
endif
endif
endif
endif
endif

#-------------------------------------------------------------------------------

LIB2 = ../Lib/libcholmod.a ../../AMD/Lib/libamd.a ../../COLAMD/Lib/libcolamd.a \
Expand Down Expand Up @@ -81,12 +93,16 @@ library:
( cd ../Lib ; $(MAKE) )
( cd ../../AMD ; $(MAKE) library )
( cd ../../COLAMD ; $(MAKE) library )
ifneq (,$(findstring -DNPARTITION, $(CONFIG)))
ifneq (,$(findstring -DCAMD, $(CONFIG)))
else
( cd ../../CCOLAMD ; $(MAKE) library )
( cd ../../CAMD ; $(MAKE) library )
endif
ifneq (,$(findstring -DNPARTITION, $(CONFIG)))
else
( cd $(METIS_PATH) && $(MAKE) )
endif

#-------------------------------------------------------------------------------

I = -I../Include -I../../SuiteSparse_config
Expand Down
5 changes: 5 additions & 0 deletions CHOLMOD/Demo/cholmod_demo.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ int main (int argc, char **argv)
double *Bx, *Rx, *Xx ;
int i, n, isize, xsize, ordering, xtype, s, ss, lnz ;
int trial, method, L_is_super ;
int ver [3] ;

/* ---------------------------------------------------------------------- */
/* get the file containing the input matrix */
Expand Down Expand Up @@ -121,6 +122,10 @@ int main (int argc, char **argv)
/* ---------------------------------------------------------------------- */

printf ("\n---------------------------------- cholmod_demo:\n") ;
cholmod_version (ver) ;
printf ("cholmod version %d.%d.%d\n", ver [0], ver [1], ver [2]) ;
SuiteSparse_version (ver) ;
printf ("SuiteSparse version %d.%d.%d\n", ver [0], ver [1], ver [2]) ;
A = cholmod_read_sparse (f, cm) ;
if (ff != NULL)
{
Expand Down
5 changes: 5 additions & 0 deletions CHOLMOD/Demo/cholmod_l_demo.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ int main (int argc, char **argv)
double *Bx, *Rx, *Xx ;
SuiteSparse_long i, n, isize, xsize, ordering, xtype, s, ss, lnz ;
int trial, method, L_is_super ;
int ver [3] ;

/* ---------------------------------------------------------------------- */
/* get the file containing the input matrix */
Expand Down Expand Up @@ -120,6 +121,10 @@ int main (int argc, char **argv)
/* ---------------------------------------------------------------------- */

printf ("\n---------------------------------- cholmod_l_demo:\n") ;
cholmod_l_version (ver) ;
printf ("cholmod version %d.%d.%d\n", ver [0], ver [1], ver [2]) ;
SuiteSparse_version (ver) ;
printf ("SuiteSparse version %d.%d.%d\n", ver [0], ver [1], ver [2]) ;
A = cholmod_l_read_sparse (f, cm) ;
if (ff != NULL)
{
Expand Down
8 changes: 8 additions & 0 deletions CHOLMOD/Doc/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
Apr 16, 2013: version 2.1.1

* bug fix to Lib/Makefile and Demo/Makefile, to handle -DNCAMD correctly.
* changes to Supernodal/t_cholmod_gpu.c: to fix a GPU memory leak,
to fix the statistics on TRSM timing, and to reduce CPU-GPU memory
traffic.
* added cholmod_version function.

Mar 27, 2013: version 2.1.0

* added the -DNCAMD option. Formerly, the -DNPARTITION option disabled
Expand Down
1 change: 1 addition & 0 deletions CHOLMOD/Doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ UserGuide.pdf: UserGuide.tex UserGuide.bib $(I) $(C) $(M) Makefile getproto rule
./getproto '/void \*cholmod_free/, /\*\) ;/' ../Include/cholmod_core.h > _free.tex
./getproto '/void \*cholmod_realloc/, /\*\) ;/' ../Include/cholmod_core.h > _realloc.tex
./getproto '/int cholmod_realloc_multiple/, /\*\) ;/' ../Include/cholmod_core.h > _realloc_multiple.tex
./getproto '/int cholmod_version/, /l_version/' ../Include/cholmod_core.h > _version.tex
./getproto '/itype defines the/, /define CHOLMOD_SUPERNODAL/' ../Include/cholmod_core.h > _defn.tex
./getproto '/int cholmod_check_common/, /\*\) ;/' ../Include/cholmod_check.h > _check_common.tex
./getproto '/int cholmod_print_common/, /\*\) ;/' ../Include/cholmod_check.h > _print_common.tex
Expand Down
Binary file modified CHOLMOD/Doc/UserGuide.pdf
Binary file not shown.
39 changes: 38 additions & 1 deletion CHOLMOD/Doc/UserGuide.tex
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
\title{User Guide for CHOLMOD: a sparse Cholesky factorization and
modification package}

\date{VERSION 2.1.0, March 27, 2013}
\date{VERSION 2.1.1, April 16, 2013}
\maketitle

%-------------------------------------------------------------------------------
Expand Down Expand Up @@ -861,6 +861,11 @@ \subsubsection{Memory management routines}
\item {\tt cholmod\_realloc\_multiple}: {\tt realloc} wrapper for multiple objects.
\end{itemize}

%-------------------------------------------------------------------------------
\subsubsection{{\tt cholmod\_version:} Version control}
%-------------------------------------------------------------------------------
The {\tt cholmod\_version} function returns the current version of CHOLMOD.

%-------------------------------------------------------------------------------
\newpage \subsection{{\tt Check} Module: print/check the CHOLMOD objects}
%-------------------------------------------------------------------------------
Expand Down Expand Up @@ -1992,6 +1997,38 @@ \subsection{{\tt cholmod\_realloc}: reallocate memory}
(but with different item sizes). Either all reallocations succeed,
or all are returned to their original size.

%-------------------------------------------------------------------------------
\newpage \section{{\tt Core} Module: version control}
%-------------------------------------------------------------------------------

\subsection{{\tt cholmod\_version}: return current CHOLMOD version}

\input{_version.tex}
Returns the CHOLMOD version number, so that it can be tested at run time, even
if the caller does not have access to the CHOLMOD include files. For example,
for a CHOLMOD version 3.2.1, the {\tt version} array will contain 3, 2, and 1,
in that order. This function appears in CHOLMOD 2.1.1 and later. You can
check if the function exists with the {\tt CHOLMOD\_HAS\_VERSION\_FUNCTION}
macro, so that the following code fragment works in any version of CHOLMOD:

\begin{verbatim}
#ifdef CHOLMOD_HAS_VERSION_FUNCTION
v = cholmod_version (NULL) ;
#else
v = CHOLMOD_VERSION ;
#endif
\end{verbatim}

Note that {\tt cholmod\_version} and {\tt cholmod\_l\_version} have identical
prototypes. Both use {\tt int}'s. Unlike all other CHOLMOD functions, this
function does not take the {\tt Common} object as an input parameter, and it
does not use any defintions from any include files. Thus, the caller can
access this function even if the caller does not include any CHOLMOD include
files.

The above code fragment does require the {\tt \#include "cholmod.h"},
of course, but {\tt cholmod\_version} can be called without it, if necessary.

%-------------------------------------------------------------------------------
\newpage \section{{\tt Check} Module routines}
%-------------------------------------------------------------------------------
Expand Down
31 changes: 29 additions & 2 deletions CHOLMOD/Include/cholmod_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -244,11 +244,13 @@
* #endif
*/

#define CHOLMOD_DATE "Mar 27, 2013"
#define CHOLMOD_HAS_VERSION_FUNCTION

#define CHOLMOD_DATE "April 16, 2013"
#define CHOLMOD_VER_CODE(main,sub) ((main) * 1000 + (sub))
#define CHOLMOD_MAIN_VERSION 2
#define CHOLMOD_SUB_VERSION 1
#define CHOLMOD_SUBSUB_VERSION 0
#define CHOLMOD_SUBSUB_VERSION 1
#define CHOLMOD_VERSION \
CHOLMOD_VER_CODE(CHOLMOD_MAIN_VERSION,CHOLMOD_SUB_VERSION)

Expand Down Expand Up @@ -2292,6 +2294,31 @@ int cholmod_realloc_multiple
int cholmod_l_realloc_multiple (size_t, int, int, void **, void **, void **,
void **, size_t *, cholmod_common *) ;

/* ========================================================================== */
/* === version control ====================================================== */
/* ========================================================================== */

int cholmod_version /* returns CHOLMOD_VERSION */
(
/* output, contents not defined on input. Not used if NULL.
version [0] = CHOLMOD_MAIN_VERSION
version [1] = CHOLMOD_SUB_VERSION
version [2] = CHOLMOD_SUBSUB_VERSION
*/
int version [3]
) ;

int cholmod_l_version (int version [3]) ;

/* Versions prior to 2.1.1 do not have the above function. The following
code fragment will work with any version of CHOLMOD:
#ifdef CHOLMOD_HAS_VERSION_FUNCTION
v = cholmod_version (NULL) ;
#else
v = CHOLMOD_VERSION ;
#endif
*/

/* ========================================================================== */
/* === symmetry types ======================================================= */
/* ========================================================================== */
Expand Down
52 changes: 36 additions & 16 deletions CHOLMOD/Lib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,38 @@ ccode: all
include ../../SuiteSparse_config/SuiteSparse_config.mk

#-------------------------------------------------------------------------------
# the optional Partition module requires METIS, CAMD, and CCOLAMD
# the optional Partition module requires METIS, CAMD, and CCOLAMD.
# CAMD and CCOLAMD can be installed without METIS, but are optional.
I_WITH_PARTITION =
LIB_WITH_PARTITION =
CONFIG = -DNPARTITION
# check if METIS is requested and available
ifeq (,$(findstring -DNPARTITION, $(CHOLMOD_CONFIG)))
# METIS is requested. See if it is available
ifeq ($(METIS_PATH), $(wildcard $(METIS_PATH)))
ifeq (../../CAMD, $(wildcard ../../CAMD))
ifeq (../../CCOLAMD, $(wildcard ../../CCOLAMD))
# METIS, CAMD, and CCOLAMD are available
LIB_WITH_PARTITION = $(METIS) ../../CCOLAMD/Lib/libccolamd.a \
../../CAMD/Lib/libcamd.a
I_WITH_PARTITION = -I$(METIS_PATH)/Lib \
-I../../CCOLAMD/Include -I../../CAMD/Include
CONFIG =
CONFIG = -DNPARTITION -DNCAMD
# check if CAMD/CCOLAMD and METIS are requested and available
ifeq (,$(findstring -DNCAMD, $(CHOLMOD_CONFIG)))
# CAMD and CCOLAMD are requested. See if they are available
ifeq (../../CAMD, $(wildcard ../../CAMD))
ifeq (../../CCOLAMD, $(wildcard ../../CCOLAMD))
# CAMD and CCOLAMD are requested and available
LIB_WITH_PARTITION = \
../../CCOLAMD/Lib/libccolamd.a ../../CAMD/Lib/libcamd.a
I_WITH_PARTITION = \
-I../../CCOLAMD/Include -I../../CAMD/Include
CONFIG = -DNPARTITION
# check if METIS is requested and available
ifeq (,$(findstring -DNPARTITION, $(CHOLMOD_CONFIG)))
# METIS is requested. See if it is available
ifeq ($(METIS_PATH), $(wildcard $(METIS_PATH)))
# METIS is available
LIB_WITH_PARTITION = $(METIS) \
../../CCOLAMD/Lib/libccolamd.a ../../CAMD/Lib/libcamd.a
I_WITH_PARTITION = -I$(METIS_PATH)/Lib \
-I../../CCOLAMD/Include -I../../CAMD/Include
CONFIG =
endif
endif
endif
endif
endif

#-------------------------------------------------------------------------------

I = -I../../AMD/Include -I../../AMD/Source -I../../COLAMD/Include \
Expand Down Expand Up @@ -76,7 +88,8 @@ CORE = cholmod_aat.o cholmod_add.o cholmod_band.o \
cholmod_change_factor.o cholmod_common.o cholmod_complex.o \
cholmod_copy.o cholmod_dense.o cholmod_error.o cholmod_factor.o \
cholmod_memory.o cholmod_sparse.o \
cholmod_transpose.o cholmod_triplet.o
cholmod_transpose.o cholmod_triplet.o \
cholmod_version.o

CHECK = cholmod_check.o cholmod_read.o cholmod_write.o

Expand Down Expand Up @@ -108,7 +121,8 @@ LCORE = cholmod_l_aat.o cholmod_l_add.o cholmod_l_band.o \
cholmod_l_change_factor.o cholmod_l_common.o cholmod_l_complex.o \
cholmod_l_copy.o cholmod_l_dense.o cholmod_l_error.o \
cholmod_l_factor.o cholmod_l_memory.o \
cholmod_l_sparse.o cholmod_l_transpose.o cholmod_l_triplet.o
cholmod_l_sparse.o cholmod_l_transpose.o cholmod_l_triplet.o \
cholmod_l_version.o

LCHECK = cholmod_l_check.o cholmod_l_read.o cholmod_l_write.o

Expand Down Expand Up @@ -215,6 +229,9 @@ cholmod_aat.o: ../Core/cholmod_aat.c
cholmod_add.o: ../Core/cholmod_add.c
$(C) -c $(I) $<

cholmod_version.o: ../Core/cholmod_version.c
$(C) -c $(I) $<

#-------------------------------------------------------------------------------

cholmod_l_common.o: ../Core/cholmod_common.c
Expand Down Expand Up @@ -260,6 +277,9 @@ cholmod_l_aat.o: ../Core/cholmod_aat.c
cholmod_l_add.o: ../Core/cholmod_add.c
$(C) -DDLONG -c $(I) $< -o $@

cholmod_l_version.o: ../Core/cholmod_version.c
$(C) -DDLONG -c $(I) $< -o $@


#-------------------------------------------------------------------------------
# Cholesky Module:
Expand Down
2 changes: 1 addition & 1 deletion CHOLMOD/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# CHOLMOD Makefile
#-------------------------------------------------------------------------------

VERSION = 2.0.1
VERSION = 2.1.1

# Note: If you do not have METIS, or do not wish to use it in CHOLMOD, you must
# compile CHOLMOD with the -DNPARTITION flag.
Expand Down
Loading

0 comments on commit c0c43fa

Please sign in to comment.