3.2.14.5. hyperflow/Solution.hpp

3.2.14.5.1. Class hyperflow::SolutionRange

class hyperflow::SolutionRange

A range of solutions for a flow model.

3.2.14.5.1.1. Synopsis

type const_iterator
type iterator
std::shared_ptr<Model> getModel()
friend std::ostream &operator<<(std::ostream &s, const SolutionRange &r)
int size() const
const_iterator begin() const
const_iterator end() const
Solution operator[](int i) const
void list() const
void print() const
void print(const Printer &printer, const dg::PrintData &data) const

3.2.14.5.1.2. Details

type const_iterator
type iterator

Random-access iterator types for solutions in a range.

std::shared_ptr<Model> getModel()
Returns:

the hyperflow model that produced these solutions.

friend std::ostream &operator<<(std::ostream &s, const SolutionRange &r)
int size() const
Returns:

the number of solutions in the range.

const_iterator begin() const
const_iterator end() const
Returns:

the begin and end iterators for the range.

Solution operator[](int i) const
Returns:

the i th solution in the range.

Throws:

LogicError if the index is out of bounds.

void list() const

List overall information about each solution.

void print() const
void print(const Printer &printer, const dg::PrintData &data) const

Print solutions using the settings in the given printer and the structure information in the data object.

The data defaults to dg::PrintData(getModel()->getDG()) and printer defaults to Printer().

Throws:

LogicError if the given print data does not belong to the underlying derivation graph.

3.2.14.5.2. Class hyperflow::Solution

class hyperflow::Solution

A solution for a flow model.

3.2.14.5.2.1. Synopsis

std::shared_ptr<Model> getModel()
int getId() const
friend std::ostream &operator<<(std::ostream &s, const Solution &sol)
friend bool operator==(const Solution &a, const Solution &b)
friend bool operator!=(const Solution &a, const Solution &b)
friend bool operator<(const Solution &a, const Solution &b)
std::variant<int, double> getObjectiveValue() const
std::variant<int, double> eval(const LinExp &exp) const
void list() const
std::pair<std::optional<std::string>, std::optional<std::string>> print() const
std::pair<std::optional<std::string>, std::optional<std::string>> print(const Printer &printer, const dg::PrintData &data) const

3.2.14.5.2.2. Details

std::shared_ptr<Model> getModel()
Returns:

the hyperflow model that produced the solution.

int getId() const
Returns:

an ID for the solution which is unique among all solutions from the parent Model object.

friend std::ostream &operator<<(std::ostream &s, const Solution &sol)
friend bool operator==(const Solution &a, const Solution &b)
friend bool operator!=(const Solution &a, const Solution &b)
friend bool operator<(const Solution &a, const Solution &b)

Compares the solution objects, i.e., the values of getModel() and getId().

std::variant<int, double> getObjectiveValue() const
Returns:

the objective value of the solution.

std::variant<int, double> eval(const LinExp &exp) const
Returns:

the value of the given linear expression evaluated on the solution.

void list() const

List overall information about the solution.

std::pair<std::optional<std::string>, std::optional<std::string>> print() const
std::pair<std::optional<std::string>, std::optional<std::string>> print(const Printer &printer, const dg::PrintData &data) const

Print the solution using the settings in the given printer and the structure information in the data object.

The data defaults to dg::PrintData(getModel()->getDG()) and printer defaults to Printer().

Returns:

the name of the PDF-files that will be compiled in post-processing for respectively the filtered and unfiltered depictions. If either is not requested by the given printer the corresponding entry has no string.

Throws:

LogicError if the given print data does not belong to the underlying derivation graph.