1 | /* |
---|
2 | * ----------------------------------------------------------------- |
---|
3 | * Programmer(s): Daniel Reynolds, Ashley Crawford @ SMU |
---|
4 | * ----------------------------------------------------------------- |
---|
5 | * LLNS/SMU Copyright Start |
---|
6 | * Copyright (c) 2017, Southern Methodist University and |
---|
7 | * Lawrence Livermore National Security |
---|
8 | * |
---|
9 | * This work was performed under the auspices of the U.S. Department |
---|
10 | * of Energy by Southern Methodist University and Lawrence Livermore |
---|
11 | * National Laboratory under Contract DE-AC52-07NA27344. |
---|
12 | * Produced at Southern Methodist University and the Lawrence |
---|
13 | * Livermore National Laboratory. |
---|
14 | * |
---|
15 | * All rights reserved. |
---|
16 | * For details, see the LICENSE file. |
---|
17 | * LLNS/SMU Copyright End |
---|
18 | * ----------------------------------------------------------------- |
---|
19 | * This is the header file for the dense implementation of the |
---|
20 | * SUNLINSOL module. |
---|
21 | * |
---|
22 | * Part I contains declarations specific to the dense implementation |
---|
23 | * of the supplied SUNLINSOL module. |
---|
24 | * |
---|
25 | * Part II contains the prototype for the constructor |
---|
26 | * SUNDenseLinearSolver as well as implementation-specific |
---|
27 | * prototypes for various useful matrix operations. |
---|
28 | * |
---|
29 | * Notes: |
---|
30 | * |
---|
31 | * - The definition of the generic SUNLinearSolver structure can |
---|
32 | * be found in the header file sundials_linearsolver.h. |
---|
33 | * |
---|
34 | * - The definition of the type 'realtype' can be found in the |
---|
35 | * header file sundials_types.h, and it may be changed (at the |
---|
36 | * configuration stage) according to the user's needs. |
---|
37 | * The sundials_types.h file also contains the definition |
---|
38 | * for the type 'booleantype' and 'indextype'. |
---|
39 | * |
---|
40 | * ----------------------------------------------------------------- |
---|
41 | */ |
---|
42 | |
---|
43 | #ifndef _SUNLINSOL_DENSE_H |
---|
44 | #define _SUNLINSOL_DENSE_H |
---|
45 | |
---|
46 | #include <sundials/sundials_linearsolver.h> |
---|
47 | #include <sundials/sundials_matrix.h> |
---|
48 | #include <sundials/sundials_nvector.h> |
---|
49 | #include <sundials/sundials_dense.h> |
---|
50 | #include <sunmatrix/sunmatrix_dense.h> |
---|
51 | |
---|
52 | #ifdef __cplusplus /* wrapper to enable C++ usage */ |
---|
53 | extern "C" { |
---|
54 | #endif |
---|
55 | |
---|
56 | /* |
---|
57 | * ----------------------------------------------------------------- |
---|
58 | * PART I: Dense implementation of SUNLinearSolver |
---|
59 | * |
---|
60 | * The dense implementation of the SUNLinearSolver 'content' |
---|
61 | * structure contains: |
---|
62 | * N -- size of the linear system |
---|
63 | * pivots -- index array for partial pivoting in LU factorization |
---|
64 | * last_flag -- last error return flag from internal setup/solve |
---|
65 | * ----------------------------------------------------------------- |
---|
66 | */ |
---|
67 | |
---|
68 | struct _SUNLinearSolverContent_Dense { |
---|
69 | sunindextype N; |
---|
70 | sunindextype *pivots; |
---|
71 | long int last_flag; |
---|
72 | }; |
---|
73 | |
---|
74 | typedef struct _SUNLinearSolverContent_Dense *SUNLinearSolverContent_Dense; |
---|
75 | |
---|
76 | /* |
---|
77 | * ----------------------------------------------------------------- |
---|
78 | * PART II: functions exported by sunlinsol_dense |
---|
79 | * |
---|
80 | * CONSTRUCTORS: |
---|
81 | * SUNDenseLinearSolver creates and allocates memory for a |
---|
82 | * dense matrix solver |
---|
83 | * ----------------------------------------------------------------- |
---|
84 | */ |
---|
85 | |
---|
86 | SUNDIALS_EXPORT SUNLinearSolver SUNDenseLinearSolver(N_Vector y, |
---|
87 | SUNMatrix A); |
---|
88 | |
---|
89 | /* |
---|
90 | * ----------------------------------------------------------------- |
---|
91 | * dense implementations of various useful linear solver operations |
---|
92 | * ----------------------------------------------------------------- |
---|
93 | */ |
---|
94 | |
---|
95 | SUNDIALS_EXPORT SUNLinearSolver_Type SUNLinSolGetType_Dense(SUNLinearSolver S); |
---|
96 | SUNDIALS_EXPORT int SUNLinSolInitialize_Dense(SUNLinearSolver S); |
---|
97 | SUNDIALS_EXPORT int SUNLinSolSetup_Dense(SUNLinearSolver S, SUNMatrix A); |
---|
98 | SUNDIALS_EXPORT int SUNLinSolSolve_Dense(SUNLinearSolver S, SUNMatrix A, |
---|
99 | N_Vector x, N_Vector b, realtype tol); |
---|
100 | SUNDIALS_EXPORT long int SUNLinSolLastFlag_Dense(SUNLinearSolver S); |
---|
101 | SUNDIALS_EXPORT int SUNLinSolSpace_Dense(SUNLinearSolver S, |
---|
102 | long int *lenrwLS, |
---|
103 | long int *leniwLS); |
---|
104 | SUNDIALS_EXPORT int SUNLinSolFree_Dense(SUNLinearSolver S); |
---|
105 | |
---|
106 | #ifdef __cplusplus |
---|
107 | } |
---|
108 | #endif |
---|
109 | |
---|
110 | #endif |
---|
111 | |
---|