Google OR-Tools v9.9
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
com.google.ortools.sat.LinearBooleanConstraint Class Reference
Inheritance diagram for com.google.ortools.sat.LinearBooleanConstraint:
com.google.ortools.sat.LinearBooleanConstraintOrBuilder

Classes

class  Builder
 

Public Member Functions

java.util.List< java.lang.Integer > getLiteralsList ()
 
int getLiteralsCount ()
 
int getLiterals (int index)
 
java.util.List< java.lang.Long > getCoefficientsList ()
 
int getCoefficientsCount ()
 
long getCoefficients (int index)
 
boolean hasLowerBound ()
 
long getLowerBound ()
 
boolean hasUpperBound ()
 
long getUpperBound ()
 
boolean hasName ()
 
java.lang.String getName ()
 
com.google.protobuf.ByteString getNameBytes ()
 
final boolean isInitialized ()
 
void writeTo (com.google.protobuf.CodedOutputStream output) throws java.io.IOException
 
int getSerializedSize ()
 
boolean equals (final java.lang.Object obj)
 
int hashCode ()
 
Builder newBuilderForType ()
 
Builder toBuilder ()
 
com.google.protobuf.Parser< LinearBooleanConstraintgetParserForType ()
 
com.google.ortools.sat.LinearBooleanConstraint getDefaultInstanceForType ()
 

Static Public Member Functions

static final com.google.protobuf.Descriptors.Descriptor getDescriptor ()
 
static com.google.ortools.sat.LinearBooleanConstraint parseFrom (java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException
 
static com.google.ortools.sat.LinearBooleanConstraint parseFrom (java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
 
static com.google.ortools.sat.LinearBooleanConstraint parseFrom (com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException
 
static com.google.ortools.sat.LinearBooleanConstraint parseFrom (com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
 
static com.google.ortools.sat.LinearBooleanConstraint parseFrom (byte[] data) throws com.google.protobuf.InvalidProtocolBufferException
 
static com.google.ortools.sat.LinearBooleanConstraint parseFrom (byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
 
static com.google.ortools.sat.LinearBooleanConstraint parseFrom (java.io.InputStream input) throws java.io.IOException
 
static com.google.ortools.sat.LinearBooleanConstraint parseFrom (java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException
 
static com.google.ortools.sat.LinearBooleanConstraint parseDelimitedFrom (java.io.InputStream input) throws java.io.IOException
 
static com.google.ortools.sat.LinearBooleanConstraint parseDelimitedFrom (java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException
 
static com.google.ortools.sat.LinearBooleanConstraint parseFrom (com.google.protobuf.CodedInputStream input) throws java.io.IOException
 
static com.google.ortools.sat.LinearBooleanConstraint parseFrom (com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException
 
static Builder newBuilder ()
 
static Builder newBuilder (com.google.ortools.sat.LinearBooleanConstraint prototype)
 
static com.google.ortools.sat.LinearBooleanConstraint getDefaultInstance ()
 
static com.google.protobuf.Parser< LinearBooleanConstraintparser ()
 

Static Public Attributes

static final int LITERALS_FIELD_NUMBER = 1
 
static final int COEFFICIENTS_FIELD_NUMBER = 2
 
static final int LOWER_BOUND_FIELD_NUMBER = 3
 
static final int UPPER_BOUND_FIELD_NUMBER = 4
 
static final int NAME_FIELD_NUMBER = 5
 
static final com.google.protobuf.Parser< LinearBooleanConstraintPARSER
 

Protected Member Functions

java.lang.Object newInstance (UnusedPrivateParameter unused)
 
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable ()
 
Builder newBuilderForType (com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
 

Detailed Description

A linear Boolean constraint which is a bounded sum of linear terms. Each term
beeing a literal times an integer coefficient. If we assume that a literal
takes the value 1 if it is true and 0 otherwise, the constraint is:
  lower_bound <= ... + coefficients[i] * literals[i] + ... <= upper_bound

Protobuf type operations_research.sat.LinearBooleanConstraint

Definition at line 17 of file LinearBooleanConstraint.java.

Member Function Documentation

◆ equals()

boolean com.google.ortools.sat.LinearBooleanConstraint.equals ( final java.lang.Object obj)

Definition at line 331 of file LinearBooleanConstraint.java.

◆ getCoefficients()

long com.google.ortools.sat.LinearBooleanConstraint.getCoefficients ( int index)

repeated int64 coefficients = 2;

Parameters
indexThe index of the element to return.
Returns
The coefficients at the given index.

Implements com.google.ortools.sat.LinearBooleanConstraintOrBuilder.

Definition at line 143 of file LinearBooleanConstraint.java.

◆ getCoefficientsCount()

int com.google.ortools.sat.LinearBooleanConstraint.getCoefficientsCount ( )

repeated int64 coefficients = 2;

Returns
The count of coefficients.

Implements com.google.ortools.sat.LinearBooleanConstraintOrBuilder.

Definition at line 135 of file LinearBooleanConstraint.java.

◆ getCoefficientsList()

java.util.List< java.lang.Long > com.google.ortools.sat.LinearBooleanConstraint.getCoefficientsList ( )

repeated int64 coefficients = 2;

Returns
A list containing the coefficients.

Implements com.google.ortools.sat.LinearBooleanConstraintOrBuilder.

Definition at line 128 of file LinearBooleanConstraint.java.

◆ getDefaultInstance()

static com.google.ortools.sat.LinearBooleanConstraint com.google.ortools.sat.LinearBooleanConstraint.getDefaultInstance ( )
static

Definition at line 1240 of file LinearBooleanConstraint.java.

◆ getDefaultInstanceForType()

com.google.ortools.sat.LinearBooleanConstraint com.google.ortools.sat.LinearBooleanConstraint.getDefaultInstanceForType ( )

Definition at line 1276 of file LinearBooleanConstraint.java.

◆ getDescriptor()

static final com.google.protobuf.Descriptors.Descriptor com.google.ortools.sat.LinearBooleanConstraint.getDescriptor ( )
static

Definition at line 40 of file LinearBooleanConstraint.java.

◆ getLiterals()

int com.google.ortools.sat.LinearBooleanConstraint.getLiterals ( int index)
Linear terms involved in this constraint.

literals[i] is the signed representation of the i-th literal of the
constraint and coefficients[i] its coefficients. The signed representation
is as follow: for a 0-based variable index x, (x + 1) represents the
variable x and -(x + 1) represents its negation.

Note that the same variable shouldn't appear twice and that zero
coefficients are not allowed.

repeated int32 literals = 1;

Parameters
indexThe index of the element to return.
Returns
The literals at the given index.

Implements com.google.ortools.sat.LinearBooleanConstraintOrBuilder.

Definition at line 114 of file LinearBooleanConstraint.java.

◆ getLiteralsCount()

int com.google.ortools.sat.LinearBooleanConstraint.getLiteralsCount ( )
Linear terms involved in this constraint.

literals[i] is the signed representation of the i-th literal of the
constraint and coefficients[i] its coefficients. The signed representation
is as follow: for a 0-based variable index x, (x + 1) represents the
variable x and -(x + 1) represents its negation.

Note that the same variable shouldn't appear twice and that zero
coefficients are not allowed.

repeated int32 literals = 1;

Returns
The count of literals.

Implements com.google.ortools.sat.LinearBooleanConstraintOrBuilder.

Definition at line 94 of file LinearBooleanConstraint.java.

◆ getLiteralsList()

java.util.List< java.lang.Integer > com.google.ortools.sat.LinearBooleanConstraint.getLiteralsList ( )
Linear terms involved in this constraint.

literals[i] is the signed representation of the i-th literal of the
constraint and coefficients[i] its coefficients. The signed representation
is as follow: for a 0-based variable index x, (x + 1) represents the
variable x and -(x + 1) represents its negation.

Note that the same variable shouldn't appear twice and that zero
coefficients are not allowed.

repeated int32 literals = 1;

Returns
A list containing the literals.

Implements com.google.ortools.sat.LinearBooleanConstraintOrBuilder.

Definition at line 75 of file LinearBooleanConstraint.java.

◆ getLowerBound()

long com.google.ortools.sat.LinearBooleanConstraint.getLowerBound ( )
Optional lower (resp. upper) bound of the constraint. If not present, it
means that the constraint is not bounded in this direction. The bounds
are INCLUSIVE.

optional int64 lower_bound = 3;

Returns
The lowerBound.

Implements com.google.ortools.sat.LinearBooleanConstraintOrBuilder.

Definition at line 174 of file LinearBooleanConstraint.java.

◆ getName()

java.lang.String com.google.ortools.sat.LinearBooleanConstraint.getName ( )
The name of this constraint.

optional string name = 5 [default = ""];

Returns
The name.

Implements com.google.ortools.sat.LinearBooleanConstraintOrBuilder.

Definition at line 221 of file LinearBooleanConstraint.java.

◆ getNameBytes()

com.google.protobuf.ByteString com.google.ortools.sat.LinearBooleanConstraint.getNameBytes ( )
The name of this constraint.

optional string name = 5 [default = ""];

Returns
The bytes for name.

Implements com.google.ortools.sat.LinearBooleanConstraintOrBuilder.

Definition at line 245 of file LinearBooleanConstraint.java.

◆ getParserForType()

com.google.protobuf.Parser< LinearBooleanConstraint > com.google.ortools.sat.LinearBooleanConstraint.getParserForType ( )

Definition at line 1271 of file LinearBooleanConstraint.java.

◆ getSerializedSize()

int com.google.ortools.sat.LinearBooleanConstraint.getSerializedSize ( )

Definition at line 291 of file LinearBooleanConstraint.java.

◆ getUpperBound()

long com.google.ortools.sat.LinearBooleanConstraint.getUpperBound ( )

optional int64 upper_bound = 4;

Returns
The upperBound.

Implements com.google.ortools.sat.LinearBooleanConstraintOrBuilder.

Definition at line 193 of file LinearBooleanConstraint.java.

◆ hashCode()

int com.google.ortools.sat.LinearBooleanConstraint.hashCode ( )

Definition at line 364 of file LinearBooleanConstraint.java.

◆ hasLowerBound()

boolean com.google.ortools.sat.LinearBooleanConstraint.hasLowerBound ( )
Optional lower (resp. upper) bound of the constraint. If not present, it
means that the constraint is not bounded in this direction. The bounds
are INCLUSIVE.

optional int64 lower_bound = 3;

Returns
Whether the lowerBound field is set.

Implements com.google.ortools.sat.LinearBooleanConstraintOrBuilder.

Definition at line 160 of file LinearBooleanConstraint.java.

◆ hasName()

boolean com.google.ortools.sat.LinearBooleanConstraint.hasName ( )
The name of this constraint.

optional string name = 5 [default = ""];

Returns
Whether the name field is set.

Implements com.google.ortools.sat.LinearBooleanConstraintOrBuilder.

Definition at line 209 of file LinearBooleanConstraint.java.

◆ hasUpperBound()

boolean com.google.ortools.sat.LinearBooleanConstraint.hasUpperBound ( )

optional int64 upper_bound = 4;

Returns
Whether the upperBound field is set.

Implements com.google.ortools.sat.LinearBooleanConstraintOrBuilder.

Definition at line 185 of file LinearBooleanConstraint.java.

◆ internalGetFieldAccessorTable()

com.google.protobuf.GeneratedMessageV3.FieldAccessorTable com.google.ortools.sat.LinearBooleanConstraint.internalGetFieldAccessorTable ( )
protected

Definition at line 46 of file LinearBooleanConstraint.java.

◆ isInitialized()

final boolean com.google.ortools.sat.LinearBooleanConstraint.isInitialized ( )

Definition at line 260 of file LinearBooleanConstraint.java.

◆ newBuilder() [1/2]

static Builder com.google.ortools.sat.LinearBooleanConstraint.newBuilder ( )
static

Definition at line 471 of file LinearBooleanConstraint.java.

◆ newBuilder() [2/2]

static Builder com.google.ortools.sat.LinearBooleanConstraint.newBuilder ( com.google.ortools.sat.LinearBooleanConstraint prototype)
static

Definition at line 474 of file LinearBooleanConstraint.java.

◆ newBuilderForType() [1/2]

Builder com.google.ortools.sat.LinearBooleanConstraint.newBuilderForType ( )

Definition at line 470 of file LinearBooleanConstraint.java.

◆ newBuilderForType() [2/2]

Builder com.google.ortools.sat.LinearBooleanConstraint.newBuilderForType ( com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
protected

Definition at line 484 of file LinearBooleanConstraint.java.

◆ newInstance()

java.lang.Object com.google.ortools.sat.LinearBooleanConstraint.newInstance ( UnusedPrivateParameter unused)
protected

Definition at line 34 of file LinearBooleanConstraint.java.

◆ parseDelimitedFrom() [1/2]

static com.google.ortools.sat.LinearBooleanConstraint com.google.ortools.sat.LinearBooleanConstraint.parseDelimitedFrom ( java.io.InputStream input) throws java.io.IOException
static

Definition at line 442 of file LinearBooleanConstraint.java.

◆ parseDelimitedFrom() [2/2]

static com.google.ortools.sat.LinearBooleanConstraint com.google.ortools.sat.LinearBooleanConstraint.parseDelimitedFrom ( java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry ) throws java.io.IOException
static

Definition at line 448 of file LinearBooleanConstraint.java.

◆ parseFrom() [1/10]

static com.google.ortools.sat.LinearBooleanConstraint com.google.ortools.sat.LinearBooleanConstraint.parseFrom ( byte[] data) throws com.google.protobuf.InvalidProtocolBufferException
static

Definition at line 419 of file LinearBooleanConstraint.java.

◆ parseFrom() [2/10]

static com.google.ortools.sat.LinearBooleanConstraint com.google.ortools.sat.LinearBooleanConstraint.parseFrom ( byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry ) throws com.google.protobuf.InvalidProtocolBufferException
static

Definition at line 423 of file LinearBooleanConstraint.java.

◆ parseFrom() [3/10]

static com.google.ortools.sat.LinearBooleanConstraint com.google.ortools.sat.LinearBooleanConstraint.parseFrom ( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException
static

Definition at line 408 of file LinearBooleanConstraint.java.

◆ parseFrom() [4/10]

static com.google.ortools.sat.LinearBooleanConstraint com.google.ortools.sat.LinearBooleanConstraint.parseFrom ( com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry ) throws com.google.protobuf.InvalidProtocolBufferException
static

Definition at line 413 of file LinearBooleanConstraint.java.

◆ parseFrom() [5/10]

static com.google.ortools.sat.LinearBooleanConstraint com.google.ortools.sat.LinearBooleanConstraint.parseFrom ( com.google.protobuf.CodedInputStream input) throws java.io.IOException
static

Definition at line 455 of file LinearBooleanConstraint.java.

◆ parseFrom() [6/10]

static com.google.ortools.sat.LinearBooleanConstraint com.google.ortools.sat.LinearBooleanConstraint.parseFrom ( com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry ) throws java.io.IOException
static

Definition at line 461 of file LinearBooleanConstraint.java.

◆ parseFrom() [7/10]

static com.google.ortools.sat.LinearBooleanConstraint com.google.ortools.sat.LinearBooleanConstraint.parseFrom ( java.io.InputStream input) throws java.io.IOException
static

Definition at line 429 of file LinearBooleanConstraint.java.

◆ parseFrom() [8/10]

static com.google.ortools.sat.LinearBooleanConstraint com.google.ortools.sat.LinearBooleanConstraint.parseFrom ( java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry ) throws java.io.IOException
static

Definition at line 434 of file LinearBooleanConstraint.java.

◆ parseFrom() [9/10]

static com.google.ortools.sat.LinearBooleanConstraint com.google.ortools.sat.LinearBooleanConstraint.parseFrom ( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException
static

Definition at line 397 of file LinearBooleanConstraint.java.

◆ parseFrom() [10/10]

static com.google.ortools.sat.LinearBooleanConstraint com.google.ortools.sat.LinearBooleanConstraint.parseFrom ( java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry ) throws com.google.protobuf.InvalidProtocolBufferException
static

Definition at line 402 of file LinearBooleanConstraint.java.

◆ parser()

static com.google.protobuf.Parser< LinearBooleanConstraint > com.google.ortools.sat.LinearBooleanConstraint.parser ( )
static

Definition at line 1266 of file LinearBooleanConstraint.java.

◆ toBuilder()

Builder com.google.ortools.sat.LinearBooleanConstraint.toBuilder ( )

Definition at line 478 of file LinearBooleanConstraint.java.

◆ writeTo()

void com.google.ortools.sat.LinearBooleanConstraint.writeTo ( com.google.protobuf.CodedOutputStream output) throws java.io.IOException

Definition at line 270 of file LinearBooleanConstraint.java.

Member Data Documentation

◆ COEFFICIENTS_FIELD_NUMBER

final int com.google.ortools.sat.LinearBooleanConstraint.COEFFICIENTS_FIELD_NUMBER = 2
static

Definition at line 118 of file LinearBooleanConstraint.java.

◆ LITERALS_FIELD_NUMBER

final int com.google.ortools.sat.LinearBooleanConstraint.LITERALS_FIELD_NUMBER = 1
static

Definition at line 53 of file LinearBooleanConstraint.java.

◆ LOWER_BOUND_FIELD_NUMBER

final int com.google.ortools.sat.LinearBooleanConstraint.LOWER_BOUND_FIELD_NUMBER = 3
static

Definition at line 147 of file LinearBooleanConstraint.java.

◆ NAME_FIELD_NUMBER

final int com.google.ortools.sat.LinearBooleanConstraint.NAME_FIELD_NUMBER = 5
static

Definition at line 197 of file LinearBooleanConstraint.java.

◆ PARSER

final com.google.protobuf.Parser<LinearBooleanConstraint> com.google.ortools.sat.LinearBooleanConstraint.PARSER
static
Initial value:
= new com.google.protobuf.AbstractParser<LinearBooleanConstraint>() {
@java.lang.Override
public LinearBooleanConstraint parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
Builder builder = newBuilder();
try {
builder.mergeFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(builder.buildPartial());
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(e)
.setUnfinishedMessage(builder.buildPartial());
}
return builder.buildPartial();
}
}

Definition at line 1245 of file LinearBooleanConstraint.java.

◆ UPPER_BOUND_FIELD_NUMBER

final int com.google.ortools.sat.LinearBooleanConstraint.UPPER_BOUND_FIELD_NUMBER = 4
static

Definition at line 178 of file LinearBooleanConstraint.java.


The documentation for this class was generated from the following file: