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 {STAN_SUNDIALS_PRINTF("In " DECL ": " MSG); assert(0); RETURNNULL; }
179
180
181 #include <stdio.h>
182 #if defined(_MSC_VER) || defined(__BORLANDC__) || defined(_WATCOM)
183 # ifndef snprintf
184 # define snprintf _snprintf
185 # endif
186 #endif
187
188
189 /* Support for the `contract` feature.
190 *
191 * Note that RETURNNULL is first because it's inserted via a 'Replaceall' in
192 * the fortran.cxx file.
193 */
194 #define SWIG_contract_assert(RETURNNULL, EXPR, MSG) \
195 if (!(EXPR)) { SWIG_exception_impl("$decl", SWIG_ValueError, MSG, RETURNNULL); }
196
197
198 #define SWIGVERSION 0x040000
199 #define SWIG_VERSION SWIGVERSION
200
201
202 #define SWIG_as_voidptr(a) (void *)((const void *)(a))
203 #define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),(void**)(a))
204
205
206 #include "sundials/sundials_linearsolver.h"
207
208
209 #include "sunlinsol/sunlinsol_pcg.h"
210
_wrap_FSUNLinSol_PCG(N_Vector farg1,int const * farg2,int const * farg3)211 SWIGEXPORT SUNLinearSolver _wrap_FSUNLinSol_PCG(N_Vector farg1, int const *farg2, int const *farg3) {
212 SUNLinearSolver fresult ;
213 N_Vector arg1 = (N_Vector) 0 ;
214 int arg2 ;
215 int arg3 ;
216 SUNLinearSolver result;
217
218 arg1 = (N_Vector)(farg1);
219 arg2 = (int)(*farg2);
220 arg3 = (int)(*farg3);
221 result = (SUNLinearSolver)SUNLinSol_PCG(arg1,arg2,arg3);
222 fresult = result;
223 return fresult;
224 }
225
226
_wrap_FSUNLinSol_PCGSetPrecType(SUNLinearSolver farg1,int const * farg2)227 SWIGEXPORT int _wrap_FSUNLinSol_PCGSetPrecType(SUNLinearSolver farg1, int const *farg2) {
228 int fresult ;
229 SUNLinearSolver arg1 = (SUNLinearSolver) 0 ;
230 int arg2 ;
231 int result;
232
233 arg1 = (SUNLinearSolver)(farg1);
234 arg2 = (int)(*farg2);
235 result = (int)SUNLinSol_PCGSetPrecType(arg1,arg2);
236 fresult = (int)(result);
237 return fresult;
238 }
239
240
_wrap_FSUNLinSol_PCGSetMaxl(SUNLinearSolver farg1,int const * farg2)241 SWIGEXPORT int _wrap_FSUNLinSol_PCGSetMaxl(SUNLinearSolver farg1, int const *farg2) {
242 int fresult ;
243 SUNLinearSolver arg1 = (SUNLinearSolver) 0 ;
244 int arg2 ;
245 int result;
246
247 arg1 = (SUNLinearSolver)(farg1);
248 arg2 = (int)(*farg2);
249 result = (int)SUNLinSol_PCGSetMaxl(arg1,arg2);
250 fresult = (int)(result);
251 return fresult;
252 }
253
254
_wrap_FSUNPCG(N_Vector farg1,int const * farg2,int const * farg3)255 SWIGEXPORT SUNLinearSolver _wrap_FSUNPCG(N_Vector farg1, int const *farg2, int const *farg3) {
256 SUNLinearSolver fresult ;
257 N_Vector arg1 = (N_Vector) 0 ;
258 int arg2 ;
259 int arg3 ;
260 SUNLinearSolver result;
261
262 arg1 = (N_Vector)(farg1);
263 arg2 = (int)(*farg2);
264 arg3 = (int)(*farg3);
265 result = (SUNLinearSolver)SUNPCG(arg1,arg2,arg3);
266 fresult = result;
267 return fresult;
268 }
269
270
_wrap_FSUNPCGSetPrecType(SUNLinearSolver farg1,int const * farg2)271 SWIGEXPORT int _wrap_FSUNPCGSetPrecType(SUNLinearSolver farg1, int const *farg2) {
272 int fresult ;
273 SUNLinearSolver arg1 = (SUNLinearSolver) 0 ;
274 int arg2 ;
275 int result;
276
277 arg1 = (SUNLinearSolver)(farg1);
278 arg2 = (int)(*farg2);
279 result = (int)SUNPCGSetPrecType(arg1,arg2);
280 fresult = (int)(result);
281 return fresult;
282 }
283
284
_wrap_FSUNPCGSetMaxl(SUNLinearSolver farg1,int const * farg2)285 SWIGEXPORT int _wrap_FSUNPCGSetMaxl(SUNLinearSolver farg1, int const *farg2) {
286 int fresult ;
287 SUNLinearSolver arg1 = (SUNLinearSolver) 0 ;
288 int arg2 ;
289 int result;
290
291 arg1 = (SUNLinearSolver)(farg1);
292 arg2 = (int)(*farg2);
293 result = (int)SUNPCGSetMaxl(arg1,arg2);
294 fresult = (int)(result);
295 return fresult;
296 }
297
298
_wrap_FSUNLinSolGetType_PCG(SUNLinearSolver farg1)299 SWIGEXPORT int _wrap_FSUNLinSolGetType_PCG(SUNLinearSolver farg1) {
300 int fresult ;
301 SUNLinearSolver arg1 = (SUNLinearSolver) 0 ;
302 SUNLinearSolver_Type result;
303
304 arg1 = (SUNLinearSolver)(farg1);
305 result = (SUNLinearSolver_Type)SUNLinSolGetType_PCG(arg1);
306 fresult = (int)(result);
307 return fresult;
308 }
309
310
_wrap_FSUNLinSolGetID_PCG(SUNLinearSolver farg1)311 SWIGEXPORT int _wrap_FSUNLinSolGetID_PCG(SUNLinearSolver farg1) {
312 int fresult ;
313 SUNLinearSolver arg1 = (SUNLinearSolver) 0 ;
314 SUNLinearSolver_ID result;
315
316 arg1 = (SUNLinearSolver)(farg1);
317 result = (SUNLinearSolver_ID)SUNLinSolGetID_PCG(arg1);
318 fresult = (int)(result);
319 return fresult;
320 }
321
322
_wrap_FSUNLinSolInitialize_PCG(SUNLinearSolver farg1)323 SWIGEXPORT int _wrap_FSUNLinSolInitialize_PCG(SUNLinearSolver farg1) {
324 int fresult ;
325 SUNLinearSolver arg1 = (SUNLinearSolver) 0 ;
326 int result;
327
328 arg1 = (SUNLinearSolver)(farg1);
329 result = (int)SUNLinSolInitialize_PCG(arg1);
330 fresult = (int)(result);
331 return fresult;
332 }
333
334
_wrap_FSUNLinSolSetATimes_PCG(SUNLinearSolver farg1,void * farg2,ATimesFn farg3)335 SWIGEXPORT int _wrap_FSUNLinSolSetATimes_PCG(SUNLinearSolver farg1, void *farg2, ATimesFn farg3) {
336 int fresult ;
337 SUNLinearSolver arg1 = (SUNLinearSolver) 0 ;
338 void *arg2 = (void *) 0 ;
339 ATimesFn arg3 = (ATimesFn) 0 ;
340 int result;
341
342 arg1 = (SUNLinearSolver)(farg1);
343 arg2 = (void *)(farg2);
344 arg3 = (ATimesFn)(farg3);
345 result = (int)SUNLinSolSetATimes_PCG(arg1,arg2,arg3);
346 fresult = (int)(result);
347 return fresult;
348 }
349
350
_wrap_FSUNLinSolSetPreconditioner_PCG(SUNLinearSolver farg1,void * farg2,PSetupFn farg3,PSolveFn farg4)351 SWIGEXPORT int _wrap_FSUNLinSolSetPreconditioner_PCG(SUNLinearSolver farg1, void *farg2, PSetupFn farg3, PSolveFn farg4) {
352 int fresult ;
353 SUNLinearSolver arg1 = (SUNLinearSolver) 0 ;
354 void *arg2 = (void *) 0 ;
355 PSetupFn arg3 = (PSetupFn) 0 ;
356 PSolveFn arg4 = (PSolveFn) 0 ;
357 int result;
358
359 arg1 = (SUNLinearSolver)(farg1);
360 arg2 = (void *)(farg2);
361 arg3 = (PSetupFn)(farg3);
362 arg4 = (PSolveFn)(farg4);
363 result = (int)SUNLinSolSetPreconditioner_PCG(arg1,arg2,arg3,arg4);
364 fresult = (int)(result);
365 return fresult;
366 }
367
368
_wrap_FSUNLinSolSetScalingVectors_PCG(SUNLinearSolver farg1,N_Vector farg2,N_Vector farg3)369 SWIGEXPORT int _wrap_FSUNLinSolSetScalingVectors_PCG(SUNLinearSolver farg1, N_Vector farg2, N_Vector farg3) {
370 int fresult ;
371 SUNLinearSolver arg1 = (SUNLinearSolver) 0 ;
372 N_Vector arg2 = (N_Vector) 0 ;
373 N_Vector arg3 = (N_Vector) 0 ;
374 int result;
375
376 arg1 = (SUNLinearSolver)(farg1);
377 arg2 = (N_Vector)(farg2);
378 arg3 = (N_Vector)(farg3);
379 result = (int)SUNLinSolSetScalingVectors_PCG(arg1,arg2,arg3);
380 fresult = (int)(result);
381 return fresult;
382 }
383
384
_wrap_FSUNLinSolSetup_PCG(SUNLinearSolver farg1,SUNMatrix farg2)385 SWIGEXPORT int _wrap_FSUNLinSolSetup_PCG(SUNLinearSolver farg1, SUNMatrix farg2) {
386 int fresult ;
387 SUNLinearSolver arg1 = (SUNLinearSolver) 0 ;
388 SUNMatrix arg2 = (SUNMatrix) 0 ;
389 int result;
390
391 arg1 = (SUNLinearSolver)(farg1);
392 arg2 = (SUNMatrix)(farg2);
393 result = (int)SUNLinSolSetup_PCG(arg1,arg2);
394 fresult = (int)(result);
395 return fresult;
396 }
397
398
_wrap_FSUNLinSolSolve_PCG(SUNLinearSolver farg1,SUNMatrix farg2,N_Vector farg3,N_Vector farg4,double const * farg5)399 SWIGEXPORT int _wrap_FSUNLinSolSolve_PCG(SUNLinearSolver farg1, SUNMatrix farg2, N_Vector farg3, N_Vector farg4, double const *farg5) {
400 int fresult ;
401 SUNLinearSolver arg1 = (SUNLinearSolver) 0 ;
402 SUNMatrix arg2 = (SUNMatrix) 0 ;
403 N_Vector arg3 = (N_Vector) 0 ;
404 N_Vector arg4 = (N_Vector) 0 ;
405 realtype arg5 ;
406 int result;
407
408 arg1 = (SUNLinearSolver)(farg1);
409 arg2 = (SUNMatrix)(farg2);
410 arg3 = (N_Vector)(farg3);
411 arg4 = (N_Vector)(farg4);
412 arg5 = (realtype)(*farg5);
413 result = (int)SUNLinSolSolve_PCG(arg1,arg2,arg3,arg4,arg5);
414 fresult = (int)(result);
415 return fresult;
416 }
417
418
_wrap_FSUNLinSolNumIters_PCG(SUNLinearSolver farg1)419 SWIGEXPORT int _wrap_FSUNLinSolNumIters_PCG(SUNLinearSolver farg1) {
420 int fresult ;
421 SUNLinearSolver arg1 = (SUNLinearSolver) 0 ;
422 int result;
423
424 arg1 = (SUNLinearSolver)(farg1);
425 result = (int)SUNLinSolNumIters_PCG(arg1);
426 fresult = (int)(result);
427 return fresult;
428 }
429
430
_wrap_FSUNLinSolResNorm_PCG(SUNLinearSolver farg1)431 SWIGEXPORT double _wrap_FSUNLinSolResNorm_PCG(SUNLinearSolver farg1) {
432 double fresult ;
433 SUNLinearSolver arg1 = (SUNLinearSolver) 0 ;
434 realtype result;
435
436 arg1 = (SUNLinearSolver)(farg1);
437 result = (realtype)SUNLinSolResNorm_PCG(arg1);
438 fresult = (realtype)(result);
439 return fresult;
440 }
441
442
_wrap_FSUNLinSolResid_PCG(SUNLinearSolver farg1)443 SWIGEXPORT N_Vector _wrap_FSUNLinSolResid_PCG(SUNLinearSolver farg1) {
444 N_Vector fresult ;
445 SUNLinearSolver arg1 = (SUNLinearSolver) 0 ;
446 N_Vector result;
447
448 arg1 = (SUNLinearSolver)(farg1);
449 result = (N_Vector)SUNLinSolResid_PCG(arg1);
450 fresult = result;
451 return fresult;
452 }
453
454
_wrap_FSUNLinSolLastFlag_PCG(SUNLinearSolver farg1)455 SWIGEXPORT int64_t _wrap_FSUNLinSolLastFlag_PCG(SUNLinearSolver farg1) {
456 int64_t fresult ;
457 SUNLinearSolver arg1 = (SUNLinearSolver) 0 ;
458 sunindextype result;
459
460 arg1 = (SUNLinearSolver)(farg1);
461 result = SUNLinSolLastFlag_PCG(arg1);
462 fresult = (sunindextype)(result);
463 return fresult;
464 }
465
466
_wrap_FSUNLinSolSpace_PCG(SUNLinearSolver farg1,long * farg2,long * farg3)467 SWIGEXPORT int _wrap_FSUNLinSolSpace_PCG(SUNLinearSolver farg1, long *farg2, long *farg3) {
468 int fresult ;
469 SUNLinearSolver arg1 = (SUNLinearSolver) 0 ;
470 long *arg2 = (long *) 0 ;
471 long *arg3 = (long *) 0 ;
472 int result;
473
474 arg1 = (SUNLinearSolver)(farg1);
475 arg2 = (long *)(farg2);
476 arg3 = (long *)(farg3);
477 result = (int)SUNLinSolSpace_PCG(arg1,arg2,arg3);
478 fresult = (int)(result);
479 return fresult;
480 }
481
482
_wrap_FSUNLinSolFree_PCG(SUNLinearSolver farg1)483 SWIGEXPORT int _wrap_FSUNLinSolFree_PCG(SUNLinearSolver farg1) {
484 int fresult ;
485 SUNLinearSolver arg1 = (SUNLinearSolver) 0 ;
486 int result;
487
488 arg1 = (SUNLinearSolver)(farg1);
489 result = (int)SUNLinSolFree_PCG(arg1);
490 fresult = (int)(result);
491 return fresult;
492 }
493
494
_wrap_FSUNLinSolSetInfoFile_PCG(SUNLinearSolver farg1,void * farg2)495 SWIGEXPORT int _wrap_FSUNLinSolSetInfoFile_PCG(SUNLinearSolver farg1, void *farg2) {
496 int fresult ;
497 SUNLinearSolver arg1 = (SUNLinearSolver) 0 ;
498 FILE *arg2 = (FILE *) 0 ;
499 int result;
500
501 arg1 = (SUNLinearSolver)(farg1);
502 arg2 = (FILE *)(farg2);
503 result = (int)SUNLinSolSetInfoFile_PCG(arg1,arg2);
504 fresult = (int)(result);
505 return fresult;
506 }
507
508
_wrap_FSUNLinSolSetPrintLevel_PCG(SUNLinearSolver farg1,int const * farg2)509 SWIGEXPORT int _wrap_FSUNLinSolSetPrintLevel_PCG(SUNLinearSolver farg1, int const *farg2) {
510 int fresult ;
511 SUNLinearSolver arg1 = (SUNLinearSolver) 0 ;
512 int arg2 ;
513 int result;
514
515 arg1 = (SUNLinearSolver)(farg1);
516 arg2 = (int)(*farg2);
517 result = (int)SUNLinSolSetPrintLevel_PCG(arg1,arg2);
518 fresult = (int)(result);
519 return fresult;
520 }
521
522
523
524