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