dreye.range_of_solutions#
- dreye.range_of_solutions(B, A, lb, ub, K=None, baseline=None, error='raise', n=None, eps=1e-07)[source]#
Calculate the range of solutions for a bound-constrained system of linear equations.
- Parameters:
- Bnp.ndarray
The target values to approximate. Can be a 1-D or 2-D array.
- Anp.ndarray
The matrix of coefficients in the system of equations. Should be a 2-D array where each row is an equation and each column is a variable.
- lbnp.ndarray
The lower bounds for the solutions. Should be a 1-D array of the same length as the number of columns in A.
- ubnp.ndarray
The upper bounds for the solutions. Should be a 1-D array of the same length as the number of columns in A.
- Knp.ndarray, optional
Transformation matrix for A, lb, ub, and baseline, by default None.
- baselinenp.ndarray, optional
The baseline values for the solutions. Should be a 1-D array of the same length as the number of columns in A, by default None.
- errorstr, optional
The error handling mode. If ‘raise’, a ValueError is raised if a target value is outside the gamut. If ‘warn’, a warning is issued and the best possible solution is chosen. If ‘ignore’, the error is ignored, by default ‘raise’.
- nint, optional
The number of equally spaced solutions to generate between the minimum and maximum solutions, by default None.
- epsfloat, optional
A small value added to the minimum and subtracted from the maximum to improve numerical stability, by default 1e-7.
- Returns:
- Tuple[np.ndarray, np.ndarray, Optional[np.ndarray]]
The minimum and maximum solutions. If n is not None, also returns an array of n equally spaced solutions.
- Raises:
- ValueError
If the system of equations is not underdetermined, or if any target values are outside the gamut and error is ‘raise’.