flow/Solution.hpp

Class flow::SolutionRange

class flow::SolutionRange

A range of solutions for a flow model.

Synopsis

type const_iterator
type iterator
std::shared_ptr<Flow> getFlow()
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

Details

type const_iterator
type iterator

Random-access iterator types for solutions in a range.

std::shared_ptr<Flow> getFlow()
Returns:

the flow 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(getFlow()->getDG()) and printer defaults to Printer().

Throws:

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

Class flow::Solution

class flow::Solution

A solution for a flow model.

Synopsis

std::shared_ptr<Flow> getFlow()
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> 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

Details

std::shared_ptr<Flow> getFlow()
Returns:

the flow model that produced the solution.

int getId() const
Returns:

an ID for the solution which is unique among all solutions from the parent Flow 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 getFlow() and getId().

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(getFlow()->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.

Class flow::SolutionOld

class flow::SolutionOld

An object of this class represents a solution for a specific flow model.

Synopsis

unsigned int getId() const
std::shared_ptr<Flow> getFlow() const
double eval(const LinExp &exp) const
void print(const dg::PrintData &data, const Printer &printer) const
void haxListDerivations() const

Details

unsigned int getId() const
Returns:

an id for the solution which is unique among all solutions from the parent Flow object.

std::shared_ptr<Flow> getFlow() const
Returns:

the flow model that produced this solution.

double eval(const LinExp &exp) const
Returns:

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

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

Print the solution using the settings in the given printer.

Returns:

the name of the PDF-file that will be compiled in post-processing for the filtered graph.

Throws:

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

void haxListDerivations() const

List the solution in more human readable form. Don’t expect this function to stay in this form.

Class flow::SolutionSet

class flow::SolutionSet

An object of this class represents the solutions for a specific flow model.

Synopsis

SolutionSet(std::shared_ptr<Flow> dgFlow)
std::shared_ptr<Flow> getFlow()
void list() const
unsigned int size() const
void print(const dg::PrintData &data, const Printer &printer) const
const_iterator begin() const
const_iterator end() const
Solution operator[](unsigned int i) const

Details

SolutionSet(std::shared_ptr<Flow> dgFlow)

Construct a representation of the solutions for the given flow model.

std::shared_ptr<Flow> getFlow()
Returns:

the flow model that produced these solutions.

void list() const

List overall information about each solution.

unsigned int size() const
Returns:

the number of solutions in the flow model.

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

Print all solutions using the given flow printer.

const_iterator begin() const
Returns:

an iterator to the first solution.

const_iterator end() const
Returns:

an iterator to after the last solution.

Solution operator[](unsigned int i) const
Returns:

the solution at the given index.

Throws:

LogicError if the index is out of bounds.