added LICENSE to cvode files

git-svn-id: svn://136.177.114.72/svn_GW/phreeqc3/trunk@8727 1feff8c3-07ed-0310-ac33-dd36852eb9cd
This commit is contained in:
Scott R Charlton 2014-05-08 02:23:14 +00:00
parent 8e81c17eb2
commit 48ec1a3837
15 changed files with 1143 additions and 484 deletions

View File

@ -1,19 +1,63 @@
/******************************************************************* /**************************************************************************
* * * *
* File : cvdense.c * * File : cvdense.c *
* Programmers : Scott D. Cohen, Alan C. Hindmarsh, and * * Programmers : Scott D. Cohen, Alan C. Hindmarsh, and *
* Radu Serban @ LLNL * * Radu Serban @ LLNL *
* Version of : 26 June 2002 * * Version of : 26 June 2002 *
*-----------------------------------------------------------------* *------------------------------------------------------------------------*
* Copyright (c) 2002, The Regents of the University of California * * Copyright (c) 2002, The Regents of the University of California *
* Produced at the Lawrence Livermore National Laboratory * * Produced at the Lawrence Livermore National Laboratory *
* All rights reserved * * All rights reserved *
* For details, see sundials/cvode/LICENSE * * For details, see LICENSE below *
*-----------------------------------------------------------------* *------------------------------------------------------------------------*
* This is the implementation file for the CVODE dense linear * * This is the implementation file for the CVODE dense linear *
* solver, CVDENSE. * * solver, CVDENSE. *
* * * *
*******************************************************************/ *------------------------------------------------------------------------*
* LICENSE *
*------------------------------------------------------------------------*
* Copyright (c) 2002, The Regents of the University of California. *
* Produced at the Lawrence Livermore National Laboratory. *
* Written by S.D. Cohen, A.C. Hindmarsh, R. Serban, *
* D. Shumaker, and A.G. Taylor. *
* UCRL-CODE-155951 (CVODE) *
* UCRL-CODE-155950 (CVODES) *
* UCRL-CODE-155952 (IDA) *
* UCRL-CODE-237203 (IDAS) *
* UCRL-CODE-155953 (KINSOL) *
* All rights reserved. *
* *
* This file is part of SUNDIALS. *
* *
* Redistribution and use in source and binary forms, with or without *
* modification, are permitted provided that the following conditions *
* are met: *
* *
* 1. Redistributions of source code must retain the above copyright *
* notice, this list of conditions and the disclaimer below. *
* *
* 2. Redistributions in binary form must reproduce the above copyright *
* notice, this list of conditions and the disclaimer (as noted below) *
* in the documentation and/or other materials provided with the *
* distribution. *
* *
* 3. Neither the name of the UC/LLNL nor the names of its contributors *
* may be used to endorse or promote products derived from this software *
* without specific prior written permission. *
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT *
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS *
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE *
* REGENTS OF THE UNIVERSITY OF CALIFORNIA, THE U.S. DEPARTMENT OF ENERGY *
* OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, *
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT *
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, *
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY *
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE *
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
**************************************************************************/
#include <stdio.h> #include <stdio.h>

View File

@ -1,24 +1,68 @@
#ifndef _INC_CVDENSE_H #ifndef _INC_CVDENSE_H
#define _INC_CVDENSE_H #define _INC_CVDENSE_H
/******************************************************************* /**************************************************************************
* * * *
* File : cvdense.h * * File : cvdense.h *
* Programmers : Scott D. Cohen, Alan C. Hindmarsh, and * * Programmers : Scott D. Cohen, Alan C. Hindmarsh, and *
* Radu Serban @ LLNL * * Radu Serban @ LLNL *
* Version of : 26 June 2002 * * Version of : 26 June 2002 *
*-----------------------------------------------------------------* *------------------------------------------------------------------------*
* Copyright (c) 2002, The Regents of the University of California * * Copyright (c) 2002, The Regents of the University of California *
* Produced at the Lawrence Livermore National Laboratory * * Produced at the Lawrence Livermore National Laboratory *
* All rights reserved * * All rights reserved *
* For details, see sundials/cvode/LICENSE * * For details, see LICENSE below *
*-----------------------------------------------------------------* *------------------------------------------------------------------------*
* This is the header file for the CVODE dense linear solver, * * This is the header file for the CVODE dense linear solver, *
* CVDENSE. * * CVDENSE. *
* * * *
* Note: The type integertype must be large enough to store the * * Note: The type integertype must be large enough to store the *
* value of the linear system size N. * * value of the linear system size N. *
* * * *
*******************************************************************/ *------------------------------------------------------------------------*
* LICENSE *
*------------------------------------------------------------------------*
* Copyright (c) 2002, The Regents of the University of California. *
* Produced at the Lawrence Livermore National Laboratory. *
* Written by S.D. Cohen, A.C. Hindmarsh, R. Serban, *
* D. Shumaker, and A.G. Taylor. *
* UCRL-CODE-155951 (CVODE) *
* UCRL-CODE-155950 (CVODES) *
* UCRL-CODE-155952 (IDA) *
* UCRL-CODE-237203 (IDAS) *
* UCRL-CODE-155953 (KINSOL) *
* All rights reserved. *
* *
* This file is part of SUNDIALS. *
* *
* Redistribution and use in source and binary forms, with or without *
* modification, are permitted provided that the following conditions *
* are met: *
* *
* 1. Redistributions of source code must retain the above copyright *
* notice, this list of conditions and the disclaimer below. *
* *
* 2. Redistributions in binary form must reproduce the above copyright *
* notice, this list of conditions and the disclaimer (as noted below) *
* in the documentation and/or other materials provided with the *
* distribution. *
* *
* 3. Neither the name of the UC/LLNL nor the names of its contributors *
* may be used to endorse or promote products derived from this software *
* without specific prior written permission. *
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT *
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS *
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE *
* REGENTS OF THE UNIVERSITY OF CALIFORNIA, THE U.S. DEPARTMENT OF ENERGY *
* OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, *
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT *
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, *
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY *
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE *
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
**************************************************************************/
#ifndef _cvdense_h #ifndef _cvdense_h
#define _cvdense_h #define _cvdense_h

View File

@ -1,20 +1,64 @@
/*#define DEBUG_CVODE*/ /*#define DEBUG_CVODE*/
/******************************************************************* /**************************************************************************
* * * *
* File : cvode.c * * File : cvode.c *
* Programmers : Scott D. Cohen, Alan C. Hindmarsh, Radu Serban, * * Programmers : Scott D. Cohen, Alan C. Hindmarsh, Radu Serban, *
* and Dan Shumaker @ LLNL * * and Dan Shumaker @ LLNL *
* Version of : 24 July 2002 * * Version of : 24 July 2002 *
*-----------------------------------------------------------------* *------------------------------------------------------------------------*
* Copyright (c) 2002, The Regents of the University of California * * Copyright (c) 2002, The Regents of the University of California *
* Produced at the Lawrence Livermore National Laboratory * * Produced at the Lawrence Livermore National Laboratory *
* All rights reserved * * All rights reserved *
* For details, see sundials/cvode/LICENSE * * For details, see LICENSE below *
*-----------------------------------------------------------------* *------------------------------------------------------------------------*
* This is the implementation file for the main CVODE integrator. * * This is the implementation file for the main CVODE integrator. *
* It is independent of the CVODE linear solver in use. * * It is independent of the CVODE linear solver in use. *
* * * *
*******************************************************************/ *------------------------------------------------------------------------*
* LICENSE *
*------------------------------------------------------------------------*
* Copyright (c) 2002, The Regents of the University of California. *
* Produced at the Lawrence Livermore National Laboratory. *
* Written by S.D. Cohen, A.C. Hindmarsh, R. Serban, *
* D. Shumaker, and A.G. Taylor. *
* UCRL-CODE-155951 (CVODE) *
* UCRL-CODE-155950 (CVODES) *
* UCRL-CODE-155952 (IDA) *
* UCRL-CODE-237203 (IDAS) *
* UCRL-CODE-155953 (KINSOL) *
* All rights reserved. *
* *
* This file is part of SUNDIALS. *
* *
* Redistribution and use in source and binary forms, with or without *
* modification, are permitted provided that the following conditions *
* are met: *
* *
* 1. Redistributions of source code must retain the above copyright *
* notice, this list of conditions and the disclaimer below. *
* *
* 2. Redistributions in binary form must reproduce the above copyright *
* notice, this list of conditions and the disclaimer (as noted below) *
* in the documentation and/or other materials provided with the *
* distribution. *
* *
* 3. Neither the name of the UC/LLNL nor the names of its contributors *
* may be used to endorse or promote products derived from this software *
* without specific prior written permission. *
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT *
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS *
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE *
* REGENTS OF THE UNIVERSITY OF CALIFORNIA, THE U.S. DEPARTMENT OF ENERGY *
* OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, *
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT *
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, *
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY *
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE *
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
**************************************************************************/
#include "nvector_serial.h" #include "nvector_serial.h"
#define Ith(v,i) NV_Ith_S(v,i-1) #define Ith(v,i) NV_Ith_S(v,i-1)
/************************************************************/ /************************************************************/

74
cvode.h
View File

@ -1,20 +1,64 @@
#ifndef _INC_CVODE_H #ifndef _INC_CVODE_H
#define _INC_CVODE_H #define _INC_CVODE_H
/******************************************************************* /**************************************************************************
* * * *
* File : cvode.h * * File : cvode.h *
* Programmers : Scott D. Cohen, Alan C. Hindmarsh, Radu Serban * * Programmers : Scott D. Cohen, Alan C. Hindmarsh, Radu Serban *
* and Dan Shumaker @ LLNL * * and Dan Shumaker @ LLNL *
* Version of : 26 June 2002 * * Version of : 26 June 2002 *
*-----------------------------------------------------------------* *------------------------------------------------------------------------*
* Copyright (c) 2002, The Regents of the University of California * * Copyright (c) 2002, The Regents of the University of California *
* Produced at the Lawrence Livermore National Laboratory * * Produced at the Lawrence Livermore National Laboratory *
* All rights reserved * * All rights reserved *
* For details, see sundials/cvode/LICENSE * * For details, see LICENSE below *
*-----------------------------------------------------------------* *------------------------------------------------------------------------*
* This is the interface file for the main CVODE integrator. * * This is the interface file for the main CVODE integrator. *
* * * *
*******************************************************************/ *------------------------------------------------------------------------*
* LICENSE *
*------------------------------------------------------------------------*
* Copyright (c) 2002, The Regents of the University of California. *
* Produced at the Lawrence Livermore National Laboratory. *
* Written by S.D. Cohen, A.C. Hindmarsh, R. Serban, *
* D. Shumaker, and A.G. Taylor. *
* UCRL-CODE-155951 (CVODE) *
* UCRL-CODE-155950 (CVODES) *
* UCRL-CODE-155952 (IDA) *
* UCRL-CODE-237203 (IDAS) *
* UCRL-CODE-155953 (KINSOL) *
* All rights reserved. *
* *
* This file is part of SUNDIALS. *
* *
* Redistribution and use in source and binary forms, with or without *
* modification, are permitted provided that the following conditions *
* are met: *
* *
* 1. Redistributions of source code must retain the above copyright *
* notice, this list of conditions and the disclaimer below. *
* *
* 2. Redistributions in binary form must reproduce the above copyright *
* notice, this list of conditions and the disclaimer (as noted below) *
* in the documentation and/or other materials provided with the *
* distribution. *
* *
* 3. Neither the name of the UC/LLNL nor the names of its contributors *
* may be used to endorse or promote products derived from this software *
* without specific prior written permission. *
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT *
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS *
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE *
* REGENTS OF THE UNIVERSITY OF CALIFORNIA, THE U.S. DEPARTMENT OF ENERGY *
* OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, *
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT *
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, *
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY *
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE *
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
**************************************************************************/
#ifndef _cvode_h #ifndef _cvode_h
#define _cvode_h #define _cvode_h

View File

@ -1,19 +1,63 @@
/******************************************************************* /**************************************************************************
* * * *
* File : dense.c * * File : dense.c *
* Programmers : Scott D. Cohen, Alan C. Hindmarsh, and * * Programmers : Scott D. Cohen, Alan C. Hindmarsh, and *
* Radu Serban @ LLNL * * Radu Serban @ LLNL *
* Version of : 26 June 2002 * * Version of : 26 June 2002 *
*-----------------------------------------------------------------* *------------------------------------------------------------------------*
* Copyright (c) 2002, The Regents of the University of California * * Copyright (c) 2002, The Regents of the University of California *
* Produced at the Lawrence Livermore National Laboratory * * Produced at the Lawrence Livermore National Laboratory *
* All rights reserved * * All rights reserved *
* For details, see sundials/shared/LICENSE * * For details, see LICENSE below *
*-----------------------------------------------------------------* *------------------------------------------------------------------------*
* This is the implementation file for a generic DENSE linear * * This is the implementation file for a generic DENSE linear *
* solver package. * * solver package. *
* * * *
*******************************************************************/ *------------------------------------------------------------------------*
* LICENSE *
*------------------------------------------------------------------------*
* Copyright (c) 2002, The Regents of the University of California. *
* Produced at the Lawrence Livermore National Laboratory. *
* Written by S.D. Cohen, A.C. Hindmarsh, R. Serban, *
* D. Shumaker, and A.G. Taylor. *
* UCRL-CODE-155951 (CVODE) *
* UCRL-CODE-155950 (CVODES) *
* UCRL-CODE-155952 (IDA) *
* UCRL-CODE-237203 (IDAS) *
* UCRL-CODE-155953 (KINSOL) *
* All rights reserved. *
* *
* This file is part of SUNDIALS. *
* *
* Redistribution and use in source and binary forms, with or without *
* modification, are permitted provided that the following conditions *
* are met: *
* *
* 1. Redistributions of source code must retain the above copyright *
* notice, this list of conditions and the disclaimer below. *
* *
* 2. Redistributions in binary form must reproduce the above copyright *
* notice, this list of conditions and the disclaimer (as noted below) *
* in the documentation and/or other materials provided with the *
* distribution. *
* *
* 3. Neither the name of the UC/LLNL nor the names of its contributors *
* may be used to endorse or promote products derived from this software *
* without specific prior written permission. *
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT *
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS *
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE *
* REGENTS OF THE UNIVERSITY OF CALIFORNIA, THE U.S. DEPARTMENT OF ENERGY *
* OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, *
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT *
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, *
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY *
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE *
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
**************************************************************************/
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>

118
dense.h
View File

@ -1,42 +1,86 @@
#ifndef _INC_DENSE_H #ifndef _INC_DENSE_H
#define _INC_DENSE_H #define _INC_DENSE_H
/******************************************************************* /**************************************************************************
* * * *
* File : dense.h * * File : dense.h *
* Programmers : Scott D. Cohen, Alan C. Hindmarsh, and * * Programmers : Scott D. Cohen, Alan C. Hindmarsh, and *
* Radu Serban @ LLNL * * Radu Serban @ LLNL *
* Version of : 26 June 2002 * * Version of : 26 June 2002 *
*-----------------------------------------------------------------* *------------------------------------------------------------------------*
* Copyright (c) 2002, The Regents of the University of California * * Copyright (c) 2002, The Regents of the University of California *
* Produced at the Lawrence Livermore National Laboratory * * Produced at the Lawrence Livermore National Laboratory *
* All rights reserved * * All rights reserved *
* For details, see sundials/shared/LICENSE * * For details, see LICENSE below *
*-----------------------------------------------------------------* *------------------------------------------------------------------------*
* This is the header file for a generic DENSE linear solver * * This is the header file for a generic DENSE linear solver *
* package. The routines listed in this file all use type * * package. The routines listed in this file all use type *
* DenseMat, defined below, for matrices. These routines in turn * * DenseMat, defined below, for matrices. These routines in turn *
* call routines in the smalldense.h/smalldense.c module, which * * call routines in the smalldense.h/smalldense.c module, which *
* use the type realtype** for matrices. This separation allows * * use the type realtype** for matrices. This separation allows *
* for possible modifications in which matrices of type DenseMat * * for possible modifications in which matrices of type DenseMat *
* may not be stored contiguously, while small matrices can still * * may not be stored contiguously, while small matrices can still *
* be treated with the routines in smalldense. * * be treated with the routines in smalldense. *
* * * *
* Routines that work with the type DenseMat begin with "Dense". * * Routines that work with the type DenseMat begin with "Dense". *
* The DenseAllocMat function allocates a dense matrix for use in * * The DenseAllocMat function allocates a dense matrix for use in *
* the other DenseMat routines listed in this file. Matrix * * the other DenseMat routines listed in this file. Matrix *
* storage details are given in the documentation for the type * * storage details are given in the documentation for the type *
* DenseMat. The DenseAllocPiv function allocates memory for * * DenseMat. The DenseAllocPiv function allocates memory for *
* pivot information. The storage allocated by DenseAllocMat and * * pivot information. The storage allocated by DenseAllocMat and *
* DenseAllocPiv is deallocated by the routines DenseFreeMat and * * DenseAllocPiv is deallocated by the routines DenseFreeMat and *
* DenseFreePiv, respectively. The DenseFactor and DenseBacksolve * * DenseFreePiv, respectively. The DenseFactor and DenseBacksolve *
* routines perform the actual solution of a dense linear system. * * routines perform the actual solution of a dense linear system. *
* * * *
* Routines that work with realtype** begin with "den" (except for * * Routines that work with realtype** begin with "den" (except for *
* the factor and solve routines which are called gefa and gesl, * * the factor and solve routines which are called gefa and gesl, *
* respectively). The underlying matrix storage is described in * * respectively). The underlying matrix storage is described in *
* the documentation for denalloc in smalldense.h * * the documentation for denalloc in smalldense.h *
* * * *
*******************************************************************/ *------------------------------------------------------------------------*
* LICENSE *
*------------------------------------------------------------------------*
* Copyright (c) 2002, The Regents of the University of California. *
* Produced at the Lawrence Livermore National Laboratory. *
* Written by S.D. Cohen, A.C. Hindmarsh, R. Serban, *
* D. Shumaker, and A.G. Taylor. *
* UCRL-CODE-155951 (CVODE) *
* UCRL-CODE-155950 (CVODES) *
* UCRL-CODE-155952 (IDA) *
* UCRL-CODE-237203 (IDAS) *
* UCRL-CODE-155953 (KINSOL) *
* All rights reserved. *
* *
* This file is part of SUNDIALS. *
* *
* Redistribution and use in source and binary forms, with or without *
* modification, are permitted provided that the following conditions *
* are met: *
* *
* 1. Redistributions of source code must retain the above copyright *
* notice, this list of conditions and the disclaimer below. *
* *
* 2. Redistributions in binary form must reproduce the above copyright *
* notice, this list of conditions and the disclaimer (as noted below) *
* in the documentation and/or other materials provided with the *
* distribution. *
* *
* 3. Neither the name of the UC/LLNL nor the names of its contributors *
* may be used to endorse or promote products derived from this software *
* without specific prior written permission. *
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT *
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS *
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE *
* REGENTS OF THE UNIVERSITY OF CALIFORNIA, THE U.S. DEPARTMENT OF ENERGY *
* OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, *
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT *
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, *
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY *
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE *
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
**************************************************************************/
#ifndef _dense_h #ifndef _dense_h
#define _dense_h #define _dense_h

View File

@ -1,19 +1,63 @@
/******************************************************************* /**************************************************************************
* * * *
* File : nvector.c * * File : nvector.c *
* Programmers : Radu Serban, LLNL * * Programmers : Radu Serban, LLNL *
* Version of : 26 June 2002 * * Version of : 26 June 2002 *
*-----------------------------------------------------------------* *------------------------------------------------------------------------*
* Copyright (c) 2002, The Regents of the University of California * * Copyright (c) 2002, The Regents of the University of California *
* Produced at the Lawrence Livermore National Laboratory * * Produced at the Lawrence Livermore National Laboratory *
* All rights reserved * * All rights reserved *
* For details, see sundials/shared/LICENSE * * For details, see LICENSE below *
*-----------------------------------------------------------------* *------------------------------------------------------------------------*
* This is the implementation file for a generic NVECTOR * * This is the implementation file for a generic NVECTOR *
* package. It contains the implementation of the N_Vector * * package. It contains the implementation of the N_Vector *
* kernels listed in nvector.h. * * kernels listed in nvector.h. *
* * * *
*******************************************************************/ *------------------------------------------------------------------------*
* LICENSE *
*------------------------------------------------------------------------*
* Copyright (c) 2002, The Regents of the University of California. *
* Produced at the Lawrence Livermore National Laboratory. *
* Written by S.D. Cohen, A.C. Hindmarsh, R. Serban, *
* D. Shumaker, and A.G. Taylor. *
* UCRL-CODE-155951 (CVODE) *
* UCRL-CODE-155950 (CVODES) *
* UCRL-CODE-155952 (IDA) *
* UCRL-CODE-237203 (IDAS) *
* UCRL-CODE-155953 (KINSOL) *
* All rights reserved. *
* *
* This file is part of SUNDIALS. *
* *
* Redistribution and use in source and binary forms, with or without *
* modification, are permitted provided that the following conditions *
* are met: *
* *
* 1. Redistributions of source code must retain the above copyright *
* notice, this list of conditions and the disclaimer below. *
* *
* 2. Redistributions in binary form must reproduce the above copyright *
* notice, this list of conditions and the disclaimer (as noted below) *
* in the documentation and/or other materials provided with the *
* distribution. *
* *
* 3. Neither the name of the UC/LLNL nor the names of its contributors *
* may be used to endorse or promote products derived from this software *
* without specific prior written permission. *
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT *
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS *
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE *
* REGENTS OF THE UNIVERSITY OF CALIFORNIA, THE U.S. DEPARTMENT OF ENERGY *
* OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, *
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT *
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, *
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY *
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE *
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
**************************************************************************/
#include "nvector.h" /* generic M_Env and N_Vector */ #include "nvector.h" /* generic M_Env and N_Vector */

126
nvector.h
View File

@ -1,44 +1,88 @@
/******************************************************************* /**************************************************************************
* * * *
* File : nvector.h * * File : nvector.h *
* Programmers : Radu Serban, LLNL * * Programmers : Radu Serban, LLNL *
* Version of : 26 June 2002 * * Version of : 26 June 2002 *
*-----------------------------------------------------------------* *------------------------------------------------------------------------*
* Copyright (c) 2002, The Regents of the University of California * * Copyright (c) 2002, The Regents of the University of California *
* Produced at the Lawrence Livermore National Laboratory * * Produced at the Lawrence Livermore National Laboratory *
* All rights reserved * * All rights reserved *
* For details, see sundials/shared/LICENSE * * For details, see LICENSE below *
*-----------------------------------------------------------------* *------------------------------------------------------------------------*
* This is the header file for a generic NVECTOR package. * * This is the header file for a generic NVECTOR package. *
* It defines the N_Vector and M_Env structures: * * It defines the N_Vector and M_Env structures: *
* M_Env has an implementation-dependent 'content' field * * M_Env has an implementation-dependent 'content' field *
* which contains the data needed to generate a new * * which contains the data needed to generate a new *
* nvector in that implementation and an 'ops' filed * * nvector in that implementation and an 'ops' filed *
* which is a structure listing operations acting on * * which is a structure listing operations acting on *
* such nvectors. * * such nvectors. *
* N_Vector has an implementation-dependent 'content' field * * N_Vector has an implementation-dependent 'content' field *
* which contains the description and actual data of * * which contains the description and actual data of *
* the nvector and a 'menv' field which points to the * * the nvector and a 'menv' field which points to the *
* M_Env structure used in creating the nvector. * * M_Env structure used in creating the nvector. *
* * * *
* Part I of this file contains type declarations for the * * Part I of this file contains type declarations for the *
* the following structures: _generic_M_Env, _generic_N_Vector, * * the following structures: _generic_M_Env, _generic_N_Vector, *
* and _generic_N_Vector_Ops, as well as references to pointers * * and _generic_N_Vector_Ops, as well as references to pointers *
* to such structures (M_Env and N_Vector). * * to such structures (M_Env and N_Vector). *
* * * *
* Part II of this file contains the prototypes for the vector * * Part II of this file contains the prototypes for the vector *
* kernels which operate on N_Vector. * * kernels which operate on N_Vector. *
* * * *
* A particular implementation of an NVECTOR package must then * * A particular implementation of an NVECTOR package must then *
* specify the 'content' fields of M_Env and N_Vector, define * * specify the 'content' fields of M_Env and N_Vector, define *
* the propotypes for kernel operations on those N_Vectors * * the propotypes for kernel operations on those N_Vectors *
* (NOTE: kernel routine names must be unique to that * * (NOTE: kernel routine names must be unique to that *
* implementation), and finally provide an initialization * * implementation), and finally provide an initialization *
* routine (which generates an M_Env with that particular * * routine (which generates an M_Env with that particular *
* 'content' field and links the defined vector kernel routines * * 'content' field and links the defined vector kernel routines *
* into the 'ops' field). * * into the 'ops' field). *
* * * *
*******************************************************************/ *------------------------------------------------------------------------*
* LICENSE *
*------------------------------------------------------------------------*
* Copyright (c) 2002, The Regents of the University of California. *
* Produced at the Lawrence Livermore National Laboratory. *
* Written by S.D. Cohen, A.C. Hindmarsh, R. Serban, *
* D. Shumaker, and A.G. Taylor. *
* UCRL-CODE-155951 (CVODE) *
* UCRL-CODE-155950 (CVODES) *
* UCRL-CODE-155952 (IDA) *
* UCRL-CODE-237203 (IDAS) *
* UCRL-CODE-155953 (KINSOL) *
* All rights reserved. *
* *
* This file is part of SUNDIALS. *
* *
* Redistribution and use in source and binary forms, with or without *
* modification, are permitted provided that the following conditions *
* are met: *
* *
* 1. Redistributions of source code must retain the above copyright *
* notice, this list of conditions and the disclaimer below. *
* *
* 2. Redistributions in binary form must reproduce the above copyright *
* notice, this list of conditions and the disclaimer (as noted below) *
* in the documentation and/or other materials provided with the *
* distribution. *
* *
* 3. Neither the name of the UC/LLNL nor the names of its contributors *
* may be used to endorse or promote products derived from this software *
* without specific prior written permission. *
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT *
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS *
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE *
* REGENTS OF THE UNIVERSITY OF CALIFORNIA, THE U.S. DEPARTMENT OF ENERGY *
* OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, *
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT *
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, *
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY *
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE *
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
**************************************************************************/
class Phreeqc; class Phreeqc;
#ifndef included_nvector_h #ifndef included_nvector_h

View File

@ -1,23 +1,66 @@
/******************************************************************* /**************************************************************************
* * * *
* File : nvector_serial.c * * File : nvector_serial.c *
* Programmers : Scott D. Cohen, Alan C. Hindmarsh, * * Programmers : Scott D. Cohen, Alan C. Hindmarsh, *
* Radu Serban, and Allan G. Taylor, LLNL * * Radu Serban, and Allan G. Taylor, LLNL *
* Version of : 26 June 2002 * * Version of : 26 June 2002 *
*-----------------------------------------------------------------* *------------------------------------------------------------------------*
* Copyright (c) 2002, The Regents of the University of California * * Copyright (c) 2002, The Regents of the University of California *
* Produced at the Lawrence Livermore National Laboratory * * Produced at the Lawrence Livermore National Laboratory *
* All rights reserved * * All rights reserved *
* For details, see sundials/shared/LICENSE * * For details, see LICENSE below *
*-----------------------------------------------------------------* *------------------------------------------------------------------------*
* This is the implementation file for a serial implementation * * This is the implementation file for a serial implementation *
* of the NVECTOR package. It contains the implementation of * * of the NVECTOR package. It contains the implementation of *
* the serial machine environment intialization and free * * the serial machine environment intialization and free *
* routines (and of the Fortran callable interfaces to them) * * routines (and of the Fortran callable interfaces to them) *
* and of the N_Vector kernels listed in nvector_serial.h. * * and of the N_Vector kernels listed in nvector_serial.h. *
* * * *
*******************************************************************/ *------------------------------------------------------------------------*
* LICENSE *
*------------------------------------------------------------------------*
* Copyright (c) 2002, The Regents of the University of California. *
* Produced at the Lawrence Livermore National Laboratory. *
* Written by S.D. Cohen, A.C. Hindmarsh, R. Serban, *
* D. Shumaker, and A.G. Taylor. *
* UCRL-CODE-155951 (CVODE) *
* UCRL-CODE-155950 (CVODES) *
* UCRL-CODE-155952 (IDA) *
* UCRL-CODE-237203 (IDAS) *
* UCRL-CODE-155953 (KINSOL) *
* All rights reserved. *
* *
* This file is part of SUNDIALS. *
* *
* Redistribution and use in source and binary forms, with or without *
* modification, are permitted provided that the following conditions *
* are met: *
* *
* 1. Redistributions of source code must retain the above copyright *
* notice, this list of conditions and the disclaimer below. *
* *
* 2. Redistributions in binary form must reproduce the above copyright *
* notice, this list of conditions and the disclaimer (as noted below) *
* in the documentation and/or other materials provided with the *
* distribution. *
* *
* 3. Neither the name of the UC/LLNL nor the names of its contributors *
* may be used to endorse or promote products derived from this software *
* without specific prior written permission. *
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT *
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS *
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE *
* REGENTS OF THE UNIVERSITY OF CALIFORNIA, THE U.S. DEPARTMENT OF ENERGY *
* OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, *
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT *
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, *
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY *
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE *
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
**************************************************************************/
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>

View File

@ -1,59 +1,103 @@
#ifndef _INC_NVECTOR_SERIAL_H #ifndef _INC_NVECTOR_SERIAL_H
#define _INC_NVECTOR_SERIAL_H #define _INC_NVECTOR_SERIAL_H
/******************************************************************* /**************************************************************************
* * * *
* File : nvector_serial.h * * File : nvector_serial.h *
* Programmers : Scott D. Cohen, Alan C. Hindmarsh, * * Programmers : Scott D. Cohen, Alan C. Hindmarsh, *
* : Radu Serban, and Allan G. Taylor, LLNL * * : Radu Serban, and Allan G. Taylor, LLNL *
* Version of : 26 June 2002 * * Version of : 26 June 2002 *
*-----------------------------------------------------------------* *------------------------------------------------------------------------*
* Copyright (c) 2002, The Regents of the University of California * * Copyright (c) 2002, The Regents of the University of California *
* Produced at the Lawrence Livermore National Laboratory * * Produced at the Lawrence Livermore National Laboratory *
* All rights reserved * * All rights reserved *
* For details, see sundials/shared/LICENSE * * For details, see LICENSE below *
*-----------------------------------------------------------------* *------------------------------------------------------------------------*
* This is the header file for a serial implementation of the * * This is the header file for a serial implementation of the *
* NVECTOR package. * * NVECTOR package. *
* * * *
* Part I of this file contains declarations which are specific * * Part I of this file contains declarations which are specific *
* to the particular machine environment in which this version * * to the particular machine environment in which this version *
* of the vector package is to be used. This includes the * * of the vector package is to be used. This includes the *
* typedef for the 'content' fields of the structures M_Env and * * typedef for the 'content' fields of the structures M_Env and *
* N_Vector (M_EnvSerialContent and N_VectorSerialContent, * * N_Vector (M_EnvSerialContent and N_VectorSerialContent, *
* respectively). * * respectively). *
* * * *
* Part II of this file defines accessor macros that allow the * * Part II of this file defines accessor macros that allow the *
* user to use efficiently the type N_Vector without making * * user to use efficiently the type N_Vector without making *
* explicit references to its underlying representation. * * explicit references to its underlying representation. *
* * * *
* Part III of this file contains the prototype for the * * Part III of this file contains the prototype for the *
* initialization routine specific to this implementation * * initialization routine specific to this implementation *
* (M_EnvInit_Serial) as well as prototypes for the vector * * (M_EnvInit_Serial) as well as prototypes for the vector *
* kernels which operate on the serial N_Vector. These * * kernels which operate on the serial N_Vector. These *
* prototypes are unique to this particular implementation of * * prototypes are unique to this particular implementation of *
* the vector package. * * the vector package. *
* * * *
* NOTES: * * NOTES: *
* * * *
* The definitions of the generic M_Env and N_Vector structures * * The definitions of the generic M_Env and N_Vector structures *
* are in the header file nvector.h. * * are in the header file nvector.h. *
* * * *
* The definitions of the types realtype and integertype are in * * The definitions of the types realtype and integertype are in *
* the header file sundialstypes.h and these may be changed * * the header file sundialstypes.h and these may be changed *
* according to the user's needs. The sundialstypes.h file also * * according to the user's needs. The sundialstypes.h file also *
* contains the definition for the type booleantype. * * contains the definition for the type booleantype. *
* * * *
* N_Vector arguments to arithmetic kernels need not be * * N_Vector arguments to arithmetic kernels need not be *
* distinct. Thus, for example, the call * * distinct. Thus, for example, the call *
* N_VLinearSum_Serial(a,x,b,y,y); y <- ax+by * * N_VLinearSum_Serial(a,x,b,y,y); y <- ax+by *
* is legal. * * is legal. *
* * * *
* This version of nvector is for the ordinary sequential * * This version of nvector is for the ordinary sequential *
* machine environment. In the documentation given below, N is * * machine environment. In the documentation given below, N is *
* the length of all N_Vector parameters and x[i] denotes the * * the length of all N_Vector parameters and x[i] denotes the *
* ith component of the N_Vector x, where 0 <= i <= N-1. * * ith component of the N_Vector x, where 0 <= i <= N-1. *
* * * *
*******************************************************************/ *------------------------------------------------------------------------*
* LICENSE *
*------------------------------------------------------------------------*
* Copyright (c) 2002, The Regents of the University of California. *
* Produced at the Lawrence Livermore National Laboratory. *
* Written by S.D. Cohen, A.C. Hindmarsh, R. Serban, *
* D. Shumaker, and A.G. Taylor. *
* UCRL-CODE-155951 (CVODE) *
* UCRL-CODE-155950 (CVODES) *
* UCRL-CODE-155952 (IDA) *
* UCRL-CODE-237203 (IDAS) *
* UCRL-CODE-155953 (KINSOL) *
* All rights reserved. *
* *
* This file is part of SUNDIALS. *
* *
* Redistribution and use in source and binary forms, with or without *
* modification, are permitted provided that the following conditions *
* are met: *
* *
* 1. Redistributions of source code must retain the above copyright *
* notice, this list of conditions and the disclaimer below. *
* *
* 2. Redistributions in binary form must reproduce the above copyright *
* notice, this list of conditions and the disclaimer (as noted below) *
* in the documentation and/or other materials provided with the *
* distribution. *
* *
* 3. Neither the name of the UC/LLNL nor the names of its contributors *
* may be used to endorse or promote products derived from this software *
* without specific prior written permission. *
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT *
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS *
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE *
* REGENTS OF THE UNIVERSITY OF CALIFORNIA, THE U.S. DEPARTMENT OF ENERGY *
* OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, *
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT *
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, *
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY *
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE *
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
**************************************************************************/
#ifndef included_nvector_serial_h #ifndef included_nvector_serial_h
#define included_nvector_serial_h #define included_nvector_serial_h

View File

@ -1,18 +1,62 @@
/******************************************************************* /**************************************************************************
* * * *
* File : smalldense.c * * File : smalldense.c *
* Programmers : Scott D. Cohen and Alan C. Hindmarsh @ LLNL * * Programmers : Scott D. Cohen and Alan C. Hindmarsh @ LLNL *
* Version of : 26 June 2002 * * Version of : 26 June 2002 *
*-----------------------------------------------------------------* *------------------------------------------------------------------------*
* Copyright (c) 2002, The Regents of the University of California * * Copyright (c) 2002, The Regents of the University of California *
* Produced at the Lawrence Livermore National Laboratory * * Produced at the Lawrence Livermore National Laboratory *
* All rights reserved * * All rights reserved *
* For details, see sundials/shared/LICENSE * * For details, see LICENSE below *
*-----------------------------------------------------------------* *------------------------------------------------------------------------*
* This is the implementation file for a generic DENSE linear * * This is the implementation file for a generic DENSE linear *
* solver package, intended for small dense matrices. * * solver package, intended for small dense matrices. *
* * * *
*******************************************************************/ *------------------------------------------------------------------------*
* LICENSE *
*------------------------------------------------------------------------*
* Copyright (c) 2002, The Regents of the University of California. *
* Produced at the Lawrence Livermore National Laboratory. *
* Written by S.D. Cohen, A.C. Hindmarsh, R. Serban, *
* D. Shumaker, and A.G. Taylor. *
* UCRL-CODE-155951 (CVODE) *
* UCRL-CODE-155950 (CVODES) *
* UCRL-CODE-155952 (IDA) *
* UCRL-CODE-237203 (IDAS) *
* UCRL-CODE-155953 (KINSOL) *
* All rights reserved. *
* *
* This file is part of SUNDIALS. *
* *
* Redistribution and use in source and binary forms, with or without *
* modification, are permitted provided that the following conditions *
* are met: *
* *
* 1. Redistributions of source code must retain the above copyright *
* notice, this list of conditions and the disclaimer below. *
* *
* 2. Redistributions in binary form must reproduce the above copyright *
* notice, this list of conditions and the disclaimer (as noted below) *
* in the documentation and/or other materials provided with the *
* distribution. *
* *
* 3. Neither the name of the UC/LLNL nor the names of its contributors *
* may be used to endorse or promote products derived from this software *
* without specific prior written permission. *
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT *
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS *
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE *
* REGENTS OF THE UNIVERSITY OF CALIFORNIA, THE U.S. DEPARTMENT OF ENERGY *
* OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, *
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT *
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, *
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY *
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE *
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
**************************************************************************/
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>

View File

@ -1,24 +1,68 @@
/******************************************************************* /**************************************************************************
* * * *
* File : smalldense.h * * File : smalldense.h *
* Programmers : Scott D. Cohen and Alan C. Hindmarsh @ LLNL * * Programmers : Scott D. Cohen and Alan C. Hindmarsh @ LLNL *
* Version of : 26 June 2002 * * Version of : 26 June 2002 *
*-----------------------------------------------------------------* *----------------------------------------------------------------- *
* Copyright (c) 2002, The Regents of the University of California * * Copyright (c) 2002, The Regents of the University of California *
* Produced at the Lawrence Livermore National Laboratory * * Produced at the Lawrence Livermore National Laboratory *
* All rights reserved * * All rights reserved *
* For details, see sundials/shared/LICENSE * * For details, see LICENSE below *
*-----------------------------------------------------------------* *----------------------------------------------------------------- *
* This is the header file for a generic DENSE linear solver * * This is the header file for a generic DENSE linear solver *
* package, intended for small dense matrices. These routines * * package, intended for small dense matrices. These routines *
* use the type realtype** for dense matrix arguments. * * use the type realtype** for dense matrix arguments. *
* * * *
* These routines begin with "den" (except for the factor and * * These routines begin with "den" (except for the factor and *
* solve routines which are called gefa and gesl, respectively). * * solve routines which are called gefa and gesl, respectively). *
* The underlying matrix storage is described in the * * The underlying matrix storage is described in the *
* documentation for denalloc. * * documentation for denalloc. *
* * * *
*******************************************************************/ *------------------------------------------------------------------------*
* LICENSE *
*------------------------------------------------------------------------*
* Copyright (c) 2002, The Regents of the University of California. *
* Produced at the Lawrence Livermore National Laboratory. *
* Written by S.D. Cohen, A.C. Hindmarsh, R. Serban, *
* D. Shumaker, and A.G. Taylor. *
* UCRL-CODE-155951 (CVODE) *
* UCRL-CODE-155950 (CVODES) *
* UCRL-CODE-155952 (IDA) *
* UCRL-CODE-237203 (IDAS) *
* UCRL-CODE-155953 (KINSOL) *
* All rights reserved. *
* *
* This file is part of SUNDIALS. *
* *
* Redistribution and use in source and binary forms, with or without *
* modification, are permitted provided that the following conditions *
* are met: *
* *
* 1. Redistributions of source code must retain the above copyright *
* notice, this list of conditions and the disclaimer below. *
* *
* 2. Redistributions in binary form must reproduce the above copyright *
* notice, this list of conditions and the disclaimer (as noted below) *
* in the documentation and/or other materials provided with the *
* distribution. *
* *
* 3. Neither the name of the UC/LLNL nor the names of its contributors *
* may be used to endorse or promote products derived from this software *
* without specific prior written permission. *
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT *
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS *
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE *
* REGENTS OF THE UNIVERSITY OF CALIFORNIA, THE U.S. DEPARTMENT OF ENERGY *
* OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, *
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT *
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, *
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY *
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE *
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
**************************************************************************/
#ifndef _smalldense_h #ifndef _smalldense_h
#define _smalldense_h #define _smalldense_h

View File

@ -1,17 +1,61 @@
/******************************************************************* /**************************************************************************
* * * *
* File : sundialsmath.c * * File : sundialsmath.c *
* Programmers : Scott D. Cohen and Alan C. Hindmarsh @ LLNL * * Programmers : Scott D. Cohen and Alan C. Hindmarsh @ LLNL *
* Version of : 26 June 2002 * * Version of : 26 June 2002 *
*-----------------------------------------------------------------* *------------------------------------------------------------------------*
* Copyright (c) 2002, The Regents of the University of California * * Copyright (c) 2002, The Regents of the University of California *
* Produced at the Lawrence Livermore National Laboratory * * Produced at the Lawrence Livermore National Laboratory *
* All rights reserved * * All rights reserved *
* For details, see sundials/shared/LICENSE * * For details, see LICENSE below *
*-----------------------------------------------------------------* *------------------------------------------------------------------------*
* This is the implementation file for a C math library. * * This is the implementation file for a C math library. *
* * * *
*******************************************************************/ *------------------------------------------------------------------------*
* LICENSE *
*------------------------------------------------------------------------*
* Copyright (c) 2002, The Regents of the University of California. *
* Produced at the Lawrence Livermore National Laboratory. *
* Written by S.D. Cohen, A.C. Hindmarsh, R. Serban, *
* D. Shumaker, and A.G. Taylor. *
* UCRL-CODE-155951 (CVODE) *
* UCRL-CODE-155950 (CVODES) *
* UCRL-CODE-155952 (IDA) *
* UCRL-CODE-237203 (IDAS) *
* UCRL-CODE-155953 (KINSOL) *
* All rights reserved. *
* *
* This file is part of SUNDIALS. *
* *
* Redistribution and use in source and binary forms, with or without *
* modification, are permitted provided that the following conditions *
* are met: *
* *
* 1. Redistributions of source code must retain the above copyright *
* notice, this list of conditions and the disclaimer below. *
* *
* 2. Redistributions in binary form must reproduce the above copyright *
* notice, this list of conditions and the disclaimer (as noted below) *
* in the documentation and/or other materials provided with the *
* distribution. *
* *
* 3. Neither the name of the UC/LLNL nor the names of its contributors *
* may be used to endorse or promote products derived from this software *
* without specific prior written permission. *
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT *
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS *
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE *
* REGENTS OF THE UNIVERSITY OF CALIFORNIA, THE U.S. DEPARTMENT OF ENERGY *
* OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, *
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT *
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, *
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY *
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE *
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
**************************************************************************/
#include <stdio.h> #include <stdio.h>

View File

@ -1,27 +1,71 @@
/******************************************************************* /**************************************************************************
* * * *
* File : sundialsmath.h * * File : sundialsmath.h *
* Programmers : Scott D. Cohen and Alan C. Hindmarsh @ LLNL * * Programmers : Scott D. Cohen and Alan C. Hindmarsh @ LLNL *
* Version of : 26 June 2002 * * Version of : 26 June 2002 *
*-----------------------------------------------------------------* *------------------------------------------------------------------------*
* Copyright (c) 2002, The Regents of the University of California * * Copyright (c) 2002, The Regents of the University of California *
* Produced at the Lawrence Livermore National Laboratory * * Produced at the Lawrence Livermore National Laboratory *
* All rights reserved * * All rights reserved *
* For details, see sundials/shared/LICENSE * * For details, see LICENSE below *
*-----------------------------------------------------------------* *------------------------------------------------------------------------*
* This is the header file for a C math library. The routines * * This is the header file for a C math library. The routines *
* listed here work with the type realtype as defined in * * listed here work with the type realtype as defined in *
* sundialstypes.h. * * sundialstypes.h. *
* To do single precision floating point arithmetic, set the type * * To do single precision floating point arithmetic, set the type *
* realtype to be float. To do double precision arithmetic, set * * realtype to be float. To do double precision arithmetic, set *
* the type realtype to be double. The default implementations * * the type realtype to be double. The default implementations *
* for RPowerR and RSqrt call standard math library functions * * for RPowerR and RSqrt call standard math library functions *
* which do double precision arithmetic. If this is unacceptable * * which do double precision arithmetic. If this is unacceptable *
* when realtype is float, then the user should re-implement * * when realtype is float, then the user should re-implement *
* these two routines by calling single precision routines * * these two routines by calling single precision routines *
* available on his/her machine. * * available on his/her machine. *
* * * *
*******************************************************************/ *------------------------------------------------------------------------*
* LICENSE *
*------------------------------------------------------------------------*
* Copyright (c) 2002, The Regents of the University of California. *
* Produced at the Lawrence Livermore National Laboratory. *
* Written by S.D. Cohen, A.C. Hindmarsh, R. Serban, *
* D. Shumaker, and A.G. Taylor. *
* UCRL-CODE-155951 (CVODE) *
* UCRL-CODE-155950 (CVODES) *
* UCRL-CODE-155952 (IDA) *
* UCRL-CODE-237203 (IDAS) *
* UCRL-CODE-155953 (KINSOL) *
* All rights reserved. *
* *
* This file is part of SUNDIALS. *
* *
* Redistribution and use in source and binary forms, with or without *
* modification, are permitted provided that the following conditions *
* are met: *
* *
* 1. Redistributions of source code must retain the above copyright *
* notice, this list of conditions and the disclaimer below. *
* *
* 2. Redistributions in binary form must reproduce the above copyright *
* notice, this list of conditions and the disclaimer (as noted below) *
* in the documentation and/or other materials provided with the *
* distribution. *
* *
* 3. Neither the name of the UC/LLNL nor the names of its contributors *
* may be used to endorse or promote products derived from this software *
* without specific prior written permission. *
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT *
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS *
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE *
* REGENTS OF THE UNIVERSITY OF CALIFORNIA, THE U.S. DEPARTMENT OF ENERGY *
* OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, *
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT *
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, *
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY *
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE *
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
**************************************************************************/
#ifndef _sundialsmath_h #ifndef _sundialsmath_h
#define _sundialsmath_h #define _sundialsmath_h

View File

@ -4,69 +4,113 @@
#include "phrqtype.h" #include "phrqtype.h"
#ifndef _INC_SUNDIALSTYPES_H #ifndef _INC_SUNDIALSTYPES_H
#define _INC_SUNDIALSTYPES_H #define _INC_SUNDIALSTYPES_H
/******************************************************************* /**************************************************************************
* * * *
* File : sundialstypes.h * * File : sundialstypes.h *
* Programmers : Scott D. Cohen and Alan C. Hindmarsh @ LLNL * * Programmers : Scott D. Cohen and Alan C. Hindmarsh @ LLNL *
* Version of : 26 June 2002 * * Version of : 26 June 2002 *
*-----------------------------------------------------------------* *------------------------------------------------------------------------*
* Copyright (c) 2002, The Regents of the University of California * * Copyright (c) 2002, The Regents of the University of California *
* Produced at the Lawrence Livermore National Laboratory * * Produced at the Lawrence Livermore National Laboratory *
* All rights reserved * * All rights reserved *
* For details, see sundials/shared/LICENSE * * For details, see LICENSE below *
*-----------------------------------------------------------------* *------------------------------------------------------------------------*
* This header file exports three types: realtype, integertype, * * This header file exports three types: realtype, integertype, *
* and booleantype, as well as the constants TRUE and FALSE. * * and booleantype, as well as the constants TRUE and FALSE. *
* * * *
* Users should #include "sundialstypes.h" in any file that * * Users should #include "sundialstypes.h" in any file that *
* shhould be easily modifiable to work with different real or * * shhould be easily modifiable to work with different real or *
* integer types and use the exported names realtype and * * integer types and use the exported names realtype and *
* integertype within such a file. * * integertype within such a file. *
* The types for realtype and integertype below have been set to * * The types for realtype and integertype below have been set to *
* double and long int, respectively. A user should modify these * * double and long int, respectively. A user should modify these *
* type declarations as he/she sees fit. For example, if a user * * type declarations as he/she sees fit. For example, if a user *
* wants the work with type float because double precision * * wants the work with type float because double precision *
* floating point arithmetic is too expensive on the user's * * floating point arithmetic is too expensive on the user's *
* machine, then the definition below should be changed to: * * machine, then the definition below should be changed to: *
* * * *
* typedef float realtype; * * typedef float realtype; *
* * * *
* Similarly, if a user does not need to work with extremely large * * Similarly, if a user does not need to work with extremely large *
* integers (see the system header file <limits.h> for the limits * * integers (see the system header file <limits.h> for the limits *
* on type int and long int on your machine), then the user * * on type int and long int on your machine), then the user *
* should change the definition below to: * * should change the definition below to: *
* * * *
* typedef int integertype; * * typedef int integertype; *
* * * *
* The constants SUNDIALS_FLOAT, SUNDIALS_DOUBLE, SUNDIALS_INT, * * The constants SUNDIALS_FLOAT, SUNDIALS_DOUBLE, SUNDIALS_INT, *
* SUNDIALS_LONG indicate the underlying types for realtype and * * SUNDIALS_LONG indicate the underlying types for realtype and *
* integertype. They should be set as follows: * * integertype. They should be set as follows: *
* * * *
* (1) #define SUNDIALS_FLOAT 1 * * (1) #define SUNDIALS_FLOAT 1 *
* #define SUNDIALS_DOUBLE 0 (real is float) * * #define SUNDIALS_DOUBLE 0 (real is float) *
* * * *
* (2) #define SUNDIALS_FLOAT 0 * * (2) #define SUNDIALS_FLOAT 0 *
* #define SUNDIALS_DOUBLE 1 (real is double) * * #define SUNDIALS_DOUBLE 1 (real is double) *
* * * *
* (3) #define SUNDIALS_INT 1 * * (3) #define SUNDIALS_INT 1 *
* #define SUNDIALS_LONG 0 (integer is int) * * #define SUNDIALS_LONG 0 (integer is int) *
* * * *
* (4) #define SUNDIALS_INT 0 * * (4) #define SUNDIALS_INT 0 *
* #define SUNDIALS_LONG 1 (integer is long int) * * #define SUNDIALS_LONG 1 (integer is long int) *
* * * *
* Thus the legal types for realtype are float and double, while * * Thus the legal types for realtype are float and double, while *
* the legal types for integertype are int and long int. * * the legal types for integertype are int and long int. *
* The macro RCONST gives a user a convenient way to define real * * The macro RCONST gives a user a convenient way to define real *
* constants. To use the real constant 1.0, for example, the * * constants. To use the real constant 1.0, for example, the *
* user should write * * user should write *
* * * *
* #define ONE RCONST(1.0) * * #define ONE RCONST(1.0) *
* * * *
* If realtype is double, then RCONST(1.0) expands to 1.0. * * If realtype is double, then RCONST(1.0) expands to 1.0. *
* If realtype is float, then RCONST(1.0) expands to 1.0F. * * If realtype is float, then RCONST(1.0) expands to 1.0F. *
* There is never a need to explicitly cast 1.0 to (realtype). * * There is never a need to explicitly cast 1.0 to (realtype). *
* * * *
*******************************************************************/ *------------------------------------------------------------------------*
* LICENSE *
*------------------------------------------------------------------------*
* Copyright (c) 2002, The Regents of the University of California. *
* Produced at the Lawrence Livermore National Laboratory. *
* Written by S.D. Cohen, A.C. Hindmarsh, R. Serban, *
* D. Shumaker, and A.G. Taylor. *
* UCRL-CODE-155951 (CVODE) *
* UCRL-CODE-155950 (CVODES) *
* UCRL-CODE-155952 (IDA) *
* UCRL-CODE-237203 (IDAS) *
* UCRL-CODE-155953 (KINSOL) *
* All rights reserved. *
* *
* This file is part of SUNDIALS. *
* *
* Redistribution and use in source and binary forms, with or without *
* modification, are permitted provided that the following conditions *
* are met: *
* *
* 1. Redistributions of source code must retain the above copyright *
* notice, this list of conditions and the disclaimer below. *
* *
* 2. Redistributions in binary form must reproduce the above copyright *
* notice, this list of conditions and the disclaimer (as noted below) *
* in the documentation and/or other materials provided with the *
* distribution. *
* *
* 3. Neither the name of the UC/LLNL nor the names of its contributors *
* may be used to endorse or promote products derived from this software *
* without specific prior written permission. *
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT *
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS *
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE *
* REGENTS OF THE UNIVERSITY OF CALIFORNIA, THE U.S. DEPARTMENT OF ENERGY *
* OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, *
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT *
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, *
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY *
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE *
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
**************************************************************************/
#ifndef _sundialstypes_h #ifndef _sundialstypes_h
#define _sundialstypes_h #define _sundialstypes_h