Class LinearBooleanConstraint

java.lang.Object
com.google.protobuf.AbstractMessageLite
com.google.protobuf.AbstractMessage
com.google.protobuf.GeneratedMessage
com.google.ortools.sat.LinearBooleanConstraint
All Implemented Interfaces:
LinearBooleanConstraintOrBuilder, com.google.protobuf.Message, com.google.protobuf.MessageLite, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Serializable

@Generated public final class LinearBooleanConstraint extends com.google.protobuf.GeneratedMessage implements LinearBooleanConstraintOrBuilder
 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
See Also:
  • Field Details

  • Method Details

    • getDescriptor

      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
    • internalGetFieldAccessorTable

      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
      Specified by:
      internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessage
    • getLiteralsList

      public List<Integer> 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;
      Specified by:
      getLiteralsList in interface LinearBooleanConstraintOrBuilder
      Returns:
      A list containing the literals.
    • getLiteralsCount

      public int 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;
      Specified by:
      getLiteralsCount in interface LinearBooleanConstraintOrBuilder
      Returns:
      The count of literals.
    • getLiterals

      public int 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;
      Specified by:
      getLiterals in interface LinearBooleanConstraintOrBuilder
      Parameters:
      index - The index of the element to return.
      Returns:
      The literals at the given index.
    • getCoefficientsList

      public List<Long> getCoefficientsList()
      repeated int64 coefficients = 2;
      Specified by:
      getCoefficientsList in interface LinearBooleanConstraintOrBuilder
      Returns:
      A list containing the coefficients.
    • getCoefficientsCount

      public int getCoefficientsCount()
      repeated int64 coefficients = 2;
      Specified by:
      getCoefficientsCount in interface LinearBooleanConstraintOrBuilder
      Returns:
      The count of coefficients.
    • getCoefficients

      public long getCoefficients(int index)
      repeated int64 coefficients = 2;
      Specified by:
      getCoefficients in interface LinearBooleanConstraintOrBuilder
      Parameters:
      index - The index of the element to return.
      Returns:
      The coefficients at the given index.
    • hasLowerBound

      public boolean 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;
      Specified by:
      hasLowerBound in interface LinearBooleanConstraintOrBuilder
      Returns:
      Whether the lowerBound field is set.
    • getLowerBound

      public long 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;
      Specified by:
      getLowerBound in interface LinearBooleanConstraintOrBuilder
      Returns:
      The lowerBound.
    • hasUpperBound

      public boolean hasUpperBound()
      optional int64 upper_bound = 4;
      Specified by:
      hasUpperBound in interface LinearBooleanConstraintOrBuilder
      Returns:
      Whether the upperBound field is set.
    • getUpperBound

      public long getUpperBound()
      optional int64 upper_bound = 4;
      Specified by:
      getUpperBound in interface LinearBooleanConstraintOrBuilder
      Returns:
      The upperBound.
    • hasName

      public boolean hasName()
       The name of this constraint.
       
      optional string name = 5 [default = ""];
      Specified by:
      hasName in interface LinearBooleanConstraintOrBuilder
      Returns:
      Whether the name field is set.
    • getName

      public String getName()
       The name of this constraint.
       
      optional string name = 5 [default = ""];
      Specified by:
      getName in interface LinearBooleanConstraintOrBuilder
      Returns:
      The name.
    • getNameBytes

      public com.google.protobuf.ByteString getNameBytes()
       The name of this constraint.
       
      optional string name = 5 [default = ""];
      Specified by:
      getNameBytes in interface LinearBooleanConstraintOrBuilder
      Returns:
      The bytes for name.
    • isInitialized

      public final boolean isInitialized()
      Specified by:
      isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
      Overrides:
      isInitialized in class com.google.protobuf.GeneratedMessage
    • writeTo

      public void writeTo(com.google.protobuf.CodedOutputStream output) throws IOException
      Specified by:
      writeTo in interface com.google.protobuf.MessageLite
      Overrides:
      writeTo in class com.google.protobuf.GeneratedMessage
      Throws:
      IOException
    • getSerializedSize

      public int getSerializedSize()
      Specified by:
      getSerializedSize in interface com.google.protobuf.MessageLite
      Overrides:
      getSerializedSize in class com.google.protobuf.GeneratedMessage
    • equals

      public boolean equals(Object obj)
      Specified by:
      equals in interface com.google.protobuf.Message
      Overrides:
      equals in class com.google.protobuf.AbstractMessage
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in interface com.google.protobuf.Message
      Overrides:
      hashCode in class com.google.protobuf.AbstractMessage
    • parseFrom

      public static LinearBooleanConstraint parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static LinearBooleanConstraint parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static LinearBooleanConstraint parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static LinearBooleanConstraint parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static LinearBooleanConstraint parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static LinearBooleanConstraint parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static LinearBooleanConstraint parseFrom(InputStream input) throws IOException
      Throws:
      IOException
    • parseFrom

      public static LinearBooleanConstraint parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • parseDelimitedFrom

      public static LinearBooleanConstraint parseDelimitedFrom(InputStream input) throws IOException
      Throws:
      IOException
    • parseDelimitedFrom

      public static LinearBooleanConstraint parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • parseFrom

      public static LinearBooleanConstraint parseFrom(com.google.protobuf.CodedInputStream input) throws IOException
      Throws:
      IOException
    • parseFrom

      public static LinearBooleanConstraint parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • newBuilderForType

      public LinearBooleanConstraint.Builder newBuilderForType()
      Specified by:
      newBuilderForType in interface com.google.protobuf.Message
      Specified by:
      newBuilderForType in interface com.google.protobuf.MessageLite
    • newBuilder

      public static LinearBooleanConstraint.Builder newBuilder()
    • newBuilder

      public static LinearBooleanConstraint.Builder newBuilder(LinearBooleanConstraint prototype)
    • toBuilder

      public LinearBooleanConstraint.Builder toBuilder()
      Specified by:
      toBuilder in interface com.google.protobuf.Message
      Specified by:
      toBuilder in interface com.google.protobuf.MessageLite
    • newBuilderForType

      protected LinearBooleanConstraint.Builder newBuilderForType(com.google.protobuf.AbstractMessage.BuilderParent parent)
      Overrides:
      newBuilderForType in class com.google.protobuf.AbstractMessage
    • getDefaultInstance

      public static LinearBooleanConstraint getDefaultInstance()
    • parser

      public static com.google.protobuf.Parser<LinearBooleanConstraint> parser()
    • getParserForType

      public com.google.protobuf.Parser<LinearBooleanConstraint> getParserForType()
      Specified by:
      getParserForType in interface com.google.protobuf.Message
      Specified by:
      getParserForType in interface com.google.protobuf.MessageLite
      Overrides:
      getParserForType in class com.google.protobuf.GeneratedMessage
    • getDefaultInstanceForType

      public LinearBooleanConstraint getDefaultInstanceForType()
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder