Google OR-Tools v9.15
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
operations_research::math_opt::Elemental Class Reference

Detailed Description

Definition at line 49 of file elemental.h.

#include <elemental.h>

Classes

class  DiffHandle
struct  AlwaysOk
struct  DiePolicy
struct  StatusPolicy
struct  UBPolicy

Public Member Functions

 Elemental (std::string model_name="", std::string primary_objective_name="")
const std::string & model_name () const
const std::string & primary_objective_name () const
template<ElementType e>
ElementId< e > AddElement (const absl::string_view name)
int64_t AddElementUntyped (const ElementType e, const absl::string_view name)
template<ElementType e>
bool DeleteElement (const ElementId< e > id)
bool DeleteElementUntyped (ElementType e, int64_t id)
template<ElementType e>
bool ElementExists (const ElementId< e > id) const
bool ElementExistsUntyped (const ElementType e, const int64_t id) const
template<ElementType e>
absl::StatusOr< absl::string_view > GetElementName (const ElementId< e > id) const
absl::StatusOr< absl::string_view > GetElementNameUntyped (const ElementType e, const int64_t id) const
template<ElementType e>
ElementIdsVector< e > AllElements () const
std::vector< int64_t > AllElementsUntyped (const ElementType e) const
int64_t NextElementId (const ElementType e) const
int64_t NumElements (const ElementType e) const
template<ElementType e>
void EnsureNextElementIdAtLeast (const ElementId< e > id)
void EnsureNextElementIdAtLeastUntyped (const ElementType e, int64_t id)
template<typename AttrType>
void AttrClear (AttrType a)
template<typename AttrType>
std::vector< AttrKeyFor< AttrType > > AttrNonDefaults (const AttrType a) const
template<typename AttrType>
int64_t AttrNumNonDefaults (const AttrType a) const
template<typename Policy = DiePolicy, typename AttrType>
Policy::template Wrapped< ValueTypeFor< AttrType > > GetAttr (AttrType a, AttrKeyFor< AttrType > key) const
template<typename Policy = DiePolicy, typename AttrType>
Policy::template Wrapped< bool > AttrIsNonDefault (AttrType a, AttrKeyFor< AttrType > key) const
template<typename Policy = DiePolicy, typename AttrType>
Policy::CheckResultT SetAttr (AttrType a, AttrKeyFor< AttrType > key, ValueTypeFor< AttrType > value)
template<int i, typename Policy = DiePolicy, typename AttrType = void>
Policy::template Wrapped< std::vector< AttrKeyFor< AttrType > > > Slice (AttrType a, int64_t key_elem) const
template<int i, typename Policy = DiePolicy, typename AttrType = void>
Policy::template Wrapped< int64_t > GetSliceSize (AttrType a, int64_t key_elem) const
Elemental Clone (std::optional< absl::string_view > new_model_name=std::nullopt) const
absl::StatusOr< ModelProtoExportModel (bool remove_names=false) const
absl::Status ApplyUpdateProto (const ModelUpdateProto &update_proto)
std::optional< DiffHandleGetDiffHandle (int64_t id) const
DiffHandle AddDiff ()
bool DeleteDiff (DiffHandle diff)
int64_t NumDiffs () const
bool Advance (DiffHandle diff)
template<typename AttrType>
std::vector< AttrKeyFor< AttrType > > ModifiedKeysThatExist (AttrType attr, const Diff &diff) const
absl::StatusOr< std::optional< ModelUpdateProto > > ExportModelUpdate (DiffHandle diff, bool remove_names=false) const
std::string DebugString (bool print_diffs=true) const

Static Public Member Functions

static absl::StatusOr< ElementalFromModelProto (const ModelProto &proto)

Constructor & Destructor Documentation

◆ Elemental()

operations_research::math_opt::Elemental::Elemental ( std::string model_name = "",
std::string primary_objective_name = "" )
explicit

Definition at line 38 of file elemental.cc.

Member Function Documentation

◆ AddDiff()

Elemental::DiffHandle operations_research::math_opt::Elemental::AddDiff ( )

Definition at line 60 of file elemental.cc.

◆ AddElement()

template<ElementType e>
ElementId< e > operations_research::math_opt::Elemental::AddElement ( const absl::string_view name)
inline

Definition at line 87 of file elemental.h.

◆ AddElementUntyped()

int64_t operations_research::math_opt::Elemental::AddElementUntyped ( const ElementType e,
const absl::string_view name )
inline

Definition at line 92 of file elemental.h.

◆ Advance()

bool operations_research::math_opt::Elemental::Advance ( DiffHandle diff)

Definition at line 74 of file elemental.cc.

◆ AllElements()

template<ElementType e>
ElementIdsVector< e > operations_research::math_opt::Elemental::AllElements ( ) const
inline

Definition at line 136 of file elemental.h.

◆ AllElementsUntyped()

std::vector< int64_t > operations_research::math_opt::Elemental::AllElementsUntyped ( const ElementType e) const
inline

Definition at line 141 of file elemental.h.

◆ ApplyUpdateProto()

absl::Status operations_research::math_opt::Elemental::ApplyUpdateProto ( const ModelUpdateProto & update_proto)

Definition at line 474 of file elemental_from_proto.cc.

◆ AttrClear()

template<typename AttrType>
void operations_research::math_opt::Elemental::AttrClear ( AttrType a)

Definition at line 406 of file elemental.h.

◆ AttrIsNonDefault()

template<typename Policy, typename AttrType>
Policy::template Wrapped< bool > operations_research::math_opt::Elemental::AttrIsNonDefault ( AttrType a,
AttrKeyFor< AttrType > key ) const

Definition at line 441 of file elemental.h.

◆ AttrNonDefaults()

template<typename AttrType>
std::vector< AttrKeyFor< AttrType > > operations_research::math_opt::Elemental::AttrNonDefaults ( const AttrType a) const
inline

Definition at line 215 of file elemental.h.

◆ AttrNumNonDefaults()

template<typename AttrType>
int64_t operations_research::math_opt::Elemental::AttrNumNonDefaults ( const AttrType a) const
inline

Definition at line 221 of file elemental.h.

◆ Clone()

Elemental operations_research::math_opt::Elemental::Clone ( std::optional< absl::string_view > new_model_name = std::nullopt) const

Definition at line 161 of file elemental.cc.

◆ DebugString()

std::string operations_research::math_opt::Elemental::DebugString ( bool print_diffs = true) const

Definition at line 155 of file elemental_to_string.cc.

◆ DeleteDiff()

bool operations_research::math_opt::Elemental::DeleteDiff ( DiffHandle diff)

Definition at line 67 of file elemental.cc.

◆ DeleteElement()

template<ElementType e>
bool operations_research::math_opt::Elemental::DeleteElement ( const ElementId< e > id)
inline

Definition at line 100 of file elemental.h.

◆ DeleteElementUntyped()

bool operations_research::math_opt::Elemental::DeleteElementUntyped ( ElementType e,
int64_t id )

Definition at line 86 of file elemental.cc.

◆ ElementExists()

template<ElementType e>
bool operations_research::math_opt::Elemental::ElementExists ( const ElementId< e > id) const
inline

Definition at line 110 of file elemental.h.

◆ ElementExistsUntyped()

bool operations_research::math_opt::Elemental::ElementExistsUntyped ( const ElementType e,
const int64_t id ) const
inline

Definition at line 115 of file elemental.h.

◆ EnsureNextElementIdAtLeast()

template<ElementType e>
void operations_research::math_opt::Elemental::EnsureNextElementIdAtLeast ( const ElementId< e > id)
inline

Definition at line 166 of file elemental.h.

◆ EnsureNextElementIdAtLeastUntyped()

void operations_research::math_opt::Elemental::EnsureNextElementIdAtLeastUntyped ( const ElementType e,
int64_t id )
inline

Definition at line 171 of file elemental.h.

◆ ExportModel()

absl::StatusOr< ModelProto > operations_research::math_opt::Elemental::ExportModel ( bool remove_names = false) const

Definition at line 525 of file elemental_export_model.cc.

◆ ExportModelUpdate()

absl::StatusOr< std::optional< ModelUpdateProto > > operations_research::math_opt::Elemental::ExportModelUpdate ( DiffHandle diff,
bool remove_names = false ) const

Definition at line 1065 of file elemental_export_model.cc.

◆ FromModelProto()

absl::StatusOr< Elemental > operations_research::math_opt::Elemental::FromModelProto ( const ModelProto & proto)
static

Definition at line 467 of file elemental_from_proto.cc.

◆ GetAttr()

template<typename Policy, typename AttrType>
Policy::template Wrapped< ValueTypeFor< AttrType > > operations_research::math_opt::Elemental::GetAttr ( AttrType a,
AttrKeyFor< AttrType > key ) const

Definition at line 434 of file elemental.h.

◆ GetDiffHandle()

std::optional< Elemental::DiffHandle > operations_research::math_opt::Elemental::GetDiffHandle ( int64_t id) const

Definition at line 52 of file elemental.cc.

◆ GetElementName()

template<ElementType e>
absl::StatusOr< absl::string_view > operations_research::math_opt::Elemental::GetElementName ( const ElementId< e > id) const
inline

Definition at line 122 of file elemental.h.

◆ GetElementNameUntyped()

absl::StatusOr< absl::string_view > operations_research::math_opt::Elemental::GetElementNameUntyped ( const ElementType e,
const int64_t id ) const
inline

Definition at line 128 of file elemental.h.

◆ GetSliceSize()

template<int i, typename Policy, typename AttrType>
Policy::template Wrapped< int64_t > operations_research::math_opt::Elemental::GetSliceSize ( AttrType a,
int64_t key_elem ) const

Definition at line 477 of file elemental.h.

◆ model_name()

const std::string & operations_research::math_opt::Elemental::model_name ( ) const
inline

Definition at line 72 of file elemental.h.

◆ ModifiedKeysThatExist()

template<typename AttrType>
std::vector< AttrKeyFor< AttrType > > operations_research::math_opt::Elemental::ModifiedKeysThatExist ( AttrType attr,
const Diff & diff ) const

Definition at line 532 of file elemental.h.

◆ NextElementId()

int64_t operations_research::math_opt::Elemental::NextElementId ( const ElementType e) const
inline

Definition at line 149 of file elemental.h.

◆ NumDiffs()

int64_t operations_research::math_opt::Elemental::NumDiffs ( ) const
inline

Definition at line 300 of file elemental.h.

◆ NumElements()

int64_t operations_research::math_opt::Elemental::NumElements ( const ElementType e) const
inline

Definition at line 157 of file elemental.h.

◆ primary_objective_name()

const std::string & operations_research::math_opt::Elemental::primary_objective_name ( ) const
inline

Definition at line 75 of file elemental.h.

◆ SetAttr()

template<typename Policy, typename AttrType>
Policy::CheckResultT operations_research::math_opt::Elemental::SetAttr ( AttrType a,
AttrKeyFor< AttrType > key,
ValueTypeFor< AttrType > value )

Definition at line 448 of file elemental.h.

◆ Slice()

template<int i, typename Policy, typename AttrType>
Policy::template Wrapped< std::vector< AttrKeyFor< AttrType > > > operations_research::math_opt::Elemental::Slice ( AttrType a,
int64_t key_elem ) const

Definition at line 470 of file elemental.h.


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