OR-Tools  9.6
routing_types.h
Go to the documentation of this file.
1 // Copyright 2010-2022 Google LLC
2 // Licensed under the Apache License, Version 2.0 (the "License");
3 // you may not use this file except in compliance with the License.
4 // You may obtain a copy of the License at
5 //
6 // http://www.apache.org/licenses/LICENSE-2.0
7 //
8 // Unless required by applicable law or agreed to in writing, software
9 // distributed under the License is distributed on an "AS IS" BASIS,
10 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 // See the License for the specific language governing permissions and
12 // limitations under the License.
13 
14 #ifndef OR_TOOLS_CONSTRAINT_SOLVER_ROUTING_TYPES_H_
15 #define OR_TOOLS_CONSTRAINT_SOLVER_ROUTING_TYPES_H_
16 
17 #include <functional>
18 #include <utility>
19 #include <vector>
20 
21 #include "absl/strings/string_view.h"
22 #include "ortools/base/int_type.h"
24 
25 namespace operations_research {
26 
36 DEFINE_INT_TYPE(RoutingNodeIndex, int);
37 DEFINE_INT_TYPE(RoutingCostClassIndex, int);
38 DEFINE_INT_TYPE(RoutingDimensionIndex, int);
39 DEFINE_INT_TYPE(RoutingDisjunctionIndex, int);
40 DEFINE_INT_TYPE(RoutingVehicleClassIndex, int);
41 
42 typedef std::function<int64_t(int64_t)> RoutingTransitCallback1;
43 typedef std::function<int64_t(int64_t, int64_t)> RoutingTransitCallback2;
44 // NOTE(user): keep the "> >" for SWIG.
45 typedef std::pair<std::vector<int64_t>, std::vector<int64_t> > RoutingIndexPair;
46 typedef std::vector<RoutingIndexPair> RoutingIndexPairs;
47 
48 } // namespace operations_research
49 
50 #endif // OR_TOOLS_CONSTRAINT_SOLVER_ROUTING_TYPES_H_
Collection of objects used to extend the Constraint Solver library.
std::function< int64_t(int64_t, int64_t)> RoutingTransitCallback2
Definition: routing_types.h:43
std::pair< std::vector< int64_t >, std::vector< int64_t > > RoutingIndexPair
Definition: routing_types.h:45
DEFINE_INT_TYPE(RoutingNodeIndex, int)
Defining common types used in the routing library outside the main RoutingModel class has several pur...
std::function< int64_t(int64_t)> RoutingTransitCallback1
Definition: routing_types.h:42
std::vector< RoutingIndexPair > RoutingIndexPairs
Definition: routing_types.h:46