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