1 /* ----------------------------------------------------------------------------
2 * This file was automatically generated by SWIG (http://www.swig.org).
3 * Version 4.0.0
4 *
5 * This file is not intended to be easily readable and contains a number of
6 * coding conventions designed to improve portability and efficiency. Do not make
7 * changes to this file unless you know what you are doing--modify the SWIG
8 * interface file instead.
9 * ----------------------------------------------------------------------------- */
10
11 /* ---------------------------------------------------------------
12 * Programmer(s): Auto-generated by swig.
13 * ---------------------------------------------------------------
14 * SUNDIALS Copyright Start
15 * Copyright (c) 2002-2021, Lawrence Livermore National Security
16 * and Southern Methodist University.
17 * All rights reserved.
18 *
19 * See the top-level LICENSE and NOTICE files for details.
20 *
21 * SPDX-License-Identifier: BSD-3-Clause
22 * SUNDIALS Copyright End
23 * -------------------------------------------------------------*/
24
25 /* -----------------------------------------------------------------------------
26 * This section contains generic SWIG labels for method/variable
27 * declarations/attributes, and other compiler dependent labels.
28 * ----------------------------------------------------------------------------- */
29
30 /* template workaround for compilers that cannot correctly implement the C++ standard */
31 #ifndef SWIGTEMPLATEDISAMBIGUATOR
32 # if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
33 # define SWIGTEMPLATEDISAMBIGUATOR template
34 # elif defined(__HP_aCC)
35 /* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
36 /* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
37 # define SWIGTEMPLATEDISAMBIGUATOR template
38 # else
39 # define SWIGTEMPLATEDISAMBIGUATOR
40 # endif
41 #endif
42
43 /* inline attribute */
44 #ifndef SWIGINLINE
45 # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
46 # define SWIGINLINE inline
47 # else
48 # define SWIGINLINE
49 # endif
50 #endif
51
52 /* attribute recognised by some compilers to avoid 'unused' warnings */
53 #ifndef SWIGUNUSED
54 # if defined(__GNUC__)
55 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
56 # define SWIGUNUSED __attribute__ ((__unused__))
57 # else
58 # define SWIGUNUSED
59 # endif
60 # elif defined(__ICC)
61 # define SWIGUNUSED __attribute__ ((__unused__))
62 # else
63 # define SWIGUNUSED
64 # endif
65 #endif
66
67 #ifndef SWIG_MSC_UNSUPPRESS_4505
68 # if defined(_MSC_VER)
69 # pragma warning(disable : 4505) /* unreferenced local function has been removed */
70 # endif
71 #endif
72
73 #ifndef SWIGUNUSEDPARM
74 # ifdef __cplusplus
75 # define SWIGUNUSEDPARM(p)
76 # else
77 # define SWIGUNUSEDPARM(p) p SWIGUNUSED
78 # endif
79 #endif
80
81 /* internal SWIG method */
82 #ifndef SWIGINTERN
83 # define SWIGINTERN static SWIGUNUSED
84 #endif
85
86 /* internal inline SWIG method */
87 #ifndef SWIGINTERNINLINE
88 # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
89 #endif
90
91 /* qualifier for exported *const* global data variables*/
92 #ifndef SWIGEXTERN
93 # ifdef __cplusplus
94 # define SWIGEXTERN extern
95 # else
96 # define SWIGEXTERN
97 # endif
98 #endif
99
100 /* exporting methods */
101 #if defined(__GNUC__)
102 # if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
103 # ifndef GCC_HASCLASSVISIBILITY
104 # define GCC_HASCLASSVISIBILITY
105 # endif
106 # endif
107 #endif
108
109 #ifndef SWIGEXPORT
110 # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
111 # if defined(STATIC_LINKED)
112 # define SWIGEXPORT
113 # else
114 # define SWIGEXPORT __declspec(dllexport)
115 # endif
116 # else
117 # if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
118 # define SWIGEXPORT __attribute__ ((visibility("default")))
119 # else
120 # define SWIGEXPORT
121 # endif
122 # endif
123 #endif
124
125 /* calling conventions for Windows */
126 #ifndef SWIGSTDCALL
127 # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
128 # define SWIGSTDCALL __stdcall
129 # else
130 # define SWIGSTDCALL
131 # endif
132 #endif
133
134 /* Deal with Microsoft's attempt at deprecating C standard runtime functions */
135 #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
136 # define _CRT_SECURE_NO_DEPRECATE
137 #endif
138
139 /* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
140 #if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
141 # define _SCL_SECURE_NO_DEPRECATE
142 #endif
143
144 /* Deal with Apple's deprecated 'AssertMacros.h' from Carbon-framework */
145 #if defined(__APPLE__) && !defined(__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES)
146 # define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0
147 #endif
148
149 /* Intel's compiler complains if a variable which was never initialised is
150 * cast to void, which is a common idiom which we use to indicate that we
151 * are aware a variable isn't used. So we just silence that warning.
152 * See: https://github.com/swig/swig/issues/192 for more discussion.
153 */
154 #ifdef __INTEL_COMPILER
155 # pragma warning disable 592
156 #endif
157
158 /* Errors in SWIG */
159 #define SWIG_UnknownError -1
160 #define SWIG_IOError -2
161 #define SWIG_RuntimeError -3
162 #define SWIG_IndexError -4
163 #define SWIG_TypeError -5
164 #define SWIG_DivisionByZero -6
165 #define SWIG_OverflowError -7
166 #define SWIG_SyntaxError -8
167 #define SWIG_ValueError -9
168 #define SWIG_SystemError -10
169 #define SWIG_AttributeError -11
170 #define SWIG_MemoryError -12
171 #define SWIG_NullReferenceError -13
172
173
174
175
176 #include <assert.h>
177 #define SWIG_exception_impl(DECL, CODE, MSG, RETURNNULL) \
178 { printf("In " DECL ": " MSG); assert(0); RETURNNULL; }
179
180
181 enum {
182 SWIG_MEM_OWN = 0x01,
183 SWIG_MEM_RVALUE = 0x02,
184 SWIG_MEM_CONST = 0x04
185 };
186
187
188 #include <stdio.h>
189 #if defined(_MSC_VER) || defined(__BORLANDC__) || defined(_WATCOM)
190 # ifndef snprintf
191 # define snprintf _snprintf
192 # endif
193 #endif
194
195
196 /* Support for the `contract` feature.
197 *
198 * Note that RETURNNULL is first because it's inserted via a 'Replaceall' in
199 * the fortran.cxx file.
200 */
201 #define SWIG_contract_assert(RETURNNULL, EXPR, MSG) \
202 if (!(EXPR)) { SWIG_exception_impl("$decl", SWIG_ValueError, MSG, RETURNNULL); }
203
204
205 #define SWIGVERSION 0x040000
206 #define SWIG_VERSION SWIGVERSION
207
208
209 #define SWIG_as_voidptr(a) (void *)((const void *)(a))
210 #define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),(void**)(a))
211
212
213 #include "sundials/sundials_linearsolver.h"
214
215
216 #include "sunlinsol/sunlinsol_klu.h"
217
218
219 typedef struct {
220 void* cptr;
221 int cmemflags;
222 } SwigClassWrapper;
223
224
SwigClassWrapper_uninitialized()225 SWIGINTERN SwigClassWrapper SwigClassWrapper_uninitialized() {
226 SwigClassWrapper result;
227 result.cptr = NULL;
228 result.cmemflags = 0;
229 return result;
230 }
231
_wrap_FSUNLinSol_KLU(N_Vector farg1,SUNMatrix farg2)232 SWIGEXPORT SUNLinearSolver _wrap_FSUNLinSol_KLU(N_Vector farg1, SUNMatrix farg2) {
233 SUNLinearSolver fresult ;
234 N_Vector arg1 = (N_Vector) 0 ;
235 SUNMatrix arg2 = (SUNMatrix) 0 ;
236 SUNLinearSolver result;
237
238 arg1 = (N_Vector)(farg1);
239 arg2 = (SUNMatrix)(farg2);
240 result = (SUNLinearSolver)SUNLinSol_KLU(arg1,arg2);
241 fresult = result;
242 return fresult;
243 }
244
245
_wrap_FSUNLinSol_KLUReInit(SUNLinearSolver farg1,SUNMatrix farg2,int64_t const * farg3,int const * farg4)246 SWIGEXPORT int _wrap_FSUNLinSol_KLUReInit(SUNLinearSolver farg1, SUNMatrix farg2, int64_t const *farg3, int const *farg4) {
247 int fresult ;
248 SUNLinearSolver arg1 = (SUNLinearSolver) 0 ;
249 SUNMatrix arg2 = (SUNMatrix) 0 ;
250 sunindextype arg3 ;
251 int arg4 ;
252 int result;
253
254 arg1 = (SUNLinearSolver)(farg1);
255 arg2 = (SUNMatrix)(farg2);
256 arg3 = (sunindextype)(*farg3);
257 arg4 = (int)(*farg4);
258 result = (int)SUNLinSol_KLUReInit(arg1,arg2,arg3,arg4);
259 fresult = (int)(result);
260 return fresult;
261 }
262
263
_wrap_FSUNLinSol_KLUSetOrdering(SUNLinearSolver farg1,int const * farg2)264 SWIGEXPORT int _wrap_FSUNLinSol_KLUSetOrdering(SUNLinearSolver farg1, int const *farg2) {
265 int fresult ;
266 SUNLinearSolver arg1 = (SUNLinearSolver) 0 ;
267 int arg2 ;
268 int result;
269
270 arg1 = (SUNLinearSolver)(farg1);
271 arg2 = (int)(*farg2);
272 result = (int)SUNLinSol_KLUSetOrdering(arg1,arg2);
273 fresult = (int)(result);
274 return fresult;
275 }
276
277
_wrap_FSUNKLU(N_Vector farg1,SUNMatrix farg2)278 SWIGEXPORT SUNLinearSolver _wrap_FSUNKLU(N_Vector farg1, SUNMatrix farg2) {
279 SUNLinearSolver fresult ;
280 N_Vector arg1 = (N_Vector) 0 ;
281 SUNMatrix arg2 = (SUNMatrix) 0 ;
282 SUNLinearSolver result;
283
284 arg1 = (N_Vector)(farg1);
285 arg2 = (SUNMatrix)(farg2);
286 result = (SUNLinearSolver)SUNKLU(arg1,arg2);
287 fresult = result;
288 return fresult;
289 }
290
291
_wrap_FSUNKLUReInit(SUNLinearSolver farg1,SUNMatrix farg2,int64_t const * farg3,int const * farg4)292 SWIGEXPORT int _wrap_FSUNKLUReInit(SUNLinearSolver farg1, SUNMatrix farg2, int64_t const *farg3, int const *farg4) {
293 int fresult ;
294 SUNLinearSolver arg1 = (SUNLinearSolver) 0 ;
295 SUNMatrix arg2 = (SUNMatrix) 0 ;
296 sunindextype arg3 ;
297 int arg4 ;
298 int result;
299
300 arg1 = (SUNLinearSolver)(farg1);
301 arg2 = (SUNMatrix)(farg2);
302 arg3 = (sunindextype)(*farg3);
303 arg4 = (int)(*farg4);
304 result = (int)SUNKLUReInit(arg1,arg2,arg3,arg4);
305 fresult = (int)(result);
306 return fresult;
307 }
308
309
_wrap_FSUNKLUSetOrdering(SUNLinearSolver farg1,int const * farg2)310 SWIGEXPORT int _wrap_FSUNKLUSetOrdering(SUNLinearSolver farg1, int const *farg2) {
311 int fresult ;
312 SUNLinearSolver arg1 = (SUNLinearSolver) 0 ;
313 int arg2 ;
314 int result;
315
316 arg1 = (SUNLinearSolver)(farg1);
317 arg2 = (int)(*farg2);
318 result = (int)SUNKLUSetOrdering(arg1,arg2);
319 fresult = (int)(result);
320 return fresult;
321 }
322
323
_wrap_FSUNLinSol_KLUGetSymbolic(SUNLinearSolver farg1)324 SWIGEXPORT SwigClassWrapper _wrap_FSUNLinSol_KLUGetSymbolic(SUNLinearSolver farg1) {
325 SwigClassWrapper fresult ;
326 SUNLinearSolver arg1 = (SUNLinearSolver) 0 ;
327 klu_l_symbolic *result = 0 ;
328
329 arg1 = (SUNLinearSolver)(farg1);
330 result = (klu_l_symbolic *)SUNLinSol_KLUGetSymbolic(arg1);
331 fresult.cptr = result;
332 fresult.cmemflags = SWIG_MEM_RVALUE | (0 ? SWIG_MEM_OWN : 0);
333 return fresult;
334 }
335
336
_wrap_FSUNLinSol_KLUGetNumeric(SUNLinearSolver farg1)337 SWIGEXPORT SwigClassWrapper _wrap_FSUNLinSol_KLUGetNumeric(SUNLinearSolver farg1) {
338 SwigClassWrapper fresult ;
339 SUNLinearSolver arg1 = (SUNLinearSolver) 0 ;
340 klu_l_numeric *result = 0 ;
341
342 arg1 = (SUNLinearSolver)(farg1);
343 result = (klu_l_numeric *)SUNLinSol_KLUGetNumeric(arg1);
344 fresult.cptr = result;
345 fresult.cmemflags = SWIG_MEM_RVALUE | (0 ? SWIG_MEM_OWN : 0);
346 return fresult;
347 }
348
349
_wrap_FSUNLinSol_KLUGetCommon(SUNLinearSolver farg1)350 SWIGEXPORT SwigClassWrapper _wrap_FSUNLinSol_KLUGetCommon(SUNLinearSolver farg1) {
351 SwigClassWrapper fresult ;
352 SUNLinearSolver arg1 = (SUNLinearSolver) 0 ;
353 klu_l_common *result = 0 ;
354
355 arg1 = (SUNLinearSolver)(farg1);
356 result = (klu_l_common *)SUNLinSol_KLUGetCommon(arg1);
357 fresult.cptr = result;
358 fresult.cmemflags = SWIG_MEM_RVALUE | (0 ? SWIG_MEM_OWN : 0);
359 return fresult;
360 }
361
362
_wrap_FSUNLinSolGetType_KLU(SUNLinearSolver farg1)363 SWIGEXPORT int _wrap_FSUNLinSolGetType_KLU(SUNLinearSolver farg1) {
364 int fresult ;
365 SUNLinearSolver arg1 = (SUNLinearSolver) 0 ;
366 SUNLinearSolver_Type result;
367
368 arg1 = (SUNLinearSolver)(farg1);
369 result = (SUNLinearSolver_Type)SUNLinSolGetType_KLU(arg1);
370 fresult = (int)(result);
371 return fresult;
372 }
373
374
_wrap_FSUNLinSolGetID_KLU(SUNLinearSolver farg1)375 SWIGEXPORT int _wrap_FSUNLinSolGetID_KLU(SUNLinearSolver farg1) {
376 int fresult ;
377 SUNLinearSolver arg1 = (SUNLinearSolver) 0 ;
378 SUNLinearSolver_ID result;
379
380 arg1 = (SUNLinearSolver)(farg1);
381 result = (SUNLinearSolver_ID)SUNLinSolGetID_KLU(arg1);
382 fresult = (int)(result);
383 return fresult;
384 }
385
386
_wrap_FSUNLinSolInitialize_KLU(SUNLinearSolver farg1)387 SWIGEXPORT int _wrap_FSUNLinSolInitialize_KLU(SUNLinearSolver farg1) {
388 int fresult ;
389 SUNLinearSolver arg1 = (SUNLinearSolver) 0 ;
390 int result;
391
392 arg1 = (SUNLinearSolver)(farg1);
393 result = (int)SUNLinSolInitialize_KLU(arg1);
394 fresult = (int)(result);
395 return fresult;
396 }
397
398
_wrap_FSUNLinSolSetup_KLU(SUNLinearSolver farg1,SUNMatrix farg2)399 SWIGEXPORT int _wrap_FSUNLinSolSetup_KLU(SUNLinearSolver farg1, SUNMatrix farg2) {
400 int fresult ;
401 SUNLinearSolver arg1 = (SUNLinearSolver) 0 ;
402 SUNMatrix arg2 = (SUNMatrix) 0 ;
403 int result;
404
405 arg1 = (SUNLinearSolver)(farg1);
406 arg2 = (SUNMatrix)(farg2);
407 result = (int)SUNLinSolSetup_KLU(arg1,arg2);
408 fresult = (int)(result);
409 return fresult;
410 }
411
412
_wrap_FSUNLinSolSolve_KLU(SUNLinearSolver farg1,SUNMatrix farg2,N_Vector farg3,N_Vector farg4,double const * farg5)413 SWIGEXPORT int _wrap_FSUNLinSolSolve_KLU(SUNLinearSolver farg1, SUNMatrix farg2, N_Vector farg3, N_Vector farg4, double const *farg5) {
414 int fresult ;
415 SUNLinearSolver arg1 = (SUNLinearSolver) 0 ;
416 SUNMatrix arg2 = (SUNMatrix) 0 ;
417 N_Vector arg3 = (N_Vector) 0 ;
418 N_Vector arg4 = (N_Vector) 0 ;
419 realtype arg5 ;
420 int result;
421
422 arg1 = (SUNLinearSolver)(farg1);
423 arg2 = (SUNMatrix)(farg2);
424 arg3 = (N_Vector)(farg3);
425 arg4 = (N_Vector)(farg4);
426 arg5 = (realtype)(*farg5);
427 result = (int)SUNLinSolSolve_KLU(arg1,arg2,arg3,arg4,arg5);
428 fresult = (int)(result);
429 return fresult;
430 }
431
432
_wrap_FSUNLinSolLastFlag_KLU(SUNLinearSolver farg1)433 SWIGEXPORT int64_t _wrap_FSUNLinSolLastFlag_KLU(SUNLinearSolver farg1) {
434 int64_t fresult ;
435 SUNLinearSolver arg1 = (SUNLinearSolver) 0 ;
436 sunindextype result;
437
438 arg1 = (SUNLinearSolver)(farg1);
439 result = SUNLinSolLastFlag_KLU(arg1);
440 fresult = (sunindextype)(result);
441 return fresult;
442 }
443
444
_wrap_FSUNLinSolSpace_KLU(SUNLinearSolver farg1,long * farg2,long * farg3)445 SWIGEXPORT int _wrap_FSUNLinSolSpace_KLU(SUNLinearSolver farg1, long *farg2, long *farg3) {
446 int fresult ;
447 SUNLinearSolver arg1 = (SUNLinearSolver) 0 ;
448 long *arg2 = (long *) 0 ;
449 long *arg3 = (long *) 0 ;
450 int result;
451
452 arg1 = (SUNLinearSolver)(farg1);
453 arg2 = (long *)(farg2);
454 arg3 = (long *)(farg3);
455 result = (int)SUNLinSolSpace_KLU(arg1,arg2,arg3);
456 fresult = (int)(result);
457 return fresult;
458 }
459
460
_wrap_FSUNLinSolFree_KLU(SUNLinearSolver farg1)461 SWIGEXPORT int _wrap_FSUNLinSolFree_KLU(SUNLinearSolver farg1) {
462 int fresult ;
463 SUNLinearSolver arg1 = (SUNLinearSolver) 0 ;
464 int result;
465
466 arg1 = (SUNLinearSolver)(farg1);
467 result = (int)SUNLinSolFree_KLU(arg1);
468 fresult = (int)(result);
469 return fresult;
470 }
471
472
473
474