Skip to content

Commit

Permalink
Adding *_version functions to all packages
Browse files Browse the repository at this point in the history
  • Loading branch information
DrTimothyAldenDavis committed Dec 2, 2023
1 parent 12e6846 commit e687e79
Show file tree
Hide file tree
Showing 105 changed files with 1,664 additions and 877 deletions.
4 changes: 4 additions & 0 deletions AMD/Config/amd.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,10 @@ void amd_l_control (double Control [ ]) ;
void amd_info (double Info [ ]) ;
void amd_l_info (double Info [ ]) ;

// amd_version: return AMD version. The version array is returned with
// version [0..2] = {AMD_MAIN_VERSION, AMD_SUB_VERSION, AMD_SUBSUB_VERSION}
void amd_version (int version [3]) ;

#ifdef __cplusplus
}
#endif
Expand Down
15 changes: 9 additions & 6 deletions AMD/Demo/amd_demo.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,17 @@ int main (void)
double Control [AMD_CONTROL], Info [AMD_INFO] ;
char A [24][24] ;

/* here is an example of how to use AMD_VERSION. This code will work in
* any version of AMD. */
#if defined(AMD_VERSION) && (AMD_VERSION >= AMD_VERSION_CODE(1,2))
printf ("AMD version %d.%d.%d, date: %s\n",
AMD_MAIN_VERSION, AMD_SUB_VERSION, AMD_SUBSUB_VERSION, AMD_DATE) ;
#else
printf ("AMD version: 1.1 or earlier\n") ;
#endif
int version [3] ;
amd_version (version) ;
if ((version [0] != AMD_MAIN_VERSION) ||
(version [1] != AMD_SUB_VERSION) ||
(version [2] != AMD_SUBSUB_VERSION))
{
fprintf (stderr, "version in header does not match library\n") ;
abort ( ) ;
}

printf ("AMD demo, with the 24-by-24 Harwell/Boeing matrix, can_24:\n") ;

Expand Down
15 changes: 9 additions & 6 deletions AMD/Demo/amd_l_demo.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,17 @@ int main (void)
double Control [AMD_CONTROL], Info [AMD_INFO] ;
char A [24][24] ;

/* here is an example of how to use AMD_VERSION. This code will work in
* any version of AMD. */
#if defined(AMD_VERSION) && (AMD_VERSION >= AMD_VERSION_CODE(1,2))
printf ("AMD version %d.%d.%d, date: %s\n",
AMD_MAIN_VERSION, AMD_SUB_VERSION, AMD_SUBSUB_VERSION, AMD_DATE) ;
#else
printf ("AMD version: 1.1 or earlier\n") ;
#endif
int version [3] ;
amd_version (version) ;
if ((version [0] != AMD_MAIN_VERSION) ||
(version [1] != AMD_SUB_VERSION) ||
(version [2] != AMD_SUBSUB_VERSION))
{
fprintf (stderr, "version in header does not match library\n") ;
abort ( ) ;
}

printf ("AMD demo, with the 24-by-24 Harwell/Boeing matrix, can_24:\n") ;

Expand Down
Binary file modified AMD/Doc/AMD_UserGuide.pdf
Binary file not shown.
16 changes: 14 additions & 2 deletions AMD/Doc/AMD_UserGuide.tex
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,8 @@ \section{Using AMD in a C program}
\label{Cversion}
%------------------------------------------------------------------------------

The C-callable AMD library consists of seven user-callable routines and one
include file. There are two versions of each of the routines, with
The C-callable AMD library consists of eight user-callable routines and one
include file. There are two versions of seven of the routines, with
\verb'int32_t' and \verb'int64_t' integers.
The routines with prefix
{\tt amd\_l\_} use \verb'int64_t' integer arguments; the others use
Expand Down Expand Up @@ -303,6 +303,8 @@ \section{Using AMD in a C program}
but it destroys the matrix on output. Additional workspace must be passed.
Refer to the source file {\tt AMD/Source/amd\_2.c} for a description.

\item \verb'amd_version': returns the AMD version.

\end{itemize}

The nonzero pattern of the matrix $\m{A}$ is represented in compressed column
Expand Down Expand Up @@ -480,6 +482,16 @@ \section{Synopsis of C-callable routines}
\end{verbatim}
}

The \verb'amd_version' function uses plain \verb'int':

{\footnotesize
\begin{verbatim}
#include "amd.h"
int version [3] ;
amd_version (version) ;
\end{verbatim}
}

%------------------------------------------------------------------------------
\section{Using AMD in a Fortran program}
%------------------------------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions AMD/Doc/ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ Dec 30, 2023: version 3.3.0

* major change to build system: by Markus Mützel
* revised test for integer overflow: for CHOLMOD 5.1.0 tests
* amd_version: added to return version of AMD

Sept 18, 2023: version 3.2.1

Expand Down
4 changes: 4 additions & 0 deletions AMD/Include/amd.h
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,10 @@ void amd_l_control (double Control [ ]) ;
void amd_info (double Info [ ]) ;
void amd_l_info (double Info [ ]) ;

// amd_version: return AMD version. The version array is returned with
// version [0..2] = {AMD_MAIN_VERSION, AMD_SUB_VERSION, AMD_SUBSUB_VERSION}
void amd_version (int version [3]) ;

#ifdef __cplusplus
}
#endif
Expand Down
19 changes: 19 additions & 0 deletions AMD/Source/amd_version.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//------------------------------------------------------------------------------
// AMD/Source/amd_version: return AMD version
//------------------------------------------------------------------------------

// AMD, Copyright (c) 1996-2023, Timothy A. Davis, Patrick R. Amestoy, and
// Iain S. Duff. All Rights Reserved.
// SPDX-License-Identifier: BSD-3-clause

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

#include "amd_internal.h"

void amd_version (int version [3])
{
version [0] = AMD_MAIN_VERSION ;
version [1] = AMD_SUB_VERSION ;
version [2] = AMD_SUBSUB_VERSION ;
}

6 changes: 6 additions & 0 deletions BTF/Config/btf.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,12 @@ int32_t btf_order /* returns number of blocks found */
int64_t btf_l_order (int64_t, int64_t *, int64_t *, double , double *,
int64_t *, int64_t *, int64_t *, int64_t *, int64_t *) ;

//------------------------------------------------------------------------------
// btf_version: return BTF version
//------------------------------------------------------------------------------

void btf_version (int version [3]) ;

#ifdef __cplusplus
}
#endif
Expand Down
1 change: 1 addition & 0 deletions BTF/Doc/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Dec 30, 2023: version 2.3.0

* major change to build system: by Markus Mützel
* btf_version: added to return version of BTF

Sept 18, 2023: version 2.2.1

Expand Down
6 changes: 6 additions & 0 deletions BTF/Include/btf.h
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,12 @@ int32_t btf_order /* returns number of blocks found */
int64_t btf_l_order (int64_t, int64_t *, int64_t *, double , double *,
int64_t *, int64_t *, int64_t *, int64_t *, int64_t *) ;

//------------------------------------------------------------------------------
// btf_version: return BTF version
//------------------------------------------------------------------------------

void btf_version (int version [3]) ;

#ifdef __cplusplus
}
#endif
Expand Down
19 changes: 19 additions & 0 deletions BTF/Source/btf_version.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//------------------------------------------------------------------------------
// BTF/Source/btf_version: return BTF version
//------------------------------------------------------------------------------

// BTF, Copyright (c) 2004-2023, University of Florida. All Rights Reserved.
// Author: Timothy A. Davis.
// SPDX-License-Identifier: LGPL-2.1+

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

#include "btf.h"

void btf_version (int version [3])
{
version [0] = BTF_MAIN_VERSION ;
version [1] = BTF_SUB_VERSION ;
version [2] = BTF_SUBSUB_VERSION ;
}

4 changes: 4 additions & 0 deletions CAMD/Config/camd.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,10 @@ void camd_l_control (double Control [ ]) ;
void camd_info (double Info [ ]) ;
void camd_l_info (double Info [ ]) ;

// camd_version: return CAMD version. The version array is returned with
// version [0..2] = {CAMD_MAIN_VERSION, CAMD_SUB_VERSION, CAMD_SUBSUB_VERSION}
void camd_version (int version [3]) ;

#ifdef __cplusplus
}
#endif
Expand Down
14 changes: 12 additions & 2 deletions CAMD/Demo/camd_demo.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,18 @@ int main (void)
int32_t C [ ] = { 0, 0, 4, 0, 1, 0, 2, 2, 1, 1, 3, 4, 5, 5, 3, 4,
5, 2, 5, 3, 4, 2, 1, 0 } ;

printf ("CAMD version %d.%d, date: %s\n", CAMD_MAIN_VERSION,
CAMD_SUB_VERSION, CAMD_DATE) ;
printf ("CAMD version %d.%d.%d, date: %s\n",
CAMD_MAIN_VERSION, CAMD_SUB_VERSION, CAMD_SUBSUB_VERSION, CAMD_DATE) ;
int version [3] ;
camd_version (version) ;
if ((version [0] != CAMD_MAIN_VERSION) ||
(version [1] != CAMD_SUB_VERSION) ||
(version [2] != CAMD_SUBSUB_VERSION))
{
fprintf (stderr, "version in header does not match library\n") ;
abort ( ) ;
}

printf ("CAMD demo, with the 24-by-24 Harwell/Boeing matrix, can_24:\n") ;

/* get the default parameters, and print them */
Expand Down
2 changes: 1 addition & 1 deletion CAMD/Demo/camd_demo.out
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CAMD version 3.3, date: Dec 30, 2023
CAMD version 3.3.0, date: Dec 30, 2023
CAMD demo, with the 24-by-24 Harwell/Boeing matrix, can_24:

camd version 3.3.0, Dec 30, 2023: approximate minimum degree ordering:
Expand Down
14 changes: 12 additions & 2 deletions CAMD/Demo/camd_l_demo.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,18 @@ int main (void)
int64_t C [ ] = { 0, 0, 4, 0, 1, 0, 2, 2, 1, 1, 3, 4, 5, 5, 3, 4,
5, 2, 5, 3, 4, 2, 1, 0 };

printf ("CAMD version %d.%d, date: %s\n", CAMD_MAIN_VERSION,
CAMD_SUB_VERSION, CAMD_DATE) ;
printf ("CAMD version %d.%d.%d, date: %s\n",
CAMD_MAIN_VERSION, CAMD_SUB_VERSION, CAMD_SUBSUB_VERSION, CAMD_DATE) ;
int version [3] ;
camd_version (version) ;
if ((version [0] != CAMD_MAIN_VERSION) ||
(version [1] != CAMD_SUB_VERSION) ||
(version [2] != CAMD_SUBSUB_VERSION))
{
fprintf (stderr, "version in header does not match library\n") ;
abort ( ) ;
}

printf ("CAMD demo, with the 24-by-24 Harwell/Boeing matrix, can_24:\n") ;

/* get the default parameters, and print them */
Expand Down
2 changes: 1 addition & 1 deletion CAMD/Demo/camd_l_demo.out
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CAMD version 3.3, date: Dec 30, 2023
CAMD version 3.3.0, date: Dec 30, 2023
CAMD demo, with the 24-by-24 Harwell/Boeing matrix, can_24:

camd version 3.3.0, Dec 30, 2023: approximate minimum degree ordering:
Expand Down
16 changes: 14 additions & 2 deletions CAMD/Doc/CAMD_UserGuide.tex
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,8 @@ \section{Using CAMD in a C program}
\label{Cversion}
%------------------------------------------------------------------------------

The C-callable CAMD library consists of seven user-callable routines and one
include file. There are two versions of each of the routines, with
The C-callable CAMD library consists of eight user-callable routines and one
include file. There are two versions of seven of the routines, with
\verb'int32_t' and \verb'int64_t' integers.
The routines with prefix
{\tt camd\_l\_} use \verb'int64_t' integer arguments; the others use
Expand Down Expand Up @@ -314,6 +314,8 @@ \section{Using CAMD in a C program}
but it destroys the matrix on output. Additional workspace must be passed.
Refer to the source file {\tt CAMD/Source/camd\_2.c} for a description.

\item \verb'camd_version': returns the CAMD version

\end{itemize}

The nonzero pattern of the matrix $\m{A}$ is represented in compressed column
Expand Down Expand Up @@ -495,6 +497,16 @@ \section{Synopsis of C-callable routines}
\end{verbatim}
}

The \verb'camd_version' function uses plain \verb'int':

{\footnotesize
\begin{verbatim}
#include "camd.h"
int version [3] ;
camd_version (version) ;
\end{verbatim}
}

%------------------------------------------------------------------------------
\section{Installation}
\label{Install}
Expand Down
1 change: 1 addition & 0 deletions CAMD/Doc/ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ Dec 30, 2023: version 3.3.0

* major change to build system: by Markus Mützel
* revised test for integer overflow: for CHOLMOD 5.1.0 tests
* camd_version: added to return version of CAMD

Sept 18, 2023: version 3.2.1

Expand Down
4 changes: 4 additions & 0 deletions CAMD/Include/camd.h
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,10 @@ void camd_l_control (double Control [ ]) ;
void camd_info (double Info [ ]) ;
void camd_l_info (double Info [ ]) ;

// camd_version: return CAMD version. The version array is returned with
// version [0..2] = {CAMD_MAIN_VERSION, CAMD_SUB_VERSION, CAMD_SUBSUB_VERSION}
void camd_version (int version [3]) ;

#ifdef __cplusplus
}
#endif
Expand Down
19 changes: 19 additions & 0 deletions CAMD/Source/camd_version.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//------------------------------------------------------------------------------
// CAMD/Source/camd_version: return CAMD version
//------------------------------------------------------------------------------

// CAMD, Copyright (c) 2007-2023, Timothy A. Davis, Yanqing Chen, Patrick R.
// Amestoy, and Iain S. Duff. All Rights Reserved.
// SPDX-License-Identifier: BSD-3-clause

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

#include "camd_internal.h"

void camd_version (int version [3])
{
version [0] = CAMD_MAIN_VERSION ;
version [1] = CAMD_SUB_VERSION ;
version [2] = CAMD_SUBSUB_VERSION ;
}

1 change: 1 addition & 0 deletions CCOLAMD/Config/ccolamd.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ void csymamd_l_report
int64_t stats [CCOLAMD_STATS]
) ;

void ccolamd_version (int version [3]) ;

/* ========================================================================== */
/* === Prototypes of "expert" routines ====================================== */
Expand Down
15 changes: 15 additions & 0 deletions CCOLAMD/Demo/ccolamd_example.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,21 @@ int main (void)

int row, col, pp, length, ok ;

//--------------------------------------------------------------------------
// ccolamd version
//--------------------------------------------------------------------------

int version [3] ;
ccolamd_version (version) ;
printf ("CCOLAMD v%d.%d.%d\n", version [0], version [1], version [2]) ;
if ((version [0] != CCOLAMD_MAIN_VERSION) ||
(version [1] != CCOLAMD_SUB_VERSION) ||
(version [2] != CCOLAMD_SUBSUB_VERSION))
{
fprintf (stderr, "version in header does not match library\n") ;
abort ( ) ;
}

/* ====================================================================== */
/* dump the input matrix A */
/* ====================================================================== */
Expand Down
1 change: 1 addition & 0 deletions CCOLAMD/Demo/ccolamd_example.out
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
CCOLAMD v3.3.0
ccolamd 5-by-4 input matrix:
Column 0, with 3 entries:
row 0
Expand Down
15 changes: 15 additions & 0 deletions CCOLAMD/Demo/ccolamd_l_example.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,21 @@ int main (void)
int64_t row, col, pp, length ;
int ok ;

//--------------------------------------------------------------------------
// ccolamd version
//--------------------------------------------------------------------------

int version [3] ;
ccolamd_version (version) ;
printf ("CCOLAMD v%d.%d.%d\n", version [0], version [1], version [2]) ;
if ((version [0] != CCOLAMD_MAIN_VERSION) ||
(version [1] != CCOLAMD_SUB_VERSION) ||
(version [2] != CCOLAMD_SUBSUB_VERSION))
{
fprintf (stderr, "version in header does not match library\n") ;
abort ( ) ;
}

/* ====================================================================== */
/* dump the input matrix A */
/* ====================================================================== */
Expand Down
1 change: 1 addition & 0 deletions CCOLAMD/Demo/ccolamd_l_example.out
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
CCOLAMD v3.3.0
ccolamd 5-by-4 input matrix:
Column 0, with 3 entries:
row 0
Expand Down
1 change: 1 addition & 0 deletions CCOLAMD/Doc/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Dec 30, 2023: version 3.3.0

* major change to build system: by Markus Mützel
* ccolamd_version: added to return version of CCOLAMD

Sept 18, 2023: version 3.2.1

Expand Down
Loading

0 comments on commit e687e79

Please sign in to comment.