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

Public Member Functions

Builder clear ()
 
com.google.protobuf.Descriptors.Descriptor getDescriptorForType ()
 
com.google.ortools.sat.LinearBooleanConstraint getDefaultInstanceForType ()
 
com.google.ortools.sat.LinearBooleanConstraint build ()
 
com.google.ortools.sat.LinearBooleanConstraint buildPartial ()
 
Builder clone ()
 
Builder setField (com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)
 
Builder clearField (com.google.protobuf.Descriptors.FieldDescriptor field)
 
Builder clearOneof (com.google.protobuf.Descriptors.OneofDescriptor oneof)
 
Builder setRepeatedField (com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)
 
Builder addRepeatedField (com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)
 
Builder mergeFrom (com.google.protobuf.Message other)
 
Builder mergeFrom (com.google.ortools.sat.LinearBooleanConstraint other)
 
final boolean isInitialized ()
 
Builder mergeFrom (com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException
 
java.util.List< java.lang.Integer > getLiteralsList ()
 
int getLiteralsCount ()
 
int getLiterals (int index)
 
Builder setLiterals (int index, int value)
 
Builder addLiterals (int value)
 
Builder addAllLiterals (java.lang.Iterable<? extends java.lang.Integer > values)
 
Builder clearLiterals ()
 
java.util.List< java.lang.Long > getCoefficientsList ()
 
int getCoefficientsCount ()
 
long getCoefficients (int index)
 
Builder setCoefficients (int index, long value)
 
Builder addCoefficients (long value)
 
Builder addAllCoefficients (java.lang.Iterable<? extends java.lang.Long > values)
 
Builder clearCoefficients ()
 
boolean hasLowerBound ()
 
long getLowerBound ()
 
Builder setLowerBound (long value)
 
Builder clearLowerBound ()
 
boolean hasUpperBound ()
 
long getUpperBound ()
 
Builder setUpperBound (long value)
 
Builder clearUpperBound ()
 
boolean hasName ()
 
java.lang.String getName ()
 
com.google.protobuf.ByteString getNameBytes ()
 
Builder setName (java.lang.String value)
 
Builder clearName ()
 
Builder setNameBytes (com.google.protobuf.ByteString value)
 
final Builder setUnknownFields (final com.google.protobuf.UnknownFieldSet unknownFields)
 
final Builder mergeUnknownFields (final com.google.protobuf.UnknownFieldSet unknownFields)
 

Static Public Member Functions

static final com.google.protobuf.Descriptors.Descriptor getDescriptor ()
 

Protected Member Functions

com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable ()
 

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 499 of file LinearBooleanConstraint.java.

Member Function Documentation

◆ addAllCoefficients()

Builder com.google.ortools.sat.LinearBooleanConstraint.Builder.addAllCoefficients ( java.lang.Iterable<? extends java.lang.Long > values)

repeated int64 coefficients = 2;

Parameters
valuesThe coefficients to add.
Returns
This builder for chaining.

Definition at line 991 of file LinearBooleanConstraint.java.

◆ addAllLiterals()

Builder com.google.ortools.sat.LinearBooleanConstraint.Builder.addAllLiterals ( java.lang.Iterable<? extends java.lang.Integer > values)
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
valuesThe literals to add.
Returns
This builder for chaining.

Definition at line 895 of file LinearBooleanConstraint.java.

◆ addCoefficients()

Builder com.google.ortools.sat.LinearBooleanConstraint.Builder.addCoefficients ( long value)

repeated int64 coefficients = 2;

Parameters
valueThe coefficients to add.
Returns
This builder for chaining.

Definition at line 978 of file LinearBooleanConstraint.java.

◆ addLiterals()

Builder com.google.ortools.sat.LinearBooleanConstraint.Builder.addLiterals ( int value)
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
valueThe literals to add.
Returns
This builder for chaining.

Definition at line 870 of file LinearBooleanConstraint.java.

◆ addRepeatedField()

Builder com.google.ortools.sat.LinearBooleanConstraint.Builder.addRepeatedField ( com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value )

Definition at line 619 of file LinearBooleanConstraint.java.

◆ build()

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

Definition at line 550 of file LinearBooleanConstraint.java.

◆ buildPartial()

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

Definition at line 559 of file LinearBooleanConstraint.java.

◆ clear()

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

Definition at line 527 of file LinearBooleanConstraint.java.

◆ clearCoefficients()

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

repeated int64 coefficients = 2;

Returns
This builder for chaining.

Definition at line 1004 of file LinearBooleanConstraint.java.

◆ clearField()

Builder com.google.ortools.sat.LinearBooleanConstraint.Builder.clearField ( com.google.protobuf.Descriptors.FieldDescriptor field)

Definition at line 603 of file LinearBooleanConstraint.java.

◆ clearLiterals()

Builder com.google.ortools.sat.LinearBooleanConstraint.Builder.clearLiterals ( )
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
This builder for chaining.

Definition at line 920 of file LinearBooleanConstraint.java.

◆ clearLowerBound()

Builder com.google.ortools.sat.LinearBooleanConstraint.Builder.clearLowerBound ( )
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
This builder for chaining.

Definition at line 1068 of file LinearBooleanConstraint.java.

◆ clearName()

Builder com.google.ortools.sat.LinearBooleanConstraint.Builder.clearName ( )
The name of this constraint.

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

Returns
This builder for chaining.

Definition at line 1195 of file LinearBooleanConstraint.java.

◆ clearOneof()

Builder com.google.ortools.sat.LinearBooleanConstraint.Builder.clearOneof ( com.google.protobuf.Descriptors.OneofDescriptor oneof)

Definition at line 608 of file LinearBooleanConstraint.java.

◆ clearUpperBound()

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

optional int64 upper_bound = 4;

Returns
This builder for chaining.

Definition at line 1108 of file LinearBooleanConstraint.java.

◆ clone()

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

Definition at line 593 of file LinearBooleanConstraint.java.

◆ getCoefficients()

long com.google.ortools.sat.LinearBooleanConstraint.Builder.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 955 of file LinearBooleanConstraint.java.

◆ getCoefficientsCount()

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

repeated int64 coefficients = 2;

Returns
The count of coefficients.

Implements com.google.ortools.sat.LinearBooleanConstraintOrBuilder.

Definition at line 947 of file LinearBooleanConstraint.java.

◆ getCoefficientsList()

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

repeated int64 coefficients = 2;

Returns
A list containing the coefficients.

Implements com.google.ortools.sat.LinearBooleanConstraintOrBuilder.

Definition at line 939 of file LinearBooleanConstraint.java.

◆ getDefaultInstanceForType()

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

Definition at line 545 of file LinearBooleanConstraint.java.

◆ getDescriptor()

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

Definition at line 504 of file LinearBooleanConstraint.java.

◆ getDescriptorForType()

com.google.protobuf.Descriptors.Descriptor com.google.ortools.sat.LinearBooleanConstraint.Builder.getDescriptorForType ( )

Definition at line 540 of file LinearBooleanConstraint.java.

◆ getLiterals()

int com.google.ortools.sat.LinearBooleanConstraint.Builder.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 823 of file LinearBooleanConstraint.java.

◆ getLiteralsCount()

int com.google.ortools.sat.LinearBooleanConstraint.Builder.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 803 of file LinearBooleanConstraint.java.

◆ getLiteralsList()

java.util.List< java.lang.Integer > com.google.ortools.sat.LinearBooleanConstraint.Builder.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 783 of file LinearBooleanConstraint.java.

◆ getLowerBound()

long com.google.ortools.sat.LinearBooleanConstraint.Builder.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 1037 of file LinearBooleanConstraint.java.

◆ getName()

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

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

Returns
The name.

Implements com.google.ortools.sat.LinearBooleanConstraintOrBuilder.

Definition at line 1135 of file LinearBooleanConstraint.java.

◆ getNameBytes()

com.google.protobuf.ByteString com.google.ortools.sat.LinearBooleanConstraint.Builder.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 1158 of file LinearBooleanConstraint.java.

◆ getUpperBound()

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

optional int64 upper_bound = 4;

Returns
The upperBound.

Implements com.google.ortools.sat.LinearBooleanConstraintOrBuilder.

Definition at line 1089 of file LinearBooleanConstraint.java.

◆ hasLowerBound()

boolean com.google.ortools.sat.LinearBooleanConstraint.Builder.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 1023 of file LinearBooleanConstraint.java.

◆ hasName()

boolean com.google.ortools.sat.LinearBooleanConstraint.Builder.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 1124 of file LinearBooleanConstraint.java.

◆ hasUpperBound()

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

optional int64 upper_bound = 4;

Returns
Whether the upperBound field is set.

Implements com.google.ortools.sat.LinearBooleanConstraintOrBuilder.

Definition at line 1081 of file LinearBooleanConstraint.java.

◆ internalGetFieldAccessorTable()

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

Definition at line 510 of file LinearBooleanConstraint.java.

◆ isInitialized()

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

Definition at line 675 of file LinearBooleanConstraint.java.

◆ mergeFrom() [1/3]

Builder com.google.ortools.sat.LinearBooleanConstraint.Builder.mergeFrom ( com.google.ortools.sat.LinearBooleanConstraint other)

Definition at line 634 of file LinearBooleanConstraint.java.

◆ mergeFrom() [2/3]

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

Definition at line 680 of file LinearBooleanConstraint.java.

◆ mergeFrom() [3/3]

Builder com.google.ortools.sat.LinearBooleanConstraint.Builder.mergeFrom ( com.google.protobuf.Message other)

Definition at line 625 of file LinearBooleanConstraint.java.

◆ mergeUnknownFields()

final Builder com.google.ortools.sat.LinearBooleanConstraint.Builder.mergeUnknownFields ( final com.google.protobuf.UnknownFieldSet unknownFields)

Definition at line 1225 of file LinearBooleanConstraint.java.

◆ setCoefficients()

Builder com.google.ortools.sat.LinearBooleanConstraint.Builder.setCoefficients ( int index,
long value )

repeated int64 coefficients = 2;

Parameters
indexThe index to set the value at.
valueThe coefficients to set.
Returns
This builder for chaining.

Definition at line 964 of file LinearBooleanConstraint.java.

◆ setField()

Builder com.google.ortools.sat.LinearBooleanConstraint.Builder.setField ( com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value )

Definition at line 597 of file LinearBooleanConstraint.java.

◆ setLiterals()

Builder com.google.ortools.sat.LinearBooleanConstraint.Builder.setLiterals ( int index,
int value )
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 to set the value at.
valueThe literals to set.
Returns
This builder for chaining.

Definition at line 844 of file LinearBooleanConstraint.java.

◆ setLowerBound()

Builder com.google.ortools.sat.LinearBooleanConstraint.Builder.setLowerBound ( long value)
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;

Parameters
valueThe lowerBound to set.
Returns
This builder for chaining.

Definition at line 1051 of file LinearBooleanConstraint.java.

◆ setName()

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

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

Parameters
valueThe name to set.
Returns
This builder for chaining.

Definition at line 1179 of file LinearBooleanConstraint.java.

◆ setNameBytes()

Builder com.google.ortools.sat.LinearBooleanConstraint.Builder.setNameBytes ( com.google.protobuf.ByteString value)
The name of this constraint.

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

Parameters
valueThe bytes for name to set.
Returns
This builder for chaining.

Definition at line 1210 of file LinearBooleanConstraint.java.

◆ setRepeatedField()

Builder com.google.ortools.sat.LinearBooleanConstraint.Builder.setRepeatedField ( com.google.protobuf.Descriptors.FieldDescriptor field,
int index,
java.lang.Object value )

Definition at line 613 of file LinearBooleanConstraint.java.

◆ setUnknownFields()

final Builder com.google.ortools.sat.LinearBooleanConstraint.Builder.setUnknownFields ( final com.google.protobuf.UnknownFieldSet unknownFields)

Definition at line 1219 of file LinearBooleanConstraint.java.

◆ setUpperBound()

Builder com.google.ortools.sat.LinearBooleanConstraint.Builder.setUpperBound ( long value)

optional int64 upper_bound = 4;

Parameters
valueThe upperBound to set.
Returns
This builder for chaining.

Definition at line 1097 of file LinearBooleanConstraint.java.


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