Google OR-Tools v9.12
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
BooleanProblem.pb.cs
Go to the documentation of this file.
1// <auto-generated>
2// Generated by the protocol buffer compiler. DO NOT EDIT!
3// source: ortools/sat/boolean_problem.proto
4// </auto-generated>
5#pragma warning disable 1591, 0612, 3021, 8981
6#region Designer generated code
7
8using pb = global::Google.Protobuf;
9using pbc = global::Google.Protobuf.Collections;
10using pbr = global::Google.Protobuf.Reflection;
11using scg = global::System.Collections.Generic;
12namespace Google.OrTools.Sat {
13
15 public static partial class BooleanProblemReflection {
16
17 #region Descriptor
19 public static pbr::FileDescriptor Descriptor {
20 get { return descriptor; }
21 }
22 private static pbr::FileDescriptor descriptor;
23
25 byte[] descriptorData = global::System.Convert.FromBase64String(
26 string.Concat(
27 "CiFvcnRvb2xzL3NhdC9ib29sZWFuX3Byb2JsZW0ucHJvdG8SF29wZXJhdGlv",
28 "bnNfcmVzZWFyY2guc2F0InsKF0xpbmVhckJvb2xlYW5Db25zdHJhaW50EhAK",
29 "CGxpdGVyYWxzGAEgAygFEhQKDGNvZWZmaWNpZW50cxgCIAMoAxITCgtsb3dl",
30 "cl9ib3VuZBgDIAEoAxITCgt1cHBlcl9ib3VuZBgEIAEoAxIOCgRuYW1lGAUg",
31 "ASgJOgAiZwoPTGluZWFyT2JqZWN0aXZlEhAKCGxpdGVyYWxzGAEgAygFEhQK",
32 "DGNvZWZmaWNpZW50cxgCIAMoAxIRCgZvZmZzZXQYAyABKAE6ATASGQoOc2Nh",
33 "bGluZ19mYWN0b3IYBCABKAE6ATEiJQoRQm9vbGVhbkFzc2lnbm1lbnQSEAoI",
34 "bGl0ZXJhbHMYASADKAUitAIKFExpbmVhckJvb2xlYW5Qcm9ibGVtEg4KBG5h",
35 "bWUYASABKAk6ABIVCg1udW1fdmFyaWFibGVzGAMgASgFEkUKC2NvbnN0cmFp",
36 "bnRzGAQgAygLMjAub3BlcmF0aW9uc19yZXNlYXJjaC5zYXQuTGluZWFyQm9v",
37 "bGVhbkNvbnN0cmFpbnQSOwoJb2JqZWN0aXZlGAUgASgLMigub3BlcmF0aW9u",
38 "c19yZXNlYXJjaC5zYXQuTGluZWFyT2JqZWN0aXZlEhEKCXZhcl9uYW1lcxgG",
39 "IAMoCRI+Cgphc3NpZ25tZW50GAcgASgLMioub3BlcmF0aW9uc19yZXNlYXJj",
40 "aC5zYXQuQm9vbGVhbkFzc2lnbm1lbnQSHgoWb3JpZ2luYWxfbnVtX3Zhcmlh",
41 "YmxlcxgIIAEoBUIvChZjb20uZ29vZ2xlLm9ydG9vbHMuc2F0UAGqAhJHb29n",
42 "bGUuT3JUb29scy5TYXQ="));
43 descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
44 new pbr::FileDescriptor[] { },
45 new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] {
46 new pbr::GeneratedClrTypeInfo(typeof(global::Google.OrTools.Sat.LinearBooleanConstraint), global::Google.OrTools.Sat.LinearBooleanConstraint.Parser, new[]{ "Literals", "Coefficients", "LowerBound", "UpperBound", "Name" }, null, null, null, null),
47 new pbr::GeneratedClrTypeInfo(typeof(global::Google.OrTools.Sat.LinearObjective), global::Google.OrTools.Sat.LinearObjective.Parser, new[]{ "Literals", "Coefficients", "Offset", "ScalingFactor" }, null, null, null, null),
48 new pbr::GeneratedClrTypeInfo(typeof(global::Google.OrTools.Sat.BooleanAssignment), global::Google.OrTools.Sat.BooleanAssignment.Parser, new[]{ "Literals" }, null, null, null, null),
49 new pbr::GeneratedClrTypeInfo(typeof(global::Google.OrTools.Sat.LinearBooleanProblem), global::Google.OrTools.Sat.LinearBooleanProblem.Parser, new[]{ "Name", "NumVariables", "Constraints", "Objective", "VarNames", "Assignment", "OriginalNumVariables" }, null, null, null, null)
50 }));
51 }
52 #endregion
53
54 }
55 #region Messages
62 [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")]
63 public sealed partial class LinearBooleanConstraint : pb::IMessage<LinearBooleanConstraint>
64 #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
65 , pb::IBufferMessage
66 #endif
67 {
68 private static readonly pb::MessageParser<LinearBooleanConstraint> _parser = new pb::MessageParser<LinearBooleanConstraint>(() => new LinearBooleanConstraint());
69 private pb::UnknownFieldSet _unknownFields;
70 private int _hasBits0;
71 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
72 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
73 public static pb::MessageParser<LinearBooleanConstraint> Parser { get { return _parser; } }
74
75 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
76 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
77 public static pbr::MessageDescriptor Descriptor {
78 get { return global::Google.OrTools.Sat.BooleanProblemReflection.Descriptor.MessageTypes[0]; }
79 }
80
81 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
82 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
83 pbr::MessageDescriptor pb::IMessage.Descriptor {
84 get { return Descriptor; }
85 }
86
87 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
88 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
90 OnConstruction();
91 }
92
93 partial void OnConstruction();
94
95 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
96 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
98 _hasBits0 = other._hasBits0;
99 literals_ = other.literals_.Clone();
100 coefficients_ = other.coefficients_.Clone();
101 lowerBound_ = other.lowerBound_;
102 upperBound_ = other.upperBound_;
103 name_ = other.name_;
104 _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
105 }
106
107 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
108 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
110 return new LinearBooleanConstraint(this);
111 }
112
114 public const int LiteralsFieldNumber = 1;
115 private static readonly pb::FieldCodec<int> _repeated_literals_codec
116 = pb::FieldCodec.ForInt32(8);
117 private readonly pbc::RepeatedField<int> literals_ = new pbc::RepeatedField<int>();
129 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
130 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
131 public pbc::RepeatedField<int> Literals {
132 get { return literals_; }
134
136 public const int CoefficientsFieldNumber = 2;
137 private static readonly pb::FieldCodec<long> _repeated_coefficients_codec
138 = pb::FieldCodec.ForInt64(16);
139 private readonly pbc::RepeatedField<long> coefficients_ = new pbc::RepeatedField<long>();
140 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
141 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
142 public pbc::RepeatedField<long> Coefficients {
143 get { return coefficients_; }
145
147 public const int LowerBoundFieldNumber = 3;
148 private readonly static long LowerBoundDefaultValue = 0L;
150 private long lowerBound_;
156 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
157 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
158 public long LowerBound {
159 get { if ((_hasBits0 & 1) != 0) { return lowerBound_; } else { return LowerBoundDefaultValue; } }
160 set {
161 _hasBits0 |= 1;
162 lowerBound_ = value;
163 }
164 }
166 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
167 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
168 public bool HasLowerBound {
169 get { return (_hasBits0 & 1) != 0; }
172 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
173 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
174 public void ClearLowerBound() {
175 _hasBits0 &= ~1;
177
179 public const int UpperBoundFieldNumber = 4;
180 private readonly static long UpperBoundDefaultValue = 0L;
182 private long upperBound_;
183 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
184 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
185 public long UpperBound {
186 get { if ((_hasBits0 & 2) != 0) { return upperBound_; } else { return UpperBoundDefaultValue; } }
187 set {
188 _hasBits0 |= 2;
189 upperBound_ = value;
190 }
191 }
193 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
194 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
195 public bool HasUpperBound {
196 get { return (_hasBits0 & 2) != 0; }
199 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
200 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
201 public void ClearUpperBound() {
202 _hasBits0 &= ~2;
204
206 public const int NameFieldNumber = 5;
207 private readonly static string NameDefaultValue = "";
209 private string name_;
213 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
214 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
215 public string Name {
216 get { return name_ ?? NameDefaultValue; }
217 set {
218 name_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
219 }
220 }
222 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
223 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
224 public bool HasName {
225 get { return name_ != null; }
228 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
229 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
230 public void ClearName() {
231 name_ = null;
233
234 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
235 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
236 public override bool Equals(object other) {
237 return Equals(other as LinearBooleanConstraint);
239
240 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
241 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
242 public bool Equals(LinearBooleanConstraint other) {
243 if (ReferenceEquals(other, null)) {
244 return false;
245 }
246 if (ReferenceEquals(other, this)) {
247 return true;
248 }
249 if(!literals_.Equals(other.literals_)) return false;
250 if(!coefficients_.Equals(other.coefficients_)) return false;
251 if (LowerBound != other.LowerBound) return false;
252 if (UpperBound != other.UpperBound) return false;
253 if (Name != other.Name) return false;
254 return Equals(_unknownFields, other._unknownFields);
255 }
256
257 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
258 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
259 public override int GetHashCode() {
260 int hash = 1;
261 hash ^= literals_.GetHashCode();
262 hash ^= coefficients_.GetHashCode();
263 if (HasLowerBound) hash ^= LowerBound.GetHashCode();
264 if (HasUpperBound) hash ^= UpperBound.GetHashCode();
265 if (HasName) hash ^= Name.GetHashCode();
266 if (_unknownFields != null) {
267 hash ^= _unknownFields.GetHashCode();
268 }
269 return hash;
270 }
271
272 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
273 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
274 public override string ToString() {
275 return pb::JsonFormatter.ToDiagnosticString(this);
277
278 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
279 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
280 public void WriteTo(pb::CodedOutputStream output) {
281 #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
282 output.WriteRawMessage(this);
283 #else
284 literals_.WriteTo(output, _repeated_literals_codec);
285 coefficients_.WriteTo(output, _repeated_coefficients_codec);
286 if (HasLowerBound) {
287 output.WriteRawTag(24);
288 output.WriteInt64(LowerBound);
289 }
290 if (HasUpperBound) {
291 output.WriteRawTag(32);
292 output.WriteInt64(UpperBound);
293 }
294 if (HasName) {
295 output.WriteRawTag(42);
296 output.WriteString(Name);
297 }
298 if (_unknownFields != null) {
299 _unknownFields.WriteTo(output);
300 }
301 #endif
302 }
303
304 #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
305 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
306 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
307 void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
308 literals_.WriteTo(ref output, _repeated_literals_codec);
309 coefficients_.WriteTo(ref output, _repeated_coefficients_codec);
310 if (HasLowerBound) {
311 output.WriteRawTag(24);
312 output.WriteInt64(LowerBound);
313 }
314 if (HasUpperBound) {
315 output.WriteRawTag(32);
316 output.WriteInt64(UpperBound);
317 }
318 if (HasName) {
319 output.WriteRawTag(42);
320 output.WriteString(Name);
321 }
322 if (_unknownFields != null) {
323 _unknownFields.WriteTo(ref output);
324 }
325 }
326 #endif
327
328 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
329 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
330 public int CalculateSize() {
331 int size = 0;
332 size += literals_.CalculateSize(_repeated_literals_codec);
333 size += coefficients_.CalculateSize(_repeated_coefficients_codec);
334 if (HasLowerBound) {
335 size += 1 + pb::CodedOutputStream.ComputeInt64Size(LowerBound);
336 }
337 if (HasUpperBound) {
338 size += 1 + pb::CodedOutputStream.ComputeInt64Size(UpperBound);
339 }
340 if (HasName) {
341 size += 1 + pb::CodedOutputStream.ComputeStringSize(Name);
342 }
343 if (_unknownFields != null) {
344 size += _unknownFields.CalculateSize();
345 }
346 return size;
347 }
348
349 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
350 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
351 public void MergeFrom(LinearBooleanConstraint other) {
352 if (other == null) {
353 return;
354 }
355 literals_.Add(other.literals_);
356 coefficients_.Add(other.coefficients_);
357 if (other.HasLowerBound) {
358 LowerBound = other.LowerBound;
359 }
360 if (other.HasUpperBound) {
361 UpperBound = other.UpperBound;
362 }
363 if (other.HasName) {
364 Name = other.Name;
365 }
366 _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
367 }
368
369 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
370 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
371 public void MergeFrom(pb::CodedInputStream input) {
372 #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
373 input.ReadRawMessage(this);
374 #else
375 uint tag;
376 while ((tag = input.ReadTag()) != 0) {
377 if ((tag & 7) == 4) {
378 // Abort on any end group tag.
379 return;
380 }
381 switch(tag) {
382 default:
383 _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
384 break;
385 case 10:
386 case 8: {
387 literals_.AddEntriesFrom(input, _repeated_literals_codec);
388 break;
389 }
390 case 18:
391 case 16: {
392 coefficients_.AddEntriesFrom(input, _repeated_coefficients_codec);
393 break;
394 }
395 case 24: {
396 LowerBound = input.ReadInt64();
397 break;
398 }
399 case 32: {
400 UpperBound = input.ReadInt64();
401 break;
402 }
403 case 42: {
404 Name = input.ReadString();
405 break;
406 }
407 }
408 }
409 #endif
410 }
411
412 #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
413 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
414 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
415 void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
416 uint tag;
417 while ((tag = input.ReadTag()) != 0) {
418 if ((tag & 7) == 4) {
419 // Abort on any end group tag.
420 return;
421 }
422 switch(tag) {
423 default:
424 _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
425 break;
426 case 10:
427 case 8: {
428 literals_.AddEntriesFrom(ref input, _repeated_literals_codec);
429 break;
430 }
431 case 18:
432 case 16: {
433 coefficients_.AddEntriesFrom(ref input, _repeated_coefficients_codec);
434 break;
435 }
436 case 24: {
437 LowerBound = input.ReadInt64();
438 break;
439 }
440 case 32: {
441 UpperBound = input.ReadInt64();
442 break;
443 }
444 case 42: {
445 Name = input.ReadString();
446 break;
447 }
448 }
449 }
450 }
451 #endif
452
453 }
454
456
458 [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")]
459 public sealed partial class LinearObjective : pb::IMessage<LinearObjective>
460 #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
461 , pb::IBufferMessage
462 #endif
463 {
464 private static readonly pb::MessageParser<LinearObjective> _parser = new pb::MessageParser<LinearObjective>(() => new LinearObjective());
465 private pb::UnknownFieldSet _unknownFields;
466 private int _hasBits0;
467 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
468 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
469 public static pb::MessageParser<LinearObjective> Parser { get { return _parser; } }
470
471 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
472 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
473 public static pbr::MessageDescriptor Descriptor {
474 get { return global::Google.OrTools.Sat.BooleanProblemReflection.Descriptor.MessageTypes[1]; }
476
477 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
478 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
479 pbr::MessageDescriptor pb::IMessage.Descriptor {
480 get { return Descriptor; }
481 }
482
483 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
484 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
485 public LinearObjective() {
486 OnConstruction();
488
489 partial void OnConstruction();
490
491 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
492 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
493 public LinearObjective(LinearObjective other) : this() {
494 _hasBits0 = other._hasBits0;
495 literals_ = other.literals_.Clone();
496 coefficients_ = other.coefficients_.Clone();
497 offset_ = other.offset_;
498 scalingFactor_ = other.scalingFactor_;
499 _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
500 }
501
502 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
503 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
504 public LinearObjective Clone() {
505 return new LinearObjective(this);
507
509 public const int LiteralsFieldNumber = 1;
510 private static readonly pb::FieldCodec<int> _repeated_literals_codec
511 = pb::FieldCodec.ForInt32(8);
512 private readonly pbc::RepeatedField<int> literals_ = new pbc::RepeatedField<int>();
521 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
522 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
523 public pbc::RepeatedField<int> Literals {
524 get { return literals_; }
525 }
528 public const int CoefficientsFieldNumber = 2;
529 private static readonly pb::FieldCodec<long> _repeated_coefficients_codec
530 = pb::FieldCodec.ForInt64(16);
531 private readonly pbc::RepeatedField<long> coefficients_ = new pbc::RepeatedField<long>();
532 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
533 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
534 public pbc::RepeatedField<long> Coefficients {
535 get { return coefficients_; }
536 }
539 public const int OffsetFieldNumber = 3;
540 private readonly static double OffsetDefaultValue = 0D;
541
542 private double offset_;
552 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
553 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
554 public double Offset {
555 get { if ((_hasBits0 & 1) != 0) { return offset_; } else { return OffsetDefaultValue; } }
556 set {
557 _hasBits0 |= 1;
558 offset_ = value;
559 }
560 }
562 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
563 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
564 public bool HasOffset {
565 get { return (_hasBits0 & 1) != 0; }
566 }
568 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
569 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
570 public void ClearOffset() {
571 _hasBits0 &= ~1;
572 }
573
574 /// <summary>Field number for the "scaling_factor" field.</summary>
575 public const int ScalingFactorFieldNumber = 4;
576 private readonly static double ScalingFactorDefaultValue = 1D;
577
578 private double scalingFactor_;
579 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
580 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
581 public double ScalingFactor {
582 get { if ((_hasBits0 & 2) != 0) { return scalingFactor_; } else { return ScalingFactorDefaultValue; } }
583 set {
584 _hasBits0 |= 2;
585 scalingFactor_ = value;
586 }
587 }
589 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
590 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
591 public bool HasScalingFactor {
592 get { return (_hasBits0 & 2) != 0; }
593 }
595 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
596 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
597 public void ClearScalingFactor() {
598 _hasBits0 &= ~2;
599 }
600
601 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
602 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
603 public override bool Equals(object other) {
604 return Equals(other as LinearObjective);
605 }
606
607 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
608 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
609 public bool Equals(LinearObjective other) {
610 if (ReferenceEquals(other, null)) {
611 return false;
612 }
613 if (ReferenceEquals(other, this)) {
614 return true;
615 }
616 if(!literals_.Equals(other.literals_)) return false;
617 if(!coefficients_.Equals(other.coefficients_)) return false;
618 if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(Offset, other.Offset)) return false;
619 if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(ScalingFactor, other.ScalingFactor)) return false;
620 return Equals(_unknownFields, other._unknownFields);
621 }
622
623 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
624 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
625 public override int GetHashCode() {
626 int hash = 1;
627 hash ^= literals_.GetHashCode();
628 hash ^= coefficients_.GetHashCode();
629 if (HasOffset) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(Offset);
630 if (HasScalingFactor) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(ScalingFactor);
631 if (_unknownFields != null) {
632 hash ^= _unknownFields.GetHashCode();
633 }
634 return hash;
635 }
636
637 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
638 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
639 public override string ToString() {
640 return pb::JsonFormatter.ToDiagnosticString(this);
641 }
642
643 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
644 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
645 public void WriteTo(pb::CodedOutputStream output) {
646 #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
647 output.WriteRawMessage(this);
648 #else
649 literals_.WriteTo(output, _repeated_literals_codec);
650 coefficients_.WriteTo(output, _repeated_coefficients_codec);
651 if (HasOffset) {
652 output.WriteRawTag(25);
653 output.WriteDouble(Offset);
654 }
655 if (HasScalingFactor) {
656 output.WriteRawTag(33);
657 output.WriteDouble(ScalingFactor);
658 }
659 if (_unknownFields != null) {
660 _unknownFields.WriteTo(output);
661 }
662 #endif
663 }
664
665 #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
666 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
667 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
668 void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
669 literals_.WriteTo(ref output, _repeated_literals_codec);
670 coefficients_.WriteTo(ref output, _repeated_coefficients_codec);
671 if (HasOffset) {
672 output.WriteRawTag(25);
673 output.WriteDouble(Offset);
674 }
675 if (HasScalingFactor) {
676 output.WriteRawTag(33);
677 output.WriteDouble(ScalingFactor);
678 }
679 if (_unknownFields != null) {
680 _unknownFields.WriteTo(ref output);
681 }
682 }
683 #endif
684
685 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
686 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
687 public int CalculateSize() {
688 int size = 0;
689 size += literals_.CalculateSize(_repeated_literals_codec);
690 size += coefficients_.CalculateSize(_repeated_coefficients_codec);
692 size += 1 + 8;
693 }
694 if (HasScalingFactor) {
695 size += 1 + 8;
696 }
697 if (_unknownFields != null) {
698 size += _unknownFields.CalculateSize();
699 }
700 return size;
701 }
702
703 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
704 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
705 public void MergeFrom(LinearObjective other) {
706 if (other == null) {
707 return;
708 }
709 literals_.Add(other.literals_);
710 coefficients_.Add(other.coefficients_);
711 if (other.HasOffset) {
712 Offset = other.Offset;
713 }
714 if (other.HasScalingFactor) {
715 ScalingFactor = other.ScalingFactor;
716 }
717 _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
718 }
719
720 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
721 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
722 public void MergeFrom(pb::CodedInputStream input) {
723 #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
724 input.ReadRawMessage(this);
725 #else
726 uint tag;
727 while ((tag = input.ReadTag()) != 0) {
728 if ((tag & 7) == 4) {
729 // Abort on any end group tag.
730 return;
731 }
732 switch(tag) {
733 default:
734 _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
735 break;
736 case 10:
737 case 8: {
738 literals_.AddEntriesFrom(input, _repeated_literals_codec);
739 break;
740 }
741 case 18:
742 case 16: {
743 coefficients_.AddEntriesFrom(input, _repeated_coefficients_codec);
744 break;
745 }
746 case 25: {
747 Offset = input.ReadDouble();
748 break;
749 }
750 case 33: {
751 ScalingFactor = input.ReadDouble();
752 break;
753 }
754 }
755 }
756 #endif
757 }
758
759 #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
760 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
761 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
762 void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
763 uint tag;
764 while ((tag = input.ReadTag()) != 0) {
765 if ((tag & 7) == 4) {
766 // Abort on any end group tag.
767 return;
768 }
769 switch(tag) {
770 default:
771 _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
772 break;
773 case 10:
774 case 8: {
775 literals_.AddEntriesFrom(ref input, _repeated_literals_codec);
776 break;
777 }
778 case 18:
779 case 16: {
780 coefficients_.AddEntriesFrom(ref input, _repeated_coefficients_codec);
781 break;
782 }
783 case 25: {
784 Offset = input.ReadDouble();
785 break;
786 }
787 case 33: {
788 ScalingFactor = input.ReadDouble();
789 break;
790 }
791 }
792 }
793 }
794 #endif
795
796 }
797
801
805 [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")]
806 public sealed partial class BooleanAssignment : pb::IMessage<BooleanAssignment>
807 #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
808 , pb::IBufferMessage
809 #endif
811 private static readonly pb::MessageParser<BooleanAssignment> _parser = new pb::MessageParser<BooleanAssignment>(() => new BooleanAssignment());
812 private pb::UnknownFieldSet _unknownFields;
813 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
814 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
815 public static pb::MessageParser<BooleanAssignment> Parser { get { return _parser; } }
816
817 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
818 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
819 public static pbr::MessageDescriptor Descriptor {
820 get { return global::Google.OrTools.Sat.BooleanProblemReflection.Descriptor.MessageTypes[2]; }
821 }
822
823 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
824 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
825 pbr::MessageDescriptor pb::IMessage.Descriptor {
826 get { return Descriptor; }
827 }
828
829 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
830 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
831 public BooleanAssignment() {
832 OnConstruction();
833 }
834
835 partial void OnConstruction();
836
837 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
838 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
839 public BooleanAssignment(BooleanAssignment other) : this() {
840 literals_ = other.literals_.Clone();
841 _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
842 }
844 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
845 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
846 public BooleanAssignment Clone() {
847 return new BooleanAssignment(this);
848 }
849
850 /// <summary>Field number for the "literals" field.</summary>
851 public const int LiteralsFieldNumber = 1;
852 private static readonly pb::FieldCodec<int> _repeated_literals_codec
853 = pb::FieldCodec.ForInt32(8);
854 private readonly pbc::RepeatedField<int> literals_ = new pbc::RepeatedField<int>();
855 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
856 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
857 public pbc::RepeatedField<int> Literals {
858 get { return literals_; }
859 }
860
861 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
862 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
863 public override bool Equals(object other) {
864 return Equals(other as BooleanAssignment);
865 }
866
867 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
868 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
869 public bool Equals(BooleanAssignment other) {
870 if (ReferenceEquals(other, null)) {
871 return false;
872 }
873 if (ReferenceEquals(other, this)) {
874 return true;
875 }
876 if(!literals_.Equals(other.literals_)) return false;
877 return Equals(_unknownFields, other._unknownFields);
878 }
879
880 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
881 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
882 public override int GetHashCode() {
883 int hash = 1;
884 hash ^= literals_.GetHashCode();
885 if (_unknownFields != null) {
886 hash ^= _unknownFields.GetHashCode();
887 }
888 return hash;
889 }
890
891 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
892 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
893 public override string ToString() {
894 return pb::JsonFormatter.ToDiagnosticString(this);
895 }
896
897 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
898 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
899 public void WriteTo(pb::CodedOutputStream output) {
900 #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
901 output.WriteRawMessage(this);
902 #else
903 literals_.WriteTo(output, _repeated_literals_codec);
904 if (_unknownFields != null) {
905 _unknownFields.WriteTo(output);
906 }
907 #endif
908 }
909
910 #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
911 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
912 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
913 void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
914 literals_.WriteTo(ref output, _repeated_literals_codec);
915 if (_unknownFields != null) {
916 _unknownFields.WriteTo(ref output);
917 }
918 }
919 #endif
920
921 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
922 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
923 public int CalculateSize() {
924 int size = 0;
925 size += literals_.CalculateSize(_repeated_literals_codec);
926 if (_unknownFields != null) {
927 size += _unknownFields.CalculateSize();
928 }
929 return size;
930 }
931
932 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
933 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
934 public void MergeFrom(BooleanAssignment other) {
935 if (other == null) {
936 return;
937 }
938 literals_.Add(other.literals_);
939 _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
940 }
941
942 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
943 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
944 public void MergeFrom(pb::CodedInputStream input) {
945 #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
946 input.ReadRawMessage(this);
947 #else
948 uint tag;
949 while ((tag = input.ReadTag()) != 0) {
950 if ((tag & 7) == 4) {
951 // Abort on any end group tag.
952 return;
953 }
954 switch(tag) {
955 default:
956 _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
957 break;
958 case 10:
959 case 8: {
960 literals_.AddEntriesFrom(input, _repeated_literals_codec);
961 break;
962 }
963 }
964 }
965 #endif
966 }
967
968 #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
969 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
970 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
971 void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
972 uint tag;
973 while ((tag = input.ReadTag()) != 0) {
974 if ((tag & 7) == 4) {
975 // Abort on any end group tag.
976 return;
977 }
978 switch(tag) {
979 default:
980 _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
981 break;
982 case 10:
983 case 8: {
984 literals_.AddEntriesFrom(ref input, _repeated_literals_codec);
985 break;
986 }
987 }
988 }
989 }
990 #endif
991
992 }
993
997 [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")]
998 public sealed partial class LinearBooleanProblem : pb::IMessage<LinearBooleanProblem>
999 #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
1000 , pb::IBufferMessage
1001 #endif
1003 private static readonly pb::MessageParser<LinearBooleanProblem> _parser = new pb::MessageParser<LinearBooleanProblem>(() => new LinearBooleanProblem());
1004 private pb::UnknownFieldSet _unknownFields;
1005 private int _hasBits0;
1006 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
1007 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
1008 public static pb::MessageParser<LinearBooleanProblem> Parser { get { return _parser; } }
1009
1010 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
1011 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
1012 public static pbr::MessageDescriptor Descriptor {
1013 get { return global::Google.OrTools.Sat.BooleanProblemReflection.Descriptor.MessageTypes[3]; }
1014 }
1015
1016 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
1017 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
1018 pbr::MessageDescriptor pb::IMessage.Descriptor {
1019 get { return Descriptor; }
1020 }
1021
1022 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
1023 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
1024 public LinearBooleanProblem() {
1025 OnConstruction();
1026 }
1027
1028 partial void OnConstruction();
1029
1030 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
1031 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
1032 public LinearBooleanProblem(LinearBooleanProblem other) : this() {
1033 _hasBits0 = other._hasBits0;
1034 name_ = other.name_;
1035 numVariables_ = other.numVariables_;
1036 constraints_ = other.constraints_.Clone();
1037 objective_ = other.objective_ != null ? other.objective_.Clone() : null;
1038 varNames_ = other.varNames_.Clone();
1039 assignment_ = other.assignment_ != null ? other.assignment_.Clone() : null;
1040 originalNumVariables_ = other.originalNumVariables_;
1041 _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
1042 }
1043
1044 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
1045 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
1046 public LinearBooleanProblem Clone() {
1047 return new LinearBooleanProblem(this);
1048 }
1049
1050 /// <summary>Field number for the "name" field.</summary>
1051 public const int NameFieldNumber = 1;
1052 private readonly static string NameDefaultValue = "";
1053
1054 private string name_;
1058 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
1059 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
1060 public string Name {
1061 get { return name_ ?? NameDefaultValue; }
1062 set {
1063 name_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
1065 }
1067 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
1068 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
1069 public bool HasName {
1070 get { return name_ != null; }
1071 }
1073 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
1074 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
1075 public void ClearName() {
1076 name_ = null;
1077 }
1078
1079 /// <summary>Field number for the "num_variables" field.</summary>
1080 public const int NumVariablesFieldNumber = 3;
1081 private readonly static int NumVariablesDefaultValue = 0;
1082
1083 private int numVariables_;
1089 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
1090 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
1091 public int NumVariables {
1092 get { if ((_hasBits0 & 1) != 0) { return numVariables_; } else { return NumVariablesDefaultValue; } }
1093 set {
1094 _hasBits0 |= 1;
1095 numVariables_ = value;
1096 }
1097 }
1099 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
1100 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
1101 public bool HasNumVariables {
1102 get { return (_hasBits0 & 1) != 0; }
1103 }
1105 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
1106 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
1107 public void ClearNumVariables() {
1108 _hasBits0 &= ~1;
1109 }
1110
1111 /// <summary>Field number for the "constraints" field.</summary>
1112 public const int ConstraintsFieldNumber = 4;
1113 private static readonly pb::FieldCodec<global::Google.OrTools.Sat.LinearBooleanConstraint> _repeated_constraints_codec
1114 = pb::FieldCodec.ForMessage(34, global::Google.OrTools.Sat.LinearBooleanConstraint.Parser);
1115 private readonly pbc::RepeatedField<global::Google.OrTools.Sat.LinearBooleanConstraint> constraints_ = new pbc::RepeatedField<global::Google.OrTools.Sat.LinearBooleanConstraint>();
1119 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
1120 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
1121 public pbc::RepeatedField<global::Google.OrTools.Sat.LinearBooleanConstraint> Constraints {
1122 get { return constraints_; }
1123 }
1124
1125 /// <summary>Field number for the "objective" field.</summary>
1126 public const int ObjectiveFieldNumber = 5;
1127 private global::Google.OrTools.Sat.LinearObjective objective_;
1128
1132 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
1133 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
1134 public global::Google.OrTools.Sat.LinearObjective Objective {
1135 get { return objective_; }
1136 set {
1137 objective_ = value;
1139 }
1140
1142 public const int VarNamesFieldNumber = 6;
1143 private static readonly pb::FieldCodec<string> _repeated_varNames_codec
1144 = pb::FieldCodec.ForString(50);
1145 private readonly pbc::RepeatedField<string> varNames_ = new pbc::RepeatedField<string>();
1151 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
1152 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
1153 public pbc::RepeatedField<string> VarNames {
1154 get { return varNames_; }
1155 }
1156
1157 /// <summary>Field number for the "assignment" field.</summary>
1158 public const int AssignmentFieldNumber = 7;
1159 private global::Google.OrTools.Sat.BooleanAssignment assignment_;
1160
1164 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
1165 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
1166 public global::Google.OrTools.Sat.BooleanAssignment Assignment {
1167 get { return assignment_; }
1168 set {
1169 assignment_ = value;
1171 }
1172
1174 public const int OriginalNumVariablesFieldNumber = 8;
1175 private readonly static int OriginalNumVariablesDefaultValue = 0;
1176
1177 private int originalNumVariables_;
1184 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
1185 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
1186 public int OriginalNumVariables {
1187 get { if ((_hasBits0 & 2) != 0) { return originalNumVariables_; } else { return OriginalNumVariablesDefaultValue; } }
1188 set {
1189 _hasBits0 |= 2;
1190 originalNumVariables_ = value;
1191 }
1192 }
1194 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
1195 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
1196 public bool HasOriginalNumVariables {
1197 get { return (_hasBits0 & 2) != 0; }
1198 }
1200 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
1201 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
1202 public void ClearOriginalNumVariables() {
1203 _hasBits0 &= ~2;
1204 }
1205
1206 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
1207 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
1208 public override bool Equals(object other) {
1209 return Equals(other as LinearBooleanProblem);
1210 }
1211
1212 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
1213 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
1214 public bool Equals(LinearBooleanProblem other) {
1215 if (ReferenceEquals(other, null)) {
1216 return false;
1217 }
1218 if (ReferenceEquals(other, this)) {
1219 return true;
1220 }
1221 if (Name != other.Name) return false;
1222 if (NumVariables != other.NumVariables) return false;
1223 if(!constraints_.Equals(other.constraints_)) return false;
1224 if (!object.Equals(Objective, other.Objective)) return false;
1225 if(!varNames_.Equals(other.varNames_)) return false;
1226 if (!object.Equals(Assignment, other.Assignment)) return false;
1227 if (OriginalNumVariables != other.OriginalNumVariables) return false;
1228 return Equals(_unknownFields, other._unknownFields);
1229 }
1230
1231 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
1232 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
1233 public override int GetHashCode() {
1234 int hash = 1;
1235 if (HasName) hash ^= Name.GetHashCode();
1236 if (HasNumVariables) hash ^= NumVariables.GetHashCode();
1237 hash ^= constraints_.GetHashCode();
1238 if (objective_ != null) hash ^= Objective.GetHashCode();
1239 hash ^= varNames_.GetHashCode();
1240 if (assignment_ != null) hash ^= Assignment.GetHashCode();
1241 if (HasOriginalNumVariables) hash ^= OriginalNumVariables.GetHashCode();
1242 if (_unknownFields != null) {
1243 hash ^= _unknownFields.GetHashCode();
1244 }
1245 return hash;
1246 }
1247
1248 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
1249 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
1250 public override string ToString() {
1251 return pb::JsonFormatter.ToDiagnosticString(this);
1252 }
1253
1254 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
1255 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
1256 public void WriteTo(pb::CodedOutputStream output) {
1257 #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
1258 output.WriteRawMessage(this);
1259 #else
1260 if (HasName) {
1261 output.WriteRawTag(10);
1262 output.WriteString(Name);
1263 }
1264 if (HasNumVariables) {
1265 output.WriteRawTag(24);
1266 output.WriteInt32(NumVariables);
1267 }
1268 constraints_.WriteTo(output, _repeated_constraints_codec);
1269 if (objective_ != null) {
1270 output.WriteRawTag(42);
1271 output.WriteMessage(Objective);
1272 }
1273 varNames_.WriteTo(output, _repeated_varNames_codec);
1274 if (assignment_ != null) {
1275 output.WriteRawTag(58);
1276 output.WriteMessage(Assignment);
1277 }
1278 if (HasOriginalNumVariables) {
1279 output.WriteRawTag(64);
1280 output.WriteInt32(OriginalNumVariables);
1281 }
1282 if (_unknownFields != null) {
1283 _unknownFields.WriteTo(output);
1284 }
1285 #endif
1286 }
1287
1288 #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
1289 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
1290 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
1291 void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
1292 if (HasName) {
1293 output.WriteRawTag(10);
1294 output.WriteString(Name);
1295 }
1296 if (HasNumVariables) {
1297 output.WriteRawTag(24);
1298 output.WriteInt32(NumVariables);
1299 }
1300 constraints_.WriteTo(ref output, _repeated_constraints_codec);
1301 if (objective_ != null) {
1302 output.WriteRawTag(42);
1303 output.WriteMessage(Objective);
1304 }
1305 varNames_.WriteTo(ref output, _repeated_varNames_codec);
1306 if (assignment_ != null) {
1307 output.WriteRawTag(58);
1308 output.WriteMessage(Assignment);
1309 }
1310 if (HasOriginalNumVariables) {
1311 output.WriteRawTag(64);
1312 output.WriteInt32(OriginalNumVariables);
1313 }
1314 if (_unknownFields != null) {
1315 _unknownFields.WriteTo(ref output);
1316 }
1317 }
1318 #endif
1319
1320 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
1321 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
1322 public int CalculateSize() {
1323 int size = 0;
1324 if (HasName) {
1325 size += 1 + pb::CodedOutputStream.ComputeStringSize(Name);
1327 if (HasNumVariables) {
1328 size += 1 + pb::CodedOutputStream.ComputeInt32Size(NumVariables);
1329 }
1330 size += constraints_.CalculateSize(_repeated_constraints_codec);
1331 if (objective_ != null) {
1332 size += 1 + pb::CodedOutputStream.ComputeMessageSize(Objective);
1333 }
1334 size += varNames_.CalculateSize(_repeated_varNames_codec);
1335 if (assignment_ != null) {
1336 size += 1 + pb::CodedOutputStream.ComputeMessageSize(Assignment);
1337 }
1338 if (HasOriginalNumVariables) {
1339 size += 1 + pb::CodedOutputStream.ComputeInt32Size(OriginalNumVariables);
1340 }
1341 if (_unknownFields != null) {
1342 size += _unknownFields.CalculateSize();
1343 }
1344 return size;
1345 }
1346
1347 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
1348 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
1349 public void MergeFrom(LinearBooleanProblem other) {
1350 if (other == null) {
1351 return;
1352 }
1353 if (other.HasName) {
1354 Name = other.Name;
1355 }
1356 if (other.HasNumVariables) {
1357 NumVariables = other.NumVariables;
1358 }
1359 constraints_.Add(other.constraints_);
1360 if (other.objective_ != null) {
1361 if (objective_ == null) {
1362 Objective = new global::Google.OrTools.Sat.LinearObjective();
1363 }
1364 Objective.MergeFrom(other.Objective);
1365 }
1366 varNames_.Add(other.varNames_);
1367 if (other.assignment_ != null) {
1368 if (assignment_ == null) {
1369 Assignment = new global::Google.OrTools.Sat.BooleanAssignment();
1370 }
1371 Assignment.MergeFrom(other.Assignment);
1372 }
1373 if (other.HasOriginalNumVariables) {
1374 OriginalNumVariables = other.OriginalNumVariables;
1375 }
1376 _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
1377 }
1378
1379 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
1380 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
1381 public void MergeFrom(pb::CodedInputStream input) {
1382 #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
1383 input.ReadRawMessage(this);
1384 #else
1385 uint tag;
1386 while ((tag = input.ReadTag()) != 0) {
1387 if ((tag & 7) == 4) {
1388 // Abort on any end group tag.
1389 return;
1390 }
1391 switch(tag) {
1392 default:
1393 _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
1394 break;
1395 case 10: {
1396 Name = input.ReadString();
1397 break;
1398 }
1399 case 24: {
1400 NumVariables = input.ReadInt32();
1401 break;
1402 }
1403 case 34: {
1404 constraints_.AddEntriesFrom(input, _repeated_constraints_codec);
1405 break;
1406 }
1407 case 42: {
1408 if (objective_ == null) {
1409 Objective = new global::Google.OrTools.Sat.LinearObjective();
1410 }
1411 input.ReadMessage(Objective);
1412 break;
1413 }
1414 case 50: {
1415 varNames_.AddEntriesFrom(input, _repeated_varNames_codec);
1416 break;
1417 }
1418 case 58: {
1419 if (assignment_ == null) {
1420 Assignment = new global::Google.OrTools.Sat.BooleanAssignment();
1421 }
1422 input.ReadMessage(Assignment);
1423 break;
1424 }
1425 case 64: {
1426 OriginalNumVariables = input.ReadInt32();
1427 break;
1428 }
1429 }
1430 }
1431 #endif
1432 }
1433
1434 #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
1435 [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
1436 [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
1437 void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
1438 uint tag;
1439 while ((tag = input.ReadTag()) != 0) {
1440 if ((tag & 7) == 4) {
1441 // Abort on any end group tag.
1442 return;
1443 }
1444 switch(tag) {
1445 default:
1446 _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
1447 break;
1448 case 10: {
1449 Name = input.ReadString();
1450 break;
1451 }
1452 case 24: {
1453 NumVariables = input.ReadInt32();
1454 break;
1455 }
1456 case 34: {
1457 constraints_.AddEntriesFrom(ref input, _repeated_constraints_codec);
1458 break;
1459 }
1460 case 42: {
1461 if (objective_ == null) {
1462 Objective = new global::Google.OrTools.Sat.LinearObjective();
1463 }
1464 input.ReadMessage(Objective);
1465 break;
1466 }
1467 case 50: {
1468 varNames_.AddEntriesFrom(ref input, _repeated_varNames_codec);
1469 break;
1470 }
1471 case 58: {
1472 if (assignment_ == null) {
1473 Assignment = new global::Google.OrTools.Sat.BooleanAssignment();
1474 }
1475 input.ReadMessage(Assignment);
1476 break;
1477 }
1478 case 64: {
1479 OriginalNumVariables = input.ReadInt32();
1480 break;
1481 }
1482 }
1483 }
1484 }
1485 #endif
1486
1487 }
1488
1489 #endregion
1490
1491}
1492
1493#endregion Designer generated code
global::Google.Protobuf pb
Definition SetCover.pb.cs:8
global::Google.Protobuf.Reflection pbr
global::System.Collections.Generic scg
global::Google.Protobuf.Collections pbc
Definition SetCover.pb.cs:9
Stores an assignment of variables as a list of true literals using their signed representation....
const int LiteralsFieldNumber
Field number for the "literals" field.
static pb::MessageParser< BooleanAssignment > Parser
override bool Equals(object other)
static pbr::MessageDescriptor Descriptor
void MergeFrom(BooleanAssignment other)
void WriteTo(pb::CodedOutputStream output)
Holder for reflection information generated from ortools/sat/boolean_problem.proto.
static pbr::FileDescriptor Descriptor
File descriptor for ortools/sat/boolean_problem.proto.
A linear Boolean constraint which is a bounded sum of linear terms. Each term beeing a literal times ...
bool HasName
Gets whether the "name" field is set.
const int CoefficientsFieldNumber
Field number for the "coefficients" field.
void ClearLowerBound()
Clears the value of the "lower_bound" field.
static pb::MessageParser< LinearBooleanConstraint > Parser
pbc::RepeatedField< int > Literals
Linear terms involved in this constraint.
const int LiteralsFieldNumber
Field number for the "literals" field.
LinearBooleanConstraint(LinearBooleanConstraint other)
bool HasLowerBound
Gets whether the "lower_bound" field is set.
bool HasUpperBound
Gets whether the "upper_bound" field is set.
void ClearUpperBound()
Clears the value of the "upper_bound" field.
string Name
The name of this constraint.
long LowerBound
Optional lower (resp. upper) bound of the constraint. If not present, it means that the constraint is...
void ClearName()
Clears the value of the "name" field.
static pbr::MessageDescriptor Descriptor
void MergeFrom(LinearBooleanConstraint other)
const int LowerBoundFieldNumber
Field number for the "lower_bound" field.
const int NameFieldNumber
Field number for the "name" field.
const int UpperBoundFieldNumber
Field number for the "upper_bound" field.
void WriteTo(pb::CodedOutputStream output)
const int ObjectiveFieldNumber
Field number for the "objective" field.
string Name
The name of the problem.
const int ConstraintsFieldNumber
Field number for the "constraints" field.
void ClearNumVariables()
Clears the value of the "num_variables" field.
static pb::MessageParser< LinearBooleanProblem > Parser
int NumVariables
The number of variables in the problem. All the signed representation of the problem literals must be...
global::Google.OrTools.Sat.LinearObjective Objective
The objective of the problem. If left empty, we just have a satisfiability problem.
pbc::RepeatedField< string > VarNames
The names of the problem variables. The variables index are 0-based and var_names[i] will be the name...
const int AssignmentFieldNumber
Field number for the "assignment" field.
static pbr::MessageDescriptor Descriptor
const int NameFieldNumber
Field number for the "name" field.
pbc::RepeatedField< global::Google.OrTools.Sat.LinearBooleanConstraint > Constraints
The constraints of the problem.
bool HasName
Gets whether the "name" field is set.
global::Google.OrTools.Sat.BooleanAssignment Assignment
Stores an assignment of the problem variables. That may be an initial feasible solution,...
bool HasOriginalNumVariables
Gets whether the "original_num_variables" field is set.
const int NumVariablesFieldNumber
Field number for the "num_variables" field.
void ClearName()
Clears the value of the "name" field.
void WriteTo(pb::CodedOutputStream output)
int OriginalNumVariables
Hack: When converting a wcnf formulat to a LinearBooleanProblem, extra variables need to be created....
bool HasNumVariables
Gets whether the "num_variables" field is set.
void ClearOriginalNumVariables()
Clears the value of the "original_num_variables" field.
The objective of an optimization problem.
pbc::RepeatedField< long > Coefficients
double Offset
For a given variable assignment, the "real" problem objective value is 'scaling_factor * (minimizatio...
pbc::RepeatedField< int > Literals
The goal is always to minimize the linear Boolean formula defined by these two fields: sum_i literal_...
void ClearScalingFactor()
Clears the value of the "scaling_factor" field.
void MergeFrom(LinearObjective other)
void WriteTo(pb::CodedOutputStream output)
static pbr::MessageDescriptor Descriptor
const int OffsetFieldNumber
Field number for the "offset" field.
const int LiteralsFieldNumber
Field number for the "literals" field.
override bool Equals(object other)
bool HasScalingFactor
Gets whether the "scaling_factor" field is set.
const int CoefficientsFieldNumber
Field number for the "coefficients" field.
static pb::MessageParser< LinearObjective > Parser
const int ScalingFactorFieldNumber
Field number for the "scaling_factor" field.
bool HasOffset
Gets whether the "offset" field is set.
void ClearOffset()
Clears the value of the "offset" field.