Google OR-Tools v9.9
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
DenseMatrixProto.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: 3.25.3
5package com.google.ortools.sat;
6
15public final class DenseMatrixProto extends
16 com.google.protobuf.GeneratedMessageV3 implements
17 // @@protoc_insertion_point(message_implements:operations_research.sat.DenseMatrixProto)
19private static final long serialVersionUID = 0L;
20 // Use DenseMatrixProto.newBuilder() to construct.
21 private DenseMatrixProto(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
22 super(builder);
23 }
24 private DenseMatrixProto() {
25 entries_ = emptyIntList();
26 }
27
28 @java.lang.Override
29 @SuppressWarnings({"unused"})
30 protected java.lang.Object newInstance(
31 UnusedPrivateParameter unused) {
32 return new DenseMatrixProto();
33 }
34
35 public static final com.google.protobuf.Descriptors.Descriptor
37 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_DenseMatrixProto_descriptor;
38 }
39
40 @java.lang.Override
41 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
43 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_DenseMatrixProto_fieldAccessorTable
44 .ensureFieldAccessorsInitialized(
45 com.google.ortools.sat.DenseMatrixProto.class, com.google.ortools.sat.DenseMatrixProto.Builder.class);
46 }
47
48 public static final int NUM_ROWS_FIELD_NUMBER = 1;
49 private int numRows_ = 0;
54 @java.lang.Override
55 public int getNumRows() {
56 return numRows_;
57 }
58
59 public static final int NUM_COLS_FIELD_NUMBER = 2;
60 private int numCols_ = 0;
65 @java.lang.Override
66 public int getNumCols() {
67 return numCols_;
68 }
69
70 public static final int ENTRIES_FIELD_NUMBER = 3;
71 @SuppressWarnings("serial")
72 private com.google.protobuf.Internal.IntList entries_ =
73 emptyIntList();
78 @java.lang.Override
79 public java.util.List<java.lang.Integer>
81 return entries_;
82 }
87 public int getEntriesCount() {
88 return entries_.size();
89 }
95 public int getEntries(int index) {
96 return entries_.getInt(index);
97 }
98 private int entriesMemoizedSerializedSize = -1;
99
100 private byte memoizedIsInitialized = -1;
101 @java.lang.Override
102 public final boolean isInitialized() {
103 byte isInitialized = memoizedIsInitialized;
104 if (isInitialized == 1) return true;
105 if (isInitialized == 0) return false;
106
107 memoizedIsInitialized = 1;
108 return true;
109 }
110
111 @java.lang.Override
112 public void writeTo(com.google.protobuf.CodedOutputStream output)
113 throws java.io.IOException {
115 if (numRows_ != 0) {
116 output.writeInt32(1, numRows_);
117 }
118 if (numCols_ != 0) {
119 output.writeInt32(2, numCols_);
120 }
121 if (getEntriesList().size() > 0) {
122 output.writeUInt32NoTag(26);
123 output.writeUInt32NoTag(entriesMemoizedSerializedSize);
124 }
125 for (int i = 0; i < entries_.size(); i++) {
126 output.writeInt32NoTag(entries_.getInt(i));
127 }
128 getUnknownFields().writeTo(output);
129 }
130
131 @java.lang.Override
132 public int getSerializedSize() {
133 int size = memoizedSize;
134 if (size != -1) return size;
135
136 size = 0;
137 if (numRows_ != 0) {
138 size += com.google.protobuf.CodedOutputStream
139 .computeInt32Size(1, numRows_);
140 }
141 if (numCols_ != 0) {
142 size += com.google.protobuf.CodedOutputStream
143 .computeInt32Size(2, numCols_);
144 }
145 {
146 int dataSize = 0;
147 for (int i = 0; i < entries_.size(); i++) {
148 dataSize += com.google.protobuf.CodedOutputStream
149 .computeInt32SizeNoTag(entries_.getInt(i));
150 }
151 size += dataSize;
152 if (!getEntriesList().isEmpty()) {
153 size += 1;
154 size += com.google.protobuf.CodedOutputStream
155 .computeInt32SizeNoTag(dataSize);
156 }
157 entriesMemoizedSerializedSize = dataSize;
158 }
159 size += getUnknownFields().getSerializedSize();
160 memoizedSize = size;
161 return size;
162 }
163
164 @java.lang.Override
165 public boolean equals(final java.lang.Object obj) {
166 if (obj == this) {
167 return true;
168 }
169 if (!(obj instanceof com.google.ortools.sat.DenseMatrixProto)) {
170 return super.equals(obj);
171 }
172 com.google.ortools.sat.DenseMatrixProto other = (com.google.ortools.sat.DenseMatrixProto) obj;
173
174 if (getNumRows()
175 != other.getNumRows()) return false;
176 if (getNumCols()
177 != other.getNumCols()) return false;
178 if (!getEntriesList()
179 .equals(other.getEntriesList())) return false;
180 if (!getUnknownFields().equals(other.getUnknownFields())) return false;
181 return true;
182 }
183
184 @java.lang.Override
185 public int hashCode() {
186 if (memoizedHashCode != 0) {
187 return memoizedHashCode;
188 }
189 int hash = 41;
190 hash = (19 * hash) + getDescriptor().hashCode();
191 hash = (37 * hash) + NUM_ROWS_FIELD_NUMBER;
192 hash = (53 * hash) + getNumRows();
193 hash = (37 * hash) + NUM_COLS_FIELD_NUMBER;
194 hash = (53 * hash) + getNumCols();
195 if (getEntriesCount() > 0) {
196 hash = (37 * hash) + ENTRIES_FIELD_NUMBER;
197 hash = (53 * hash) + getEntriesList().hashCode();
198 }
199 hash = (29 * hash) + getUnknownFields().hashCode();
200 memoizedHashCode = hash;
201 return hash;
202 }
203
205 java.nio.ByteBuffer data)
206 throws com.google.protobuf.InvalidProtocolBufferException {
207 return PARSER.parseFrom(data);
208 }
210 java.nio.ByteBuffer data,
211 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
212 throws com.google.protobuf.InvalidProtocolBufferException {
213 return PARSER.parseFrom(data, extensionRegistry);
214 }
216 com.google.protobuf.ByteString data)
217 throws com.google.protobuf.InvalidProtocolBufferException {
218 return PARSER.parseFrom(data);
219 }
221 com.google.protobuf.ByteString data,
222 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
223 throws com.google.protobuf.InvalidProtocolBufferException {
224 return PARSER.parseFrom(data, extensionRegistry);
225 }
227 throws com.google.protobuf.InvalidProtocolBufferException {
228 return PARSER.parseFrom(data);
229 }
231 byte[] data,
232 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
233 throws com.google.protobuf.InvalidProtocolBufferException {
234 return PARSER.parseFrom(data, extensionRegistry);
235 }
236 public static com.google.ortools.sat.DenseMatrixProto parseFrom(java.io.InputStream input)
237 throws java.io.IOException {
238 return com.google.protobuf.GeneratedMessageV3
239 .parseWithIOException(PARSER, input);
240 }
242 java.io.InputStream input,
243 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
244 throws java.io.IOException {
245 return com.google.protobuf.GeneratedMessageV3
246 .parseWithIOException(PARSER, input, extensionRegistry);
247 }
248
249 public static com.google.ortools.sat.DenseMatrixProto parseDelimitedFrom(java.io.InputStream input)
250 throws java.io.IOException {
251 return com.google.protobuf.GeneratedMessageV3
252 .parseDelimitedWithIOException(PARSER, input);
253 }
254
256 java.io.InputStream input,
257 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
258 throws java.io.IOException {
259 return com.google.protobuf.GeneratedMessageV3
260 .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
261 }
263 com.google.protobuf.CodedInputStream input)
264 throws java.io.IOException {
265 return com.google.protobuf.GeneratedMessageV3
266 .parseWithIOException(PARSER, input);
267 }
269 com.google.protobuf.CodedInputStream input,
270 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
271 throws java.io.IOException {
272 return com.google.protobuf.GeneratedMessageV3
273 .parseWithIOException(PARSER, input, extensionRegistry);
274 }
275
276 @java.lang.Override
277 public Builder newBuilderForType() { return newBuilder(); }
278 public static Builder newBuilder() {
279 return DEFAULT_INSTANCE.toBuilder();
280 }
281 public static Builder newBuilder(com.google.ortools.sat.DenseMatrixProto prototype) {
282 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
283 }
284 @java.lang.Override
286 return this == DEFAULT_INSTANCE
287 ? new Builder() : new Builder().mergeFrom(this);
288 }
289
290 @java.lang.Override
292 com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
293 Builder builder = new Builder(parent);
294 return builder;
295 }
304 public static final class Builder extends
305 com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
306 // @@protoc_insertion_point(builder_implements:operations_research.sat.DenseMatrixProto)
307 com.google.ortools.sat.DenseMatrixProtoOrBuilder {
308 public static final com.google.protobuf.Descriptors.Descriptor
310 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_DenseMatrixProto_descriptor;
311 }
312
313 @java.lang.Override
314 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
316 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_DenseMatrixProto_fieldAccessorTable
317 .ensureFieldAccessorsInitialized(
318 com.google.ortools.sat.DenseMatrixProto.class, com.google.ortools.sat.DenseMatrixProto.Builder.class);
319 }
320
321 // Construct using com.google.ortools.sat.DenseMatrixProto.newBuilder()
322 private Builder() {
323
324 }
325
326 private Builder(
327 com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
328 super(parent);
329
330 }
331 @java.lang.Override
332 public Builder clear() {
333 super.clear();
334 bitField0_ = 0;
335 numRows_ = 0;
336 numCols_ = 0;
337 entries_ = emptyIntList();
338 return this;
339 }
340
341 @java.lang.Override
342 public com.google.protobuf.Descriptors.Descriptor
344 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_DenseMatrixProto_descriptor;
345 }
346
347 @java.lang.Override
349 return com.google.ortools.sat.DenseMatrixProto.getDefaultInstance();
350 }
351
352 @java.lang.Override
355 if (!result.isInitialized()) {
356 throw newUninitializedMessageException(result);
357 }
358 return result;
359 }
360
361 @java.lang.Override
363 com.google.ortools.sat.DenseMatrixProto result = new com.google.ortools.sat.DenseMatrixProto(this);
364 if (bitField0_ != 0) { buildPartial0(result); }
365 onBuilt();
366 return result;
367 }
368
369 private void buildPartial0(com.google.ortools.sat.DenseMatrixProto result) {
370 int from_bitField0_ = bitField0_;
371 if (((from_bitField0_ & 0x00000001) != 0)) {
372 result.numRows_ = numRows_;
373 }
374 if (((from_bitField0_ & 0x00000002) != 0)) {
375 result.numCols_ = numCols_;
376 }
377 if (((from_bitField0_ & 0x00000004) != 0)) {
378 entries_.makeImmutable();
379 result.entries_ = entries_;
380 }
381 }
382
383 @java.lang.Override
384 public Builder clone() {
385 return super.clone();
386 }
387 @java.lang.Override
389 com.google.protobuf.Descriptors.FieldDescriptor field,
390 java.lang.Object value) {
391 return super.setField(field, value);
392 }
393 @java.lang.Override
395 com.google.protobuf.Descriptors.FieldDescriptor field) {
396 return super.clearField(field);
397 }
398 @java.lang.Override
400 com.google.protobuf.Descriptors.OneofDescriptor oneof) {
401 return super.clearOneof(oneof);
402 }
403 @java.lang.Override
405 com.google.protobuf.Descriptors.FieldDescriptor field,
406 int index, java.lang.Object value) {
407 return super.setRepeatedField(field, index, value);
408 }
409 @java.lang.Override
411 com.google.protobuf.Descriptors.FieldDescriptor field,
412 java.lang.Object value) {
413 return super.addRepeatedField(field, value);
414 }
415 @java.lang.Override
416 public Builder mergeFrom(com.google.protobuf.Message other) {
417 if (other instanceof com.google.ortools.sat.DenseMatrixProto) {
418 return mergeFrom((com.google.ortools.sat.DenseMatrixProto)other);
419 } else {
420 super.mergeFrom(other);
421 return this;
422 }
423 }
424
425 public Builder mergeFrom(com.google.ortools.sat.DenseMatrixProto other) {
426 if (other == com.google.ortools.sat.DenseMatrixProto.getDefaultInstance()) return this;
427 if (other.getNumRows() != 0) {
428 setNumRows(other.getNumRows());
429 }
430 if (other.getNumCols() != 0) {
431 setNumCols(other.getNumCols());
432 }
433 if (!other.entries_.isEmpty()) {
434 if (entries_.isEmpty()) {
435 entries_ = other.entries_;
436 entries_.makeImmutable();
437 bitField0_ |= 0x00000004;
438 } else {
439 ensureEntriesIsMutable();
440 entries_.addAll(other.entries_);
441 }
442 onChanged();
443 }
444 this.mergeUnknownFields(other.getUnknownFields());
445 onChanged();
446 return this;
447 }
448
449 @java.lang.Override
450 public final boolean isInitialized() {
451 return true;
452 }
453
454 @java.lang.Override
456 com.google.protobuf.CodedInputStream input,
457 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
458 throws java.io.IOException {
459 if (extensionRegistry == null) {
460 throw new java.lang.NullPointerException();
461 }
462 try {
463 boolean done = false;
464 while (!done) {
465 int tag = input.readTag();
466 switch (tag) {
467 case 0:
468 done = true;
469 break;
470 case 8: {
471 numRows_ = input.readInt32();
472 bitField0_ |= 0x00000001;
473 break;
474 } // case 8
475 case 16: {
476 numCols_ = input.readInt32();
477 bitField0_ |= 0x00000002;
478 break;
479 } // case 16
480 case 24: {
481 int v = input.readInt32();
482 ensureEntriesIsMutable();
483 entries_.addInt(v);
484 break;
485 } // case 24
486 case 26: {
487 int length = input.readRawVarint32();
488 int limit = input.pushLimit(length);
489 ensureEntriesIsMutable();
490 while (input.getBytesUntilLimit() > 0) {
491 entries_.addInt(input.readInt32());
492 }
493 input.popLimit(limit);
494 break;
495 } // case 26
496 default: {
497 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
498 done = true; // was an endgroup tag
499 }
500 break;
501 } // default:
502 } // switch (tag)
503 } // while (!done)
504 } catch (com.google.protobuf.InvalidProtocolBufferException e) {
505 throw e.unwrapIOException();
506 } finally {
507 onChanged();
508 } // finally
509 return this;
510 }
511 private int bitField0_;
512
513 private int numRows_ ;
518 @java.lang.Override
519 public int getNumRows() {
520 return numRows_;
521 }
527 public Builder setNumRows(int value) {
528
529 numRows_ = value;
530 bitField0_ |= 0x00000001;
531 onChanged();
532 return this;
533 }
539 bitField0_ = (bitField0_ & ~0x00000001);
540 numRows_ = 0;
541 onChanged();
542 return this;
543 }
544
545 private int numCols_ ;
550 @java.lang.Override
551 public int getNumCols() {
552 return numCols_;
553 }
559 public Builder setNumCols(int value) {
560
561 numCols_ = value;
562 bitField0_ |= 0x00000002;
563 onChanged();
564 return this;
565 }
571 bitField0_ = (bitField0_ & ~0x00000002);
572 numCols_ = 0;
573 onChanged();
574 return this;
575 }
576
577 private com.google.protobuf.Internal.IntList entries_ = emptyIntList();
578 private void ensureEntriesIsMutable() {
579 if (!entries_.isModifiable()) {
580 entries_ = makeMutableCopy(entries_);
581 }
582 bitField0_ |= 0x00000004;
583 }
588 public java.util.List<java.lang.Integer>
590 entries_.makeImmutable();
591 return entries_;
592 }
597 public int getEntriesCount() {
598 return entries_.size();
599 }
605 public int getEntries(int index) {
606 return entries_.getInt(index);
607 }
615 int index, int value) {
616
617 ensureEntriesIsMutable();
618 entries_.setInt(index, value);
619 bitField0_ |= 0x00000004;
620 onChanged();
621 return this;
622 }
628 public Builder addEntries(int value) {
629
630 ensureEntriesIsMutable();
631 entries_.addInt(value);
632 bitField0_ |= 0x00000004;
633 onChanged();
634 return this;
635 }
642 java.lang.Iterable<? extends java.lang.Integer> values) {
643 ensureEntriesIsMutable();
644 com.google.protobuf.AbstractMessageLite.Builder.addAll(
645 values, entries_);
646 bitField0_ |= 0x00000004;
647 onChanged();
648 return this;
649 }
655 entries_ = emptyIntList();
656 bitField0_ = (bitField0_ & ~0x00000004);
657 onChanged();
658 return this;
659 }
660 @java.lang.Override
662 final com.google.protobuf.UnknownFieldSet unknownFields) {
663 return super.setUnknownFields(unknownFields);
664 }
665
666 @java.lang.Override
668 final com.google.protobuf.UnknownFieldSet unknownFields) {
669 return super.mergeUnknownFields(unknownFields);
670 }
671
672
673 // @@protoc_insertion_point(builder_scope:operations_research.sat.DenseMatrixProto)
674 }
675
676 // @@protoc_insertion_point(class_scope:operations_research.sat.DenseMatrixProto)
677 private static final com.google.ortools.sat.DenseMatrixProto DEFAULT_INSTANCE;
678 static {
679 DEFAULT_INSTANCE = new com.google.ortools.sat.DenseMatrixProto();
680 }
681
683 return DEFAULT_INSTANCE;
684 }
685
686 private static final com.google.protobuf.Parser<DenseMatrixProto>
687 PARSER = new com.google.protobuf.AbstractParser<DenseMatrixProto>() {
688 @java.lang.Override
689 public DenseMatrixProto parsePartialFrom(
690 com.google.protobuf.CodedInputStream input,
691 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
692 throws com.google.protobuf.InvalidProtocolBufferException {
693 Builder builder = newBuilder();
694 try {
695 builder.mergeFrom(input, extensionRegistry);
696 } catch (com.google.protobuf.InvalidProtocolBufferException e) {
697 throw e.setUnfinishedMessage(builder.buildPartial());
698 } catch (com.google.protobuf.UninitializedMessageException e) {
699 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
700 } catch (java.io.IOException e) {
701 throw new com.google.protobuf.InvalidProtocolBufferException(e)
702 .setUnfinishedMessage(builder.buildPartial());
703 }
704 return builder.buildPartial();
705 }
706 };
707
708 public static com.google.protobuf.Parser<DenseMatrixProto> parser() {
709 return PARSER;
710 }
711
712 @java.lang.Override
713 public com.google.protobuf.Parser<DenseMatrixProto> getParserForType() {
714 return PARSER;
715 }
716
717 @java.lang.Override
719 return DEFAULT_INSTANCE;
720 }
721
722}
723
com.google.ortools.sat.DenseMatrixProto build()
com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)
com.google.ortools.sat.DenseMatrixProto getDefaultInstanceForType()
static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)
Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field)
final Builder mergeUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)
Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)
java.util.List< java.lang.Integer > getEntriesList()
Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
Builder addAllEntries(java.lang.Iterable<? extends java.lang.Integer > values)
Builder mergeFrom(com.google.protobuf.Message other)
Builder mergeFrom(com.google.ortools.sat.DenseMatrixProto other)
final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)
com.google.ortools.sat.DenseMatrixProto buildPartial()
static com.google.ortools.sat.DenseMatrixProto parseDelimitedFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
com.google.ortools.sat.DenseMatrixProto getDefaultInstanceForType()
boolean equals(final java.lang.Object obj)
java.lang.Object newInstance(UnusedPrivateParameter unused)
static com.google.ortools.sat.DenseMatrixProto parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
static com.google.ortools.sat.DenseMatrixProto parseFrom(java.io.InputStream input)
static com.google.ortools.sat.DenseMatrixProto getDefaultInstance()
static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
static com.google.ortools.sat.DenseMatrixProto parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static com.google.ortools.sat.DenseMatrixProto parseFrom(java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static com.google.ortools.sat.DenseMatrixProto parseFrom(com.google.protobuf.CodedInputStream input)
Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
static com.google.ortools.sat.DenseMatrixProto parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static com.google.protobuf.Parser< DenseMatrixProto > parser()
java.util.List< java.lang.Integer > getEntriesList()
static com.google.ortools.sat.DenseMatrixProto parseFrom(com.google.protobuf.ByteString data)
void writeTo(com.google.protobuf.CodedOutputStream output)
static com.google.ortools.sat.DenseMatrixProto parseFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static Builder newBuilder(com.google.ortools.sat.DenseMatrixProto prototype)
static com.google.ortools.sat.DenseMatrixProto parseDelimitedFrom(java.io.InputStream input)
static com.google.ortools.sat.DenseMatrixProto parseFrom(java.nio.ByteBuffer data)
static com.google.ortools.sat.DenseMatrixProto parseFrom(byte[] data)
com.google.protobuf.Parser< DenseMatrixProto > getParserForType()