Google OR-Tools v9.14
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
operations_research::math_opt::SecondOrderConeConstraint Class Referencefinal

Detailed Description

A value type that references a second-order cone constraint from ModelStorage. Usually this type is passed by copy.

This type implements https://abseil.io/docs/cpp/guides/hash.

Definition at line 39 of file second_order_cone_constraint.h.

#include <second_order_cone_constraint.h>

Inheritance diagram for operations_research::math_opt::SecondOrderConeConstraint:
operations_research::math_opt::ModelStorageItem

Public Types

using IdType = SecondOrderConeConstraintId
 The typed integer used for ids.

Public Member Functions

 SecondOrderConeConstraint (ModelStorageCPtr storage, SecondOrderConeConstraintId id)
int64_t id () const
SecondOrderConeConstraintId typed_id () const
absl::string_view name () const
LinearExpression UpperBound () const
std::vector< LinearExpressionArgumentsToNorm () const
std::vector< VariableNonzeroVariables () const
std::string ToString () const
Public Member Functions inherited from operations_research::math_opt::ModelStorageItem
ModelStorageCPtr storage () const

Friends

bool operator== (const SecondOrderConeConstraint &lhs, const SecondOrderConeConstraint &rhs)
bool operator!= (const SecondOrderConeConstraint &lhs, const SecondOrderConeConstraint &rhs)
template<typename H>
AbslHashValue (H h, const SecondOrderConeConstraint &constraint)
std::ostream & operator<< (std::ostream &ostr, const SecondOrderConeConstraint &constraint)

Additional Inherited Members

Protected Member Functions inherited from operations_research::math_opt::ModelStorageItem
 ModelStorageItem (ModelStorageCPtr storage)
 ModelStorageItem (const ModelStorageItem &)=default
ModelStorageItemoperator= (const ModelStorageItem &)=default
 ModelStorageItem (ModelStorageItem &&)=default
ModelStorageItemoperator= (ModelStorageItem &&)=default
 ~ModelStorageItem ()=default

Member Typedef Documentation

◆ IdType

The typed integer used for ids.

Definition at line 42 of file second_order_cone_constraint.h.

Constructor & Destructor Documentation

◆ SecondOrderConeConstraint()

operations_research::math_opt::SecondOrderConeConstraint::SecondOrderConeConstraint ( ModelStorageCPtr storage,
SecondOrderConeConstraintId id )
inline

Definition at line 137 of file second_order_cone_constraint.h.

Member Function Documentation

◆ ArgumentsToNorm()

std::vector< LinearExpression > operations_research::math_opt::SecondOrderConeConstraint::ArgumentsToNorm ( ) const

Returns "arguments_to_norm" with respect to a constraint of the form |arguments_to_norm|₂ ≤ upper_bound.

Definition at line 37 of file second_order_cone_constraint.cc.

◆ id()

int64_t operations_research::math_opt::SecondOrderConeConstraint::id ( ) const
inline

Inline function implementations

Definition at line 93 of file second_order_cone_constraint.h.

◆ name()

absl::string_view operations_research::math_opt::SecondOrderConeConstraint::name ( ) const
inline

Definition at line 99 of file second_order_cone_constraint.h.

◆ NonzeroVariables()

std::vector< Variable > operations_research::math_opt::SecondOrderConeConstraint::NonzeroVariables ( ) const
inline

Returns all variables that appear in the second-order cone constraint with a nonzero coefficient. Order is not defined.

Definition at line 106 of file second_order_cone_constraint.h.

◆ ToString()

std::string operations_research::math_opt::SecondOrderConeConstraint::ToString ( ) const

Returns a detailed string description of the contents of the constraint (not its name, use << for that instead).

Definition at line 48 of file second_order_cone_constraint.cc.

◆ typed_id()

SecondOrderConeConstraintId operations_research::math_opt::SecondOrderConeConstraint::typed_id ( ) const
inline

Definition at line 95 of file second_order_cone_constraint.h.

◆ UpperBound()

LinearExpression operations_research::math_opt::SecondOrderConeConstraint::UpperBound ( ) const

Returns "upper_bound" with respect to a constraint of the form |arguments_to_norm|₂ ≤ upper_bound.

Definition at line 32 of file second_order_cone_constraint.cc.

◆ AbslHashValue

template<typename H>
H AbslHashValue ( H h,
const SecondOrderConeConstraint & constraint )
friend

Definition at line 121 of file second_order_cone_constraint.h.

◆ operator!=

bool operator!= ( const SecondOrderConeConstraint & lhs,
const SecondOrderConeConstraint & rhs )
friend

Definition at line 115 of file second_order_cone_constraint.h.

◆ operator<<

std::ostream & operator<< ( std::ostream & ostr,
const SecondOrderConeConstraint & constraint )
friend

Streams the name of the constraint, as registered upon constraint creation, or a short default if none was provided.

Todo
(b/170992529): handle quoting of invalid characters in the name.

Definition at line 125 of file second_order_cone_constraint.h.

◆ operator==

bool operator== ( const SecondOrderConeConstraint & lhs,
const SecondOrderConeConstraint & rhs )
friend

Definition at line 110 of file second_order_cone_constraint.h.


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