Google OR-Tools v9.14
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// NO CHECKED-IN PROTOBUF GENCODE
3// source: ortools/sat/cp_model.proto
4// Protobuf Java Version: 4.31.1
5
6package com.google.ortools.sat;
7
16@com.google.protobuf.Generated
17public final class DenseMatrixProto extends
18 com.google.protobuf.GeneratedMessage implements
19 // @@protoc_insertion_point(message_implements:operations_research.sat.DenseMatrixProto)
21private static final long serialVersionUID = 0L;
22 static {
23 com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
24 com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
25 /* major= */ 4,
26 /* minor= */ 31,
27 /* patch= */ 1,
28 /* suffix= */ "",
29 DenseMatrixProto.class.getName());
30 }
31 // Use DenseMatrixProto.newBuilder() to construct.
32 private DenseMatrixProto(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
33 super(builder);
34 }
35 private DenseMatrixProto() {
36 entries_ = emptyIntList();
37 }
38
39 public static final com.google.protobuf.Descriptors.Descriptor
41 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_DenseMatrixProto_descriptor;
42 }
43
44 @java.lang.Override
45 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
47 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_DenseMatrixProto_fieldAccessorTable
48 .ensureFieldAccessorsInitialized(
49 com.google.ortools.sat.DenseMatrixProto.class, com.google.ortools.sat.DenseMatrixProto.Builder.class);
50 }
51
52 public static final int NUM_ROWS_FIELD_NUMBER = 1;
53 private int numRows_ = 0;
58 @java.lang.Override
59 public int getNumRows() {
60 return numRows_;
61 }
62
63 public static final int NUM_COLS_FIELD_NUMBER = 2;
64 private int numCols_ = 0;
69 @java.lang.Override
70 public int getNumCols() {
71 return numCols_;
72 }
73
74 public static final int ENTRIES_FIELD_NUMBER = 3;
75 @SuppressWarnings("serial")
76 private com.google.protobuf.Internal.IntList entries_ =
77 emptyIntList();
82 @java.lang.Override
83 public java.util.List<java.lang.Integer>
85 return entries_;
86 }
87
91 public int getEntriesCount() {
92 return entries_.size();
93 }
94
99 public int getEntries(int index) {
100 return entries_.getInt(index);
101 }
102 private int entriesMemoizedSerializedSize = -1;
103
104 private byte memoizedIsInitialized = -1;
105 @java.lang.Override
106 public final boolean isInitialized() {
107 byte isInitialized = memoizedIsInitialized;
108 if (isInitialized == 1) return true;
109 if (isInitialized == 0) return false;
110
111 memoizedIsInitialized = 1;
112 return true;
113 }
114
115 @java.lang.Override
116 public void writeTo(com.google.protobuf.CodedOutputStream output)
117 throws java.io.IOException {
119 if (numRows_ != 0) {
120 output.writeInt32(1, numRows_);
121 }
122 if (numCols_ != 0) {
123 output.writeInt32(2, numCols_);
124 }
125 if (getEntriesList().size() > 0) {
126 output.writeUInt32NoTag(26);
127 output.writeUInt32NoTag(entriesMemoizedSerializedSize);
128 }
129 for (int i = 0; i < entries_.size(); i++) {
130 output.writeInt32NoTag(entries_.getInt(i));
131 }
132 getUnknownFields().writeTo(output);
133 }
134
135 @java.lang.Override
136 public int getSerializedSize() {
137 int size = memoizedSize;
138 if (size != -1) return size;
139
140 size = 0;
141 if (numRows_ != 0) {
142 size += com.google.protobuf.CodedOutputStream
143 .computeInt32Size(1, numRows_);
144 }
145 if (numCols_ != 0) {
146 size += com.google.protobuf.CodedOutputStream
147 .computeInt32Size(2, numCols_);
148 }
149 {
150 int dataSize = 0;
151 for (int i = 0; i < entries_.size(); i++) {
152 dataSize += com.google.protobuf.CodedOutputStream
153 .computeInt32SizeNoTag(entries_.getInt(i));
154 }
155 size += dataSize;
156 if (!getEntriesList().isEmpty()) {
157 size += 1;
158 size += com.google.protobuf.CodedOutputStream
159 .computeInt32SizeNoTag(dataSize);
160 }
161 entriesMemoizedSerializedSize = dataSize;
162 }
163 size += getUnknownFields().getSerializedSize();
164 memoizedSize = size;
165 return size;
166 }
167
168 @java.lang.Override
169 public boolean equals(final java.lang.Object obj) {
170 if (obj == this) {
171 return true;
172 }
173 if (!(obj instanceof com.google.ortools.sat.DenseMatrixProto)) {
174 return super.equals(obj);
175 }
176 com.google.ortools.sat.DenseMatrixProto other = (com.google.ortools.sat.DenseMatrixProto) obj;
177
178 if (getNumRows()
179 != other.getNumRows()) return false;
180 if (getNumCols()
181 != other.getNumCols()) return false;
182 if (!getEntriesList()
183 .equals(other.getEntriesList())) return false;
184 if (!getUnknownFields().equals(other.getUnknownFields())) return false;
185 return true;
186 }
187
188 @java.lang.Override
189 public int hashCode() {
190 if (memoizedHashCode != 0) {
191 return memoizedHashCode;
192 }
193 int hash = 41;
194 hash = (19 * hash) + getDescriptor().hashCode();
195 hash = (37 * hash) + NUM_ROWS_FIELD_NUMBER;
196 hash = (53 * hash) + getNumRows();
197 hash = (37 * hash) + NUM_COLS_FIELD_NUMBER;
198 hash = (53 * hash) + getNumCols();
199 if (getEntriesCount() > 0) {
200 hash = (37 * hash) + ENTRIES_FIELD_NUMBER;
201 hash = (53 * hash) + getEntriesList().hashCode();
202 }
203 hash = (29 * hash) + getUnknownFields().hashCode();
204 memoizedHashCode = hash;
205 return hash;
206 }
207
209 java.nio.ByteBuffer data)
210 throws com.google.protobuf.InvalidProtocolBufferException {
211 return PARSER.parseFrom(data);
212 }
214 java.nio.ByteBuffer data,
215 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
216 throws com.google.protobuf.InvalidProtocolBufferException {
217 return PARSER.parseFrom(data, extensionRegistry);
218 }
220 com.google.protobuf.ByteString data)
221 throws com.google.protobuf.InvalidProtocolBufferException {
222 return PARSER.parseFrom(data);
223 }
225 com.google.protobuf.ByteString data,
226 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
227 throws com.google.protobuf.InvalidProtocolBufferException {
228 return PARSER.parseFrom(data, extensionRegistry);
229 }
231 throws com.google.protobuf.InvalidProtocolBufferException {
232 return PARSER.parseFrom(data);
233 }
235 byte[] data,
236 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
237 throws com.google.protobuf.InvalidProtocolBufferException {
238 return PARSER.parseFrom(data, extensionRegistry);
239 }
240 public static com.google.ortools.sat.DenseMatrixProto parseFrom(java.io.InputStream input)
241 throws java.io.IOException {
242 return com.google.protobuf.GeneratedMessage
243 .parseWithIOException(PARSER, input);
244 }
246 java.io.InputStream input,
247 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
248 throws java.io.IOException {
249 return com.google.protobuf.GeneratedMessage
250 .parseWithIOException(PARSER, input, extensionRegistry);
251 }
252
253 public static com.google.ortools.sat.DenseMatrixProto parseDelimitedFrom(java.io.InputStream input)
254 throws java.io.IOException {
255 return com.google.protobuf.GeneratedMessage
256 .parseDelimitedWithIOException(PARSER, input);
257 }
258
260 java.io.InputStream input,
261 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
262 throws java.io.IOException {
263 return com.google.protobuf.GeneratedMessage
264 .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
265 }
267 com.google.protobuf.CodedInputStream input)
268 throws java.io.IOException {
269 return com.google.protobuf.GeneratedMessage
270 .parseWithIOException(PARSER, input);
271 }
273 com.google.protobuf.CodedInputStream input,
274 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
275 throws java.io.IOException {
276 return com.google.protobuf.GeneratedMessage
277 .parseWithIOException(PARSER, input, extensionRegistry);
278 }
279
280 @java.lang.Override
281 public Builder newBuilderForType() { return newBuilder(); }
282 public static Builder newBuilder() {
283 return DEFAULT_INSTANCE.toBuilder();
284 }
285 public static Builder newBuilder(com.google.ortools.sat.DenseMatrixProto prototype) {
286 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
287 }
288 @java.lang.Override
290 return this == DEFAULT_INSTANCE
291 ? new Builder() : new Builder().mergeFrom(this);
292 }
293
294 @java.lang.Override
296 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
297 Builder builder = new Builder(parent);
298 return builder;
299 }
300
308 public static final class Builder extends
309 com.google.protobuf.GeneratedMessage.Builder<Builder> implements
310 // @@protoc_insertion_point(builder_implements:operations_research.sat.DenseMatrixProto)
312 public static final com.google.protobuf.Descriptors.Descriptor
314 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_DenseMatrixProto_descriptor;
315 }
316
317 @java.lang.Override
318 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
320 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_DenseMatrixProto_fieldAccessorTable
321 .ensureFieldAccessorsInitialized(
322 com.google.ortools.sat.DenseMatrixProto.class, com.google.ortools.sat.DenseMatrixProto.Builder.class);
323 }
324
325 // Construct using com.google.ortools.sat.DenseMatrixProto.newBuilder()
326 private Builder() {
327
328 }
329
330 private Builder(
331 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
332 super(parent);
333
334 }
335 @java.lang.Override
336 public Builder clear() {
337 super.clear();
338 bitField0_ = 0;
339 numRows_ = 0;
340 numCols_ = 0;
341 entries_ = emptyIntList();
342 return this;
343 }
344
345 @java.lang.Override
346 public com.google.protobuf.Descriptors.Descriptor
348 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_DenseMatrixProto_descriptor;
349 }
350
351 @java.lang.Override
353 return com.google.ortools.sat.DenseMatrixProto.getDefaultInstance();
354 }
355
356 @java.lang.Override
359 if (!result.isInitialized()) {
360 throw newUninitializedMessageException(result);
361 }
362 return result;
363 }
364
365 @java.lang.Override
367 com.google.ortools.sat.DenseMatrixProto result = new com.google.ortools.sat.DenseMatrixProto(this);
368 if (bitField0_ != 0) { buildPartial0(result); }
369 onBuilt();
370 return result;
371 }
372
373 private void buildPartial0(com.google.ortools.sat.DenseMatrixProto result) {
374 int from_bitField0_ = bitField0_;
375 if (((from_bitField0_ & 0x00000001) != 0)) {
376 result.numRows_ = numRows_;
377 }
378 if (((from_bitField0_ & 0x00000002) != 0)) {
379 result.numCols_ = numCols_;
380 }
381 if (((from_bitField0_ & 0x00000004) != 0)) {
382 entries_.makeImmutable();
383 result.entries_ = entries_;
384 }
385 }
386
387 @java.lang.Override
388 public Builder mergeFrom(com.google.protobuf.Message other) {
389 if (other instanceof com.google.ortools.sat.DenseMatrixProto) {
390 return mergeFrom((com.google.ortools.sat.DenseMatrixProto)other);
391 } else {
392 super.mergeFrom(other);
393 return this;
394 }
395 }
396
397 public Builder mergeFrom(com.google.ortools.sat.DenseMatrixProto other) {
398 if (other == com.google.ortools.sat.DenseMatrixProto.getDefaultInstance()) return this;
399 if (other.getNumRows() != 0) {
400 setNumRows(other.getNumRows());
401 }
402 if (other.getNumCols() != 0) {
403 setNumCols(other.getNumCols());
404 }
405 if (!other.entries_.isEmpty()) {
406 if (entries_.isEmpty()) {
407 entries_ = other.entries_;
408 entries_.makeImmutable();
409 bitField0_ |= 0x00000004;
410 } else {
411 ensureEntriesIsMutable();
412 entries_.addAll(other.entries_);
413 }
414 onChanged();
415 }
416 this.mergeUnknownFields(other.getUnknownFields());
417 onChanged();
418 return this;
419 }
420
421 @java.lang.Override
422 public final boolean isInitialized() {
423 return true;
424 }
425
426 @java.lang.Override
427 public Builder mergeFrom(
428 com.google.protobuf.CodedInputStream input,
429 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
430 throws java.io.IOException {
431 if (extensionRegistry == null) {
432 throw new java.lang.NullPointerException();
433 }
434 try {
435 boolean done = false;
436 while (!done) {
437 int tag = input.readTag();
438 switch (tag) {
439 case 0:
440 done = true;
441 break;
442 case 8: {
443 numRows_ = input.readInt32();
444 bitField0_ |= 0x00000001;
445 break;
446 } // case 8
447 case 16: {
448 numCols_ = input.readInt32();
449 bitField0_ |= 0x00000002;
450 break;
451 } // case 16
452 case 24: {
453 int v = input.readInt32();
454 ensureEntriesIsMutable();
455 entries_.addInt(v);
456 break;
457 } // case 24
458 case 26: {
459 int length = input.readRawVarint32();
460 int limit = input.pushLimit(length);
461 ensureEntriesIsMutable();
462 while (input.getBytesUntilLimit() > 0) {
463 entries_.addInt(input.readInt32());
464 }
465 input.popLimit(limit);
466 break;
467 } // case 26
468 default: {
469 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
470 done = true; // was an endgroup tag
471 }
472 break;
473 } // default:
474 } // switch (tag)
475 } // while (!done)
476 } catch (com.google.protobuf.InvalidProtocolBufferException e) {
477 throw e.unwrapIOException();
478 } finally {
479 onChanged();
480 } // finally
481 return this;
482 }
483 private int bitField0_;
484
485 private int numRows_ ;
490 @java.lang.Override
491 public int getNumRows() {
492 return numRows_;
493 }
494
499 public Builder setNumRows(int value) {
500
501 numRows_ = value;
502 bitField0_ |= 0x00000001;
503 onChanged();
504 return this;
505 }
506
510 public Builder clearNumRows() {
511 bitField0_ = (bitField0_ & ~0x00000001);
512 numRows_ = 0;
513 onChanged();
514 return this;
515 }
516
517 private int numCols_ ;
522 @java.lang.Override
523 public int getNumCols() {
524 return numCols_;
525 }
526
531 public Builder setNumCols(int value) {
532
533 numCols_ = value;
534 bitField0_ |= 0x00000002;
535 onChanged();
536 return this;
537 }
538
542 public Builder clearNumCols() {
543 bitField0_ = (bitField0_ & ~0x00000002);
544 numCols_ = 0;
545 onChanged();
546 return this;
547 }
548
549 private com.google.protobuf.Internal.IntList entries_ = emptyIntList();
550 private void ensureEntriesIsMutable() {
551 if (!entries_.isModifiable()) {
552 entries_ = makeMutableCopy(entries_);
553 }
554 bitField0_ |= 0x00000004;
555 }
560 public java.util.List<java.lang.Integer>
562 entries_.makeImmutable();
563 return entries_;
564 }
565
569 public int getEntriesCount() {
570 return entries_.size();
571 }
572
577 public int getEntries(int index) {
578 return entries_.getInt(index);
579 }
580
586 public Builder setEntries(
587 int index, int value) {
588
589 ensureEntriesIsMutable();
590 entries_.setInt(index, value);
591 bitField0_ |= 0x00000004;
592 onChanged();
593 return this;
594 }
595
600 public Builder addEntries(int value) {
601
602 ensureEntriesIsMutable();
603 entries_.addInt(value);
604 bitField0_ |= 0x00000004;
605 onChanged();
606 return this;
607 }
608
613 public Builder addAllEntries(
614 java.lang.Iterable<? extends java.lang.Integer> values) {
615 ensureEntriesIsMutable();
616 com.google.protobuf.AbstractMessageLite.Builder.addAll(
617 values, entries_);
618 bitField0_ |= 0x00000004;
619 onChanged();
620 return this;
621 }
622
626 public Builder clearEntries() {
627 entries_ = emptyIntList();
628 bitField0_ = (bitField0_ & ~0x00000004);
629 onChanged();
630 return this;
631 }
632
633 // @@protoc_insertion_point(builder_scope:operations_research.sat.DenseMatrixProto)
634 }
635
636 // @@protoc_insertion_point(class_scope:operations_research.sat.DenseMatrixProto)
637 private static final com.google.ortools.sat.DenseMatrixProto DEFAULT_INSTANCE;
638 static {
639 DEFAULT_INSTANCE = new com.google.ortools.sat.DenseMatrixProto();
640 }
641
643 return DEFAULT_INSTANCE;
644 }
645
646 private static final com.google.protobuf.Parser<DenseMatrixProto>
647 PARSER = new com.google.protobuf.AbstractParser<DenseMatrixProto>() {
648 @java.lang.Override
649 public DenseMatrixProto parsePartialFrom(
650 com.google.protobuf.CodedInputStream input,
651 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
652 throws com.google.protobuf.InvalidProtocolBufferException {
653 Builder builder = newBuilder();
654 try {
655 builder.mergeFrom(input, extensionRegistry);
656 } catch (com.google.protobuf.InvalidProtocolBufferException e) {
657 throw e.setUnfinishedMessage(builder.buildPartial());
658 } catch (com.google.protobuf.UninitializedMessageException e) {
659 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
660 } catch (java.io.IOException e) {
661 throw new com.google.protobuf.InvalidProtocolBufferException(e)
662 .setUnfinishedMessage(builder.buildPartial());
663 }
664 return builder.buildPartial();
665 }
666 };
667
668 public static com.google.protobuf.Parser<DenseMatrixProto> parser() {
669 return PARSER;
670 }
671
672 @java.lang.Override
673 public com.google.protobuf.Parser<DenseMatrixProto> getParserForType() {
674 return PARSER;
675 }
676
677 @java.lang.Override
679 return DEFAULT_INSTANCE;
680 }
681
682}
683
com.google.ortools.sat.DenseMatrixProto build()
com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
com.google.ortools.sat.DenseMatrixProto getDefaultInstanceForType()
static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
java.util.List< java.lang.Integer > getEntriesList()
Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
Builder addAllEntries(java.lang.Iterable<? extends java.lang.Integer > values)
com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
Builder mergeFrom(com.google.protobuf.Message other)
Builder mergeFrom(com.google.ortools.sat.DenseMatrixProto other)
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)
static com.google.ortools.sat.DenseMatrixProto parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
com.google.protobuf.GeneratedMessage.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)
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)
Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent)
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()