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