-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathformetis.f90
1201 lines (1140 loc) · 31.2 KB
/
formetis.f90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
! This file was automatically generated by SWIG (http://www.swig.org).
! Version 4.0.2+fortran
!
! Do not make changes to this file unless you know what you are doing--modify
! the SWIG interface file instead.
! Formetis project, https://github.com/swig-fortran/formetis
! Copyright (c) 2021 Oak Ridge National Laboratory, UT-Battelle, LLC.
! Distributed under an MIT open source license: see LICENSE for details.
module formetis
use, intrinsic :: ISO_C_BINDING
implicit none
private
! DECLARATION CONSTRUCTS
type, bind(C) :: SwigArrayWrapper
type(C_PTR), public :: data = C_NULL_PTR
integer(C_SIZE_T), public :: size = 0
end type
public :: get_formetis_version
integer(C_INT), public, protected, &
bind(C, name="formetis_version_major") :: formetis_version_major
integer(C_INT), public, protected, &
bind(C, name="formetis_version_minor") :: formetis_version_minor
integer(C_INT), public, protected, &
bind(C, name="formetis_version_patch") :: formetis_version_patch
integer(C_INT), parameter, public :: IDXTYPEWIDTH = 32_C_INT
integer(C_INT), parameter, public :: REALTYPEWIDTH = 32_C_INT
character(kind=C_CHAR, len=*), parameter, public :: SCREAL = "f"
character(kind=C_CHAR, len=*), parameter, public :: PRREAL = "f"
integer(C_INT), parameter, public :: VER_MAJOR = 5_C_INT
integer(C_INT), parameter, public :: VER_MINOR = 1_C_INT
integer(C_INT), parameter, public :: VER_SUBMINOR = 0_C_INT
integer(C_INT), parameter, public :: NOPTIONS = 40_C_INT
public :: PartGraphRecursive
public :: PartGraphKway
integer, parameter :: swig_cmem_own_bit = 0
integer, parameter :: swig_cmem_rvalue_bit = 1
type, bind(C) :: SwigClassWrapper
type(C_PTR), public :: cptr = C_NULL_PTR
integer(C_INT), public :: cmemflags = 0
end type
type, public :: SWIGTYPE_p_p_int32_t
type(SwigClassWrapper), public :: swigdata
end type
public :: MeshToDual
public :: MeshToNodal
public :: PartMeshNodal
public :: PartMeshDual
public :: NodeND
public :: Free
public :: SetDefaultOptions
public :: NodeNDP
public :: ComputeVertexSeparator
public :: NodeRefine
! typedef enum rstatus_et
enum, bind(c)
enumerator :: OK = 1
enumerator :: ERROR_INPUT = -2
enumerator :: ERROR_MEMORY = -3
enumerator :: ERROR = -4
end enum
integer, parameter, public :: rstatus_et = kind(OK)
public :: OK, ERROR_INPUT, ERROR_MEMORY, ERROR
! typedef enum moptype_et
enum, bind(c)
enumerator :: OP_PMETIS
enumerator :: OP_KMETIS
enumerator :: OP_OMETIS
end enum
integer, parameter, public :: moptype_et = kind(OP_PMETIS)
public :: OP_PMETIS, OP_KMETIS, OP_OMETIS
! typedef enum moptions_et
enum, bind(c)
enumerator :: OPTION_PTYPE
enumerator :: OPTION_OBJTYPE
enumerator :: OPTION_CTYPE
enumerator :: OPTION_IPTYPE
enumerator :: OPTION_RTYPE
enumerator :: OPTION_DBGLVL
enumerator :: OPTION_NITER
enumerator :: OPTION_NCUTS
enumerator :: OPTION_SEED
enumerator :: OPTION_NO2HOP
enumerator :: OPTION_MINCONN
enumerator :: OPTION_CONTIG
enumerator :: OPTION_COMPRESS
enumerator :: OPTION_CCORDER
enumerator :: OPTION_PFACTOR
enumerator :: OPTION_NSEPS
enumerator :: OPTION_UFACTOR
enumerator :: OPTION_NUMBERING
enumerator :: OPTION_HELP
enumerator :: OPTION_TPWGTS
enumerator :: OPTION_NCOMMON
enumerator :: OPTION_NOOUTPUT
enumerator :: OPTION_BALANCE
enumerator :: OPTION_GTYPE
enumerator :: OPTION_UBVEC
end enum
integer, parameter, public :: moptions_et = kind(OPTION_PTYPE)
public :: OPTION_PTYPE, OPTION_OBJTYPE, OPTION_CTYPE, OPTION_IPTYPE, OPTION_RTYPE, OPTION_DBGLVL, OPTION_NITER, OPTION_NCUTS, &
OPTION_SEED, OPTION_NO2HOP, OPTION_MINCONN, OPTION_CONTIG, OPTION_COMPRESS, OPTION_CCORDER, OPTION_PFACTOR, OPTION_NSEPS, &
OPTION_UFACTOR, OPTION_NUMBERING, OPTION_HELP, OPTION_TPWGTS, OPTION_NCOMMON, OPTION_NOOUTPUT, OPTION_BALANCE, OPTION_GTYPE, &
OPTION_UBVEC
! typedef enum mptype_et
enum, bind(c)
enumerator :: PTYPE_RB
enumerator :: PTYPE_KWAY
end enum
integer, parameter, public :: mptype_et = kind(PTYPE_RB)
public :: PTYPE_RB, PTYPE_KWAY
! typedef enum mgtype_et
enum, bind(c)
enumerator :: GTYPE_DUAL
enumerator :: GTYPE_NODAL
end enum
integer, parameter, public :: mgtype_et = kind(GTYPE_DUAL)
public :: GTYPE_DUAL, GTYPE_NODAL
! typedef enum mctype_et
enum, bind(c)
enumerator :: CTYPE_RM
enumerator :: CTYPE_SHEM
end enum
integer, parameter, public :: mctype_et = kind(CTYPE_RM)
public :: CTYPE_RM, CTYPE_SHEM
! typedef enum miptype_et
enum, bind(c)
enumerator :: IPTYPE_GROW
enumerator :: IPTYPE_RANDOM
enumerator :: IPTYPE_EDGE
enumerator :: IPTYPE_NODE
enumerator :: IPTYPE_METISRB
end enum
integer, parameter, public :: miptype_et = kind(IPTYPE_GROW)
public :: IPTYPE_GROW, IPTYPE_RANDOM, IPTYPE_EDGE, IPTYPE_NODE, IPTYPE_METISRB
! typedef enum mrtype_et
enum, bind(c)
enumerator :: RTYPE_FM
enumerator :: RTYPE_GREEDY
enumerator :: RTYPE_SEP2SIDED
enumerator :: RTYPE_SEP1SIDED
end enum
integer, parameter, public :: mrtype_et = kind(RTYPE_FM)
public :: RTYPE_FM, RTYPE_GREEDY, RTYPE_SEP2SIDED, RTYPE_SEP1SIDED
! typedef enum mdbglvl_et
enum, bind(c)
enumerator :: DBG_INFO = 1
enumerator :: DBG_TIME = 2
enumerator :: DBG_COARSEN = 4
enumerator :: DBG_REFINE = 8
enumerator :: DBG_IPART = 16
enumerator :: DBG_MOVEINFO = 32
enumerator :: DBG_SEPINFO = 64
enumerator :: DBG_CONNINFO = 128
enumerator :: DBG_CONTIGINFO = 256
enumerator :: DBG_MEMORY = 2048
end enum
integer, parameter, public :: mdbglvl_et = kind(DBG_INFO)
public :: DBG_INFO, DBG_TIME, DBG_COARSEN, DBG_REFINE, DBG_IPART, DBG_MOVEINFO, DBG_SEPINFO, DBG_CONNINFO, DBG_CONTIGINFO, &
DBG_MEMORY
! typedef enum mobjtype_et
enum, bind(c)
enumerator :: OBJTYPE_CUT
enumerator :: OBJTYPE_VOL
enumerator :: OBJTYPE_NODE
end enum
integer, parameter, public :: mobjtype_et = kind(OBJTYPE_CUT)
public :: OBJTYPE_CUT, OBJTYPE_VOL, OBJTYPE_NODE
! WRAPPER DECLARATIONS
interface
subroutine SWIG_free(cptr) &
bind(C, name="free")
use, intrinsic :: ISO_C_BINDING
type(C_PTR), value :: cptr
end subroutine
function swigc_formetis_version_get() &
bind(C, name="_wrap_formetis_version_get") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
import :: swigarraywrapper
type(SwigArrayWrapper) :: fresult
end function
function swigc_PartGraphRecursive(farg1, farg2, farg3, farg4, farg5, farg6, farg7, farg8, farg9, farg10, farg11, farg12, &
farg13) &
bind(C, name="_wrap_PartGraphRecursive") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
type(C_PTR), value :: farg1
type(C_PTR), value :: farg2
type(C_PTR), value :: farg3
type(C_PTR), value :: farg4
type(C_PTR), value :: farg5
type(C_PTR), value :: farg6
type(C_PTR), value :: farg7
type(C_PTR), value :: farg8
type(C_PTR), value :: farg9
type(C_PTR), value :: farg10
type(C_PTR), value :: farg11
type(C_PTR), value :: farg12
type(C_PTR), value :: farg13
integer(C_INT) :: fresult
end function
function swigc_PartGraphKway(farg1, farg2, farg3, farg4, farg5, farg6, farg7, farg8, farg9, farg10, farg11, farg12, farg13) &
bind(C, name="_wrap_PartGraphKway") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
type(C_PTR), value :: farg1
type(C_PTR), value :: farg2
type(C_PTR), value :: farg3
type(C_PTR), value :: farg4
type(C_PTR), value :: farg5
type(C_PTR), value :: farg6
type(C_PTR), value :: farg7
type(C_PTR), value :: farg8
type(C_PTR), value :: farg9
type(C_PTR), value :: farg10
type(C_PTR), value :: farg11
type(C_PTR), value :: farg12
type(C_PTR), value :: farg13
integer(C_INT) :: fresult
end function
function swigc_MeshToDual(farg1, farg2, farg3, farg4, farg5, farg6, farg7, farg8) &
bind(C, name="_wrap_MeshToDual") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
import :: swigclasswrapper
type(C_PTR), value :: farg1
type(C_PTR), value :: farg2
type(C_PTR), value :: farg3
type(C_PTR), value :: farg4
type(C_PTR), value :: farg5
type(C_PTR), value :: farg6
type(SwigClassWrapper), intent(in) :: farg7
type(SwigClassWrapper), intent(in) :: farg8
integer(C_INT) :: fresult
end function
function swigc_MeshToNodal(farg1, farg2, farg3, farg4, farg5, farg6, farg7) &
bind(C, name="_wrap_MeshToNodal") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
import :: swigclasswrapper
type(C_PTR), value :: farg1
type(C_PTR), value :: farg2
type(C_PTR), value :: farg3
type(C_PTR), value :: farg4
type(C_PTR), value :: farg5
type(SwigClassWrapper), intent(in) :: farg6
type(SwigClassWrapper), intent(in) :: farg7
integer(C_INT) :: fresult
end function
function swigc_PartMeshNodal(farg1, farg2, farg3, farg4, farg5, farg6, farg7, farg8, farg9, farg10, farg11, farg12) &
bind(C, name="_wrap_PartMeshNodal") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
type(C_PTR), value :: farg1
type(C_PTR), value :: farg2
type(C_PTR), value :: farg3
type(C_PTR), value :: farg4
type(C_PTR), value :: farg5
type(C_PTR), value :: farg6
type(C_PTR), value :: farg7
type(C_PTR), value :: farg8
type(C_PTR), value :: farg9
type(C_PTR), value :: farg10
type(C_PTR), value :: farg11
type(C_PTR), value :: farg12
integer(C_INT) :: fresult
end function
function swigc_PartMeshDual(farg1, farg2, farg3, farg4, farg5, farg6, farg7, farg8, farg9, farg10, farg11, farg12, farg13) &
bind(C, name="_wrap_PartMeshDual") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
type(C_PTR), value :: farg1
type(C_PTR), value :: farg2
type(C_PTR), value :: farg3
type(C_PTR), value :: farg4
type(C_PTR), value :: farg5
type(C_PTR), value :: farg6
type(C_PTR), value :: farg7
type(C_PTR), value :: farg8
type(C_PTR), value :: farg9
type(C_PTR), value :: farg10
type(C_PTR), value :: farg11
type(C_PTR), value :: farg12
type(C_PTR), value :: farg13
integer(C_INT) :: fresult
end function
function swigc_NodeND(farg1, farg2, farg3, farg4, farg5, farg6, farg7) &
bind(C, name="_wrap_NodeND") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
type(C_PTR), value :: farg1
type(C_PTR), value :: farg2
type(C_PTR), value :: farg3
type(C_PTR), value :: farg4
type(C_PTR), value :: farg5
type(C_PTR), value :: farg6
type(C_PTR), value :: farg7
integer(C_INT) :: fresult
end function
function swigc_Free(farg1) &
bind(C, name="_wrap_Free") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
type(C_PTR), intent(in) :: farg1
integer(C_INT) :: fresult
end function
function swigc_SetDefaultOptions(farg1) &
bind(C, name="_wrap_SetDefaultOptions") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
type(C_PTR), value :: farg1
integer(C_INT) :: fresult
end function
function swigc_NodeNDP(farg1, farg2, farg3, farg4, farg5, farg6, farg7, farg8, farg9) &
bind(C, name="_wrap_NodeNDP") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
integer(C_INT32_T), intent(in) :: farg1
type(C_PTR), value :: farg2
type(C_PTR), value :: farg3
type(C_PTR), value :: farg4
integer(C_INT32_T), intent(in) :: farg5
type(C_PTR), value :: farg6
type(C_PTR), value :: farg7
type(C_PTR), value :: farg8
type(C_PTR), value :: farg9
integer(C_INT) :: fresult
end function
function swigc_ComputeVertexSeparator(farg1, farg2, farg3, farg4, farg5, farg6, farg7) &
bind(C, name="_wrap_ComputeVertexSeparator") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
type(C_PTR), value :: farg1
type(C_PTR), value :: farg2
type(C_PTR), value :: farg3
type(C_PTR), value :: farg4
type(C_PTR), value :: farg5
type(C_PTR), value :: farg6
type(C_PTR), value :: farg7
integer(C_INT) :: fresult
end function
function swigc_NodeRefine(farg1, farg2, farg3, farg4, farg5, farg6, farg7) &
bind(C, name="_wrap_NodeRefine") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
integer(C_INT32_T), intent(in) :: farg1
type(C_PTR), value :: farg2
type(C_PTR), value :: farg3
type(C_PTR), value :: farg4
type(C_PTR), value :: farg5
type(C_PTR), value :: farg6
real(C_FLOAT), intent(in) :: farg7
integer(C_INT) :: fresult
end function
end interface
contains
! MODULE SUBPROGRAMS
subroutine SWIGTM_fout_char_Sm_(imout, fout)
use, intrinsic :: ISO_C_BINDING
type(SwigArrayWrapper), intent(in) :: imout
character(len=:), allocatable, intent(out) :: fout
character(kind=C_CHAR), dimension(:), pointer :: chars
integer(kind=C_SIZE_T) :: i
call c_f_pointer(imout%data, chars, [imout%size])
allocate(character(len=imout%size) :: fout)
do i=1, imout%size
fout(i:i) = char(ichar(chars(i)))
end do
end subroutine
function get_formetis_version() &
result(swig_result)
use, intrinsic :: ISO_C_BINDING
character(len=:), allocatable :: swig_result
type(SwigArrayWrapper) :: fresult
fresult = swigc_formetis_version_get()
call SWIGTM_fout_char_Sm_(fresult, swig_result)
if (.false.) call SWIG_free(fresult%data)
end function
subroutine PartGraphRecursive(nvtxs, ncon, xadj, adjncy, vwgt, vsize, adjwgt, nparts, tpwgts, ubvec, options, edgecut, part, &
swig_result)
use, intrinsic :: ISO_C_BINDING
integer(C_INT32_T), dimension(*), target, optional :: nvtxs
integer(C_INT32_T), dimension(*), target, optional :: ncon
integer(C_INT32_T), dimension(*), target, optional :: xadj
integer(C_INT32_T), dimension(*), target, optional :: adjncy
integer(C_INT32_T), dimension(*), target, optional :: vwgt
integer(C_INT32_T), dimension(*), target, optional :: vsize
integer(C_INT32_T), dimension(*), target, optional :: adjwgt
integer(C_INT32_T), dimension(*), target, optional :: nparts
real(C_FLOAT), dimension(*), target, optional :: tpwgts
real(C_FLOAT), dimension(*), target, optional :: ubvec
integer(C_INT32_T), dimension(*), target, optional :: options
integer(C_INT32_T), dimension(*), target, optional :: edgecut
integer(C_INT32_T), dimension(*), target, optional :: part
integer(C_INT), intent(out), optional :: swig_result
integer(C_INT) :: fresult
type(C_PTR) :: farg1
type(C_PTR) :: farg2
type(C_PTR) :: farg3
type(C_PTR) :: farg4
type(C_PTR) :: farg5
type(C_PTR) :: farg6
type(C_PTR) :: farg7
type(C_PTR) :: farg8
type(C_PTR) :: farg9
type(C_PTR) :: farg10
type(C_PTR) :: farg11
type(C_PTR) :: farg12
type(C_PTR) :: farg13
if (present(nvtxs)) then
farg1 = c_loc(nvtxs)
else
farg1 = C_NULL_PTR
endif
if (present(ncon)) then
farg2 = c_loc(ncon)
else
farg2 = C_NULL_PTR
endif
if (present(xadj)) then
farg3 = c_loc(xadj)
else
farg3 = C_NULL_PTR
endif
if (present(adjncy)) then
farg4 = c_loc(adjncy)
else
farg4 = C_NULL_PTR
endif
if (present(vwgt)) then
farg5 = c_loc(vwgt)
else
farg5 = C_NULL_PTR
endif
if (present(vsize)) then
farg6 = c_loc(vsize)
else
farg6 = C_NULL_PTR
endif
if (present(adjwgt)) then
farg7 = c_loc(adjwgt)
else
farg7 = C_NULL_PTR
endif
if (present(nparts)) then
farg8 = c_loc(nparts)
else
farg8 = C_NULL_PTR
endif
if (present(tpwgts)) then
farg9 = c_loc(tpwgts)
else
farg9 = C_NULL_PTR
endif
if (present(ubvec)) then
farg10 = c_loc(ubvec)
else
farg10 = C_NULL_PTR
endif
if (present(options)) then
farg11 = c_loc(options)
else
farg11 = C_NULL_PTR
endif
if (present(edgecut)) then
farg12 = c_loc(edgecut)
else
farg12 = C_NULL_PTR
endif
if (present(part)) then
farg13 = c_loc(part)
else
farg13 = C_NULL_PTR
endif
fresult = swigc_PartGraphRecursive(farg1, farg2, farg3, farg4, farg5, farg6, farg7, farg8, farg9, farg10, farg11, farg12, &
farg13)
if (present(swig_result)) then
swig_result = fresult
endif
end subroutine
subroutine PartGraphKway(nvtxs, ncon, xadj, adjncy, vwgt, vsize, adjwgt, nparts, tpwgts, ubvec, options, edgecut, part, &
swig_result)
use, intrinsic :: ISO_C_BINDING
integer(C_INT32_T), dimension(*), target, optional :: nvtxs
integer(C_INT32_T), dimension(*), target, optional :: ncon
integer(C_INT32_T), dimension(*), target, optional :: xadj
integer(C_INT32_T), dimension(*), target, optional :: adjncy
integer(C_INT32_T), dimension(*), target, optional :: vwgt
integer(C_INT32_T), dimension(*), target, optional :: vsize
integer(C_INT32_T), dimension(*), target, optional :: adjwgt
integer(C_INT32_T), dimension(*), target, optional :: nparts
real(C_FLOAT), dimension(*), target, optional :: tpwgts
real(C_FLOAT), dimension(*), target, optional :: ubvec
integer(C_INT32_T), dimension(*), target, optional :: options
integer(C_INT32_T), dimension(*), target, optional :: edgecut
integer(C_INT32_T), dimension(*), target, optional :: part
integer(C_INT), intent(out), optional :: swig_result
integer(C_INT) :: fresult
type(C_PTR) :: farg1
type(C_PTR) :: farg2
type(C_PTR) :: farg3
type(C_PTR) :: farg4
type(C_PTR) :: farg5
type(C_PTR) :: farg6
type(C_PTR) :: farg7
type(C_PTR) :: farg8
type(C_PTR) :: farg9
type(C_PTR) :: farg10
type(C_PTR) :: farg11
type(C_PTR) :: farg12
type(C_PTR) :: farg13
if (present(nvtxs)) then
farg1 = c_loc(nvtxs)
else
farg1 = C_NULL_PTR
endif
if (present(ncon)) then
farg2 = c_loc(ncon)
else
farg2 = C_NULL_PTR
endif
if (present(xadj)) then
farg3 = c_loc(xadj)
else
farg3 = C_NULL_PTR
endif
if (present(adjncy)) then
farg4 = c_loc(adjncy)
else
farg4 = C_NULL_PTR
endif
if (present(vwgt)) then
farg5 = c_loc(vwgt)
else
farg5 = C_NULL_PTR
endif
if (present(vsize)) then
farg6 = c_loc(vsize)
else
farg6 = C_NULL_PTR
endif
if (present(adjwgt)) then
farg7 = c_loc(adjwgt)
else
farg7 = C_NULL_PTR
endif
if (present(nparts)) then
farg8 = c_loc(nparts)
else
farg8 = C_NULL_PTR
endif
if (present(tpwgts)) then
farg9 = c_loc(tpwgts)
else
farg9 = C_NULL_PTR
endif
if (present(ubvec)) then
farg10 = c_loc(ubvec)
else
farg10 = C_NULL_PTR
endif
if (present(options)) then
farg11 = c_loc(options)
else
farg11 = C_NULL_PTR
endif
if (present(edgecut)) then
farg12 = c_loc(edgecut)
else
farg12 = C_NULL_PTR
endif
if (present(part)) then
farg13 = c_loc(part)
else
farg13 = C_NULL_PTR
endif
fresult = swigc_PartGraphKway(farg1, farg2, farg3, farg4, farg5, farg6, farg7, farg8, farg9, farg10, farg11, farg12, farg13)
if (present(swig_result)) then
swig_result = fresult
endif
end subroutine
subroutine MeshToDual(ne, nn, eptr, eind, ncommon, numflag, r_xadj, r_adjncy, swig_result)
use, intrinsic :: ISO_C_BINDING
integer(C_INT32_T), dimension(*), target, optional :: ne
integer(C_INT32_T), dimension(*), target, optional :: nn
integer(C_INT32_T), dimension(*), target, optional :: eptr
integer(C_INT32_T), dimension(*), target, optional :: eind
integer(C_INT32_T), dimension(*), target, optional :: ncommon
integer(C_INT32_T), dimension(*), target, optional :: numflag
class(SWIGTYPE_p_p_int32_t), intent(in) :: r_xadj
class(SWIGTYPE_p_p_int32_t), intent(in) :: r_adjncy
integer(C_INT), intent(out), optional :: swig_result
integer(C_INT) :: fresult
type(C_PTR) :: farg1
type(C_PTR) :: farg2
type(C_PTR) :: farg3
type(C_PTR) :: farg4
type(C_PTR) :: farg5
type(C_PTR) :: farg6
type(SwigClassWrapper) :: farg7
type(SwigClassWrapper) :: farg8
if (present(ne)) then
farg1 = c_loc(ne)
else
farg1 = C_NULL_PTR
endif
if (present(nn)) then
farg2 = c_loc(nn)
else
farg2 = C_NULL_PTR
endif
if (present(eptr)) then
farg3 = c_loc(eptr)
else
farg3 = C_NULL_PTR
endif
if (present(eind)) then
farg4 = c_loc(eind)
else
farg4 = C_NULL_PTR
endif
if (present(ncommon)) then
farg5 = c_loc(ncommon)
else
farg5 = C_NULL_PTR
endif
if (present(numflag)) then
farg6 = c_loc(numflag)
else
farg6 = C_NULL_PTR
endif
farg7 = r_xadj%swigdata
farg8 = r_adjncy%swigdata
fresult = swigc_MeshToDual(farg1, farg2, farg3, farg4, farg5, farg6, farg7, farg8)
if (present(swig_result)) then
swig_result = fresult
endif
end subroutine
subroutine MeshToNodal(ne, nn, eptr, eind, numflag, r_xadj, r_adjncy, swig_result)
use, intrinsic :: ISO_C_BINDING
integer(C_INT32_T), dimension(*), target, optional :: ne
integer(C_INT32_T), dimension(*), target, optional :: nn
integer(C_INT32_T), dimension(*), target, optional :: eptr
integer(C_INT32_T), dimension(*), target, optional :: eind
integer(C_INT32_T), dimension(*), target, optional :: numflag
class(SWIGTYPE_p_p_int32_t), intent(in) :: r_xadj
class(SWIGTYPE_p_p_int32_t), intent(in) :: r_adjncy
integer(C_INT), intent(out), optional :: swig_result
integer(C_INT) :: fresult
type(C_PTR) :: farg1
type(C_PTR) :: farg2
type(C_PTR) :: farg3
type(C_PTR) :: farg4
type(C_PTR) :: farg5
type(SwigClassWrapper) :: farg6
type(SwigClassWrapper) :: farg7
if (present(ne)) then
farg1 = c_loc(ne)
else
farg1 = C_NULL_PTR
endif
if (present(nn)) then
farg2 = c_loc(nn)
else
farg2 = C_NULL_PTR
endif
if (present(eptr)) then
farg3 = c_loc(eptr)
else
farg3 = C_NULL_PTR
endif
if (present(eind)) then
farg4 = c_loc(eind)
else
farg4 = C_NULL_PTR
endif
if (present(numflag)) then
farg5 = c_loc(numflag)
else
farg5 = C_NULL_PTR
endif
farg6 = r_xadj%swigdata
farg7 = r_adjncy%swigdata
fresult = swigc_MeshToNodal(farg1, farg2, farg3, farg4, farg5, farg6, farg7)
if (present(swig_result)) then
swig_result = fresult
endif
end subroutine
subroutine PartMeshNodal(ne, nn, eptr, eind, vwgt, vsize, nparts, tpwgts, options, objval, epart, npart, swig_result)
use, intrinsic :: ISO_C_BINDING
integer(C_INT32_T), dimension(*), target, optional :: ne
integer(C_INT32_T), dimension(*), target, optional :: nn
integer(C_INT32_T), dimension(*), target, optional :: eptr
integer(C_INT32_T), dimension(*), target, optional :: eind
integer(C_INT32_T), dimension(*), target, optional :: vwgt
integer(C_INT32_T), dimension(*), target, optional :: vsize
integer(C_INT32_T), dimension(*), target, optional :: nparts
real(C_FLOAT), dimension(*), target, optional :: tpwgts
integer(C_INT32_T), dimension(*), target, optional :: options
integer(C_INT32_T), dimension(*), target, optional :: objval
integer(C_INT32_T), dimension(*), target, optional :: epart
integer(C_INT32_T), dimension(*), target, optional :: npart
integer(C_INT), intent(out), optional :: swig_result
integer(C_INT) :: fresult
type(C_PTR) :: farg1
type(C_PTR) :: farg2
type(C_PTR) :: farg3
type(C_PTR) :: farg4
type(C_PTR) :: farg5
type(C_PTR) :: farg6
type(C_PTR) :: farg7
type(C_PTR) :: farg8
type(C_PTR) :: farg9
type(C_PTR) :: farg10
type(C_PTR) :: farg11
type(C_PTR) :: farg12
if (present(ne)) then
farg1 = c_loc(ne)
else
farg1 = C_NULL_PTR
endif
if (present(nn)) then
farg2 = c_loc(nn)
else
farg2 = C_NULL_PTR
endif
if (present(eptr)) then
farg3 = c_loc(eptr)
else
farg3 = C_NULL_PTR
endif
if (present(eind)) then
farg4 = c_loc(eind)
else
farg4 = C_NULL_PTR
endif
if (present(vwgt)) then
farg5 = c_loc(vwgt)
else
farg5 = C_NULL_PTR
endif
if (present(vsize)) then
farg6 = c_loc(vsize)
else
farg6 = C_NULL_PTR
endif
if (present(nparts)) then
farg7 = c_loc(nparts)
else
farg7 = C_NULL_PTR
endif
if (present(tpwgts)) then
farg8 = c_loc(tpwgts)
else
farg8 = C_NULL_PTR
endif
if (present(options)) then
farg9 = c_loc(options)
else
farg9 = C_NULL_PTR
endif
if (present(objval)) then
farg10 = c_loc(objval)
else
farg10 = C_NULL_PTR
endif
if (present(epart)) then
farg11 = c_loc(epart)
else
farg11 = C_NULL_PTR
endif
if (present(npart)) then
farg12 = c_loc(npart)
else
farg12 = C_NULL_PTR
endif
fresult = swigc_PartMeshNodal(farg1, farg2, farg3, farg4, farg5, farg6, farg7, farg8, farg9, farg10, farg11, farg12)
if (present(swig_result)) then
swig_result = fresult
endif
end subroutine
subroutine PartMeshDual(ne, nn, eptr, eind, vwgt, vsize, ncommon, nparts, tpwgts, options, objval, epart, npart, swig_result)
use, intrinsic :: ISO_C_BINDING
integer(C_INT32_T), dimension(*), target, optional :: ne
integer(C_INT32_T), dimension(*), target, optional :: nn
integer(C_INT32_T), dimension(*), target, optional :: eptr
integer(C_INT32_T), dimension(*), target, optional :: eind
integer(C_INT32_T), dimension(*), target, optional :: vwgt
integer(C_INT32_T), dimension(*), target, optional :: vsize
integer(C_INT32_T), dimension(*), target, optional :: ncommon
integer(C_INT32_T), dimension(*), target, optional :: nparts
real(C_FLOAT), dimension(*), target, optional :: tpwgts
integer(C_INT32_T), dimension(*), target, optional :: options
integer(C_INT32_T), dimension(*), target, optional :: objval
integer(C_INT32_T), dimension(*), target, optional :: epart
integer(C_INT32_T), dimension(*), target, optional :: npart
integer(C_INT), intent(out), optional :: swig_result
integer(C_INT) :: fresult
type(C_PTR) :: farg1
type(C_PTR) :: farg2
type(C_PTR) :: farg3
type(C_PTR) :: farg4
type(C_PTR) :: farg5
type(C_PTR) :: farg6
type(C_PTR) :: farg7
type(C_PTR) :: farg8
type(C_PTR) :: farg9
type(C_PTR) :: farg10
type(C_PTR) :: farg11
type(C_PTR) :: farg12
type(C_PTR) :: farg13
if (present(ne)) then
farg1 = c_loc(ne)
else
farg1 = C_NULL_PTR
endif
if (present(nn)) then
farg2 = c_loc(nn)
else
farg2 = C_NULL_PTR
endif
if (present(eptr)) then
farg3 = c_loc(eptr)
else
farg3 = C_NULL_PTR
endif
if (present(eind)) then
farg4 = c_loc(eind)
else
farg4 = C_NULL_PTR
endif
if (present(vwgt)) then
farg5 = c_loc(vwgt)
else
farg5 = C_NULL_PTR
endif
if (present(vsize)) then
farg6 = c_loc(vsize)
else
farg6 = C_NULL_PTR
endif
if (present(ncommon)) then
farg7 = c_loc(ncommon)
else
farg7 = C_NULL_PTR
endif
if (present(nparts)) then
farg8 = c_loc(nparts)
else
farg8 = C_NULL_PTR
endif
if (present(tpwgts)) then
farg9 = c_loc(tpwgts)
else
farg9 = C_NULL_PTR
endif
if (present(options)) then
farg10 = c_loc(options)
else
farg10 = C_NULL_PTR
endif
if (present(objval)) then
farg11 = c_loc(objval)
else
farg11 = C_NULL_PTR
endif
if (present(epart)) then
farg12 = c_loc(epart)
else
farg12 = C_NULL_PTR
endif
if (present(npart)) then
farg13 = c_loc(npart)
else
farg13 = C_NULL_PTR
endif
fresult = swigc_PartMeshDual(farg1, farg2, farg3, farg4, farg5, farg6, farg7, farg8, farg9, farg10, farg11, farg12, farg13)
if (present(swig_result)) then
swig_result = fresult
endif
end subroutine
subroutine NodeND(nvtxs, xadj, adjncy, vwgt, options, perm, iperm, swig_result)
use, intrinsic :: ISO_C_BINDING
integer(C_INT32_T), dimension(*), target, optional :: nvtxs
integer(C_INT32_T), dimension(*), target, optional :: xadj
integer(C_INT32_T), dimension(*), target, optional :: adjncy
integer(C_INT32_T), dimension(*), target, optional :: vwgt
integer(C_INT32_T), dimension(*), target, optional :: options
integer(C_INT32_T), dimension(*), target, optional :: perm
integer(C_INT32_T), dimension(*), target, optional :: iperm
integer(C_INT), intent(out), optional :: swig_result
integer(C_INT) :: fresult
type(C_PTR) :: farg1
type(C_PTR) :: farg2
type(C_PTR) :: farg3
type(C_PTR) :: farg4
type(C_PTR) :: farg5
type(C_PTR) :: farg6
type(C_PTR) :: farg7
if (present(nvtxs)) then
farg1 = c_loc(nvtxs)
else
farg1 = C_NULL_PTR
endif
if (present(xadj)) then
farg2 = c_loc(xadj)
else
farg2 = C_NULL_PTR
endif
if (present(adjncy)) then
farg3 = c_loc(adjncy)
else
farg3 = C_NULL_PTR
endif
if (present(vwgt)) then
farg4 = c_loc(vwgt)
else
farg4 = C_NULL_PTR
endif
if (present(options)) then
farg5 = c_loc(options)
else
farg5 = C_NULL_PTR
endif
if (present(perm)) then
farg6 = c_loc(perm)
else
farg6 = C_NULL_PTR
endif
if (present(iperm)) then
farg7 = c_loc(iperm)
else
farg7 = C_NULL_PTR
endif
fresult = swigc_NodeND(farg1, farg2, farg3, farg4, farg5, farg6, farg7)
if (present(swig_result)) then
swig_result = fresult
endif
end subroutine
subroutine Free(ptr, swig_result)
use, intrinsic :: ISO_C_BINDING
type(C_PTR), intent(in) :: ptr
integer(C_INT), intent(out), optional :: swig_result
integer(C_INT) :: fresult
type(C_PTR) :: farg1
farg1 = ptr
fresult = swigc_Free(farg1)
if (present(swig_result)) then
swig_result = fresult
endif
end subroutine
subroutine SetDefaultOptions(options, swig_result)