1 /*
2  * -----------------------------------------------------------------
3  * Programmer(s): Daniel Reynolds, Ashley Crawford @ SMU
4  * -----------------------------------------------------------------
5  * SUNDIALS Copyright Start
6  * Copyright (c) 2002-2019, Lawrence Livermore National Security
7  * and Southern Methodist University.
8  * All rights reserved.
9  *
10  * See the top-level LICENSE and NOTICE files for details.
11  *
12  * SPDX-License-Identifier: BSD-3-Clause
13  * SUNDIALS Copyright End
14  * -----------------------------------------------------------------
15  * This is the header file for the band implementation of the
16  * SUNLINSOL module, SUNLINSOL_BAND.
17  *
18  * Note:
19  *   - The definition of the generic SUNLinearSolver structure can
20  *     be found in the header file sundials_linearsolver.h.
21  * -----------------------------------------------------------------
22  */
23 
24 #ifndef _SUNLINSOL_BAND_H
25 #define _SUNLINSOL_BAND_H
26 
27 #include <sundials/sundials_linearsolver.h>
28 #include <sundials/sundials_matrix.h>
29 #include <sundials/sundials_nvector.h>
30 #include <sundials/sundials_band.h>
31 #include <sunmatrix/sunmatrix_band.h>
32 
33 #ifdef __cplusplus  /* wrapper to enable C++ usage */
34 extern "C" {
35 #endif
36 
37 /* ---------------------------------------
38  * Band Implementation of SUNLinearSolver
39  * --------------------------------------- */
40 
41 struct _SUNLinearSolverContent_Band {
42   sunindextype  N;
43   sunindextype *pivots;
44   long int last_flag;
45 };
46 
47 typedef struct _SUNLinearSolverContent_Band *SUNLinearSolverContent_Band;
48 
49 
50 /* --------------------------------------
51  * Exported Functions for SUNLINSOL_BAND
52  * -------------------------------------- */
53 
54 SUNDIALS_EXPORT SUNLinearSolver SUNLinSol_Band(N_Vector y, SUNMatrix A);
55 
56 /* deprecated */
57 SUNDIALS_EXPORT SUNLinearSolver SUNBandLinearSolver(N_Vector y,
58                                                     SUNMatrix A);
59 
60 SUNDIALS_EXPORT SUNLinearSolver_Type SUNLinSolGetType_Band(SUNLinearSolver S);
61 SUNDIALS_EXPORT int SUNLinSolInitialize_Band(SUNLinearSolver S);
62 SUNDIALS_EXPORT int SUNLinSolSetup_Band(SUNLinearSolver S, SUNMatrix A);
63 SUNDIALS_EXPORT int SUNLinSolSolve_Band(SUNLinearSolver S, SUNMatrix A,
64                                         N_Vector x, N_Vector b, realtype tol);
65 SUNDIALS_EXPORT long int SUNLinSolLastFlag_Band(SUNLinearSolver S);
66 SUNDIALS_EXPORT int SUNLinSolSpace_Band(SUNLinearSolver S,
67                                         long int *lenrwLS,
68                                         long int *leniwLS);
69 SUNDIALS_EXPORT int SUNLinSolFree_Band(SUNLinearSolver S);
70 
71 #ifdef __cplusplus
72 }
73 #endif
74 
75 #endif
76