MinimizeToMaximize#

class MinimizeToMaximize[ソース]#

ベースクラス: _FlipProblemSense

Convert a minimization problem to a maximization problem only if it is a minimization problem, otherwise problem’s sense is unchanged.

Methods

convert(problem)#

Flip the sense of a problem.

パラメータ:

problem (QuadraticProgram) – The problem to be flipped.

戻り値:

A converted problem, that has the flipped sense.

戻り値の型:

QuadraticProgram

interpret(x)#

Convert the result of the converted problem back to that of the original problem.

パラメータ:

x (ndarray | List[float]) – The result of the converted problem or the given result in case of FAILURE.

戻り値:

The result of the original problem.

例外:

QiskitOptimizationError – if the number of variables in the result differs from that of the original problem.

戻り値の型:

ndarray