Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
CpObjectiveProto.java
Go to the documentation of this file.
1// Generated by the protocol buffer compiler. DO NOT EDIT!
2// source: ortools/sat/cp_model.proto
3
4// Protobuf Java Version: 4.26.1
5package com.google.ortools.sat;
6
14public final class CpObjectiveProto extends
15 com.google.protobuf.GeneratedMessage implements
16 // @@protoc_insertion_point(message_implements:operations_research.sat.CpObjectiveProto)
18private static final long serialVersionUID = 0L;
19 static {
20 com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
21 com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
22 /* major= */ 4,
23 /* minor= */ 26,
24 /* patch= */ 1,
25 /* suffix= */ "",
26 CpObjectiveProto.class.getName());
27 }
28 // Use CpObjectiveProto.newBuilder() to construct.
29 private CpObjectiveProto(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
30 super(builder);
31 }
32 private CpObjectiveProto() {
33 vars_ = emptyIntList();
34 coeffs_ = emptyLongList();
35 domain_ = emptyLongList();
36 }
37
38 public static final com.google.protobuf.Descriptors.Descriptor
40 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_CpObjectiveProto_descriptor;
41 }
42
43 @java.lang.Override
44 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
46 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_CpObjectiveProto_fieldAccessorTable
47 .ensureFieldAccessorsInitialized(
48 com.google.ortools.sat.CpObjectiveProto.class, com.google.ortools.sat.CpObjectiveProto.Builder.class);
49 }
50
51 public static final int VARS_FIELD_NUMBER = 1;
52 @SuppressWarnings("serial")
53 private com.google.protobuf.Internal.IntList vars_ =
54 emptyIntList();
65 @java.lang.Override
66 public java.util.List<java.lang.Integer>
68 return vars_;
69 }
80 public int getVarsCount() {
81 return vars_.size();
82 }
94 public int getVars(int index) {
95 return vars_.getInt(index);
96 }
97 private int varsMemoizedSerializedSize = -1;
98
99 public static final int COEFFS_FIELD_NUMBER = 4;
100 @SuppressWarnings("serial")
101 private com.google.protobuf.Internal.LongList coeffs_ =
102 emptyLongList();
107 @java.lang.Override
108 public java.util.List<java.lang.Long>
110 return coeffs_;
111 }
116 public int getCoeffsCount() {
117 return coeffs_.size();
118 }
124 public long getCoeffs(int index) {
125 return coeffs_.getLong(index);
126 }
127 private int coeffsMemoizedSerializedSize = -1;
128
129 public static final int OFFSET_FIELD_NUMBER = 2;
130 private double offset_ = 0D;
145 @java.lang.Override
146 public double getOffset() {
147 return offset_;
148 }
149
150 public static final int SCALING_FACTOR_FIELD_NUMBER = 3;
151 private double scalingFactor_ = 0D;
156 @java.lang.Override
157 public double getScalingFactor() {
158 return scalingFactor_;
159 }
160
161 public static final int DOMAIN_FIELD_NUMBER = 5;
162 @SuppressWarnings("serial")
163 private com.google.protobuf.Internal.LongList domain_ =
164 emptyLongList();
175 @java.lang.Override
176 public java.util.List<java.lang.Long>
178 return domain_;
179 }
190 public int getDomainCount() {
191 return domain_.size();
192 }
204 public long getDomain(int index) {
205 return domain_.getLong(index);
206 }
207 private int domainMemoizedSerializedSize = -1;
208
209 public static final int SCALING_WAS_EXACT_FIELD_NUMBER = 6;
210 private boolean scalingWasExact_ = false;
223 @java.lang.Override
224 public boolean getScalingWasExact() {
225 return scalingWasExact_;
226 }
227
228 public static final int INTEGER_BEFORE_OFFSET_FIELD_NUMBER = 7;
229 private long integerBeforeOffset_ = 0L;
249 @java.lang.Override
251 return integerBeforeOffset_;
252 }
253
254 public static final int INTEGER_AFTER_OFFSET_FIELD_NUMBER = 9;
255 private long integerAfterOffset_ = 0L;
260 @java.lang.Override
261 public long getIntegerAfterOffset() {
262 return integerAfterOffset_;
263 }
264
265 public static final int INTEGER_SCALING_FACTOR_FIELD_NUMBER = 8;
266 private long integerScalingFactor_ = 0L;
271 @java.lang.Override
273 return integerScalingFactor_;
274 }
275
276 private byte memoizedIsInitialized = -1;
277 @java.lang.Override
278 public final boolean isInitialized() {
279 byte isInitialized = memoizedIsInitialized;
280 if (isInitialized == 1) return true;
281 if (isInitialized == 0) return false;
282
283 memoizedIsInitialized = 1;
284 return true;
285 }
286
287 @java.lang.Override
288 public void writeTo(com.google.protobuf.CodedOutputStream output)
289 throws java.io.IOException {
291 if (getVarsList().size() > 0) {
292 output.writeUInt32NoTag(10);
293 output.writeUInt32NoTag(varsMemoizedSerializedSize);
294 }
295 for (int i = 0; i < vars_.size(); i++) {
296 output.writeInt32NoTag(vars_.getInt(i));
297 }
298 if (java.lang.Double.doubleToRawLongBits(offset_) != 0) {
299 output.writeDouble(2, offset_);
300 }
301 if (java.lang.Double.doubleToRawLongBits(scalingFactor_) != 0) {
302 output.writeDouble(3, scalingFactor_);
303 }
304 if (getCoeffsList().size() > 0) {
305 output.writeUInt32NoTag(34);
306 output.writeUInt32NoTag(coeffsMemoizedSerializedSize);
307 }
308 for (int i = 0; i < coeffs_.size(); i++) {
309 output.writeInt64NoTag(coeffs_.getLong(i));
310 }
311 if (getDomainList().size() > 0) {
312 output.writeUInt32NoTag(42);
313 output.writeUInt32NoTag(domainMemoizedSerializedSize);
314 }
315 for (int i = 0; i < domain_.size(); i++) {
316 output.writeInt64NoTag(domain_.getLong(i));
317 }
318 if (scalingWasExact_ != false) {
319 output.writeBool(6, scalingWasExact_);
320 }
321 if (integerBeforeOffset_ != 0L) {
322 output.writeInt64(7, integerBeforeOffset_);
323 }
324 if (integerScalingFactor_ != 0L) {
325 output.writeInt64(8, integerScalingFactor_);
326 }
327 if (integerAfterOffset_ != 0L) {
328 output.writeInt64(9, integerAfterOffset_);
329 }
330 getUnknownFields().writeTo(output);
331 }
332
333 @java.lang.Override
334 public int getSerializedSize() {
335 int size = memoizedSize;
336 if (size != -1) return size;
337
338 size = 0;
339 {
340 int dataSize = 0;
341 for (int i = 0; i < vars_.size(); i++) {
342 dataSize += com.google.protobuf.CodedOutputStream
343 .computeInt32SizeNoTag(vars_.getInt(i));
344 }
345 size += dataSize;
346 if (!getVarsList().isEmpty()) {
347 size += 1;
348 size += com.google.protobuf.CodedOutputStream
349 .computeInt32SizeNoTag(dataSize);
350 }
351 varsMemoizedSerializedSize = dataSize;
352 }
353 if (java.lang.Double.doubleToRawLongBits(offset_) != 0) {
354 size += com.google.protobuf.CodedOutputStream
355 .computeDoubleSize(2, offset_);
356 }
357 if (java.lang.Double.doubleToRawLongBits(scalingFactor_) != 0) {
358 size += com.google.protobuf.CodedOutputStream
359 .computeDoubleSize(3, scalingFactor_);
360 }
361 {
362 int dataSize = 0;
363 for (int i = 0; i < coeffs_.size(); i++) {
364 dataSize += com.google.protobuf.CodedOutputStream
365 .computeInt64SizeNoTag(coeffs_.getLong(i));
366 }
367 size += dataSize;
368 if (!getCoeffsList().isEmpty()) {
369 size += 1;
370 size += com.google.protobuf.CodedOutputStream
371 .computeInt32SizeNoTag(dataSize);
372 }
373 coeffsMemoizedSerializedSize = dataSize;
374 }
375 {
376 int dataSize = 0;
377 for (int i = 0; i < domain_.size(); i++) {
378 dataSize += com.google.protobuf.CodedOutputStream
379 .computeInt64SizeNoTag(domain_.getLong(i));
380 }
381 size += dataSize;
382 if (!getDomainList().isEmpty()) {
383 size += 1;
384 size += com.google.protobuf.CodedOutputStream
385 .computeInt32SizeNoTag(dataSize);
386 }
387 domainMemoizedSerializedSize = dataSize;
388 }
389 if (scalingWasExact_ != false) {
390 size += com.google.protobuf.CodedOutputStream
391 .computeBoolSize(6, scalingWasExact_);
392 }
393 if (integerBeforeOffset_ != 0L) {
394 size += com.google.protobuf.CodedOutputStream
395 .computeInt64Size(7, integerBeforeOffset_);
396 }
397 if (integerScalingFactor_ != 0L) {
398 size += com.google.protobuf.CodedOutputStream
399 .computeInt64Size(8, integerScalingFactor_);
400 }
401 if (integerAfterOffset_ != 0L) {
402 size += com.google.protobuf.CodedOutputStream
403 .computeInt64Size(9, integerAfterOffset_);
404 }
405 size += getUnknownFields().getSerializedSize();
406 memoizedSize = size;
407 return size;
408 }
409
410 @java.lang.Override
411 public boolean equals(final java.lang.Object obj) {
412 if (obj == this) {
413 return true;
414 }
415 if (!(obj instanceof com.google.ortools.sat.CpObjectiveProto)) {
416 return super.equals(obj);
417 }
418 com.google.ortools.sat.CpObjectiveProto other = (com.google.ortools.sat.CpObjectiveProto) obj;
419
420 if (!getVarsList()
421 .equals(other.getVarsList())) return false;
422 if (!getCoeffsList()
423 .equals(other.getCoeffsList())) return false;
424 if (java.lang.Double.doubleToLongBits(getOffset())
425 != java.lang.Double.doubleToLongBits(
426 other.getOffset())) return false;
427 if (java.lang.Double.doubleToLongBits(getScalingFactor())
428 != java.lang.Double.doubleToLongBits(
429 other.getScalingFactor())) return false;
430 if (!getDomainList()
431 .equals(other.getDomainList())) return false;
433 != other.getScalingWasExact()) return false;
435 != other.getIntegerBeforeOffset()) return false;
437 != other.getIntegerAfterOffset()) return false;
439 != other.getIntegerScalingFactor()) return false;
440 if (!getUnknownFields().equals(other.getUnknownFields())) return false;
441 return true;
442 }
443
444 @java.lang.Override
445 public int hashCode() {
446 if (memoizedHashCode != 0) {
447 return memoizedHashCode;
448 }
449 int hash = 41;
450 hash = (19 * hash) + getDescriptor().hashCode();
451 if (getVarsCount() > 0) {
452 hash = (37 * hash) + VARS_FIELD_NUMBER;
453 hash = (53 * hash) + getVarsList().hashCode();
454 }
455 if (getCoeffsCount() > 0) {
456 hash = (37 * hash) + COEFFS_FIELD_NUMBER;
457 hash = (53 * hash) + getCoeffsList().hashCode();
458 }
459 hash = (37 * hash) + OFFSET_FIELD_NUMBER;
460 hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
461 java.lang.Double.doubleToLongBits(getOffset()));
462 hash = (37 * hash) + SCALING_FACTOR_FIELD_NUMBER;
463 hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
464 java.lang.Double.doubleToLongBits(getScalingFactor()));
465 if (getDomainCount() > 0) {
466 hash = (37 * hash) + DOMAIN_FIELD_NUMBER;
467 hash = (53 * hash) + getDomainList().hashCode();
468 }
469 hash = (37 * hash) + SCALING_WAS_EXACT_FIELD_NUMBER;
470 hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
472 hash = (37 * hash) + INTEGER_BEFORE_OFFSET_FIELD_NUMBER;
473 hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
475 hash = (37 * hash) + INTEGER_AFTER_OFFSET_FIELD_NUMBER;
476 hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
478 hash = (37 * hash) + INTEGER_SCALING_FACTOR_FIELD_NUMBER;
479 hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
481 hash = (29 * hash) + getUnknownFields().hashCode();
482 memoizedHashCode = hash;
483 return hash;
484 }
485
487 java.nio.ByteBuffer data)
488 throws com.google.protobuf.InvalidProtocolBufferException {
489 return PARSER.parseFrom(data);
490 }
492 java.nio.ByteBuffer data,
493 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
494 throws com.google.protobuf.InvalidProtocolBufferException {
495 return PARSER.parseFrom(data, extensionRegistry);
496 }
498 com.google.protobuf.ByteString data)
499 throws com.google.protobuf.InvalidProtocolBufferException {
500 return PARSER.parseFrom(data);
501 }
503 com.google.protobuf.ByteString data,
504 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
505 throws com.google.protobuf.InvalidProtocolBufferException {
506 return PARSER.parseFrom(data, extensionRegistry);
507 }
509 throws com.google.protobuf.InvalidProtocolBufferException {
510 return PARSER.parseFrom(data);
511 }
513 byte[] data,
514 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
515 throws com.google.protobuf.InvalidProtocolBufferException {
516 return PARSER.parseFrom(data, extensionRegistry);
517 }
518 public static com.google.ortools.sat.CpObjectiveProto parseFrom(java.io.InputStream input)
519 throws java.io.IOException {
520 return com.google.protobuf.GeneratedMessage
521 .parseWithIOException(PARSER, input);
522 }
524 java.io.InputStream input,
525 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
526 throws java.io.IOException {
527 return com.google.protobuf.GeneratedMessage
528 .parseWithIOException(PARSER, input, extensionRegistry);
529 }
530
531 public static com.google.ortools.sat.CpObjectiveProto parseDelimitedFrom(java.io.InputStream input)
532 throws java.io.IOException {
533 return com.google.protobuf.GeneratedMessage
534 .parseDelimitedWithIOException(PARSER, input);
535 }
536
538 java.io.InputStream input,
539 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
540 throws java.io.IOException {
541 return com.google.protobuf.GeneratedMessage
542 .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
543 }
545 com.google.protobuf.CodedInputStream input)
546 throws java.io.IOException {
547 return com.google.protobuf.GeneratedMessage
548 .parseWithIOException(PARSER, input);
549 }
551 com.google.protobuf.CodedInputStream input,
552 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
553 throws java.io.IOException {
554 return com.google.protobuf.GeneratedMessage
555 .parseWithIOException(PARSER, input, extensionRegistry);
556 }
557
558 @java.lang.Override
559 public Builder newBuilderForType() { return newBuilder(); }
560 public static Builder newBuilder() {
561 return DEFAULT_INSTANCE.toBuilder();
562 }
563 public static Builder newBuilder(com.google.ortools.sat.CpObjectiveProto prototype) {
564 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
565 }
566 @java.lang.Override
568 return this == DEFAULT_INSTANCE
569 ? new Builder() : new Builder().mergeFrom(this);
570 }
571
572 @java.lang.Override
574 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
575 Builder builder = new Builder(parent);
576 return builder;
577 }
585 public static final class Builder extends
586 com.google.protobuf.GeneratedMessage.Builder<Builder> implements
587 // @@protoc_insertion_point(builder_implements:operations_research.sat.CpObjectiveProto)
588 com.google.ortools.sat.CpObjectiveProtoOrBuilder {
589 public static final com.google.protobuf.Descriptors.Descriptor
591 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_CpObjectiveProto_descriptor;
592 }
593
594 @java.lang.Override
595 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
597 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_CpObjectiveProto_fieldAccessorTable
598 .ensureFieldAccessorsInitialized(
599 com.google.ortools.sat.CpObjectiveProto.class, com.google.ortools.sat.CpObjectiveProto.Builder.class);
600 }
601
602 // Construct using com.google.ortools.sat.CpObjectiveProto.newBuilder()
603 private Builder() {
604
605 }
606
607 private Builder(
608 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
609 super(parent);
610
611 }
612 @java.lang.Override
613 public Builder clear() {
614 super.clear();
615 bitField0_ = 0;
616 vars_ = emptyIntList();
617 coeffs_ = emptyLongList();
618 offset_ = 0D;
619 scalingFactor_ = 0D;
620 domain_ = emptyLongList();
621 scalingWasExact_ = false;
622 integerBeforeOffset_ = 0L;
623 integerAfterOffset_ = 0L;
624 integerScalingFactor_ = 0L;
625 return this;
626 }
627
628 @java.lang.Override
629 public com.google.protobuf.Descriptors.Descriptor
631 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_CpObjectiveProto_descriptor;
632 }
633
634 @java.lang.Override
636 return com.google.ortools.sat.CpObjectiveProto.getDefaultInstance();
637 }
638
639 @java.lang.Override
642 if (!result.isInitialized()) {
643 throw newUninitializedMessageException(result);
644 }
645 return result;
646 }
647
648 @java.lang.Override
650 com.google.ortools.sat.CpObjectiveProto result = new com.google.ortools.sat.CpObjectiveProto(this);
651 if (bitField0_ != 0) { buildPartial0(result); }
652 onBuilt();
653 return result;
654 }
655
656 private void buildPartial0(com.google.ortools.sat.CpObjectiveProto result) {
657 int from_bitField0_ = bitField0_;
658 if (((from_bitField0_ & 0x00000001) != 0)) {
659 vars_.makeImmutable();
660 result.vars_ = vars_;
661 }
662 if (((from_bitField0_ & 0x00000002) != 0)) {
663 coeffs_.makeImmutable();
664 result.coeffs_ = coeffs_;
665 }
666 if (((from_bitField0_ & 0x00000004) != 0)) {
667 result.offset_ = offset_;
668 }
669 if (((from_bitField0_ & 0x00000008) != 0)) {
670 result.scalingFactor_ = scalingFactor_;
671 }
672 if (((from_bitField0_ & 0x00000010) != 0)) {
673 domain_.makeImmutable();
674 result.domain_ = domain_;
675 }
676 if (((from_bitField0_ & 0x00000020) != 0)) {
677 result.scalingWasExact_ = scalingWasExact_;
678 }
679 if (((from_bitField0_ & 0x00000040) != 0)) {
680 result.integerBeforeOffset_ = integerBeforeOffset_;
681 }
682 if (((from_bitField0_ & 0x00000080) != 0)) {
683 result.integerAfterOffset_ = integerAfterOffset_;
684 }
685 if (((from_bitField0_ & 0x00000100) != 0)) {
686 result.integerScalingFactor_ = integerScalingFactor_;
687 }
688 }
689
690 @java.lang.Override
691 public Builder mergeFrom(com.google.protobuf.Message other) {
692 if (other instanceof com.google.ortools.sat.CpObjectiveProto) {
693 return mergeFrom((com.google.ortools.sat.CpObjectiveProto)other);
694 } else {
695 super.mergeFrom(other);
696 return this;
697 }
698 }
699
700 public Builder mergeFrom(com.google.ortools.sat.CpObjectiveProto other) {
701 if (other == com.google.ortools.sat.CpObjectiveProto.getDefaultInstance()) return this;
702 if (!other.vars_.isEmpty()) {
703 if (vars_.isEmpty()) {
704 vars_ = other.vars_;
705 vars_.makeImmutable();
706 bitField0_ |= 0x00000001;
707 } else {
708 ensureVarsIsMutable();
709 vars_.addAll(other.vars_);
710 }
711 onChanged();
712 }
713 if (!other.coeffs_.isEmpty()) {
714 if (coeffs_.isEmpty()) {
715 coeffs_ = other.coeffs_;
716 coeffs_.makeImmutable();
717 bitField0_ |= 0x00000002;
718 } else {
719 ensureCoeffsIsMutable();
720 coeffs_.addAll(other.coeffs_);
721 }
722 onChanged();
723 }
724 if (other.getOffset() != 0D) {
725 setOffset(other.getOffset());
726 }
727 if (other.getScalingFactor() != 0D) {
728 setScalingFactor(other.getScalingFactor());
729 }
730 if (!other.domain_.isEmpty()) {
731 if (domain_.isEmpty()) {
732 domain_ = other.domain_;
733 domain_.makeImmutable();
734 bitField0_ |= 0x00000010;
735 } else {
736 ensureDomainIsMutable();
737 domain_.addAll(other.domain_);
738 }
739 onChanged();
740 }
741 if (other.getScalingWasExact() != false) {
742 setScalingWasExact(other.getScalingWasExact());
743 }
744 if (other.getIntegerBeforeOffset() != 0L) {
745 setIntegerBeforeOffset(other.getIntegerBeforeOffset());
746 }
747 if (other.getIntegerAfterOffset() != 0L) {
748 setIntegerAfterOffset(other.getIntegerAfterOffset());
749 }
750 if (other.getIntegerScalingFactor() != 0L) {
751 setIntegerScalingFactor(other.getIntegerScalingFactor());
752 }
753 this.mergeUnknownFields(other.getUnknownFields());
754 onChanged();
755 return this;
756 }
757
758 @java.lang.Override
759 public final boolean isInitialized() {
760 return true;
761 }
762
763 @java.lang.Override
765 com.google.protobuf.CodedInputStream input,
766 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
767 throws java.io.IOException {
768 if (extensionRegistry == null) {
769 throw new java.lang.NullPointerException();
770 }
771 try {
772 boolean done = false;
773 while (!done) {
774 int tag = input.readTag();
775 switch (tag) {
776 case 0:
777 done = true;
778 break;
779 case 8: {
780 int v = input.readInt32();
781 ensureVarsIsMutable();
782 vars_.addInt(v);
783 break;
784 } // case 8
785 case 10: {
786 int length = input.readRawVarint32();
787 int limit = input.pushLimit(length);
788 ensureVarsIsMutable();
789 while (input.getBytesUntilLimit() > 0) {
790 vars_.addInt(input.readInt32());
791 }
792 input.popLimit(limit);
793 break;
794 } // case 10
795 case 17: {
796 offset_ = input.readDouble();
797 bitField0_ |= 0x00000004;
798 break;
799 } // case 17
800 case 25: {
801 scalingFactor_ = input.readDouble();
802 bitField0_ |= 0x00000008;
803 break;
804 } // case 25
805 case 32: {
806 long v = input.readInt64();
807 ensureCoeffsIsMutable();
808 coeffs_.addLong(v);
809 break;
810 } // case 32
811 case 34: {
812 int length = input.readRawVarint32();
813 int limit = input.pushLimit(length);
814 ensureCoeffsIsMutable();
815 while (input.getBytesUntilLimit() > 0) {
816 coeffs_.addLong(input.readInt64());
817 }
818 input.popLimit(limit);
819 break;
820 } // case 34
821 case 40: {
822 long v = input.readInt64();
823 ensureDomainIsMutable();
824 domain_.addLong(v);
825 break;
826 } // case 40
827 case 42: {
828 int length = input.readRawVarint32();
829 int limit = input.pushLimit(length);
830 ensureDomainIsMutable();
831 while (input.getBytesUntilLimit() > 0) {
832 domain_.addLong(input.readInt64());
833 }
834 input.popLimit(limit);
835 break;
836 } // case 42
837 case 48: {
838 scalingWasExact_ = input.readBool();
839 bitField0_ |= 0x00000020;
840 break;
841 } // case 48
842 case 56: {
843 integerBeforeOffset_ = input.readInt64();
844 bitField0_ |= 0x00000040;
845 break;
846 } // case 56
847 case 64: {
848 integerScalingFactor_ = input.readInt64();
849 bitField0_ |= 0x00000100;
850 break;
851 } // case 64
852 case 72: {
853 integerAfterOffset_ = input.readInt64();
854 bitField0_ |= 0x00000080;
855 break;
856 } // case 72
857 default: {
858 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
859 done = true; // was an endgroup tag
860 }
861 break;
862 } // default:
863 } // switch (tag)
864 } // while (!done)
865 } catch (com.google.protobuf.InvalidProtocolBufferException e) {
866 throw e.unwrapIOException();
867 } finally {
868 onChanged();
869 } // finally
870 return this;
871 }
872 private int bitField0_;
873
874 private com.google.protobuf.Internal.IntList vars_ = emptyIntList();
875 private void ensureVarsIsMutable() {
876 if (!vars_.isModifiable()) {
877 vars_ = makeMutableCopy(vars_);
878 }
879 bitField0_ |= 0x00000001;
880 }
891 public java.util.List<java.lang.Integer>
893 vars_.makeImmutable();
894 return vars_;
895 }
906 public int getVarsCount() {
907 return vars_.size();
908 }
920 public int getVars(int index) {
921 return vars_.getInt(index);
922 }
936 int index, int value) {
937
938 ensureVarsIsMutable();
939 vars_.setInt(index, value);
940 bitField0_ |= 0x00000001;
941 onChanged();
942 return this;
943 }
955 public Builder addVars(int value) {
956
957 ensureVarsIsMutable();
958 vars_.addInt(value);
959 bitField0_ |= 0x00000001;
960 onChanged();
961 return this;
962 }
975 java.lang.Iterable<? extends java.lang.Integer> values) {
976 ensureVarsIsMutable();
977 com.google.protobuf.AbstractMessageLite.Builder.addAll(
978 values, vars_);
979 bitField0_ |= 0x00000001;
980 onChanged();
981 return this;
982 }
994 vars_ = emptyIntList();
995 bitField0_ = (bitField0_ & ~0x00000001);
996 onChanged();
997 return this;
998 }
999
1000 private com.google.protobuf.Internal.LongList coeffs_ = emptyLongList();
1001 private void ensureCoeffsIsMutable() {
1002 if (!coeffs_.isModifiable()) {
1003 coeffs_ = makeMutableCopy(coeffs_);
1004 }
1005 bitField0_ |= 0x00000002;
1006 }
1011 public java.util.List<java.lang.Long>
1013 coeffs_.makeImmutable();
1014 return coeffs_;
1015 }
1020 public int getCoeffsCount() {
1021 return coeffs_.size();
1022 }
1028 public long getCoeffs(int index) {
1029 return coeffs_.getLong(index);
1030 }
1038 int index, long value) {
1039
1040 ensureCoeffsIsMutable();
1041 coeffs_.setLong(index, value);
1042 bitField0_ |= 0x00000002;
1043 onChanged();
1044 return this;
1045 }
1051 public Builder addCoeffs(long value) {
1052
1053 ensureCoeffsIsMutable();
1054 coeffs_.addLong(value);
1055 bitField0_ |= 0x00000002;
1056 onChanged();
1057 return this;
1058 }
1065 java.lang.Iterable<? extends java.lang.Long> values) {
1066 ensureCoeffsIsMutable();
1067 com.google.protobuf.AbstractMessageLite.Builder.addAll(
1068 values, coeffs_);
1069 bitField0_ |= 0x00000002;
1070 onChanged();
1071 return this;
1072 }
1078 coeffs_ = emptyLongList();
1079 bitField0_ = (bitField0_ & ~0x00000002);
1080 onChanged();
1081 return this;
1082 }
1083
1084 private double offset_ ;
1099 @java.lang.Override
1100 public double getOffset() {
1101 return offset_;
1102 }
1118 public Builder setOffset(double value) {
1119
1120 offset_ = value;
1121 bitField0_ |= 0x00000004;
1122 onChanged();
1123 return this;
1124 }
1140 bitField0_ = (bitField0_ & ~0x00000004);
1141 offset_ = 0D;
1142 onChanged();
1143 return this;
1144 }
1145
1146 private double scalingFactor_ ;
1151 @java.lang.Override
1152 public double getScalingFactor() {
1153 return scalingFactor_;
1154 }
1160 public Builder setScalingFactor(double value) {
1161
1162 scalingFactor_ = value;
1163 bitField0_ |= 0x00000008;
1164 onChanged();
1165 return this;
1166 }
1172 bitField0_ = (bitField0_ & ~0x00000008);
1173 scalingFactor_ = 0D;
1174 onChanged();
1175 return this;
1176 }
1177
1178 private com.google.protobuf.Internal.LongList domain_ = emptyLongList();
1179 private void ensureDomainIsMutable() {
1180 if (!domain_.isModifiable()) {
1181 domain_ = makeMutableCopy(domain_);
1182 }
1183 bitField0_ |= 0x00000010;
1184 }
1195 public java.util.List<java.lang.Long>
1197 domain_.makeImmutable();
1198 return domain_;
1199 }
1210 public int getDomainCount() {
1211 return domain_.size();
1212 }
1224 public long getDomain(int index) {
1225 return domain_.getLong(index);
1226 }
1240 int index, long value) {
1241
1242 ensureDomainIsMutable();
1243 domain_.setLong(index, value);
1244 bitField0_ |= 0x00000010;
1245 onChanged();
1246 return this;
1247 }
1259 public Builder addDomain(long value) {
1260
1261 ensureDomainIsMutable();
1262 domain_.addLong(value);
1263 bitField0_ |= 0x00000010;
1264 onChanged();
1265 return this;
1266 }
1279 java.lang.Iterable<? extends java.lang.Long> values) {
1280 ensureDomainIsMutable();
1281 com.google.protobuf.AbstractMessageLite.Builder.addAll(
1282 values, domain_);
1283 bitField0_ |= 0x00000010;
1284 onChanged();
1285 return this;
1286 }
1298 domain_ = emptyLongList();
1299 bitField0_ = (bitField0_ & ~0x00000010);
1300 onChanged();
1301 return this;
1302 }
1303
1304 private boolean scalingWasExact_ ;
1317 @java.lang.Override
1318 public boolean getScalingWasExact() {
1319 return scalingWasExact_;
1320 }
1334 public Builder setScalingWasExact(boolean value) {
1335
1336 scalingWasExact_ = value;
1337 bitField0_ |= 0x00000020;
1338 onChanged();
1339 return this;
1340 }
1354 bitField0_ = (bitField0_ & ~0x00000020);
1355 scalingWasExact_ = false;
1356 onChanged();
1357 return this;
1358 }
1359
1360 private long integerBeforeOffset_ ;
1380 @java.lang.Override
1382 return integerBeforeOffset_;
1383 }
1404 public Builder setIntegerBeforeOffset(long value) {
1405
1406 integerBeforeOffset_ = value;
1407 bitField0_ |= 0x00000040;
1408 onChanged();
1409 return this;
1410 }
1431 bitField0_ = (bitField0_ & ~0x00000040);
1432 integerBeforeOffset_ = 0L;
1433 onChanged();
1434 return this;
1435 }
1436
1437 private long integerAfterOffset_ ;
1442 @java.lang.Override
1444 return integerAfterOffset_;
1445 }
1451 public Builder setIntegerAfterOffset(long value) {
1452
1453 integerAfterOffset_ = value;
1454 bitField0_ |= 0x00000080;
1455 onChanged();
1456 return this;
1457 }
1463 bitField0_ = (bitField0_ & ~0x00000080);
1464 integerAfterOffset_ = 0L;
1465 onChanged();
1466 return this;
1467 }
1468
1469 private long integerScalingFactor_ ;
1474 @java.lang.Override
1476 return integerScalingFactor_;
1477 }
1484
1485 integerScalingFactor_ = value;
1486 bitField0_ |= 0x00000100;
1487 onChanged();
1488 return this;
1489 }
1495 bitField0_ = (bitField0_ & ~0x00000100);
1496 integerScalingFactor_ = 0L;
1497 onChanged();
1498 return this;
1499 }
1500
1501 // @@protoc_insertion_point(builder_scope:operations_research.sat.CpObjectiveProto)
1502 }
1503
1504 // @@protoc_insertion_point(class_scope:operations_research.sat.CpObjectiveProto)
1505 private static final com.google.ortools.sat.CpObjectiveProto DEFAULT_INSTANCE;
1506 static {
1507 DEFAULT_INSTANCE = new com.google.ortools.sat.CpObjectiveProto();
1508 }
1509
1511 return DEFAULT_INSTANCE;
1512 }
1513
1514 private static final com.google.protobuf.Parser<CpObjectiveProto>
1515 PARSER = new com.google.protobuf.AbstractParser<CpObjectiveProto>() {
1516 @java.lang.Override
1517 public CpObjectiveProto parsePartialFrom(
1518 com.google.protobuf.CodedInputStream input,
1519 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1520 throws com.google.protobuf.InvalidProtocolBufferException {
1521 Builder builder = newBuilder();
1522 try {
1523 builder.mergeFrom(input, extensionRegistry);
1524 } catch (com.google.protobuf.InvalidProtocolBufferException e) {
1525 throw e.setUnfinishedMessage(builder.buildPartial());
1526 } catch (com.google.protobuf.UninitializedMessageException e) {
1527 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
1528 } catch (java.io.IOException e) {
1529 throw new com.google.protobuf.InvalidProtocolBufferException(e)
1530 .setUnfinishedMessage(builder.buildPartial());
1531 }
1532 return builder.buildPartial();
1533 }
1534 };
1535
1536 public static com.google.protobuf.Parser<CpObjectiveProto> parser() {
1537 return PARSER;
1538 }
1539
1540 @java.lang.Override
1541 public com.google.protobuf.Parser<CpObjectiveProto> getParserForType() {
1542 return PARSER;
1543 }
1544
1545 @java.lang.Override
1547 return DEFAULT_INSTANCE;
1548 }
1549
1550}
1551
static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
Builder mergeFrom(com.google.ortools.sat.CpObjectiveProto other)
java.util.List< java.lang.Long > getDomainList()
Builder mergeFrom(com.google.protobuf.Message other)
com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
com.google.ortools.sat.CpObjectiveProto buildPartial()
java.util.List< java.lang.Long > getCoeffsList()
Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
Builder addAllDomain(java.lang.Iterable<? extends java.lang.Long > values)
Builder addAllVars(java.lang.Iterable<? extends java.lang.Integer > values)
Builder addAllCoeffs(java.lang.Iterable<? extends java.lang.Long > values)
java.util.List< java.lang.Integer > getVarsList()
com.google.ortools.sat.CpObjectiveProto build()
com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
com.google.ortools.sat.CpObjectiveProto getDefaultInstanceForType()
static com.google.ortools.sat.CpObjectiveProto parseFrom(java.io.InputStream input)
static com.google.protobuf.Parser< CpObjectiveProto > parser()
static com.google.ortools.sat.CpObjectiveProto getDefaultInstance()
static com.google.ortools.sat.CpObjectiveProto parseFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
void writeTo(com.google.protobuf.CodedOutputStream output)
static com.google.ortools.sat.CpObjectiveProto parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static com.google.ortools.sat.CpObjectiveProto parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent)
static com.google.ortools.sat.CpObjectiveProto parseDelimitedFrom(java.io.InputStream input)
static com.google.ortools.sat.CpObjectiveProto parseFrom(com.google.protobuf.ByteString data)
static com.google.ortools.sat.CpObjectiveProto parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static com.google.ortools.sat.CpObjectiveProto parseDelimitedFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
java.util.List< java.lang.Long > getDomainList()
java.util.List< java.lang.Integer > getVarsList()
com.google.ortools.sat.CpObjectiveProto getDefaultInstanceForType()
static Builder newBuilder(com.google.ortools.sat.CpObjectiveProto prototype)
static com.google.ortools.sat.CpObjectiveProto parseFrom(com.google.protobuf.CodedInputStream input)
static com.google.ortools.sat.CpObjectiveProto parseFrom(java.nio.ByteBuffer data)
boolean equals(final java.lang.Object obj)
com.google.protobuf.Parser< CpObjectiveProto > getParserForType()
static com.google.ortools.sat.CpObjectiveProto parseFrom(byte[] data)
static com.google.ortools.sat.CpObjectiveProto parseFrom(java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
java.util.List< java.lang.Long > getCoeffsList()
com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()