Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
operations_research::math_opt::Solution Struct Reference

#include <solution.h>

Public Member Functions

SolutionProto Proto () const
 Returns the proto equivalent of this.
 

Static Public Member Functions

static absl::StatusOr< SolutionFromProto (const ModelStorage *model, const SolutionProto &solution_proto)
 

Public Attributes

std::optional< PrimalSolutionprimal_solution
 
std::optional< DualSolutiondual_solution
 
std::optional< Basisbasis
 

Detailed Description

What is included in a solution depends on the kind of problem and solver. The current common patterns are

  1. MIP solvers return only a primal solution.
  2. Simplex LP solvers often return a basis and the primal and dual solutions associated to this basis.
  3. Other continuous solvers often return a primal and dual solution that are connected in a solver-dependent form.

Definition at line 259 of file solution.h.

Member Function Documentation

◆ FromProto()

absl::StatusOr< Solution > operations_research::math_opt::Solution::FromProto ( const ModelStorage * model,
const SolutionProto & solution_proto )
static

Returns the Solution equivalent of solution_proto.

Returns an error if FromProto() fails on any field that is not std::nullopt (see the static FromProto() functions for each field type for details).

Definition at line 225 of file solution.cc.

◆ Proto()

SolutionProto operations_research::math_opt::Solution::Proto ( ) const

Returns the proto equivalent of this.

Definition at line 248 of file solution.cc.

Member Data Documentation

◆ basis

std::optional<Basis> operations_research::math_opt::Solution::basis

Definition at line 272 of file solution.h.

◆ dual_solution

std::optional<DualSolution> operations_research::math_opt::Solution::dual_solution

Definition at line 271 of file solution.h.

◆ primal_solution

std::optional<PrimalSolution> operations_research::math_opt::Solution::primal_solution

Definition at line 270 of file solution.h.


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