Google OR-Tools v9.14
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
operations_research::math_opt::internal::SosConstraintData< ConstraintId > Class Template Reference

Detailed Description

template<typename ConstraintId>
class operations_research::math_opt::internal::SosConstraintData< ConstraintId >

Internal storage representation for a single SOS constraint.

Implements the interface specified for the ConstraintData parameter of AtomicConstraintStorage.

Definition at line 41 of file storage.h.

#include <storage.h>

Public Types

using IdType = ConstraintId
using ProtoType = SosConstraintProto
using UpdatesProtoType = SosConstraintUpdatesProto

Public Member Functions

 SosConstraintData (std::vector< LinearExpressionData > expressions, std::vector< double > weights, std::string name)
ProtoType Proto () const
std::vector< VariableIdRelatedVariables () const
void DeleteVariable (VariableId var)
bool has_weights () const
double weight (const int index) const
const LinearExpressionDataexpression (const int index) const
int64_t num_expressions () const
const std::string & name () const

Static Public Member Functions

static SosConstraintData FromProto (const ProtoType &in_proto)

Static Public Attributes

static constexpr bool kSupportsElemental = false

Member Typedef Documentation

◆ IdType

template<typename ConstraintId>
using operations_research::math_opt::internal::SosConstraintData< ConstraintId >::IdType = ConstraintId

Definition at line 43 of file storage.h.

◆ ProtoType

template<typename ConstraintId>
using operations_research::math_opt::internal::SosConstraintData< ConstraintId >::ProtoType = SosConstraintProto

Definition at line 44 of file storage.h.

◆ UpdatesProtoType

template<typename ConstraintId>
using operations_research::math_opt::internal::SosConstraintData< ConstraintId >::UpdatesProtoType = SosConstraintUpdatesProto

Definition at line 45 of file storage.h.

Constructor & Destructor Documentation

◆ SosConstraintData()

template<typename ConstraintId>
operations_research::math_opt::internal::SosConstraintData< ConstraintId >::SosConstraintData ( std::vector< LinearExpressionData > expressions,
std::vector< double > weights,
std::string name )
inline

weights must either be empty or the same length as expressions. If it is empty, default weights of 1, 2, ... will be used.

Definition at line 55 of file storage.h.

Member Function Documentation

◆ DeleteVariable()

template<typename ConstraintId>
void operations_research::math_opt::internal::SosConstraintData< ConstraintId >::DeleteVariable ( VariableId var)

Definition at line 171 of file storage.h.

◆ expression()

template<typename ConstraintId>
const LinearExpressionData & operations_research::math_opt::internal::SosConstraintData< ConstraintId >::expression ( const int index) const
inline

Definition at line 77 of file storage.h.

◆ FromProto()

template<typename ConstraintId>
SosConstraintData< ConstraintId > operations_research::math_opt::internal::SosConstraintData< ConstraintId >::FromProto ( const ProtoType & in_proto)
static

The in_proto must be in a valid state; see the inline comments on SosConstraintProto for details.

Otherwise proto has default weights, so leave data.weights_ as unset.

Definition at line 123 of file storage.h.

◆ has_weights()

template<typename ConstraintId>
bool operations_research::math_opt::internal::SosConstraintData< ConstraintId >::has_weights ( ) const
inline

Definition at line 71 of file storage.h.

◆ name()

template<typename ConstraintId>
const std::string & operations_research::math_opt::internal::SosConstraintData< ConstraintId >::name ( ) const
inline

Definition at line 82 of file storage.h.

◆ num_expressions()

template<typename ConstraintId>
int64_t operations_research::math_opt::internal::SosConstraintData< ConstraintId >::num_expressions ( ) const
inline

Definition at line 81 of file storage.h.

◆ Proto()

template<typename ConstraintId>
SosConstraintData< ConstraintId >::ProtoType operations_research::math_opt::internal::SosConstraintData< ConstraintId >::Proto ( ) const

Definition at line 144 of file storage.h.

◆ RelatedVariables()

template<typename ConstraintId>
std::vector< VariableId > operations_research::math_opt::internal::SosConstraintData< ConstraintId >::RelatedVariables ( ) const

Definition at line 159 of file storage.h.

◆ weight()

template<typename ConstraintId>
double operations_research::math_opt::internal::SosConstraintData< ConstraintId >::weight ( const int index) const
inline

Definition at line 73 of file storage.h.

Member Data Documentation

◆ kSupportsElemental

template<typename ConstraintId>
bool operations_research::math_opt::internal::SosConstraintData< ConstraintId >::kSupportsElemental = false
staticconstexpr

Definition at line 46 of file storage.h.


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