Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
RoutingIndexManager.cs
Go to the documentation of this file.
1//------------------------------------------------------------------------------
2// <auto-generated />
3//
4// This file was automatically generated by SWIG (https://www.swig.org).
5// Version 4.2.1
6//
7// Do not make changes to this file unless you know what you are doing - modify
8// the SWIG interface file instead.
9//------------------------------------------------------------------------------
10
12
13using System;
14using System.Runtime.InteropServices;
15using System.Collections;
16using System.Collections.Generic;
17
18public partial class RoutingIndexManager : global::System.IDisposable {
19 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
20 protected bool swigCMemOwn;
21
22 internal RoutingIndexManager(global::System.IntPtr cPtr, bool cMemoryOwn) {
23 swigCMemOwn = cMemoryOwn;
24 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
25 }
26
27 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(RoutingIndexManager obj) {
28 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
29 }
30
31 internal static global::System.Runtime.InteropServices.HandleRef swigRelease(RoutingIndexManager obj) {
32 if (obj != null) {
33 if (!obj.swigCMemOwn)
34 throw new global::System.ApplicationException("Cannot release ownership as memory is not owned");
35 global::System.Runtime.InteropServices.HandleRef ptr = obj.swigCPtr;
36 obj.swigCMemOwn = false;
37 obj.Dispose();
38 return ptr;
39 } else {
40 return new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
41 }
42 }
43
44 ~RoutingIndexManager() {
45 Dispose(false);
46 }
47
48 public void Dispose() {
49 Dispose(true);
50 global::System.GC.SuppressFinalize(this);
51 }
52
53 protected virtual void Dispose(bool disposing) {
54 lock(this) {
55 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
56 if (swigCMemOwn) {
57 swigCMemOwn = false;
59 }
60 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
61 }
62 }
63 }
64
65 public RoutingIndexManager(int num_nodes, int num_vehicles, int depot) : this(operations_research_constraint_solverPINVOKE.new_RoutingIndexManager__SWIG_0(num_nodes, num_vehicles, depot), true) {
66 }
68 public RoutingIndexManager(int num_nodes, int num_vehicles, int[] starts, int[] ends) : this(operations_research_constraint_solverPINVOKE.new_RoutingIndexManager__SWIG_1(num_nodes, num_vehicles, starts.Length, starts , ends.Length, ends ), true) {
69 }
71 public int GetNumberOfNodes() {
73 return ret;
74 }
75
76 public int GetNumberOfVehicles() {
78 return ret;
79 }
80
81 public int GetNumberOfIndices() {
83 return ret;
84 }
85
86 public long GetStartIndex(int vehicle) {
88 return ret;
89 }
90
91 public long GetEndIndex(int vehicle) {
93 return ret;
94 }
95
96 public long NodeToIndex(int node) {
98 return ret;
99 }
100
101 public long[] NodesToIndices( int[] nodes) {
102 global::System.IntPtr cPtr = operations_research_constraint_solverPINVOKE.RoutingIndexManager_NodesToIndices(swigCPtr, nodes.Length, nodes );
103 Int64Vector tmpVector = null;
104 if (cPtr != global::System.IntPtr.Zero) {
105 tmpVector = new Int64Vector(cPtr, true);
106 long[] outArray = new long[tmpVector.Count];
107 tmpVector.CopyTo(outArray);
108 return outArray;
109 }
110 return null;
111}
112
113 public int IndexToNode(long index) {
114 return operations_research_constraint_solverPINVOKE.RoutingIndexManager_IndexToNode(swigCPtr, index);
116
117}
118
119}
static long RoutingIndexManager_NodeToIndex(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)
static void delete_RoutingIndexManager(global::System.Runtime.InteropServices.HandleRef jarg1)
static long RoutingIndexManager_GetEndIndex(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)
static int RoutingIndexManager_GetNumberOfNodes(global::System.Runtime.InteropServices.HandleRef jarg1)
static global::System.IntPtr RoutingIndexManager_NodesToIndices(global::System.Runtime.InteropServices.HandleRef jarg1, int length2, int[] jarg2)
static int RoutingIndexManager_GetNumberOfVehicles(global::System.Runtime.InteropServices.HandleRef jarg1)
static int RoutingIndexManager_GetNumberOfIndices(global::System.Runtime.InteropServices.HandleRef jarg1)
static long RoutingIndexManager_GetStartIndex(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)