OR-Tools  8.2
flow_problem.pb.cc
Go to the documentation of this file.
1 // Generated by the protocol buffer compiler. DO NOT EDIT!
2 // source: ortools/graph/flow_problem.proto
3 
5 
6 #include <algorithm>
7 
8 #include <google/protobuf/io/coded_stream.h>
9 #include <google/protobuf/extension_set.h>
10 #include <google/protobuf/wire_format_lite.h>
11 #include <google/protobuf/descriptor.h>
12 #include <google/protobuf/generated_message_reflection.h>
13 #include <google/protobuf/reflection_ops.h>
14 #include <google/protobuf/wire_format.h>
15 // @@protoc_insertion_point(includes)
16 #include <google/protobuf/port_def.inc>
17 extern PROTOBUF_INTERNAL_EXPORT_ortools_2fgraph_2fflow_5fproblem_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_Arc_ortools_2fgraph_2fflow_5fproblem_2eproto;
18 extern PROTOBUF_INTERNAL_EXPORT_ortools_2fgraph_2fflow_5fproblem_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_Node_ortools_2fgraph_2fflow_5fproblem_2eproto;
19 namespace operations_research {
21  public:
22  ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<Arc> _instance;
25  public:
26  ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<Node> _instance;
29  public:
30  ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<FlowModel> _instance;
32 } // namespace operations_research
34  GOOGLE_PROTOBUF_VERIFY_VERSION;
35 
36  {
38  new (ptr) ::operations_research::Arc();
39  ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
40  }
41 }
42 
43 ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_Arc_ortools_2fgraph_2fflow_5fproblem_2eproto =
44  {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_Arc_ortools_2fgraph_2fflow_5fproblem_2eproto}, {}};
45 
47  GOOGLE_PROTOBUF_VERIFY_VERSION;
48 
49  {
51  new (ptr) ::operations_research::FlowModel();
52  ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
53  }
54 }
55 
56 ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_FlowModel_ortools_2fgraph_2fflow_5fproblem_2eproto =
57  {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 2, 0, InitDefaultsscc_info_FlowModel_ortools_2fgraph_2fflow_5fproblem_2eproto}, {
60 
62  GOOGLE_PROTOBUF_VERIFY_VERSION;
63 
64  {
66  new (ptr) ::operations_research::Node();
67  ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
68  }
69 }
70 
71 ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_Node_ortools_2fgraph_2fflow_5fproblem_2eproto =
72  {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_Node_ortools_2fgraph_2fflow_5fproblem_2eproto}, {}};
73 
74 static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_ortools_2fgraph_2fflow_5fproblem_2eproto[3];
75 static const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* file_level_enum_descriptors_ortools_2fgraph_2fflow_5fproblem_2eproto[1];
76 static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_ortools_2fgraph_2fflow_5fproblem_2eproto = nullptr;
77 
79  PROTOBUF_FIELD_OFFSET(::operations_research::Arc, _has_bits_),
80  PROTOBUF_FIELD_OFFSET(::operations_research::Arc, _internal_metadata_),
81  ~0u, // no _extensions_
82  ~0u, // no _oneof_case_
83  ~0u, // no _weak_field_map_
84  PROTOBUF_FIELD_OFFSET(::operations_research::Arc, tail_node_id_),
85  PROTOBUF_FIELD_OFFSET(::operations_research::Arc, head_node_id_),
86  PROTOBUF_FIELD_OFFSET(::operations_research::Arc, capacity_),
87  PROTOBUF_FIELD_OFFSET(::operations_research::Arc, unit_cost_),
88  0,
89  1,
90  3,
91  2,
92  PROTOBUF_FIELD_OFFSET(::operations_research::Node, _has_bits_),
93  PROTOBUF_FIELD_OFFSET(::operations_research::Node, _internal_metadata_),
94  ~0u, // no _extensions_
95  ~0u, // no _oneof_case_
96  ~0u, // no _weak_field_map_
97  PROTOBUF_FIELD_OFFSET(::operations_research::Node, id_),
98  PROTOBUF_FIELD_OFFSET(::operations_research::Node, supply_),
99  0,
100  1,
101  PROTOBUF_FIELD_OFFSET(::operations_research::FlowModel, _has_bits_),
102  PROTOBUF_FIELD_OFFSET(::operations_research::FlowModel, _internal_metadata_),
103  ~0u, // no _extensions_
104  ~0u, // no _oneof_case_
105  ~0u, // no _weak_field_map_
106  PROTOBUF_FIELD_OFFSET(::operations_research::FlowModel, node_),
107  PROTOBUF_FIELD_OFFSET(::operations_research::FlowModel, arc_),
108  PROTOBUF_FIELD_OFFSET(::operations_research::FlowModel, problem_type_),
109  ~0u,
110  ~0u,
111  0,
112 };
113 static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
114  { 0, 9, sizeof(::operations_research::Arc)},
115  { 13, 20, sizeof(::operations_research::Node)},
116  { 22, 30, sizeof(::operations_research::FlowModel)},
117 };
118 
119 static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = {
120  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::operations_research::_Arc_default_instance_),
121  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::operations_research::_Node_default_instance_),
122  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::operations_research::_FlowModel_default_instance_),
123 };
124 
125 const char descriptor_table_protodef_ortools_2fgraph_2fflow_5fproblem_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
126  "\n ortools/graph/flow_problem.proto\022\023oper"
127  "ations_research\"\\\n\003Arc\022\024\n\014tail_node_id\030\001"
128  " \001(\003\022\024\n\014head_node_id\030\002 \001(\003\022\023\n\010capacity\030\003"
129  " \001(\003:\0011\022\024\n\tunit_cost\030\004 \001(\003:\0010\"%\n\004Node\022\n\n"
130  "\002id\030\001 \001(\003\022\021\n\006supply\030\002 \001(\003:\0010\"\367\001\n\tFlowMod"
131  "el\022\'\n\004node\030\001 \003(\0132\031.operations_research.N"
132  "ode\022%\n\003arc\030\002 \003(\0132\030.operations_research.A"
133  "rc\022O\n\014problem_type\030\003 \001(\0162*.operations_re"
134  "search.FlowModel.ProblemType:\rMIN_COST_F"
135  "LOW\"I\n\013ProblemType\022\031\n\025LINEAR_SUM_ASSIGNM"
136  "ENT\020\000\022\014\n\010MAX_FLOW\020\001\022\021\n\rMIN_COST_FLOW\020\002"
137  ;
138 static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_ortools_2fgraph_2fflow_5fproblem_2eproto_deps[1] = {
139 };
140 static ::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase*const descriptor_table_ortools_2fgraph_2fflow_5fproblem_2eproto_sccs[3] = {
144 };
145 static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_ortools_2fgraph_2fflow_5fproblem_2eproto_once;
146 const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_ortools_2fgraph_2fflow_5fproblem_2eproto = {
147  false, false, descriptor_table_protodef_ortools_2fgraph_2fflow_5fproblem_2eproto, "ortools/graph/flow_problem.proto", 438,
151 };
152 
153 // Force running AddDescriptors() at dynamic initialization time.
154 static bool dynamic_init_dummy_ortools_2fgraph_2fflow_5fproblem_2eproto = (static_cast<void>(::PROTOBUF_NAMESPACE_ID::internal::AddDescriptors(&descriptor_table_ortools_2fgraph_2fflow_5fproblem_2eproto)), true);
155 namespace operations_research {
156 const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* FlowModel_ProblemType_descriptor() {
157  ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_ortools_2fgraph_2fflow_5fproblem_2eproto);
159 }
161  switch (value) {
162  case 0:
163  case 1:
164  case 2:
165  return true;
166  default:
167  return false;
168  }
169 }
170 
171 #if (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900)
172 constexpr FlowModel_ProblemType FlowModel::LINEAR_SUM_ASSIGNMENT;
173 constexpr FlowModel_ProblemType FlowModel::MAX_FLOW;
174 constexpr FlowModel_ProblemType FlowModel::MIN_COST_FLOW;
175 constexpr FlowModel_ProblemType FlowModel::ProblemType_MIN;
176 constexpr FlowModel_ProblemType FlowModel::ProblemType_MAX;
177 constexpr int FlowModel::ProblemType_ARRAYSIZE;
178 #endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900)
179 
180 // ===================================================================
181 
182 class Arc::_Internal {
183  public:
184  using HasBits = decltype(std::declval<Arc>()._has_bits_);
185  static void set_has_tail_node_id(HasBits* has_bits) {
186  (*has_bits)[0] |= 1u;
187  }
188  static void set_has_head_node_id(HasBits* has_bits) {
189  (*has_bits)[0] |= 2u;
190  }
191  static void set_has_capacity(HasBits* has_bits) {
192  (*has_bits)[0] |= 8u;
193  }
194  static void set_has_unit_cost(HasBits* has_bits) {
195  (*has_bits)[0] |= 4u;
196  }
197 };
198 
199 Arc::Arc(::PROTOBUF_NAMESPACE_ID::Arena* arena)
200  : ::PROTOBUF_NAMESPACE_ID::Message(arena) {
201  SharedCtor();
202  RegisterArenaDtor(arena);
203  // @@protoc_insertion_point(arena_constructor:operations_research.Arc)
204 }
205 Arc::Arc(const Arc& from)
206  : ::PROTOBUF_NAMESPACE_ID::Message(),
207  _has_bits_(from._has_bits_) {
208  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
209  ::memcpy(&tail_node_id_, &from.tail_node_id_,
210  static_cast<size_t>(reinterpret_cast<char*>(&capacity_) -
211  reinterpret_cast<char*>(&tail_node_id_)) + sizeof(capacity_));
212  // @@protoc_insertion_point(copy_constructor:operations_research.Arc)
213 }
214 
215 void Arc::SharedCtor() {
216  ::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
217  reinterpret_cast<char*>(&tail_node_id_) - reinterpret_cast<char*>(this)),
218  0, static_cast<size_t>(reinterpret_cast<char*>(&unit_cost_) -
219  reinterpret_cast<char*>(&tail_node_id_)) + sizeof(unit_cost_));
220  capacity_ = PROTOBUF_LONGLONG(1);
221 }
222 
223 Arc::~Arc() {
224  // @@protoc_insertion_point(destructor:operations_research.Arc)
225  SharedDtor();
226  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
227 }
228 
229 void Arc::SharedDtor() {
230  GOOGLE_DCHECK(GetArena() == nullptr);
231 }
232 
233 void Arc::ArenaDtor(void* object) {
234  Arc* _this = reinterpret_cast< Arc* >(object);
235  (void)_this;
236 }
237 void Arc::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
238 }
239 void Arc::SetCachedSize(int size) const {
240  _cached_size_.Set(size);
241 }
242 const Arc& Arc::default_instance() {
243  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_Arc_ortools_2fgraph_2fflow_5fproblem_2eproto.base);
244  return *internal_default_instance();
245 }
246 
247 
248 void Arc::Clear() {
249 // @@protoc_insertion_point(message_clear_start:operations_research.Arc)
250  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
251  // Prevent compiler warnings about cached_has_bits being unused
252  (void) cached_has_bits;
253 
254  cached_has_bits = _has_bits_[0];
255  if (cached_has_bits & 0x0000000fu) {
256  ::memset(&tail_node_id_, 0, static_cast<size_t>(
257  reinterpret_cast<char*>(&unit_cost_) -
258  reinterpret_cast<char*>(&tail_node_id_)) + sizeof(unit_cost_));
259  capacity_ = PROTOBUF_LONGLONG(1);
260  }
261  _has_bits_.Clear();
262  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
263 }
264 
265 const char* Arc::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
266 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
267  _Internal::HasBits has_bits{};
268  while (!ctx->Done(&ptr)) {
270  ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
271  CHK_(ptr);
272  switch (tag >> 3) {
273  // optional int64 tail_node_id = 1;
274  case 1:
275  if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) {
277  tail_node_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
278  CHK_(ptr);
279  } else goto handle_unusual;
280  continue;
281  // optional int64 head_node_id = 2;
282  case 2:
283  if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) {
285  head_node_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
286  CHK_(ptr);
287  } else goto handle_unusual;
288  continue;
289  // optional int64 capacity = 3 [default = 1];
290  case 3:
291  if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) {
292  _Internal::set_has_capacity(&has_bits);
293  capacity_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
294  CHK_(ptr);
295  } else goto handle_unusual;
296  continue;
297  // optional int64 unit_cost = 4 [default = 0];
298  case 4:
299  if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) {
300  _Internal::set_has_unit_cost(&has_bits);
301  unit_cost_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
302  CHK_(ptr);
303  } else goto handle_unusual;
304  continue;
305  default: {
306  handle_unusual:
307  if ((tag & 7) == 4 || tag == 0) {
308  ctx->SetLastTag(tag);
309  goto success;
310  }
311  ptr = UnknownFieldParse(tag,
312  _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
313  ptr, ctx);
314  CHK_(ptr != nullptr);
315  continue;
316  }
317  } // switch
318  } // while
319 success:
320  _has_bits_.Or(has_bits);
321  return ptr;
322 failure:
323  ptr = nullptr;
324  goto success;
325 #undef CHK_
326 }
327 
328 ::PROTOBUF_NAMESPACE_ID::uint8* Arc::_InternalSerialize(
329  ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
330  // @@protoc_insertion_point(serialize_to_array_start:operations_research.Arc)
331  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
332  (void) cached_has_bits;
333 
334  cached_has_bits = _has_bits_[0];
335  // optional int64 tail_node_id = 1;
336  if (cached_has_bits & 0x00000001u) {
337  target = stream->EnsureSpace(target);
338  target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(1, this->_internal_tail_node_id(), target);
339  }
340 
341  // optional int64 head_node_id = 2;
342  if (cached_has_bits & 0x00000002u) {
343  target = stream->EnsureSpace(target);
344  target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(2, this->_internal_head_node_id(), target);
345  }
346 
347  // optional int64 capacity = 3 [default = 1];
348  if (cached_has_bits & 0x00000008u) {
349  target = stream->EnsureSpace(target);
350  target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(3, this->_internal_capacity(), target);
351  }
352 
353  // optional int64 unit_cost = 4 [default = 0];
354  if (cached_has_bits & 0x00000004u) {
355  target = stream->EnsureSpace(target);
356  target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(4, this->_internal_unit_cost(), target);
357  }
358 
359  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
360  target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
361  _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
362  }
363  // @@protoc_insertion_point(serialize_to_array_end:operations_research.Arc)
364  return target;
365 }
366 
367 size_t Arc::ByteSizeLong() const {
368 // @@protoc_insertion_point(message_byte_size_start:operations_research.Arc)
369  size_t total_size = 0;
370 
371  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
372  // Prevent compiler warnings about cached_has_bits being unused
373  (void) cached_has_bits;
374 
375  cached_has_bits = _has_bits_[0];
376  if (cached_has_bits & 0x0000000fu) {
377  // optional int64 tail_node_id = 1;
378  if (cached_has_bits & 0x00000001u) {
379  total_size += 1 +
380  ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size(
381  this->_internal_tail_node_id());
382  }
383 
384  // optional int64 head_node_id = 2;
385  if (cached_has_bits & 0x00000002u) {
386  total_size += 1 +
387  ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size(
388  this->_internal_head_node_id());
389  }
390 
391  // optional int64 unit_cost = 4 [default = 0];
392  if (cached_has_bits & 0x00000004u) {
393  total_size += 1 +
394  ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size(
395  this->_internal_unit_cost());
396  }
397 
398  // optional int64 capacity = 3 [default = 1];
399  if (cached_has_bits & 0x00000008u) {
400  total_size += 1 +
401  ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size(
402  this->_internal_capacity());
403  }
404 
405  }
406  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
407  return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
408  _internal_metadata_, total_size, &_cached_size_);
409  }
410  int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
411  SetCachedSize(cached_size);
412  return total_size;
413 }
414 
415 void Arc::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
416 // @@protoc_insertion_point(generalized_merge_from_start:operations_research.Arc)
417  GOOGLE_DCHECK_NE(&from, this);
418  const Arc* source =
419  ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<Arc>(
420  &from);
421  if (source == nullptr) {
422  // @@protoc_insertion_point(generalized_merge_from_cast_fail:operations_research.Arc)
423  ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
424  } else {
425  // @@protoc_insertion_point(generalized_merge_from_cast_success:operations_research.Arc)
426  MergeFrom(*source);
427  }
428 }
429 
430 void Arc::MergeFrom(const Arc& from) {
431 // @@protoc_insertion_point(class_specific_merge_from_start:operations_research.Arc)
432  GOOGLE_DCHECK_NE(&from, this);
433  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
434  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
435  (void) cached_has_bits;
436 
437  cached_has_bits = from._has_bits_[0];
438  if (cached_has_bits & 0x0000000fu) {
439  if (cached_has_bits & 0x00000001u) {
440  tail_node_id_ = from.tail_node_id_;
441  }
442  if (cached_has_bits & 0x00000002u) {
443  head_node_id_ = from.head_node_id_;
444  }
445  if (cached_has_bits & 0x00000004u) {
446  unit_cost_ = from.unit_cost_;
447  }
448  if (cached_has_bits & 0x00000008u) {
449  capacity_ = from.capacity_;
450  }
451  _has_bits_[0] |= cached_has_bits;
452  }
453 }
454 
455 void Arc::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
456 // @@protoc_insertion_point(generalized_copy_from_start:operations_research.Arc)
457  if (&from == this) return;
458  Clear();
459  MergeFrom(from);
460 }
461 
462 void Arc::CopyFrom(const Arc& from) {
463 // @@protoc_insertion_point(class_specific_copy_from_start:operations_research.Arc)
464  if (&from == this) return;
465  Clear();
466  MergeFrom(from);
467 }
468 
469 bool Arc::IsInitialized() const {
470  return true;
471 }
472 
473 void Arc::InternalSwap(Arc* other) {
474  using std::swap;
475  _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_);
476  swap(_has_bits_[0], other->_has_bits_[0]);
477  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
478  PROTOBUF_FIELD_OFFSET(Arc, unit_cost_)
479  + sizeof(Arc::unit_cost_)
480  - PROTOBUF_FIELD_OFFSET(Arc, tail_node_id_)>(
481  reinterpret_cast<char*>(&tail_node_id_),
482  reinterpret_cast<char*>(&other->tail_node_id_));
483  swap(capacity_, other->capacity_);
484 }
485 
486 ::PROTOBUF_NAMESPACE_ID::Metadata Arc::GetMetadata() const {
487  return GetMetadataStatic();
488 }
489 
490 
491 // ===================================================================
492 
494  public:
495  using HasBits = decltype(std::declval<Node>()._has_bits_);
496  static void set_has_id(HasBits* has_bits) {
497  (*has_bits)[0] |= 1u;
498  }
499  static void set_has_supply(HasBits* has_bits) {
500  (*has_bits)[0] |= 2u;
501  }
502 };
503 
504 Node::Node(::PROTOBUF_NAMESPACE_ID::Arena* arena)
505  : ::PROTOBUF_NAMESPACE_ID::Message(arena) {
506  SharedCtor();
507  RegisterArenaDtor(arena);
508  // @@protoc_insertion_point(arena_constructor:operations_research.Node)
509 }
510 Node::Node(const Node& from)
511  : ::PROTOBUF_NAMESPACE_ID::Message(),
512  _has_bits_(from._has_bits_) {
513  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
514  ::memcpy(&id_, &from.id_,
515  static_cast<size_t>(reinterpret_cast<char*>(&supply_) -
516  reinterpret_cast<char*>(&id_)) + sizeof(supply_));
517  // @@protoc_insertion_point(copy_constructor:operations_research.Node)
518 }
519 
520 void Node::SharedCtor() {
521  ::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
522  reinterpret_cast<char*>(&id_) - reinterpret_cast<char*>(this)),
523  0, static_cast<size_t>(reinterpret_cast<char*>(&supply_) -
524  reinterpret_cast<char*>(&id_)) + sizeof(supply_));
525 }
526 
527 Node::~Node() {
528  // @@protoc_insertion_point(destructor:operations_research.Node)
529  SharedDtor();
530  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
531 }
532 
533 void Node::SharedDtor() {
534  GOOGLE_DCHECK(GetArena() == nullptr);
535 }
536 
537 void Node::ArenaDtor(void* object) {
538  Node* _this = reinterpret_cast< Node* >(object);
539  (void)_this;
540 }
541 void Node::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
542 }
543 void Node::SetCachedSize(int size) const {
544  _cached_size_.Set(size);
545 }
546 const Node& Node::default_instance() {
547  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_Node_ortools_2fgraph_2fflow_5fproblem_2eproto.base);
548  return *internal_default_instance();
549 }
550 
551 
552 void Node::Clear() {
553 // @@protoc_insertion_point(message_clear_start:operations_research.Node)
554  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
555  // Prevent compiler warnings about cached_has_bits being unused
556  (void) cached_has_bits;
557 
558  cached_has_bits = _has_bits_[0];
559  if (cached_has_bits & 0x00000003u) {
560  ::memset(&id_, 0, static_cast<size_t>(
561  reinterpret_cast<char*>(&supply_) -
562  reinterpret_cast<char*>(&id_)) + sizeof(supply_));
563  }
564  _has_bits_.Clear();
565  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
566 }
567 
568 const char* Node::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
569 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
570  _Internal::HasBits has_bits{};
571  while (!ctx->Done(&ptr)) {
573  ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
574  CHK_(ptr);
575  switch (tag >> 3) {
576  // optional int64 id = 1;
577  case 1:
578  if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) {
579  _Internal::set_has_id(&has_bits);
580  id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
581  CHK_(ptr);
582  } else goto handle_unusual;
583  continue;
584  // optional int64 supply = 2 [default = 0];
585  case 2:
586  if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) {
587  _Internal::set_has_supply(&has_bits);
588  supply_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
589  CHK_(ptr);
590  } else goto handle_unusual;
591  continue;
592  default: {
593  handle_unusual:
594  if ((tag & 7) == 4 || tag == 0) {
595  ctx->SetLastTag(tag);
596  goto success;
597  }
598  ptr = UnknownFieldParse(tag,
599  _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
600  ptr, ctx);
601  CHK_(ptr != nullptr);
602  continue;
603  }
604  } // switch
605  } // while
606 success:
607  _has_bits_.Or(has_bits);
608  return ptr;
609 failure:
610  ptr = nullptr;
611  goto success;
612 #undef CHK_
613 }
614 
615 ::PROTOBUF_NAMESPACE_ID::uint8* Node::_InternalSerialize(
616  ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
617  // @@protoc_insertion_point(serialize_to_array_start:operations_research.Node)
618  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
619  (void) cached_has_bits;
620 
621  cached_has_bits = _has_bits_[0];
622  // optional int64 id = 1;
623  if (cached_has_bits & 0x00000001u) {
624  target = stream->EnsureSpace(target);
625  target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(1, this->_internal_id(), target);
626  }
627 
628  // optional int64 supply = 2 [default = 0];
629  if (cached_has_bits & 0x00000002u) {
630  target = stream->EnsureSpace(target);
631  target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(2, this->_internal_supply(), target);
632  }
633 
634  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
635  target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
636  _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
637  }
638  // @@protoc_insertion_point(serialize_to_array_end:operations_research.Node)
639  return target;
640 }
641 
642 size_t Node::ByteSizeLong() const {
643 // @@protoc_insertion_point(message_byte_size_start:operations_research.Node)
644  size_t total_size = 0;
645 
646  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
647  // Prevent compiler warnings about cached_has_bits being unused
648  (void) cached_has_bits;
649 
650  cached_has_bits = _has_bits_[0];
651  if (cached_has_bits & 0x00000003u) {
652  // optional int64 id = 1;
653  if (cached_has_bits & 0x00000001u) {
654  total_size += 1 +
655  ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size(
656  this->_internal_id());
657  }
658 
659  // optional int64 supply = 2 [default = 0];
660  if (cached_has_bits & 0x00000002u) {
661  total_size += 1 +
662  ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size(
663  this->_internal_supply());
664  }
665 
666  }
667  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
668  return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
669  _internal_metadata_, total_size, &_cached_size_);
670  }
671  int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
672  SetCachedSize(cached_size);
673  return total_size;
674 }
675 
676 void Node::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
677 // @@protoc_insertion_point(generalized_merge_from_start:operations_research.Node)
678  GOOGLE_DCHECK_NE(&from, this);
679  const Node* source =
680  ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<Node>(
681  &from);
682  if (source == nullptr) {
683  // @@protoc_insertion_point(generalized_merge_from_cast_fail:operations_research.Node)
684  ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
685  } else {
686  // @@protoc_insertion_point(generalized_merge_from_cast_success:operations_research.Node)
687  MergeFrom(*source);
688  }
689 }
690 
691 void Node::MergeFrom(const Node& from) {
692 // @@protoc_insertion_point(class_specific_merge_from_start:operations_research.Node)
693  GOOGLE_DCHECK_NE(&from, this);
694  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
695  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
696  (void) cached_has_bits;
697 
698  cached_has_bits = from._has_bits_[0];
699  if (cached_has_bits & 0x00000003u) {
700  if (cached_has_bits & 0x00000001u) {
701  id_ = from.id_;
702  }
703  if (cached_has_bits & 0x00000002u) {
704  supply_ = from.supply_;
705  }
706  _has_bits_[0] |= cached_has_bits;
707  }
708 }
709 
710 void Node::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
711 // @@protoc_insertion_point(generalized_copy_from_start:operations_research.Node)
712  if (&from == this) return;
713  Clear();
714  MergeFrom(from);
715 }
716 
717 void Node::CopyFrom(const Node& from) {
718 // @@protoc_insertion_point(class_specific_copy_from_start:operations_research.Node)
719  if (&from == this) return;
720  Clear();
721  MergeFrom(from);
722 }
723 
724 bool Node::IsInitialized() const {
725  return true;
726 }
727 
728 void Node::InternalSwap(Node* other) {
729  using std::swap;
730  _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_);
731  swap(_has_bits_[0], other->_has_bits_[0]);
732  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
733  PROTOBUF_FIELD_OFFSET(Node, supply_)
734  + sizeof(Node::supply_)
735  - PROTOBUF_FIELD_OFFSET(Node, id_)>(
736  reinterpret_cast<char*>(&id_),
737  reinterpret_cast<char*>(&other->id_));
738 }
739 
740 ::PROTOBUF_NAMESPACE_ID::Metadata Node::GetMetadata() const {
741  return GetMetadataStatic();
742 }
743 
744 
745 // ===================================================================
746 
748  public:
749  using HasBits = decltype(std::declval<FlowModel>()._has_bits_);
750  static void set_has_problem_type(HasBits* has_bits) {
751  (*has_bits)[0] |= 1u;
752  }
753 };
754 
755 FlowModel::FlowModel(::PROTOBUF_NAMESPACE_ID::Arena* arena)
756  : ::PROTOBUF_NAMESPACE_ID::Message(arena),
757  node_(arena),
758  arc_(arena) {
759  SharedCtor();
760  RegisterArenaDtor(arena);
761  // @@protoc_insertion_point(arena_constructor:operations_research.FlowModel)
762 }
763 FlowModel::FlowModel(const FlowModel& from)
764  : ::PROTOBUF_NAMESPACE_ID::Message(),
765  _has_bits_(from._has_bits_),
766  node_(from.node_),
767  arc_(from.arc_) {
768  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
769  problem_type_ = from.problem_type_;
770  // @@protoc_insertion_point(copy_constructor:operations_research.FlowModel)
771 }
772 
773 void FlowModel::SharedCtor() {
774  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_FlowModel_ortools_2fgraph_2fflow_5fproblem_2eproto.base);
775  problem_type_ = 2;
776 }
777 
778 FlowModel::~FlowModel() {
779  // @@protoc_insertion_point(destructor:operations_research.FlowModel)
780  SharedDtor();
781  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
782 }
783 
784 void FlowModel::SharedDtor() {
785  GOOGLE_DCHECK(GetArena() == nullptr);
786 }
787 
788 void FlowModel::ArenaDtor(void* object) {
789  FlowModel* _this = reinterpret_cast< FlowModel* >(object);
790  (void)_this;
791 }
792 void FlowModel::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
793 }
794 void FlowModel::SetCachedSize(int size) const {
795  _cached_size_.Set(size);
796 }
797 const FlowModel& FlowModel::default_instance() {
798  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_FlowModel_ortools_2fgraph_2fflow_5fproblem_2eproto.base);
799  return *internal_default_instance();
800 }
801 
802 
803 void FlowModel::Clear() {
804 // @@protoc_insertion_point(message_clear_start:operations_research.FlowModel)
805  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
806  // Prevent compiler warnings about cached_has_bits being unused
807  (void) cached_has_bits;
808 
809  node_.Clear();
810  arc_.Clear();
811  problem_type_ = 2;
812  _has_bits_.Clear();
813  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
814 }
815 
816 const char* FlowModel::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
817 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
818  _Internal::HasBits has_bits{};
819  while (!ctx->Done(&ptr)) {
821  ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
822  CHK_(ptr);
823  switch (tag >> 3) {
824  // repeated .operations_research.Node node = 1;
825  case 1:
826  if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
827  ptr -= 1;
828  do {
829  ptr += 1;
830  ptr = ctx->ParseMessage(_internal_add_node(), ptr);
831  CHK_(ptr);
832  if (!ctx->DataAvailable(ptr)) break;
833  } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<10>(ptr));
834  } else goto handle_unusual;
835  continue;
836  // repeated .operations_research.Arc arc = 2;
837  case 2:
838  if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) {
839  ptr -= 1;
840  do {
841  ptr += 1;
842  ptr = ctx->ParseMessage(_internal_add_arc(), ptr);
843  CHK_(ptr);
844  if (!ctx->DataAvailable(ptr)) break;
845  } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<18>(ptr));
846  } else goto handle_unusual;
847  continue;
848  // optional .operations_research.FlowModel.ProblemType problem_type = 3 [default = MIN_COST_FLOW];
849  case 3:
850  if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) {
851  ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
852  CHK_(ptr);
853  if (PROTOBUF_PREDICT_TRUE(::operations_research::FlowModel_ProblemType_IsValid(val))) {
854  _internal_set_problem_type(static_cast<::operations_research::FlowModel_ProblemType>(val));
855  } else {
856  ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(3, val, mutable_unknown_fields());
857  }
858  } else goto handle_unusual;
859  continue;
860  default: {
861  handle_unusual:
862  if ((tag & 7) == 4 || tag == 0) {
863  ctx->SetLastTag(tag);
864  goto success;
865  }
866  ptr = UnknownFieldParse(tag,
867  _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
868  ptr, ctx);
869  CHK_(ptr != nullptr);
870  continue;
871  }
872  } // switch
873  } // while
874 success:
875  _has_bits_.Or(has_bits);
876  return ptr;
877 failure:
878  ptr = nullptr;
879  goto success;
880 #undef CHK_
881 }
882 
883 ::PROTOBUF_NAMESPACE_ID::uint8* FlowModel::_InternalSerialize(
884  ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
885  // @@protoc_insertion_point(serialize_to_array_start:operations_research.FlowModel)
886  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
887  (void) cached_has_bits;
888 
889  // repeated .operations_research.Node node = 1;
890  for (unsigned int i = 0,
891  n = static_cast<unsigned int>(this->_internal_node_size()); i < n; i++) {
892  target = stream->EnsureSpace(target);
893  target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
894  InternalWriteMessage(1, this->_internal_node(i), target, stream);
895  }
896 
897  // repeated .operations_research.Arc arc = 2;
898  for (unsigned int i = 0,
899  n = static_cast<unsigned int>(this->_internal_arc_size()); i < n; i++) {
900  target = stream->EnsureSpace(target);
901  target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
902  InternalWriteMessage(2, this->_internal_arc(i), target, stream);
903  }
904 
905  cached_has_bits = _has_bits_[0];
906  // optional .operations_research.FlowModel.ProblemType problem_type = 3 [default = MIN_COST_FLOW];
907  if (cached_has_bits & 0x00000001u) {
908  target = stream->EnsureSpace(target);
909  target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
910  3, this->_internal_problem_type(), target);
911  }
912 
913  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
914  target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
915  _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
916  }
917  // @@protoc_insertion_point(serialize_to_array_end:operations_research.FlowModel)
918  return target;
919 }
920 
921 size_t FlowModel::ByteSizeLong() const {
922 // @@protoc_insertion_point(message_byte_size_start:operations_research.FlowModel)
923  size_t total_size = 0;
924 
925  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
926  // Prevent compiler warnings about cached_has_bits being unused
927  (void) cached_has_bits;
928 
929  // repeated .operations_research.Node node = 1;
930  total_size += 1UL * this->_internal_node_size();
931  for (const auto& msg : this->node_) {
932  total_size +=
933  ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
934  }
935 
936  // repeated .operations_research.Arc arc = 2;
937  total_size += 1UL * this->_internal_arc_size();
938  for (const auto& msg : this->arc_) {
939  total_size +=
940  ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
941  }
942 
943  // optional .operations_research.FlowModel.ProblemType problem_type = 3 [default = MIN_COST_FLOW];
944  cached_has_bits = _has_bits_[0];
945  if (cached_has_bits & 0x00000001u) {
946  total_size += 1 +
947  ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_problem_type());
948  }
949 
950  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
951  return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
952  _internal_metadata_, total_size, &_cached_size_);
953  }
954  int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
955  SetCachedSize(cached_size);
956  return total_size;
957 }
958 
959 void FlowModel::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
960 // @@protoc_insertion_point(generalized_merge_from_start:operations_research.FlowModel)
961  GOOGLE_DCHECK_NE(&from, this);
962  const FlowModel* source =
963  ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<FlowModel>(
964  &from);
965  if (source == nullptr) {
966  // @@protoc_insertion_point(generalized_merge_from_cast_fail:operations_research.FlowModel)
967  ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
968  } else {
969  // @@protoc_insertion_point(generalized_merge_from_cast_success:operations_research.FlowModel)
970  MergeFrom(*source);
971  }
972 }
973 
974 void FlowModel::MergeFrom(const FlowModel& from) {
975 // @@protoc_insertion_point(class_specific_merge_from_start:operations_research.FlowModel)
976  GOOGLE_DCHECK_NE(&from, this);
977  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
978  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
979  (void) cached_has_bits;
980 
981  node_.MergeFrom(from.node_);
982  arc_.MergeFrom(from.arc_);
983  if (from._internal_has_problem_type()) {
984  _internal_set_problem_type(from._internal_problem_type());
985  }
986 }
987 
988 void FlowModel::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
989 // @@protoc_insertion_point(generalized_copy_from_start:operations_research.FlowModel)
990  if (&from == this) return;
991  Clear();
992  MergeFrom(from);
993 }
994 
995 void FlowModel::CopyFrom(const FlowModel& from) {
996 // @@protoc_insertion_point(class_specific_copy_from_start:operations_research.FlowModel)
997  if (&from == this) return;
998  Clear();
999  MergeFrom(from);
1000 }
1001 
1002 bool FlowModel::IsInitialized() const {
1003  return true;
1004 }
1005 
1006 void FlowModel::InternalSwap(FlowModel* other) {
1007  using std::swap;
1008  _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_);
1009  swap(_has_bits_[0], other->_has_bits_[0]);
1010  node_.InternalSwap(&other->node_);
1011  arc_.InternalSwap(&other->arc_);
1012  swap(problem_type_, other->problem_type_);
1013 }
1014 
1015 ::PROTOBUF_NAMESPACE_ID::Metadata FlowModel::GetMetadata() const {
1016  return GetMetadataStatic();
1017 }
1018 
1019 
1020 // @@protoc_insertion_point(namespace_scope)
1021 } // namespace operations_research
1022 PROTOBUF_NAMESPACE_OPEN
1024  return Arena::CreateMessageInternal< ::operations_research::Arc >(arena);
1025 }
1026 template<> PROTOBUF_NOINLINE ::operations_research::Node* Arena::CreateMaybeMessage< ::operations_research::Node >(Arena* arena) {
1027  return Arena::CreateMessageInternal< ::operations_research::Node >(arena);
1028 }
1029 template<> PROTOBUF_NOINLINE ::operations_research::FlowModel* Arena::CreateMaybeMessage< ::operations_research::FlowModel >(Arena* arena) {
1030  return Arena::CreateMessageInternal< ::operations_research::FlowModel >(arena);
1031 }
1032 PROTOBUF_NAMESPACE_CLOSE
1033 
1034 // @@protoc_insertion_point(global_scope)
1035 #include <google/protobuf/port_undef.inc>
static void set_has_capacity(HasBits *has_bits)
static void set_has_tail_node_id(HasBits *has_bits)
static void set_has_unit_cost(HasBits *has_bits)
static void set_has_head_node_id(HasBits *has_bits)
decltype(std::declval< Arc >()._has_bits_) HasBits
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed< Arc > _instance
static void set_has_problem_type(HasBits *has_bits)
decltype(std::declval< FlowModel >()._has_bits_) HasBits
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed< FlowModel > _instance
static void set_has_id(HasBits *has_bits)
decltype(std::declval< Node >()._has_bits_) HasBits
static void set_has_supply(HasBits *has_bits)
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed< Node > _instance
int64 value
const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_ortools_2fgraph_2fflow_5fproblem_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold)
#define CHK_(x)
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo< 2 > scc_info_FlowModel_ortools_2fgraph_2fflow_5fproblem_2eproto
PROTOBUF_INTERNAL_EXPORT_ortools_2fgraph_2fflow_5fproblem_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo< 0 > scc_info_Node_ortools_2fgraph_2fflow_5fproblem_2eproto
static void InitDefaultsscc_info_FlowModel_ortools_2fgraph_2fflow_5fproblem_2eproto()
PROTOBUF_NAMESPACE_OPEN PROTOBUF_NOINLINE ::operations_research::Arc * Arena::CreateMaybeMessage< ::operations_research::Arc >(Arena *arena)
const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_ortools_2fgraph_2fflow_5fproblem_2eproto
static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable *const descriptor_table_ortools_2fgraph_2fflow_5fproblem_2eproto_deps[1]
::PROTOBUF_NAMESPACE_ID::Message const *const file_default_instances[]
PROTOBUF_NOINLINE ::operations_research::Node * Arena::CreateMaybeMessage< ::operations_research::Node >(Arena *arena)
static bool dynamic_init_dummy_ortools_2fgraph_2fflow_5fproblem_2eproto
static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const ** file_level_service_descriptors_ortools_2fgraph_2fflow_5fproblem_2eproto
::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_ortools_2fgraph_2fflow_5fproblem_2eproto_once
PROTOBUF_NOINLINE ::operations_research::FlowModel * Arena::CreateMaybeMessage< ::operations_research::FlowModel >(Arena *arena)
static void InitDefaultsscc_info_Node_ortools_2fgraph_2fflow_5fproblem_2eproto()
static const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor * file_level_enum_descriptors_ortools_2fgraph_2fflow_5fproblem_2eproto[1]
::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_ortools_2fgraph_2fflow_5fproblem_2eproto[3]
PROTOBUF_INTERNAL_EXPORT_ortools_2fgraph_2fflow_5fproblem_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo< 0 > scc_info_Arc_ortools_2fgraph_2fflow_5fproblem_2eproto
::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase *const descriptor_table_ortools_2fgraph_2fflow_5fproblem_2eproto_sccs[3]
static void InitDefaultsscc_info_Arc_ortools_2fgraph_2fflow_5fproblem_2eproto()
unsigned int uint32
uint64_t uint64
unsigned char uint8
The vehicle routing library lets one model and solve generic vehicle routing problems ranging from th...
class operations_research::NodeDefaultTypeInternal _Node_default_instance_
class operations_research::FlowModelDefaultTypeInternal _FlowModel_default_instance_
std::pair< int64, int64 > Arc
Definition: search.cc:3361
bool FlowModel_ProblemType_IsValid(int value)
class operations_research::ArcDefaultTypeInternal _Arc_default_instance_
const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor * FlowModel_ProblemType_descriptor()
static constexpr ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema * schemas
static const ::PROTOBUF_NAMESPACE_ID::uint32 offsets[]