Google OR-Tools v9.11
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 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)
 
- Public Member Functions inherited from com.google.ortools.sat.LinearBooleanConstraintOrBuilder

Static Public Member Functions

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

Protected Member Functions

com.google.protobuf.GeneratedMessage.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 501 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 961 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 865 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 948 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 840 of file LinearBooleanConstraint.java.

◆ build()

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

Definition at line 552 of file LinearBooleanConstraint.java.

◆ buildPartial()

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

Definition at line 561 of file LinearBooleanConstraint.java.

◆ clear()

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

Definition at line 529 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 974 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 890 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 1038 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 1165 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 1078 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 925 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 917 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 909 of file LinearBooleanConstraint.java.

◆ getDefaultInstanceForType()

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

Definition at line 547 of file LinearBooleanConstraint.java.

◆ getDescriptor()

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

Definition at line 506 of file LinearBooleanConstraint.java.

◆ getDescriptorForType()

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

Definition at line 542 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 793 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 773 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 753 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 1007 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 1105 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 1128 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 1059 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 993 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 1094 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 1051 of file LinearBooleanConstraint.java.

◆ internalGetFieldAccessorTable()

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

Definition at line 512 of file LinearBooleanConstraint.java.

◆ isInitialized()

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

Definition at line 645 of file LinearBooleanConstraint.java.

◆ mergeFrom() [1/3]

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

Definition at line 604 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 650 of file LinearBooleanConstraint.java.

◆ mergeFrom() [3/3]

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

Definition at line 595 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 934 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 814 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 1021 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 1149 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 1180 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 1067 of file LinearBooleanConstraint.java.


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