System Documentation
    Preparing search index...
    • This function is used to calculate the primal bound of an optimization problem, which can either be a maximization or minimization problem.

      Parameters

      • primalBound: string | number

        The primal bound of the problem. This value can be a number or a string. If it's a string, it can represent a number, 'NA', 'nan', 'inf', '+inf', '-inf', '-nan', or an empty string.

      • direction: string

        The optimization direction, which can either be 'max' for maximization problems or 'min' for minimization problems.

      Returns string | number

      • Returns a numerical value based on the input primalBound. If the primal bound is an empty string, 'na', 'nan', or '-nan', it returns -Infinity for 'max' direction and Infinity for 'min' direction. If the primal bound is 'inf' or '+inf', it returns Infinity, and for '-inf', it returns -Infinity. Otherwise, it converts the primal bound into a number.