1! This file was automatically generated by SWIG (http://www.swig.org). 2! Version 4.0.0 3! 4! Do not make changes to this file unless you know what you are doing--modify 5! the SWIG interface file instead. 6module fsundials_matrix_mod 7 use, intrinsic :: ISO_C_BINDING 8 use fsundials_types_mod 9 use fsundials_nvector_mod 10 use fsundials_types_mod 11 implicit none 12 private 13 14 ! DECLARATION CONSTRUCTS 15 ! typedef enum SUNMatrix_ID 16 enum, bind(c) 17 enumerator :: SUNMATRIX_DENSE 18 enumerator :: SUNMATRIX_BAND 19 enumerator :: SUNMATRIX_SPARSE 20 enumerator :: SUNMATRIX_SLUNRLOC 21 enumerator :: SUNMATRIX_CUSPARSE 22 enumerator :: SUNMATRIX_CUSTOM 23 end enum 24 integer, parameter, public :: SUNMatrix_ID = kind(SUNMATRIX_DENSE) 25 public :: SUNMATRIX_DENSE, SUNMATRIX_BAND, SUNMATRIX_SPARSE, SUNMATRIX_SLUNRLOC, SUNMATRIX_CUSPARSE, SUNMATRIX_CUSTOM 26 ! struct struct _generic_SUNMatrix_Ops 27 type, bind(C), public :: SUNMatrix_Ops 28 type(C_FUNPTR), public :: getid 29 type(C_FUNPTR), public :: clone 30 type(C_FUNPTR), public :: destroy 31 type(C_FUNPTR), public :: zero 32 type(C_FUNPTR), public :: copy 33 type(C_FUNPTR), public :: scaleadd 34 type(C_FUNPTR), public :: scaleaddi 35 type(C_FUNPTR), public :: matvecsetup 36 type(C_FUNPTR), public :: matvec 37 type(C_FUNPTR), public :: space 38 end type SUNMatrix_Ops 39 ! struct struct _generic_SUNMatrix 40 type, bind(C), public :: SUNMatrix 41 type(C_PTR), public :: content 42 type(C_PTR), public :: ops 43 end type SUNMatrix 44 public :: FSUNMatNewEmpty 45 public :: FSUNMatFreeEmpty 46 public :: FSUNMatCopyOps 47 public :: FSUNMatGetID 48 public :: FSUNMatClone 49 public :: FSUNMatDestroy 50 public :: FSUNMatZero 51 public :: FSUNMatCopy 52 public :: FSUNMatScaleAdd 53 public :: FSUNMatScaleAddI 54 public :: FSUNMatMatvecSetup 55 public :: FSUNMatMatvec 56 public :: FSUNMatSpace 57 integer(C_INT), parameter, public :: SUNMAT_SUCCESS = 0_C_INT 58 integer(C_INT), parameter, public :: SUNMAT_ILL_INPUT = -701_C_INT 59 integer(C_INT), parameter, public :: SUNMAT_MEM_FAIL = -702_C_INT 60 integer(C_INT), parameter, public :: SUNMAT_OPERATION_FAIL = -703_C_INT 61 integer(C_INT), parameter, public :: SUNMAT_MATVEC_SETUP_REQUIRED = -704_C_INT 62 63! WRAPPER DECLARATIONS 64interface 65function swigc_FSUNMatNewEmpty() & 66bind(C, name="_wrap_FSUNMatNewEmpty") & 67result(fresult) 68use, intrinsic :: ISO_C_BINDING 69type(C_PTR) :: fresult 70end function 71 72subroutine swigc_FSUNMatFreeEmpty(farg1) & 73bind(C, name="_wrap_FSUNMatFreeEmpty") 74use, intrinsic :: ISO_C_BINDING 75type(C_PTR), value :: farg1 76end subroutine 77 78function swigc_FSUNMatCopyOps(farg1, farg2) & 79bind(C, name="_wrap_FSUNMatCopyOps") & 80result(fresult) 81use, intrinsic :: ISO_C_BINDING 82type(C_PTR), value :: farg1 83type(C_PTR), value :: farg2 84integer(C_INT) :: fresult 85end function 86 87function swigc_FSUNMatGetID(farg1) & 88bind(C, name="_wrap_FSUNMatGetID") & 89result(fresult) 90use, intrinsic :: ISO_C_BINDING 91type(C_PTR), value :: farg1 92integer(C_INT) :: fresult 93end function 94 95function swigc_FSUNMatClone(farg1) & 96bind(C, name="_wrap_FSUNMatClone") & 97result(fresult) 98use, intrinsic :: ISO_C_BINDING 99type(C_PTR), value :: farg1 100type(C_PTR) :: fresult 101end function 102 103subroutine swigc_FSUNMatDestroy(farg1) & 104bind(C, name="_wrap_FSUNMatDestroy") 105use, intrinsic :: ISO_C_BINDING 106type(C_PTR), value :: farg1 107end subroutine 108 109function swigc_FSUNMatZero(farg1) & 110bind(C, name="_wrap_FSUNMatZero") & 111result(fresult) 112use, intrinsic :: ISO_C_BINDING 113type(C_PTR), value :: farg1 114integer(C_INT) :: fresult 115end function 116 117function swigc_FSUNMatCopy(farg1, farg2) & 118bind(C, name="_wrap_FSUNMatCopy") & 119result(fresult) 120use, intrinsic :: ISO_C_BINDING 121type(C_PTR), value :: farg1 122type(C_PTR), value :: farg2 123integer(C_INT) :: fresult 124end function 125 126function swigc_FSUNMatScaleAdd(farg1, farg2, farg3) & 127bind(C, name="_wrap_FSUNMatScaleAdd") & 128result(fresult) 129use, intrinsic :: ISO_C_BINDING 130real(C_DOUBLE), intent(in) :: farg1 131type(C_PTR), value :: farg2 132type(C_PTR), value :: farg3 133integer(C_INT) :: fresult 134end function 135 136function swigc_FSUNMatScaleAddI(farg1, farg2) & 137bind(C, name="_wrap_FSUNMatScaleAddI") & 138result(fresult) 139use, intrinsic :: ISO_C_BINDING 140real(C_DOUBLE), intent(in) :: farg1 141type(C_PTR), value :: farg2 142integer(C_INT) :: fresult 143end function 144 145function swigc_FSUNMatMatvecSetup(farg1) & 146bind(C, name="_wrap_FSUNMatMatvecSetup") & 147result(fresult) 148use, intrinsic :: ISO_C_BINDING 149type(C_PTR), value :: farg1 150integer(C_INT) :: fresult 151end function 152 153function swigc_FSUNMatMatvec(farg1, farg2, farg3) & 154bind(C, name="_wrap_FSUNMatMatvec") & 155result(fresult) 156use, intrinsic :: ISO_C_BINDING 157type(C_PTR), value :: farg1 158type(C_PTR), value :: farg2 159type(C_PTR), value :: farg3 160integer(C_INT) :: fresult 161end function 162 163function swigc_FSUNMatSpace(farg1, farg2, farg3) & 164bind(C, name="_wrap_FSUNMatSpace") & 165result(fresult) 166use, intrinsic :: ISO_C_BINDING 167type(C_PTR), value :: farg1 168type(C_PTR), value :: farg2 169type(C_PTR), value :: farg3 170integer(C_INT) :: fresult 171end function 172 173end interface 174 175 176contains 177 ! MODULE SUBPROGRAMS 178function FSUNMatNewEmpty() & 179result(swig_result) 180use, intrinsic :: ISO_C_BINDING 181type(SUNMatrix), pointer :: swig_result 182type(C_PTR) :: fresult 183 184fresult = swigc_FSUNMatNewEmpty() 185call c_f_pointer(fresult, swig_result) 186end function 187 188subroutine FSUNMatFreeEmpty(a) 189use, intrinsic :: ISO_C_BINDING 190type(SUNMatrix), target, intent(inout) :: a 191type(C_PTR) :: farg1 192 193farg1 = c_loc(a) 194call swigc_FSUNMatFreeEmpty(farg1) 195end subroutine 196 197function FSUNMatCopyOps(a, b) & 198result(swig_result) 199use, intrinsic :: ISO_C_BINDING 200integer(C_INT) :: swig_result 201type(SUNMatrix), target, intent(inout) :: a 202type(SUNMatrix), target, intent(inout) :: b 203integer(C_INT) :: fresult 204type(C_PTR) :: farg1 205type(C_PTR) :: farg2 206 207farg1 = c_loc(a) 208farg2 = c_loc(b) 209fresult = swigc_FSUNMatCopyOps(farg1, farg2) 210swig_result = fresult 211end function 212 213function FSUNMatGetID(a) & 214result(swig_result) 215use, intrinsic :: ISO_C_BINDING 216integer(SUNMatrix_ID) :: swig_result 217type(SUNMatrix), target, intent(inout) :: a 218integer(C_INT) :: fresult 219type(C_PTR) :: farg1 220 221farg1 = c_loc(a) 222fresult = swigc_FSUNMatGetID(farg1) 223swig_result = fresult 224end function 225 226function FSUNMatClone(a) & 227result(swig_result) 228use, intrinsic :: ISO_C_BINDING 229type(SUNMatrix), pointer :: swig_result 230type(SUNMatrix), target, intent(inout) :: a 231type(C_PTR) :: fresult 232type(C_PTR) :: farg1 233 234farg1 = c_loc(a) 235fresult = swigc_FSUNMatClone(farg1) 236call c_f_pointer(fresult, swig_result) 237end function 238 239subroutine FSUNMatDestroy(a) 240use, intrinsic :: ISO_C_BINDING 241type(SUNMatrix), target, intent(inout) :: a 242type(C_PTR) :: farg1 243 244farg1 = c_loc(a) 245call swigc_FSUNMatDestroy(farg1) 246end subroutine 247 248function FSUNMatZero(a) & 249result(swig_result) 250use, intrinsic :: ISO_C_BINDING 251integer(C_INT) :: swig_result 252type(SUNMatrix), target, intent(inout) :: a 253integer(C_INT) :: fresult 254type(C_PTR) :: farg1 255 256farg1 = c_loc(a) 257fresult = swigc_FSUNMatZero(farg1) 258swig_result = fresult 259end function 260 261function FSUNMatCopy(a, b) & 262result(swig_result) 263use, intrinsic :: ISO_C_BINDING 264integer(C_INT) :: swig_result 265type(SUNMatrix), target, intent(inout) :: a 266type(SUNMatrix), target, intent(inout) :: b 267integer(C_INT) :: fresult 268type(C_PTR) :: farg1 269type(C_PTR) :: farg2 270 271farg1 = c_loc(a) 272farg2 = c_loc(b) 273fresult = swigc_FSUNMatCopy(farg1, farg2) 274swig_result = fresult 275end function 276 277function FSUNMatScaleAdd(c, a, b) & 278result(swig_result) 279use, intrinsic :: ISO_C_BINDING 280integer(C_INT) :: swig_result 281real(C_DOUBLE), intent(in) :: c 282type(SUNMatrix), target, intent(inout) :: a 283type(SUNMatrix), target, intent(inout) :: b 284integer(C_INT) :: fresult 285real(C_DOUBLE) :: farg1 286type(C_PTR) :: farg2 287type(C_PTR) :: farg3 288 289farg1 = c 290farg2 = c_loc(a) 291farg3 = c_loc(b) 292fresult = swigc_FSUNMatScaleAdd(farg1, farg2, farg3) 293swig_result = fresult 294end function 295 296function FSUNMatScaleAddI(c, a) & 297result(swig_result) 298use, intrinsic :: ISO_C_BINDING 299integer(C_INT) :: swig_result 300real(C_DOUBLE), intent(in) :: c 301type(SUNMatrix), target, intent(inout) :: a 302integer(C_INT) :: fresult 303real(C_DOUBLE) :: farg1 304type(C_PTR) :: farg2 305 306farg1 = c 307farg2 = c_loc(a) 308fresult = swigc_FSUNMatScaleAddI(farg1, farg2) 309swig_result = fresult 310end function 311 312function FSUNMatMatvecSetup(a) & 313result(swig_result) 314use, intrinsic :: ISO_C_BINDING 315integer(C_INT) :: swig_result 316type(SUNMatrix), target, intent(inout) :: a 317integer(C_INT) :: fresult 318type(C_PTR) :: farg1 319 320farg1 = c_loc(a) 321fresult = swigc_FSUNMatMatvecSetup(farg1) 322swig_result = fresult 323end function 324 325function FSUNMatMatvec(a, x, y) & 326result(swig_result) 327use, intrinsic :: ISO_C_BINDING 328integer(C_INT) :: swig_result 329type(SUNMatrix), target, intent(inout) :: a 330type(N_Vector), target, intent(inout) :: x 331type(N_Vector), target, intent(inout) :: y 332integer(C_INT) :: fresult 333type(C_PTR) :: farg1 334type(C_PTR) :: farg2 335type(C_PTR) :: farg3 336 337farg1 = c_loc(a) 338farg2 = c_loc(x) 339farg3 = c_loc(y) 340fresult = swigc_FSUNMatMatvec(farg1, farg2, farg3) 341swig_result = fresult 342end function 343 344function FSUNMatSpace(a, lenrw, leniw) & 345result(swig_result) 346use, intrinsic :: ISO_C_BINDING 347integer(C_INT) :: swig_result 348type(SUNMatrix), target, intent(inout) :: a 349integer(C_LONG), dimension(*), target, intent(inout) :: lenrw 350integer(C_LONG), dimension(*), target, intent(inout) :: leniw 351integer(C_INT) :: fresult 352type(C_PTR) :: farg1 353type(C_PTR) :: farg2 354type(C_PTR) :: farg3 355 356farg1 = c_loc(a) 357farg2 = c_loc(lenrw(1)) 358farg3 = c_loc(leniw(1)) 359fresult = swigc_FSUNMatSpace(farg1, farg2, farg3) 360swig_result = fresult 361end function 362 363 364end module 365