OR-Tools  9.2
graph_java_wrap.cc
Go to the documentation of this file.
1/* ----------------------------------------------------------------------------
2 * This file was automatically generated by SWIG (http://www.swig.org).
3 * Version 4.0.2
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#ifndef SWIGJAVA
13#define SWIGJAVA
14#endif
15
16
17
18#ifdef __cplusplus
19/* SwigValueWrapper is described in swig.swg */
20template<typename T> class SwigValueWrapper {
21 struct SwigMovePointer {
22 T *ptr;
23 SwigMovePointer(T *p) : ptr(p) { }
24 ~SwigMovePointer() { delete ptr; }
25 SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; }
26 } pointer;
27 SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
28 SwigValueWrapper(const SwigValueWrapper<T>& rhs);
29public:
30 SwigValueWrapper() : pointer(0) { }
31 SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; }
32 operator T&() const { return *pointer.ptr; }
33 T *operator&() { return pointer.ptr; }
34};
35
36template <typename T> T SwigValueInit() {
37 return T();
38}
39#endif
40
41/* -----------------------------------------------------------------------------
42 * This section contains generic SWIG labels for method/variable
43 * declarations/attributes, and other compiler dependent labels.
44 * ----------------------------------------------------------------------------- */
45
46/* template workaround for compilers that cannot correctly implement the C++ standard */
47#ifndef SWIGTEMPLATEDISAMBIGUATOR
48# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
49# define SWIGTEMPLATEDISAMBIGUATOR template
50# elif defined(__HP_aCC)
51/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
52/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
53# define SWIGTEMPLATEDISAMBIGUATOR template
54# else
55# define SWIGTEMPLATEDISAMBIGUATOR
56# endif
57#endif
58
59/* inline attribute */
60#ifndef SWIGINLINE
61# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
62# define SWIGINLINE inline
63# else
64# define SWIGINLINE
65# endif
66#endif
67
68/* attribute recognised by some compilers to avoid 'unused' warnings */
69#ifndef SWIGUNUSED
70# if defined(__GNUC__)
71# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
72# define SWIGUNUSED __attribute__ ((__unused__))
73# else
74# define SWIGUNUSED
75# endif
76# elif defined(__ICC)
77# define SWIGUNUSED __attribute__ ((__unused__))
78# else
79# define SWIGUNUSED
80# endif
81#endif
82
83#ifndef SWIG_MSC_UNSUPPRESS_4505
84# if defined(_MSC_VER)
85# pragma warning(disable : 4505) /* unreferenced local function has been removed */
86# endif
87#endif
88
89#ifndef SWIGUNUSEDPARM
90# ifdef __cplusplus
91# define SWIGUNUSEDPARM(p)
92# else
93# define SWIGUNUSEDPARM(p) p SWIGUNUSED
94# endif
95#endif
96
97/* internal SWIG method */
98#ifndef SWIGINTERN
99# define SWIGINTERN static SWIGUNUSED
100#endif
101
102/* internal inline SWIG method */
103#ifndef SWIGINTERNINLINE
104# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
105#endif
106
107/* exporting methods */
108#if defined(__GNUC__)
109# if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
110# ifndef GCC_HASCLASSVISIBILITY
111# define GCC_HASCLASSVISIBILITY
112# endif
113# endif
114#endif
115
116#ifndef SWIGEXPORT
117# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
118# if defined(STATIC_LINKED)
119# define SWIGEXPORT
120# else
121# define SWIGEXPORT __declspec(dllexport)
122# endif
123# else
124# if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
125# define SWIGEXPORT __attribute__ ((visibility("default")))
126# else
127# define SWIGEXPORT
128# endif
129# endif
130#endif
131
132/* calling conventions for Windows */
133#ifndef SWIGSTDCALL
134# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
135# define SWIGSTDCALL __stdcall
136# else
137# define SWIGSTDCALL
138# endif
139#endif
140
141/* Deal with Microsoft's attempt at deprecating C standard runtime functions */
142#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
143# define _CRT_SECURE_NO_DEPRECATE
144#endif
145
146/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
147#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
148# define _SCL_SECURE_NO_DEPRECATE
149#endif
150
151/* Deal with Apple's deprecated 'AssertMacros.h' from Carbon-framework */
152#if defined(__APPLE__) && !defined(__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES)
153# define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0
154#endif
155
156/* Intel's compiler complains if a variable which was never initialised is
157 * cast to void, which is a common idiom which we use to indicate that we
158 * are aware a variable isn't used. So we just silence that warning.
159 * See: https://github.com/swig/swig/issues/192 for more discussion.
160 */
161#ifdef __INTEL_COMPILER
162# pragma warning disable 592
163#endif
164
165
166/* Fix for jlong on some versions of gcc on Windows */
167#if defined(__GNUC__) && !defined(__INTEL_COMPILER)
168 typedef long long __int64;
169#endif
170
171/* Fix for jlong on 64-bit x86 Solaris */
172#if defined(__x86_64)
173# ifdef _LP64
174# undef _LP64
175# endif
176#endif
177
178#include <jni.h>
179#include <stdlib.h>
180#include <string.h>
181
182
183/* Support for throwing Java exceptions */
184typedef enum {
196
197typedef struct {
199 const char *java_exception;
201
202
203static void SWIGUNUSED SWIG_JavaThrowException(JNIEnv *jenv, SWIG_JavaExceptionCodes code, const char *msg) {
204 jclass excep;
205 static const SWIG_JavaExceptions_t java_exceptions[] = {
206 { SWIG_JavaOutOfMemoryError, "java/lang/OutOfMemoryError" },
207 { SWIG_JavaIOException, "java/io/IOException" },
208 { SWIG_JavaRuntimeException, "java/lang/RuntimeException" },
209 { SWIG_JavaIndexOutOfBoundsException, "java/lang/IndexOutOfBoundsException" },
210 { SWIG_JavaArithmeticException, "java/lang/ArithmeticException" },
211 { SWIG_JavaIllegalArgumentException, "java/lang/IllegalArgumentException" },
212 { SWIG_JavaNullPointerException, "java/lang/NullPointerException" },
213 { SWIG_JavaDirectorPureVirtual, "java/lang/RuntimeException" },
214 { SWIG_JavaUnknownError, "java/lang/UnknownError" },
215 { SWIG_JavaIllegalStateException, "java/lang/IllegalStateException" },
216 { (SWIG_JavaExceptionCodes)0, "java/lang/UnknownError" }
217 };
218 const SWIG_JavaExceptions_t *except_ptr = java_exceptions;
219
220 while (except_ptr->code != code && except_ptr->code)
221 except_ptr++;
222
223 jenv->ExceptionClear();
224 excep = jenv->FindClass(except_ptr->java_exception);
225 if (excep)
226 jenv->ThrowNew(excep, msg);
227}
228
229
230/* Contract support */
231
232#define SWIG_contract_assert(nullreturn, expr, msg) if (!(expr)) {SWIG_JavaThrowException(jenv, SWIG_JavaIllegalArgumentException, msg); return nullreturn; } else
233
234
235#include <stdint.h> // Use the C99 official header
236
237
238#include <cstdint>
239#include <string>
240#include <vector>
241
243
244
245#include <string>
246
247
251
252
253#ifdef __cplusplus
254extern "C" {
255#endif
256
257SWIGEXPORT jlong JNICALL Java_com_google_ortools_graph_mainJNI_new_1MaxFlow(JNIEnv *jenv, jclass jcls) {
258 jlong jresult = 0 ;
260
261 (void)jenv;
262 (void)jcls;
264 *(operations_research::SimpleMaxFlow **)&jresult = result;
265 return jresult;
266}
267
268
269SWIGEXPORT jint JNICALL Java_com_google_ortools_graph_mainJNI_MaxFlow_1addArcWithCapacity(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2, jint jarg3, jlong jarg4) {
270 jint jresult = 0 ;
276
277 (void)jenv;
278 (void)jcls;
279 (void)jarg1_;
280 arg1 = *(operations_research::SimpleMaxFlow **)&jarg1;
281 arg2 = (operations_research::NodeIndex)jarg2;
282 arg3 = (operations_research::NodeIndex)jarg3;
284 result = (operations_research::ArcIndex)(arg1)->AddArcWithCapacity(arg2,arg3,arg4);
285 jresult = (jint)result;
286 return jresult;
287}
288
289
290SWIGEXPORT jint JNICALL Java_com_google_ortools_graph_mainJNI_MaxFlow_1getNumNodes(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
291 jint jresult = 0 ;
294
295 (void)jenv;
296 (void)jcls;
297 (void)jarg1_;
298 arg1 = *(operations_research::SimpleMaxFlow **)&jarg1;
299 result = (operations_research::NodeIndex)((operations_research::SimpleMaxFlow const *)arg1)->NumNodes();
300 jresult = (jint)result;
301 return jresult;
302}
303
304
305SWIGEXPORT jint JNICALL Java_com_google_ortools_graph_mainJNI_MaxFlow_1getNumArcs(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
306 jint jresult = 0 ;
309
310 (void)jenv;
311 (void)jcls;
312 (void)jarg1_;
313 arg1 = *(operations_research::SimpleMaxFlow **)&jarg1;
314 result = (operations_research::ArcIndex)((operations_research::SimpleMaxFlow const *)arg1)->NumArcs();
315 jresult = (jint)result;
316 return jresult;
317}
318
319
320SWIGEXPORT jint JNICALL Java_com_google_ortools_graph_mainJNI_MaxFlow_1getTail(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) {
321 jint jresult = 0 ;
325
326 (void)jenv;
327 (void)jcls;
328 (void)jarg1_;
329 arg1 = *(operations_research::SimpleMaxFlow **)&jarg1;
330 arg2 = (operations_research::ArcIndex)jarg2;
331 result = (operations_research::NodeIndex)((operations_research::SimpleMaxFlow const *)arg1)->Tail(arg2);
332 jresult = (jint)result;
333 return jresult;
334}
335
336
337SWIGEXPORT jint JNICALL Java_com_google_ortools_graph_mainJNI_MaxFlow_1getHead(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) {
338 jint jresult = 0 ;
342
343 (void)jenv;
344 (void)jcls;
345 (void)jarg1_;
346 arg1 = *(operations_research::SimpleMaxFlow **)&jarg1;
347 arg2 = (operations_research::ArcIndex)jarg2;
348 result = (operations_research::NodeIndex)((operations_research::SimpleMaxFlow const *)arg1)->Head(arg2);
349 jresult = (jint)result;
350 return jresult;
351}
352
353
354SWIGEXPORT jlong JNICALL Java_com_google_ortools_graph_mainJNI_MaxFlow_1getCapacity(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) {
355 jlong jresult = 0 ;
359
360 (void)jenv;
361 (void)jcls;
362 (void)jarg1_;
363 arg1 = *(operations_research::SimpleMaxFlow **)&jarg1;
364 arg2 = (operations_research::ArcIndex)jarg2;
365 result = (operations_research::FlowQuantity)((operations_research::SimpleMaxFlow const *)arg1)->Capacity(arg2);
366 jresult = (jlong)result;
367 return jresult;
368}
369
370
371SWIGEXPORT jint JNICALL Java_com_google_ortools_graph_mainJNI_MaxFlow_1solve(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2, jint jarg3) {
372 jint jresult = 0 ;
377
378 (void)jenv;
379 (void)jcls;
380 (void)jarg1_;
381 arg1 = *(operations_research::SimpleMaxFlow **)&jarg1;
382 arg2 = (operations_research::NodeIndex)jarg2;
383 arg3 = (operations_research::NodeIndex)jarg3;
384 result = (operations_research::SimpleMaxFlow::Status)(arg1)->Solve(arg2,arg3);
385 jresult = (jint)result;
386 return jresult;
387}
388
389
390SWIGEXPORT jlong JNICALL Java_com_google_ortools_graph_mainJNI_MaxFlow_1getOptimalFlow(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
391 jlong jresult = 0 ;
394
395 (void)jenv;
396 (void)jcls;
397 (void)jarg1_;
398 arg1 = *(operations_research::SimpleMaxFlow **)&jarg1;
399 result = (operations_research::FlowQuantity)((operations_research::SimpleMaxFlow const *)arg1)->OptimalFlow();
400 jresult = (jlong)result;
401 return jresult;
402}
403
404
405SWIGEXPORT jlong JNICALL Java_com_google_ortools_graph_mainJNI_MaxFlow_1getFlow(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) {
406 jlong jresult = 0 ;
410
411 (void)jenv;
412 (void)jcls;
413 (void)jarg1_;
414 arg1 = *(operations_research::SimpleMaxFlow **)&jarg1;
415 arg2 = (operations_research::ArcIndex)jarg2;
416 result = (operations_research::FlowQuantity)((operations_research::SimpleMaxFlow const *)arg1)->Flow(arg2);
417 jresult = (jlong)result;
418 return jresult;
419}
420
421
422SWIGEXPORT void JNICALL Java_com_google_ortools_graph_mainJNI_MaxFlow_1setArcCapacity(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2, jlong jarg3) {
426
427 (void)jenv;
428 (void)jcls;
429 (void)jarg1_;
430 arg1 = *(operations_research::SimpleMaxFlow **)&jarg1;
431 arg2 = (operations_research::ArcIndex)jarg2;
433 (arg1)->SetArcCapacity(arg2,arg3);
434}
435
436
437SWIGEXPORT void JNICALL Java_com_google_ortools_graph_mainJNI_delete_1MaxFlow(JNIEnv *jenv, jclass jcls, jlong jarg1) {
439
440 (void)jenv;
441 (void)jcls;
442 arg1 = *(operations_research::SimpleMaxFlow **)&jarg1;
443 delete arg1;
444}
445
446
448 jlong jresult = 0 ;
450
451 (void)jenv;
452 (void)jcls;
454 *(operations_research::MinCostFlowBase **)&jresult = result;
455 return jresult;
456}
457
458
459SWIGEXPORT void JNICALL Java_com_google_ortools_graph_mainJNI_delete_1MinCostFlowBase(JNIEnv *jenv, jclass jcls, jlong jarg1) {
461
462 (void)jenv;
463 (void)jcls;
464 arg1 = *(operations_research::MinCostFlowBase **)&jarg1;
465 delete arg1;
466}
467
468
469SWIGEXPORT jlong JNICALL Java_com_google_ortools_graph_mainJNI_new_1MinCostFlow_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jint jarg1, jint jarg2) {
470 jlong jresult = 0 ;
474
475 (void)jenv;
476 (void)jcls;
477 arg1 = (operations_research::NodeIndex)jarg1;
478 arg2 = (operations_research::ArcIndex)jarg2;
480 *(operations_research::SimpleMinCostFlow **)&jresult = result;
481 return jresult;
482}
483
484
485SWIGEXPORT jlong JNICALL Java_com_google_ortools_graph_mainJNI_new_1MinCostFlow_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jint jarg1) {
486 jlong jresult = 0 ;
489
490 (void)jenv;
491 (void)jcls;
492 arg1 = (operations_research::NodeIndex)jarg1;
494 *(operations_research::SimpleMinCostFlow **)&jresult = result;
495 return jresult;
496}
497
498
500 jlong jresult = 0 ;
502
503 (void)jenv;
504 (void)jcls;
506 *(operations_research::SimpleMinCostFlow **)&jresult = result;
507 return jresult;
508}
509
510
511SWIGEXPORT jint JNICALL Java_com_google_ortools_graph_mainJNI_MinCostFlow_1addArcWithCapacityAndUnitCost(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2, jint jarg3, jlong jarg4, jlong jarg5) {
512 jint jresult = 0 ;
519
520 (void)jenv;
521 (void)jcls;
522 (void)jarg1_;
523 arg1 = *(operations_research::SimpleMinCostFlow **)&jarg1;
524 arg2 = (operations_research::NodeIndex)jarg2;
525 arg3 = (operations_research::NodeIndex)jarg3;
527 arg5 = (operations_research::CostValue)jarg5;
528 result = (operations_research::ArcIndex)(arg1)->AddArcWithCapacityAndUnitCost(arg2,arg3,arg4,arg5);
529 jresult = (jint)result;
530 return jresult;
531}
532
533
534SWIGEXPORT void JNICALL Java_com_google_ortools_graph_mainJNI_MinCostFlow_1setNodeSupply(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2, jlong jarg3) {
538
539 (void)jenv;
540 (void)jcls;
541 (void)jarg1_;
542 arg1 = *(operations_research::SimpleMinCostFlow **)&jarg1;
543 arg2 = (operations_research::NodeIndex)jarg2;
545 (arg1)->SetNodeSupply(arg2,arg3);
546}
547
548
549SWIGEXPORT jint JNICALL Java_com_google_ortools_graph_mainJNI_MinCostFlow_1solve(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
550 jint jresult = 0 ;
553
554 (void)jenv;
555 (void)jcls;
556 (void)jarg1_;
557 arg1 = *(operations_research::SimpleMinCostFlow **)&jarg1;
559 jresult = (jint)result;
560 return jresult;
561}
562
563
564SWIGEXPORT jint JNICALL Java_com_google_ortools_graph_mainJNI_MinCostFlow_1solveMaxFlowWithMinCost(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
565 jint jresult = 0 ;
568
569 (void)jenv;
570 (void)jcls;
571 (void)jarg1_;
572 arg1 = *(operations_research::SimpleMinCostFlow **)&jarg1;
574 jresult = (jint)result;
575 return jresult;
576}
577
578
579SWIGEXPORT jlong JNICALL Java_com_google_ortools_graph_mainJNI_MinCostFlow_1getOptimalCost(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
580 jlong jresult = 0 ;
583
584 (void)jenv;
585 (void)jcls;
586 (void)jarg1_;
587 arg1 = *(operations_research::SimpleMinCostFlow **)&jarg1;
588 result = (operations_research::CostValue)((operations_research::SimpleMinCostFlow const *)arg1)->OptimalCost();
589 jresult = (jlong)result;
590 return jresult;
591}
592
593
594SWIGEXPORT jlong JNICALL Java_com_google_ortools_graph_mainJNI_MinCostFlow_1getMaximumFlow(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
595 jlong jresult = 0 ;
598
599 (void)jenv;
600 (void)jcls;
601 (void)jarg1_;
602 arg1 = *(operations_research::SimpleMinCostFlow **)&jarg1;
603 result = (operations_research::FlowQuantity)((operations_research::SimpleMinCostFlow const *)arg1)->MaximumFlow();
604 jresult = (jlong)result;
605 return jresult;
606}
607
608
609SWIGEXPORT jlong JNICALL Java_com_google_ortools_graph_mainJNI_MinCostFlow_1getFlow(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) {
610 jlong jresult = 0 ;
614
615 (void)jenv;
616 (void)jcls;
617 (void)jarg1_;
618 arg1 = *(operations_research::SimpleMinCostFlow **)&jarg1;
619 arg2 = (operations_research::ArcIndex)jarg2;
621 jresult = (jlong)result;
622 return jresult;
623}
624
625
626SWIGEXPORT jint JNICALL Java_com_google_ortools_graph_mainJNI_MinCostFlow_1getNumNodes(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
627 jint jresult = 0 ;
630
631 (void)jenv;
632 (void)jcls;
633 (void)jarg1_;
634 arg1 = *(operations_research::SimpleMinCostFlow **)&jarg1;
636 jresult = (jint)result;
637 return jresult;
638}
639
640
641SWIGEXPORT jint JNICALL Java_com_google_ortools_graph_mainJNI_MinCostFlow_1getNumArcs(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
642 jint jresult = 0 ;
645
646 (void)jenv;
647 (void)jcls;
648 (void)jarg1_;
649 arg1 = *(operations_research::SimpleMinCostFlow **)&jarg1;
651 jresult = (jint)result;
652 return jresult;
653}
654
655
656SWIGEXPORT jint JNICALL Java_com_google_ortools_graph_mainJNI_MinCostFlow_1getTail(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) {
657 jint jresult = 0 ;
661
662 (void)jenv;
663 (void)jcls;
664 (void)jarg1_;
665 arg1 = *(operations_research::SimpleMinCostFlow **)&jarg1;
666 arg2 = (operations_research::ArcIndex)jarg2;
668 jresult = (jint)result;
669 return jresult;
670}
671
672
673SWIGEXPORT jint JNICALL Java_com_google_ortools_graph_mainJNI_MinCostFlow_1getHead(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) {
674 jint jresult = 0 ;
678
679 (void)jenv;
680 (void)jcls;
681 (void)jarg1_;
682 arg1 = *(operations_research::SimpleMinCostFlow **)&jarg1;
683 arg2 = (operations_research::ArcIndex)jarg2;
685 jresult = (jint)result;
686 return jresult;
687}
688
689
690SWIGEXPORT jlong JNICALL Java_com_google_ortools_graph_mainJNI_MinCostFlow_1getCapacity(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) {
691 jlong jresult = 0 ;
695
696 (void)jenv;
697 (void)jcls;
698 (void)jarg1_;
699 arg1 = *(operations_research::SimpleMinCostFlow **)&jarg1;
700 arg2 = (operations_research::ArcIndex)jarg2;
701 result = (operations_research::FlowQuantity)((operations_research::SimpleMinCostFlow const *)arg1)->Capacity(arg2);
702 jresult = (jlong)result;
703 return jresult;
704}
705
706
707SWIGEXPORT jlong JNICALL Java_com_google_ortools_graph_mainJNI_MinCostFlow_1getSupply(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) {
708 jlong jresult = 0 ;
712
713 (void)jenv;
714 (void)jcls;
715 (void)jarg1_;
716 arg1 = *(operations_research::SimpleMinCostFlow **)&jarg1;
717 arg2 = (operations_research::NodeIndex)jarg2;
719 jresult = (jlong)result;
720 return jresult;
721}
722
723
724SWIGEXPORT jlong JNICALL Java_com_google_ortools_graph_mainJNI_MinCostFlow_1getUnitCost(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) {
725 jlong jresult = 0 ;
729
730 (void)jenv;
731 (void)jcls;
732 (void)jarg1_;
733 arg1 = *(operations_research::SimpleMinCostFlow **)&jarg1;
734 arg2 = (operations_research::ArcIndex)jarg2;
735 result = (operations_research::CostValue)((operations_research::SimpleMinCostFlow const *)arg1)->UnitCost(arg2);
736 jresult = (jlong)result;
737 return jresult;
738}
739
740
741SWIGEXPORT void JNICALL Java_com_google_ortools_graph_mainJNI_delete_1MinCostFlow(JNIEnv *jenv, jclass jcls, jlong jarg1) {
743
744 (void)jenv;
745 (void)jcls;
746 arg1 = *(operations_research::SimpleMinCostFlow **)&jarg1;
747 delete arg1;
748}
749
750
752 jlong jresult = 0 ;
754
755 (void)jenv;
756 (void)jcls;
759 return jresult;
760}
761
762
763SWIGEXPORT jint JNICALL Java_com_google_ortools_graph_mainJNI_LinearSumAssignment_1addArcWithCost(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2, jint jarg3, jlong jarg4) {
764 jint jresult = 0 ;
770
771 (void)jenv;
772 (void)jcls;
773 (void)jarg1_;
775 arg2 = (operations_research::NodeIndex)jarg2;
776 arg3 = (operations_research::NodeIndex)jarg3;
777 arg4 = (operations_research::CostValue)jarg4;
778 result = (operations_research::ArcIndex)(arg1)->AddArcWithCost(arg2,arg3,arg4);
779 jresult = (jint)result;
780 return jresult;
781}
782
783
784SWIGEXPORT jint JNICALL Java_com_google_ortools_graph_mainJNI_LinearSumAssignment_1getNumNodes(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
785 jint jresult = 0 ;
788
789 (void)jenv;
790 (void)jcls;
791 (void)jarg1_;
794 jresult = (jint)result;
795 return jresult;
796}
797
798
799SWIGEXPORT jint JNICALL Java_com_google_ortools_graph_mainJNI_LinearSumAssignment_1getNumArcs(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
800 jint jresult = 0 ;
803
804 (void)jenv;
805 (void)jcls;
806 (void)jarg1_;
809 jresult = (jint)result;
810 return jresult;
811}
812
813
814SWIGEXPORT jint JNICALL Java_com_google_ortools_graph_mainJNI_LinearSumAssignment_1getLeftNode(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) {
815 jint jresult = 0 ;
819
820 (void)jenv;
821 (void)jcls;
822 (void)jarg1_;
824 arg2 = (operations_research::ArcIndex)jarg2;
826 jresult = (jint)result;
827 return jresult;
828}
829
830
831SWIGEXPORT jint JNICALL Java_com_google_ortools_graph_mainJNI_LinearSumAssignment_1getRightNode(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) {
832 jint jresult = 0 ;
836
837 (void)jenv;
838 (void)jcls;
839 (void)jarg1_;
841 arg2 = (operations_research::ArcIndex)jarg2;
843 jresult = (jint)result;
844 return jresult;
845}
846
847
848SWIGEXPORT jlong JNICALL Java_com_google_ortools_graph_mainJNI_LinearSumAssignment_1getCost(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) {
849 jlong jresult = 0 ;
853
854 (void)jenv;
855 (void)jcls;
856 (void)jarg1_;
858 arg2 = (operations_research::ArcIndex)jarg2;
860 jresult = (jlong)result;
861 return jresult;
862}
863
864
865SWIGEXPORT jint JNICALL Java_com_google_ortools_graph_mainJNI_LinearSumAssignment_1solve(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
866 jint jresult = 0 ;
869
870 (void)jenv;
871 (void)jcls;
872 (void)jarg1_;
875 jresult = (jint)result;
876 return jresult;
877}
878
879
880SWIGEXPORT jlong JNICALL Java_com_google_ortools_graph_mainJNI_LinearSumAssignment_1getOptimalCost(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
881 jlong jresult = 0 ;
884
885 (void)jenv;
886 (void)jcls;
887 (void)jarg1_;
890 jresult = (jlong)result;
891 return jresult;
892}
893
894
895SWIGEXPORT jint JNICALL Java_com_google_ortools_graph_mainJNI_LinearSumAssignment_1getRightMate(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) {
896 jint jresult = 0 ;
900
901 (void)jenv;
902 (void)jcls;
903 (void)jarg1_;
905 arg2 = (operations_research::NodeIndex)jarg2;
907 jresult = (jint)result;
908 return jresult;
909}
910
911
912SWIGEXPORT jlong JNICALL Java_com_google_ortools_graph_mainJNI_LinearSumAssignment_1getAssignmentCost(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) {
913 jlong jresult = 0 ;
917
918 (void)jenv;
919 (void)jcls;
920 (void)jarg1_;
922 arg2 = (operations_research::NodeIndex)jarg2;
923 result = (operations_research::CostValue)((operations_research::SimpleLinearSumAssignment const *)arg1)->AssignmentCost(arg2);
924 jresult = (jlong)result;
925 return jresult;
926}
927
928
929SWIGEXPORT void JNICALL Java_com_google_ortools_graph_mainJNI_delete_1LinearSumAssignment(JNIEnv *jenv, jclass jcls, jlong jarg1) {
931
932 (void)jenv;
933 (void)jcls;
935 delete arg1;
936}
937
938
939SWIGEXPORT jlong JNICALL Java_com_google_ortools_graph_mainJNI_MinCostFlow_1SWIGUpcast(JNIEnv *jenv, jclass jcls, jlong jarg1) {
940 jlong baseptr = 0;
941 (void)jenv;
942 (void)jcls;
944 return baseptr;
945}
946
947#ifdef __cplusplus
948}
949#endif
950
ArcIndex AddArcWithCost(NodeIndex left_node, NodeIndex right_node, CostValue cost)
Status Solve(NodeIndex source, NodeIndex sink)
Definition: max_flow.cc:55
ArcIndex AddArcWithCapacity(NodeIndex tail, NodeIndex head, FlowQuantity capacity)
Definition: max_flow.cc:28
ArcIndex AddArcWithCapacityAndUnitCost(NodeIndex tail, NodeIndex head, FlowQuantity capacity, CostValue unit_cost)
SWIGEXPORT jint JNICALL Java_com_google_ortools_graph_mainJNI_MinCostFlow_1getHead(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2)
SWIGEXPORT void JNICALL Java_com_google_ortools_graph_mainJNI_MaxFlow_1setArcCapacity(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2, jlong jarg3)
SWIGEXPORT void JNICALL Java_com_google_ortools_graph_mainJNI_delete_1MinCostFlowBase(JNIEnv *jenv, jclass jcls, jlong jarg1)
SWIGEXPORT jlong JNICALL Java_com_google_ortools_graph_mainJNI_MinCostFlow_1getMaximumFlow(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_)
SWIGEXPORT jint JNICALL Java_com_google_ortools_graph_mainJNI_MaxFlow_1getNumNodes(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_)
SWIGEXPORT void JNICALL Java_com_google_ortools_graph_mainJNI_delete_1LinearSumAssignment(JNIEnv *jenv, jclass jcls, jlong jarg1)
SWIGEXPORT jint JNICALL Java_com_google_ortools_graph_mainJNI_LinearSumAssignment_1getRightMate(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2)
SWIGEXPORT void JNICALL Java_com_google_ortools_graph_mainJNI_delete_1MaxFlow(JNIEnv *jenv, jclass jcls, jlong jarg1)
SWIGEXPORT jint JNICALL Java_com_google_ortools_graph_mainJNI_MinCostFlow_1getTail(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2)
SWIGEXPORT jlong JNICALL Java_com_google_ortools_graph_mainJNI_LinearSumAssignment_1getOptimalCost(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_)
SWIGEXPORT jint JNICALL Java_com_google_ortools_graph_mainJNI_MaxFlow_1solve(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2, jint jarg3)
SWIGEXPORT jint JNICALL Java_com_google_ortools_graph_mainJNI_MinCostFlow_1solve(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_)
SWIGEXPORT void JNICALL Java_com_google_ortools_graph_mainJNI_delete_1MinCostFlow(JNIEnv *jenv, jclass jcls, jlong jarg1)
SWIGEXPORT jlong JNICALL Java_com_google_ortools_graph_mainJNI_MinCostFlow_1SWIGUpcast(JNIEnv *jenv, jclass jcls, jlong jarg1)
SWIGEXPORT jlong JNICALL Java_com_google_ortools_graph_mainJNI_new_1MinCostFlowBase(JNIEnv *jenv, jclass jcls)
SWIGEXPORT jlong JNICALL Java_com_google_ortools_graph_mainJNI_MinCostFlow_1getOptimalCost(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_)
SWIGEXPORT jlong JNICALL Java_com_google_ortools_graph_mainJNI_LinearSumAssignment_1getCost(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2)
#define SWIGUNUSED
static void SWIGUNUSED SWIG_JavaThrowException(JNIEnv *jenv, SWIG_JavaExceptionCodes code, const char *msg)
SWIG_JavaExceptionCodes
@ SWIG_JavaIOException
@ SWIG_JavaArithmeticException
@ SWIG_JavaUnknownError
@ SWIG_JavaRuntimeException
@ SWIG_JavaNullPointerException
@ SWIG_JavaDirectorPureVirtual
@ SWIG_JavaOutOfMemoryError
@ SWIG_JavaIllegalStateException
@ SWIG_JavaIllegalArgumentException
@ SWIG_JavaIndexOutOfBoundsException
SWIGEXPORT jint JNICALL Java_com_google_ortools_graph_mainJNI_MinCostFlow_1solveMaxFlowWithMinCost(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_)
SWIGEXPORT jlong JNICALL Java_com_google_ortools_graph_mainJNI_MaxFlow_1getFlow(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2)
SWIGEXPORT jlong JNICALL Java_com_google_ortools_graph_mainJNI_new_1LinearSumAssignment(JNIEnv *jenv, jclass jcls)
SWIGEXPORT jlong JNICALL Java_com_google_ortools_graph_mainJNI_MinCostFlow_1getFlow(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2)
SWIGEXPORT jint JNICALL Java_com_google_ortools_graph_mainJNI_LinearSumAssignment_1solve(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_)
SWIGEXPORT jlong JNICALL Java_com_google_ortools_graph_mainJNI_MinCostFlow_1getCapacity(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2)
SWIGEXPORT jlong JNICALL Java_com_google_ortools_graph_mainJNI_LinearSumAssignment_1getAssignmentCost(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2)
SWIGEXPORT jint JNICALL Java_com_google_ortools_graph_mainJNI_MinCostFlow_1addArcWithCapacityAndUnitCost(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2, jint jarg3, jlong jarg4, jlong jarg5)
SWIGEXPORT jint JNICALL Java_com_google_ortools_graph_mainJNI_MinCostFlow_1getNumArcs(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_)
SWIGEXPORT jint JNICALL Java_com_google_ortools_graph_mainJNI_MaxFlow_1getTail(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2)
SWIGEXPORT void JNICALL Java_com_google_ortools_graph_mainJNI_MinCostFlow_1setNodeSupply(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2, jlong jarg3)
SWIGEXPORT jint JNICALL Java_com_google_ortools_graph_mainJNI_MaxFlow_1getNumArcs(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_)
SWIGEXPORT jlong JNICALL Java_com_google_ortools_graph_mainJNI_new_1MinCostFlow_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jint jarg1, jint jarg2)
SWIGEXPORT jint JNICALL Java_com_google_ortools_graph_mainJNI_LinearSumAssignment_1addArcWithCost(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2, jint jarg3, jlong jarg4)
SWIGEXPORT jlong JNICALL Java_com_google_ortools_graph_mainJNI_new_1MaxFlow(JNIEnv *jenv, jclass jcls)
SWIGEXPORT jlong JNICALL Java_com_google_ortools_graph_mainJNI_new_1MinCostFlow_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jint jarg1)
SWIGEXPORT jint JNICALL Java_com_google_ortools_graph_mainJNI_MaxFlow_1getHead(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2)
SWIGEXPORT jint JNICALL Java_com_google_ortools_graph_mainJNI_LinearSumAssignment_1getLeftNode(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2)
SWIGEXPORT jint JNICALL Java_com_google_ortools_graph_mainJNI_MaxFlow_1addArcWithCapacity(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2, jint jarg3, jlong jarg4)
SWIGEXPORT jlong JNICALL Java_com_google_ortools_graph_mainJNI_MaxFlow_1getOptimalFlow(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_)
SWIGEXPORT jlong JNICALL Java_com_google_ortools_graph_mainJNI_new_1MinCostFlow_1_1SWIG_12(JNIEnv *jenv, jclass jcls)
SWIGEXPORT jint JNICALL Java_com_google_ortools_graph_mainJNI_LinearSumAssignment_1getNumArcs(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_)
SWIGEXPORT jint JNICALL Java_com_google_ortools_graph_mainJNI_LinearSumAssignment_1getRightNode(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2)
#define SWIGEXPORT
SWIGEXPORT jlong JNICALL Java_com_google_ortools_graph_mainJNI_MinCostFlow_1getSupply(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2)
SWIGEXPORT jlong JNICALL Java_com_google_ortools_graph_mainJNI_MaxFlow_1getCapacity(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2)
SWIGEXPORT jint JNICALL Java_com_google_ortools_graph_mainJNI_LinearSumAssignment_1getNumNodes(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_)
SWIGEXPORT jint JNICALL Java_com_google_ortools_graph_mainJNI_MinCostFlow_1getNumNodes(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_)
SWIGEXPORT jlong JNICALL Java_com_google_ortools_graph_mainJNI_MinCostFlow_1getUnitCost(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2)
SWIG_JavaExceptionCodes code