### AbstractPolynomialSolver Setup Method Source: https://www.hipparchus.org/hipparchus-core/jacoco/org.hipparchus.analysis.solvers/AbstractPolynomialSolver.java.html Details the `setup` method used to initialize the solver with evaluation parameters and the polynomial function. ```APIDOC ## void setup(int maxEval, PolynomialFunction f, double min, double max, double startValue) ### Description Sets up the solver with the maximum number of evaluations, the polynomial function, and the search interval. ### Method `protected void setup` ### Parameters #### Path Parameters * None #### Query Parameters * None #### Request Body * `maxEval` (int) - Maximum number of evaluations allowed. * `f` (PolynomialFunction) - The polynomial function to solve. * `min` (double) - The lower bound of the search interval. * `max` (double) - The upper bound of the search interval. * `startValue` (double) - The initial guess for the root. ``` -------------------------------- ### Get Start Point Source: https://www.hipparchus.org/apidocs/org/hipparchus/geometry/euclidean/threed/Segment.html Retrieves the start point of the segment. ```java public Vector3D getStart() ``` -------------------------------- ### Get Start Vertex of Edge Source: https://www.hipparchus.org/hipparchus-geometry/jacoco/org.hipparchus.geometry.spherical.twod/Edge.java.html Retrieves the starting vertex of the edge. ```java public Vertex getStart() { return start; } ``` -------------------------------- ### Setup Method Source: https://www.hipparchus.org/apidocs/org/hipparchus/analysis/solvers/AbstractPolynomialSolver.html Prepares the solver for computation. Subclasses must call this method if they override any of the solve methods. ```java protected void setup​(int maxEval, PolynomialFunction f, double min, double max, double startValue) ``` -------------------------------- ### Get Start Value Source: https://www.hipparchus.org/hipparchus-optim/jacoco/org.hipparchus.optim.univariate/SearchInterval.java.html Retrieves the start value for the search within the interval. ```java public double getStartValue() { return start; } ``` -------------------------------- ### Method: setup Source: https://www.hipparchus.org/hipparchus-core/apidocs/org/hipparchus/analysis/solvers/AbstractPolynomialSolver.html Prepares the solver for computation. Subclasses must call this method if they override any of the solve methods. ```APIDOC ## setup ### Description Prepare for computation. Subclasses must call this method if they override any of the solve methods. ### Parameters #### Request Body - **maxEval** (int) - Required - Maximum number of evaluations. - **f** (PolynomialFunction) - Required - Function to solve. - **min** (double) - Required - Lower bound for the interval. - **max** (double) - Required - Upper bound for the interval. - **startValue** (double) - Required - Start value to use. ``` -------------------------------- ### Method: setup Source: https://www.hipparchus.org/hipparchus-core/jacoco/org.hipparchus.analysis.integration/BaseAbstractUnivariateIntegrator.java.html Prepares the integrator for computation by setting bounds, the function, and evaluation limits. ```APIDOC ## setup ### Description Prepares the integrator for computation. Subclasses must call this method if they override any of the solve methods. ### Parameters - **maxEval** (int) - Required - Maximum number of evaluations. - **f** (UnivariateFunction) - Required - The integrand function. - **lower** (double) - Required - The min bound for the interval. - **upper** (double) - Required - The upper bound for the interval. ### Errors - **NullArgumentException** - If f is null. - **MathIllegalArgumentException** - If min >= max. ``` -------------------------------- ### Get Start Index Source: https://www.hipparchus.org/hipparchus-core/jacoco/org.hipparchus.util/ResizableDoubleArray.java.html Retrieves the starting index of the first addressable element in the internal array. ```APIDOC ## GET /api/start-index ### Description Retrieves the starting index of the internal array. This index is the position of the first addressable element in the internal storage array. Addressable elements are in the interval [startIndex, startIndex + numElements - 1]. ### Method GET ### Endpoint /api/start-index ### Parameters None ### Request Body None ### Response #### Success Response (200) - **startIndex** (integer) - The start index of the first addressable element. #### Response Example ```json { "startIndex": 2 } ``` ``` -------------------------------- ### Set and Get Step Start Source: https://www.hipparchus.org/hipparchus-ode/jacoco/org.hipparchus.ode/AbstractIntegrator.java.html Manages the starting state of the current integration step. Includes methods to set and retrieve the step start information. ```Java protected void setStepStart(final ODEStateAndDerivative stepStart) { this.stepStart = stepStart; } ``` ```Java public ODEStateAndDerivative getStepStart() { return stepStart; } ``` -------------------------------- ### POST /setup Source: https://www.hipparchus.org/apidocs/org/hipparchus/exception/class-use/MathIllegalArgumentException.html Prepares an integrator for computation by setting the function and interval bounds. ```APIDOC ## POST /setup ### Description Prepares the integrator instance for a specific computation task. ### Method POST ### Endpoint /setup ### Request Body - **maxEval** (int) - Required - Maximum number of evaluations. - **f** (UnivariateFunction) - Required - The function to be integrated. - **lower** (double) - Required - The lower bound. - **upper** (double) - Required - The upper bound. ``` -------------------------------- ### Get Start Index Source: https://www.hipparchus.org/apidocs/org/hipparchus/util/ResizableDoubleArray.html Returns the starting index of the first addressable element within the internal storage array. ```java protected int getStartIndex() ``` -------------------------------- ### Solver Setup and Solving Source: https://www.hipparchus.org/hipparchus-core/jacoco/org.hipparchus.analysis.solvers/BaseAbstractUnivariateSolver.java.html Details the methods for setting up the solver with initial parameters and performing the actual solving process. ```APIDOC ## Solver Setup and Solving ### Description Details the methods for setting up the solver with initial parameters and performing the actual solving process. ### Methods - **setup(int maxEval, F f, double min, double max, double startValue)** - Description: Prepares the solver for computation by setting the function, interval, start value, and maximum evaluations. Subclasses must call this method if they override any `solve` methods. - Parameters: - **maxEval** (int) - Maximum number of evaluations allowed. - **f** (F) - The function to solve. - **min** (double) - The lower bound for the search interval. - **max** (double) - The upper bound for the search interval. - **startValue** (double) - The initial guess for the solution. - Throws: - `NullArgumentException` - If `f` is null. - **solve(int maxEval, F f, double min, double max, double startValue)** - Description: Solves the equation using the provided parameters. - Parameters: - **maxEval** (int) - Maximum number of evaluations allowed. - **f** (F) - The function to solve. - **min** (double) - The lower bound for the search interval. - **max** (double) - The upper bound for the search interval. - **startValue** (double) - The initial guess for the solution. - Return Type: `double` - Throws: - `MathIllegalArgumentException` - If the initial search interval does not bracket a root and the solver requires it. - `MathIllegalStateException` - If the maximal number of evaluations is exceeded. - **solve(int maxEval, F f, double min, double max)** - Description: Solves the equation with a default start value (midpoint of the interval). - Parameters: - **maxEval** (int) - Maximum number of evaluations allowed. - **f** (F) - The function to solve. - **min** (double) - The lower bound for the search interval. - **max** (double) - The upper bound for the search interval. - Return Type: `double` - Throws: - `MathIllegalArgumentException` - If the initial search interval does not bracket a root and the solver requires it. - `MathIllegalStateException` - If the maximal number of evaluations is exceeded. - **solve(int maxEval, F f, double startValue)** - Description: Solves the equation with a default interval (NaN values indicate no specific interval). - Parameters: - **maxEval** (int) - Maximum number of evaluations allowed. - **f** (F) - The function to solve. - **startValue** (double) - The initial guess for the solution. - Return Type: `double` - Throws: - `MathIllegalArgumentException` - If the initial search interval does not bracket a root and the solver requires it. - `MathIllegalStateException` - If the maximal number of evaluations is exceeded. - **doSolve()** - Description: Abstract method for implementing the actual optimization algorithms in derived classes. - Return Type: `double` - Throws: - `MathIllegalStateException` - If the maximal number of evaluations is exceeded. - `MathIllegalArgumentException` - If the initial search interval does not bracket a root and the solver requires it. ``` -------------------------------- ### Get Step Start State Source: https://www.hipparchus.org/apidocs/org/hipparchus/ode/ODEIntegrator.html Retrieves the state at the start of the current step. Results are undefined if called outside of the integrate method. ```java ODEStateAndDerivative getStepStart() ``` -------------------------------- ### static void showExampleFrame(ExampleUtils.ExampleFrame frame) Source: https://www.hipparchus.org/apidocs/org/hipparchus/samples/ExampleUtils.html Displays a graphical frame for an example application. ```APIDOC ## showExampleFrame ### Description Displays an example frame. ### Parameters - **frame** (ExampleUtils.ExampleFrame) - Required - The frame to display. ``` -------------------------------- ### Get State at Step Start Time Source: https://www.hipparchus.org/hipparchus-ode/apidocs/org/hipparchus/ode/AbstractIntegrator.html Retrieve the state of the system at the start time of the current step (`ti`). This method can be called during integration to access the current step's starting conditions. ```java public ODEStateAndDerivative getStepStart() ``` -------------------------------- ### setup Source: https://www.hipparchus.org/apidocs/org/hipparchus/analysis/integration/BaseAbstractFieldUnivariateIntegrator.html Prepares the integrator for computation. Subclasses must call this method if they override any of the solve methods. ```APIDOC ## setup ### Description Prepare for computation. Subclasses must call this method if they override any of the solve methods. ### Method protected void setup(int maxEval, CalculusFieldUnivariateFunction f, T lower, T upper) ### Parameters - **maxEval** (int) - Required - Maximum number of evaluations. - **f** (CalculusFieldUnivariateFunction) - Required - The integrand function. - **lower** (T) - Required - The min bound for the interval. - **upper** (T) - Required - The upper bound for the interval. ### Throws - NullArgumentException - if f is null. - MathIllegalArgumentException - if min >= max. ``` -------------------------------- ### Get ODE Integration Step Start Source: https://www.hipparchus.org/hipparchus-ode/xref/org/hipparchus/ode/AbstractIntegrator.html Returns the starting state of the current integration step, which includes the time and derivatives at the beginning of the step. ```Java @Override public ODEStateAndDerivative getStepStart() { return stepStart; } ``` -------------------------------- ### Setup Solver Method Source: https://www.hipparchus.org/apidocs/org/hipparchus/ode/events/AbstractFieldODEDetector.html Sets up the root-finding algorithm to use for detecting state events. Returns a new instance with the updated solver. ```java T withSolver (BracketedRealFieldUnivariateSolver newSolver) ``` -------------------------------- ### Setting up and Integrating Variational Equations Source: https://www.hipparchus.org/hipparchus-ode/index.html Demonstrates the workflow for setting up variational equations, including initializing the ODE, configuring initial states with derivatives, performing integration, and extracting Jacobian matrices. Ensure `setUpInitialState` is called before integration. ```java // set up equations ODEJacobiansProvider jode = new MyODE(...); ExpandableODE expandable = new Expandable(jode); VariationalEquation ve = new VariationalEquation(expandable, jode); // set up initial state ODEState initWithoutDerivatives = new ODEState(t0, y0); ve.setInitialMainStateJacobian(dYdY0); // only needed if the default identity matrix is not suitable ve.setInitialParameterJacobian(name, dYdP); // only needed if the default zero matrix is not suitable ODEState initWithDerivatives = ve.setUpInitialState(initWithoutDerivatives); // perform integration on the expanded equations with the expanded initial state ODEStateAndDerivative finalState = integrator.integrate(expandable, initWithDerivatives, finalT); // extract Jacobian matrices dYdY0 = ve.extractMainSetJacobian(finalState); dYdP = ve.extractParameterJacobian(finalState, name); ``` -------------------------------- ### Get First Arc Start Source: https://www.hipparchus.org/hipparchus-geometry/jacoco/org.hipparchus.geometry.spherical.oned/ArcsSet.java.html Identifies the node corresponding to the first arc start in the tree, returning null if no internal nodes exist. ```java private BSPTree getFirstArcStart() { // start search at the tree root BSPTree node = getTree(false); if (node.getCut() == null) { return null; } // walk tree until we find the smallest internal node node = getFirstLeaf(node).getParent(); // walk tree until we find an arc start ``` -------------------------------- ### GET /ode/step-start Source: https://www.hipparchus.org/hipparchus-ode/xref/org/hipparchus/ode/ODEIntegrator.html Retrieves the state at the start of the current integration step. ```APIDOC ## GET /ode/step-start ### Description Returns the state at step start time t_i. This method is intended to be called during integration. ### Method GET ### Endpoint /ode/step-start ### Response #### Success Response (200) - **state** (ODEStateAndDerivative) - The state at the beginning of the current step. ``` -------------------------------- ### Setting Up and Executing Integration Source: https://www.hipparchus.org/hipparchus-coverage/jacoco-aggregate/hipparchus-core/org.hipparchus.analysis.integration/BaseAbstractUnivariateIntegrator.java.html Methods for initializing solver state and performing the integration process. ```java protected void setup(final int maxEval, final UnivariateFunction f, final double lower, final double upper) throws MathIllegalArgumentException, NullArgumentException { // Checks. MathUtils.checkNotNull(f); UnivariateSolverUtils.verifyInterval(lower, upper); // Reset. min = lower; max = upper; function = f; evaluations = evaluations.withMaximalCount(maxEval); iterations.reset(); } /** {@inheritDoc} */ @Override public double integrate(final int maxEval, final UnivariateFunction f, final double lower, final double upper) throws MathIllegalArgumentException, MathIllegalStateException, NullArgumentException { // Initialization. setup(maxEval, f, lower, upper); // Perform computation. return doIntegrate(); } /** * Method for implementing actual integration algorithms in derived * classes. * * @return the root. * @throws MathIllegalStateException if the maximal number of evaluations * is exceeded. * @throws MathIllegalStateException if the maximum iteration count is exceeded * or the integrator detects convergence problems otherwise */ protected abstract double doIntegrate() throws MathIllegalStateException; ``` -------------------------------- ### Get initial integration time Source: https://www.hipparchus.org/hipparchus-ode/apidocs/org/hipparchus/ode/DenseOutputModel.html Retrieves the starting time of the integration. ```java public double getInitialTime() ``` -------------------------------- ### Integration Setup and Execution Source: https://www.hipparchus.org/hipparchus-core/jacoco/org.hipparchus.analysis.integration/BaseAbstractFieldUnivariateIntegrator.java.html Methods for initializing the integration process and performing the computation. ```java /** * Prepare for computation. * Subclasses must call this method if they override any of the * {@code solve} methods. * * @param maxEval Maximum number of evaluations. * @param f the integrand function * @param lower the min bound for the interval * @param upper the upper bound for the interval * @throws NullArgumentException if {@code f} is {@code null}. * @throws MathIllegalArgumentException if {@code min >= max}. */ protected void setup(final int maxEval, final CalculusFieldUnivariateFunction f, final T lower, final T upper) throws MathIllegalArgumentException, NullArgumentException { // Checks. MathUtils.checkNotNull(f); UnivariateSolverUtils.verifyInterval(lower.getReal(), upper.getReal()); // Reset. min = lower; max = upper; function = f; evaluations = evaluations.withMaximalCount(maxEval); iterations.reset(); } /** {@inheritDoc} */ @Override public T integrate(final int maxEval, final CalculusFieldUnivariateFunction f, final T lower, final T upper) throws MathIllegalArgumentException, MathIllegalStateException, NullArgumentException { // Initialization. setup(maxEval, f, lower, upper); // Perform computation. return doIntegrate(); } /** * Method for implementing actual integration algorithms in derived * classes. * * @return the root. * @throws MathIllegalStateException if the maximal number of evaluations * is exceeded. * @throws MathIllegalStateException if the maximum iteration count is exceeded * or the integrator detects convergence problems otherwise */ protected abstract T doIntegrate() throws MathIllegalStateException; ``` -------------------------------- ### Initialize QP Matrices and Vectors Source: https://www.hipparchus.org/hipparchus-optim/jacoco/org.hipparchus.optim.nonlinear.vector.constrained/ADMMQPOptimizer.java.html Sets up the quadratic term (H), gradient (q), and constraint matrices (A) and vectors (lb, ub) for the QP problem. ```java RealMatrix H = function.getP(); RealVector q = function.getQ(); int me = 0; int mi = 0; int mb = 0; if (eqConstraint != null) { me = eqConstraint.dimY(); } if (iqConstraint != null) { mi = iqConstraint.dimY(); } if (bqConstraint != null) { mb = bqConstraint.dimY(); } RealVector lb = new ArrayRealVector(me + mi + mb); RealVector ub = new ArrayRealVector(me + mi + mb); RealMatrix A = new Array2DRowRealMatrix(me + mi + mb, n); ``` -------------------------------- ### Get Left Abscissa of Interval Source: https://www.hipparchus.org/hipparchus-core/jacoco/org.hipparchus.analysis.solvers/BracketedUnivariateSolver.java.html Retrieves the x-coordinate of the start of the interval. ```java public double getLeftAbscissa() { return leftAbscissa; } ``` -------------------------------- ### Get Start Index Source: https://www.hipparchus.org/hipparchus-core/apidocs/org/hipparchus/util/ResizableDoubleArray.html Returns the starting index of the first addressable element within the internal storage array. Addressable elements are in the range [getStartIndex(), getStartIndex() + getNumElements() - 1]. ```java protected int getStartIndex() ``` -------------------------------- ### Solver Setup and Solve Methods Source: https://www.hipparchus.org/hipparchus-core/apidocs/org/hipparchus/analysis/solvers/BaseAbstractUnivariateSolver.html Methods for setting up the solver and performing the solve operation for univariate functions. ```APIDOC ## POST /websites/hipparchus/setup ### Description Prepares the solver for computation by setting the function, interval, start value, and maximum evaluations. ### Method POST ### Endpoint /websites/hipparchus/setup ### Parameters #### Request Body - **maxEval** (int) - Maximum number of evaluations allowed. - **f** (UnivariateFunction) - The function to solve. - **min** (double) - The lower bound of the interval. - **max** (double) - The upper bound of the interval. - **startValue** (double) - The initial guess for the root. ### Request Example ```json { "maxEval": 100, "f": "yourUnivariateFunctionImplementation", "min": 0.0, "max": 1.0, "startValue": 0.5 } ``` ### Response #### Success Response (200) Indicates successful setup. No specific return value is documented for this setup method. ## POST /websites/hipparchus/solve ### Description Solves for a zero of the univariate function within the specified interval, starting from an initial guess. ### Method POST ### Endpoint /websites/hipparchus/solve ### Parameters #### Request Body - **maxEval** (int) - Maximum number of evaluations. - **f** (UnivariateFunction) - Function to solve. - **min** (double) - Lower bound for the interval. - **max** (double) - Upper bound for the interval. - **startValue** (double) - Start value to use. ### Request Example ```json { "maxEval": 100, "f": "yourUnivariateFunctionImplementation", "min": 0.0, "max": 1.0, "startValue": 0.5 } ``` ### Response #### Success Response (200) - **root** (double) - A value where the function is zero. #### Response Example ```json { "root": 0.7071067811865476 } ``` #### Error Response - **MathIllegalArgumentException**: If the arguments do not satisfy the requirements specified by the solver. - **MathIllegalStateException**: If the allowed number of evaluations is exceeded. ``` -------------------------------- ### Get All Optima - Hipparchus Source: https://www.hipparchus.org/hipparchus-coverage/jacoco-aggregate/hipparchus-optim/org.hipparchus.optim/BaseMultiStartMultivariateOptimizer.java.html Retrieves all optima found during the last optimization call, including those from failed starts. The array is sorted by objective value. Call this after `optimize` to get all results. ```java /** * Gets all the optima found during the last call to {@code optimize}. * The optimizer stores all the optima found during a set of * restarts. The {@code optimize} method returns the best point only. * This method returns all the points found at the end of each starts, * including the best one already returned by the {@code optimize} method. *
* The returned array as one element for each start as specified * in the constructor. It is ordered with the results from the * runs that did converge first, sorted from best to worst * objective value (i.e in ascending order if minimizing and in * descending order if maximizing), followed by {@code null} elements * corresponding to the runs that did not converge. This means all * elements will be {@code null} if the {@code optimize} method did throw * an exception. * This also means that if the first element is not {@code null}, it is * the best point found across all starts. *
* The behaviour is undefined if this method is called before * {@code optimize}; it will likely throw {@code NullPointerException}. * * @return an array containing the optima sorted from best to worst. */ public abstract P[] getOptima(); ``` -------------------------------- ### BaseAbstractUnivariateSolver - Setup Method Source: https://www.hipparchus.org/hipparchus-core/apidocs/org/hipparchus/exception/class-use/NullArgumentException.html Prepares the solver for computation. ```APIDOC ## BaseAbstractUnivariateSolver.setup ### Description Prepare for computation. ### Method protected void ### Endpoint N/A (Protected method within a solver class) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) None #### Response Example None ``` -------------------------------- ### Setting up and Integrating Variational Equations Source: https://www.hipparchus.org/hipparchus-coverage/jacoco-aggregate/hipparchus-ode/org.hipparchus.ode/VariationalEquation.java.html This example demonstrates the proper scheduling for setting up, integrating, and extracting Jacobian matrices using the VariationalEquation class. Ensure setUpInitialState is called before integration to avoid errors. ```java ODEJacobiansProvider jode = new MyODE(...); ExpandableODE expandable = new Expandable(jode); VariationalEquation ve = new VariationalEquation(expandable, jode); ODEState initWithoutDerivatives = new ODEState(t0, y0); ve.setInitialMainStateJacobian(dYdY0); ve.setInitialParameterJacobian(name, dYdP); ODEState initWithDerivatives = ve.setUpInitialState(initWithoutDerivatives); ODEStateAndDerivative finalState = integrator.integrate(expandable, initWithDerivatives, finalT); dYdY0 = ve.extractMainSetJacobian(finalState); dYdP = ve.extractParameterJacobian(finalState, name); ``` -------------------------------- ### Get Submatrix by Row and Column Indices Source: https://www.hipparchus.org/apidocs/org/hipparchus/linear/BlockRealMatrix.html Gets a submatrix defined by the given start and end row and column indices (inclusive, 0-based). Throws MathIllegalArgumentException if indices are invalid. ```java public BlockRealMatrix getSubMatrix(int startRow, int endRow, int startColumn, int endColumn) throws MathIllegalArgumentException ``` -------------------------------- ### Get subvector Source: https://www.hipparchus.org/hipparchus-core/apidocs/org/hipparchus/linear/SparseFieldVector.html Extracts a contiguous subvector starting at the given index with the specified length. ```java public FieldVector getSubVector​(int index, int n) throws MathIllegalArgumentException ``` -------------------------------- ### POST /integrator/setup Source: https://www.hipparchus.org/hipparchus-core/apidocs/org/hipparchus/analysis/integration/BaseAbstractUnivariateIntegrator.html Prepares the integrator for a new computation task. ```APIDOC ## POST /integrator/setup ### Description Prepares the integrator for computation by setting the maximum evaluations, the function to integrate, and the integration bounds. ### Method POST ### Parameters #### Request Body - **maxEval** (int) - Required - Maximum number of evaluations. - **f** (UnivariateFunction) - Required - The integrand function. - **lower** (double) - Required - The min bound for the interval. - **upper** (double) - Required - The upper bound for the interval. ``` -------------------------------- ### GET /optima Source: https://www.hipparchus.org/hipparchus-optim/jacoco/org.hipparchus.optim.univariate/MultiStartUnivariateOptimizer.java.html Retrieves an array of all points found at the end of each start, sorted by objective value. ```APIDOC ## GET /optima ### Description Returns all the points found at the end of each start, including the best one. The array is ordered by convergence and objective value (best to worst), with null elements for non-converged runs. ### Method GET ### Response #### Success Response (200) - **optima** (UnivariatePointValuePair[]) - An array containing the optima found across all starts. #### Error Handling - **MathIllegalStateException** - Thrown if the optimize method has not been called yet. ``` -------------------------------- ### Initialize BOBYQA setup Source: https://www.hipparchus.org/hipparchus-optim/jacoco/org.hipparchus.optim.nonlinear.scalar.noderiv/BOBYQAOptimizer.java.html Validates problem constraints and initializes the required matrices and vectors for the BOBYQA optimization process. ```java private void setup(double[] lowerBound, double[] upperBound) { double[] init = getStartPoint(); final int dimension = init.length; // Check problem dimension. if (dimension < MINIMUM_PROBLEM_DIMENSION) { throw new MathIllegalArgumentException(LocalizedCoreFormats.NUMBER_TOO_SMALL, dimension, MINIMUM_PROBLEM_DIMENSION); } // Check number of interpolation points. final int[] nPointsInterval = { dimension + 2, (dimension + 2) * (dimension + 1) / 2 }; if (numberOfInterpolationPoints < nPointsInterval[0] || numberOfInterpolationPoints > nPointsInterval[1]) { throw new MathIllegalArgumentException(LocalizedCoreFormats.NUMBER_OF_INTERPOLATION_POINTS, numberOfInterpolationPoints, nPointsInterval[0], nPointsInterval[1]); } // Initialize bound differences. boundDifference = new double[dimension]; double requiredMinDiff = 2 * initialTrustRegionRadius; double minDiff = Double.POSITIVE_INFINITY; for (int i = 0; i < dimension; i++) { boundDifference[i] = upperBound[i] - lowerBound[i]; minDiff = FastMath.min(minDiff, boundDifference[i]); } if (minDiff < requiredMinDiff) { initialTrustRegionRadius = minDiff / 3.0; } // Initialize the data structures used by the "bobyqa" method. bMatrix = new Array2DRowRealMatrix(dimension + numberOfInterpolationPoints, dimension); zMatrix = new Array2DRowRealMatrix(numberOfInterpolationPoints, numberOfInterpolationPoints - dimension - 1); interpolationPoints = new Array2DRowRealMatrix(numberOfInterpolationPoints, dimension); originShift = new ArrayRealVector(dimension); fAtInterpolationPoints = new ArrayRealVector(numberOfInterpolationPoints); trustRegionCenterOffset = new ArrayRealVector(dimension); gradientAtTrustRegionCenter = new ArrayRealVector(dimension); lowerDifference = new ArrayRealVector(dimension); upperDifference = new ArrayRealVector(dimension); modelSecondDerivativesParameters = new ArrayRealVector(numberOfInterpolationPoints); newPoint = new ArrayRealVector(dimension); alternativeNewPoint = new ArrayRealVector(dimension); trialStepPoint = new ArrayRealVector(dimension); lagrangeValuesAtNewPoint = new ArrayRealVector(dimension + numberOfInterpolationPoints); modelSecondDerivativesValues = new ArrayRealVector(dimension * (dimension + 1) / 2); } ``` -------------------------------- ### start Method Source: https://www.hipparchus.org/apidocs/org/hipparchus/linear/FieldMatrixChangingVisitor.html Initializes the visitor before traversing the matrix. ```APIDOC ## Method: start ### Description Start visiting a matrix. This method is called once before any entry of the matrix is visited. ### Method Signature ```java void start(int rows, int columns, int startRow, int endRow, int startColumn, int endColumn) ``` ### Parameters * **rows** (int) - Required - number of rows of the matrix * **columns** (int) - Required - number of columns of the matrix * **startRow** (int) - Required - Initial row index * **endRow** (int) - Required - Final row index (inclusive) * **startColumn** (int) - Required - Initial column index * **endColumn** (int) - Required - Final column index (inclusive) ``` -------------------------------- ### GET /optimizer/properties Source: https://www.hipparchus.org/hipparchus-optim/apidocs/org/hipparchus/optim/univariate/UnivariateOptimizer.html Retrieves configuration properties of the optimizer such as goal type, bounds, and start value. ```APIDOC ## GET /optimizer/properties ### Description Retrieves the current configuration and state of the optimizer. ### Method GET ### Response #### Success Response (200) - **getGoalType** (GoalType) - The optimization type. - **getMin** (double) - The lower bounds. - **getMax** (double) - The upper bounds. - **getStartValue** (double) - The initial guess. ``` -------------------------------- ### Get Optima Source: https://www.hipparchus.org/hipparchus-optim/apidocs/org/hipparchus/optim/univariate/MultiStartUnivariateOptimizer.html Returns an array of all optima found across all start attempts, ordered by quality. ```java public UnivariatePointValuePair[] getOptima() ``` -------------------------------- ### Solver Setup and Execution Source: https://www.hipparchus.org/hipparchus-core/jacoco/org.hipparchus.analysis.solvers/BaseAbstractUnivariateSolver.java.html Methods for initializing solver parameters and executing the solving process. ```java protected void setup(int maxEval, F f, double min, double max, double startValue) throws NullArgumentException { // Checks. MathUtils.checkNotNull(f); // Reset. searchMin = min; searchMax = max; searchStart = startValue; function = f; evaluations = evaluations.withMaximalCount(maxEval); } @Override public double solve(int maxEval, F f, double min, double max, double startValue) throws MathIllegalArgumentException, MathIllegalStateException { // Initialization. setup(maxEval, f, min, max, startValue); // Perform computation. return doSolve(); } @Override public double solve(int maxEval, F f, double min, double max) { return solve(maxEval, f, min, max, min + 0.5 * (max - min)); } @Override public double solve(int maxEval, F f, double startValue) throws MathIllegalArgumentException, MathIllegalStateException { return solve(maxEval, f, Double.NaN, Double.NaN, startValue); } protected abstract double doSolve() throws MathIllegalArgumentException, MathIllegalStateException; ``` -------------------------------- ### GET /optima Source: https://www.hipparchus.org/hipparchus-coverage/jacoco-aggregate/hipparchus-optim/org.hipparchus.optim.univariate/MultiStartUnivariateOptimizer.java.html Retrieves an array of all points found at the end of each start in the multi-start optimization process. ```APIDOC ## GET /optima ### Description Returns all the points found at the end of each start, including the best one. The array is ordered by convergence and objective value. ### Method GET ### Endpoint /optima ### Response #### Success Response (200) - **optima** (UnivariatePointValuePair[]) - An array containing the optima found across all starts. #### Error Handling - **MathIllegalStateException** - Thrown if the optimize method has not been called yet. ``` -------------------------------- ### Setting up and Integrating with VariationalEquation Source: https://www.hipparchus.org/apidocs/org/hipparchus/ode/VariationalEquation.html Demonstrates the correct sequence of calls for setting up equations, initializing the state with derivatives, performing integration, and extracting Jacobian matrices. Ensure `setUpInitialState` is called before integration. ```java // set up equations ODEJacobiansProvider jode = new MyODE(...); ExpandableODE expandable = new Expandable(jode); VariationalEquation ve = new VariationalEquation(expandable, jode); // set up initial state ODEState initWithoutDerivatives = new ODEState(t0, y0); ve.setInitialMainStateJacobian(dYdY0); // only needed if the default identity matrix is not suitable ve.setInitialParameterJacobian(name, dYdP); // only needed if the default zero matrix is not suitable ODEState initWithDerivatives = ve.setUpInitialState(initWithoutDerivatives); // perform integration on the expanded equations with the expanded initial state ODEStateAndDerivative finalState = integrator.integrate(expandable, initWithDerivatives, finalT); // extract Jacobian matrices dYdY0 = ve.extractMainSetJacobian(finalState); dYdP = ve.extractParameterJacobian(finalState, name); ``` -------------------------------- ### Setup Integration Source: https://www.hipparchus.org/apidocs/org/hipparchus/analysis/integration/BaseAbstractUnivariateIntegrator.html Prepares the integrator for a computation by setting maximum evaluations, the function, and integration bounds. ```APIDOC ## Setup Integration ### Description Initializes the integrator with the necessary parameters for performing an integration. This method should be called by subclasses that override the `solve` methods. ### Method `setup(int maxEval, UnivariateFunction f, double lower, double upper)` ### Parameters - **maxEval** (int) - Required - The maximum number of function evaluations allowed. - **f** (UnivariateFunction) - Required - The function to be integrated. - **lower** (double) - Required - The lower bound of the integration interval. - **upper** (double) - Required - The upper bound of the integration interval. ### Throws - `MathIllegalArgumentException` - If parameters are invalid. - `NullArgumentException` - If the function `f` is null. ``` -------------------------------- ### GET /geometry/firstIntersection Source: https://www.hipparchus.org/hipparchus-coverage/jacoco-aggregate/hipparchus-geometry/org.hipparchus.geometry.euclidean.threed/PolyhedronsSet.java.html Calculates the first sub-hyperplane intersected by a semi-infinite line starting from a given point. ```APIDOC ## GET /geometry/firstIntersection ### Description Retrieves the first sub-hyperplane crossed by a semi-infinite line after a specified point. If no intersection occurs, it returns null. ### Method GET ### Endpoint /geometry/firstIntersection ### Parameters #### Query Parameters - **point** (Vector3D) - Required - The starting point of the line segment. - **line** (Line) - Required - The line to consider for intersection. ### Response #### Success Response (200) - **sub-hyperplane** (SubHyperplane) - The first sub-hyperplane intersected by the line. ``` -------------------------------- ### Main Entry Point Source: https://www.hipparchus.org/hipparchus-samples/apidocs/org/hipparchus/samples/geometry/GeometryExample.html Standard main method for executing the geometry example application. ```java public static void main​(String argv) ``` -------------------------------- ### Get Column Vector Source: https://www.hipparchus.org/hipparchus-core/jacoco/org.hipparchus.linear/RealMatrix.java.html Retrieves a column from the matrix as a RealVector. Column indices start at 0. ```Java RealVector getColumnVector(int column) throws MathIllegalArgumentException; ``` -------------------------------- ### Initialize BOBYQA setup Source: https://www.hipparchus.org/hipparchus-coverage/jacoco-aggregate/hipparchus-optim/org.hipparchus.optim.nonlinear.scalar.noderiv/BOBYQAOptimizer.java.html Performs validity checks on problem dimensions and interpolation points, and initializes the required matrices and vectors for the BOBYQA algorithm. ```java private void setup(double[] lowerBound, double[] upperBound) { double[] init = getStartPoint(); final int dimension = init.length; // Check problem dimension. if (dimension < MINIMUM_PROBLEM_DIMENSION) { throw new MathIllegalArgumentException(LocalizedCoreFormats.NUMBER_TOO_SMALL, dimension, MINIMUM_PROBLEM_DIMENSION); } // Check number of interpolation points. final int[] nPointsInterval = { dimension + 2, (dimension + 2) * (dimension + 1) / 2 }; if (numberOfInterpolationPoints < nPointsInterval[0] || numberOfInterpolationPoints > nPointsInterval[1]) { throw new MathIllegalArgumentException(LocalizedCoreFormats.NUMBER_OF_INTERPOLATION_POINTS, numberOfInterpolationPoints, nPointsInterval[0], nPointsInterval[1]); } // Initialize bound differences. boundDifference = new double[dimension]; double requiredMinDiff = 2 * initialTrustRegionRadius; double minDiff = Double.POSITIVE_INFINITY; for (int i = 0; i < dimension; i++) { boundDifference[i] = upperBound[i] - lowerBound[i]; minDiff = FastMath.min(minDiff, boundDifference[i]); } if (minDiff < requiredMinDiff) { initialTrustRegionRadius = minDiff / 3.0; } // Initialize the data structures used by the "bobyqa" method. bMatrix = new Array2DRowRealMatrix(dimension + numberOfInterpolationPoints, dimension); zMatrix = new Array2DRowRealMatrix(numberOfInterpolationPoints, numberOfInterpolationPoints - dimension - 1); interpolationPoints = new Array2DRowRealMatrix(numberOfInterpolationPoints, dimension); originShift = new ArrayRealVector(dimension); fAtInterpolationPoints = new ArrayRealVector(numberOfInterpolationPoints); trustRegionCenterOffset = new ArrayRealVector(dimension); gradientAtTrustRegionCenter = new ArrayRealVector(dimension); lowerDifference = new ArrayRealVector(dimension); upperDifference = new ArrayRealVector(dimension); modelSecondDerivativesParameters = new ArrayRealVector(numberOfInterpolationPoints); newPoint = new ArrayRealVector(dimension); alternativeNewPoint = new ArrayRealVector(dimension); trialStepPoint = new ArrayRealVector(dimension); lagrangeValuesAtNewPoint = new ArrayRealVector(dimension + numberOfInterpolationPoints); modelSecondDerivativesValues = new ArrayRealVector(dimension * (dimension + 1) / 2); } ``` -------------------------------- ### Get Row Vector Source: https://www.hipparchus.org/hipparchus-core/jacoco/org.hipparchus.linear/RealMatrix.java.html Retrieves a row from the matrix as a RealVector. Row indices start at 0. ```Java RealVector getRowVector(int row) throws MathIllegalArgumentException; ``` -------------------------------- ### Integration Setup and Execution Source: https://www.hipparchus.org/hipparchus-core/jacoco/org.hipparchus.analysis.integration/BaseAbstractUnivariateIntegrator.java.html Configures the solver parameters and provides the template for integration execution. ```java protected void setup(final int maxEval, final UnivariateFunction f, final double lower, final double upper) throws MathIllegalArgumentException, NullArgumentException { // Checks. MathUtils.checkNotNull(f); UnivariateSolverUtils.verifyInterval(lower, upper); // Reset. min = lower; max = upper; function = f; evaluations = evaluations.withMaximalCount(maxEval); iterations.reset(); } /** {@inheritDoc} */ @Override public double integrate(final int maxEval, final UnivariateFunction f, final double lower, final double upper) throws MathIllegalArgumentException, MathIllegalStateException, NullArgumentException { // Initialization. setup(maxEval, f, lower, upper); // Perform computation. return doIntegrate(); } ``` -------------------------------- ### First Intersection Source: https://www.hipparchus.org/apidocs/org/hipparchus/geometry/euclidean/threed/PolyhedronsSet.html Gets the first sub-hyperplane crossed by a semi-infinite line starting from a given point. ```APIDOC ## firstIntersection ### Description Get the first sub-hyperplane crossed by a semi-infinite line. ### Method `public SubHyperplane firstIntersection(Vector3D point, Line line)` ### Parameters - **point** (Vector3D) - start point of the part of the line considered - **line** (Line) - line to consider (contains point) ### Returns The first sub-hyperplane crossed by the line after the given point, or null if the line does not intersect any sub-hyperplane. ``` -------------------------------- ### Configure Start Point Source: https://www.hipparchus.org/apidocs/org/hipparchus/fitting/SimpleCurveFitter.html Sets the initial guess for the parameters, returning a new instance. ```java public SimpleCurveFitter withStartPoint​(double[] newStart) ``` -------------------------------- ### Get Plus Inside Hyperplane Source: https://www.hipparchus.org/hipparchus-coverage/jacoco-aggregate/hipparchus-geometry/org.hipparchus.geometry.partitioning/BoundaryAttribute.java.html Retrieves the internal hyperplane. No specific setup or constraints are mentioned. ```Java public I getPlusInside() { return plusInside; } ``` -------------------------------- ### ExampleUtils.ExampleFrame Constructor Source: https://www.hipparchus.org/hipparchus-samples/apidocs/org/hipparchus/samples/ExampleUtils.ExampleFrame.html Initializes a new instance of the ExampleFrame class. ```APIDOC ## ExampleUtils.ExampleFrame() ### Description Empty constructor. ### Method CONSTRUCTOR ### Endpoint N/A ### Parameters None ### Request Example ```json {} ``` ### Response #### Success Response (200) An instance of ExampleFrame. #### Response Example ```json { "message": "ExampleFrame instance created" } ``` ``` -------------------------------- ### Initialize Step End Handler Source: https://www.hipparchus.org/apidocs/org/hipparchus/ode/events/FieldODEStepEndHandler.html Method called once at the start of integration to perform internal setup. ```java default void init​(FieldODEStateAndDerivative initialState, T finalTime) ``` -------------------------------- ### ExampleUtils.showExampleFrame Source: https://www.hipparchus.org/apidocs/org/hipparchus/samples/class-use/ExampleUtils.ExampleFrame.html Displays a specified example frame to the user interface. ```APIDOC ## Method: showExampleFrame ### Description Displays an instance of ExampleUtils.ExampleFrame to the user interface. ### Parameters #### Path Parameters - **frame** (ExampleUtils.ExampleFrame) - Required - The frame instance to be displayed. ### Response - **void** - This method does not return a value. ``` -------------------------------- ### Get Column Source: https://www.hipparchus.org/hipparchus-coverage/jacoco-aggregate/hipparchus-core/org.hipparchus.linear/RealMatrix.java.html Retrieves the entries of a specified column as a double array. Column indices start at 0. ```APIDOC ## GET COLUMN ### Description Get the entries at the given column index as an array. Column indices start at 0. ### Method double[] ### Endpoint N/A (Method within a class) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **column** (int) - Required - The index of the column to be fetched. ### Request Example ```json { "column": 0 } ``` ### Response #### Success Response (200) - **array** (double[]) - The array of entries in the column. ### Response Example ```json { "array": [1.0, 2.0, 3.0] } ``` ### Error Handling - **MathIllegalArgumentException**: if the specified column index is not valid. ``` -------------------------------- ### Integration Start Method Source: https://www.hipparchus.org/hipparchus-ode/jacoco/org.hipparchus.ode/MultistepIntegrator.java.html Initiates the ODE integration process using the configured starter integrator. ```APIDOC ## PROTECTED void start(final ExpandableODE equations, final ODEState initialState, final double finalTime) ### Description Starts the integration process. This method computes one step using the underlying starter integrator and initializes the Nordsieck vector. The starter integrator's primary role is to establish initial conditions; it does not propagate time or handle events itself. User events and step handlers are cleared before use, and a specific NordsieckInitializer step handler is added. ### Method PROTECTED void ### Endpoint start ### Parameters #### Path Parameters - **equations** (ExpandableODE) - Required - The complete set of differential equations to integrate. - **initialState** (ODEState) - Required - The initial state, including time, primary, and secondary state vectors. - **finalTime** (double) - Required - The target time for the integration. Can be less than initialState.getTime() for backward integration. ### Throws - MathIllegalArgumentException: If array dimensions do not match equation settings, or if the integration step is too small. - MathIllegalStateException: If the number of function evaluations is exceeded. - MathIllegalArgumentException: If the location of an event cannot be bracketed. ### Response #### Success Response (200) This method does not return a value upon successful completion, but it initializes the integration state. #### Response Example (No direct response body, exceptions indicate errors.) ``` -------------------------------- ### Get Column as Array Source: https://www.hipparchus.org/hipparchus-core/jacoco/org.hipparchus.linear/RealMatrix.java.html Retrieves a column from the matrix as a double array. Column indices start at 0. ```Java double[] getColumn(int column) throws MathIllegalArgumentException; ``` -------------------------------- ### Example constructor usage Source: https://www.hipparchus.org/hipparchus-core/apidocs/org/hipparchus/linear/BlockRealMatrix.html Demonstrates the internal logic equivalent to calling the raw data constructor. ```java matrix = new BlockRealMatrix(rawData.length, rawData[0].length, toBlocksLayout(rawData), false); ``` -------------------------------- ### Get Row as Array Source: https://www.hipparchus.org/hipparchus-core/jacoco/org.hipparchus.linear/RealMatrix.java.html Retrieves a row from the matrix as a double array. Row indices start at 0. ```Java double[] getRow(int row) throws MathIllegalArgumentException; ``` -------------------------------- ### POST /start Source: https://www.hipparchus.org/hipparchus-ode/apidocs/org/hipparchus/ode/MultistepIntegrator.html Starts the integration process by initializing the Nordsieck vector. ```APIDOC ## POST start ### Description Start the integration. This method computes one step using the underlying starter integrator and initializes the Nordsieck vector. ### Parameters - **equations** (ExpandableODE) - Required - Complete set of differential equations - **initialState** (ODEState) - Required - Initial state - **finalTime** (double) - Required - Target time for the integration ### Throws - MathIllegalArgumentException - if arrays dimension do not match or integration step is too small - MathIllegalStateException - if the number of functions evaluations is exceeded ``` -------------------------------- ### Get Column Vector Source: https://www.hipparchus.org/hipparchus-core/apidocs/org/hipparchus/linear/BlockRealMatrix.html Retrieves the entries of a specified column as a vector. Column indices start at 0. ```APIDOC ## GET /websites/hipparchus/getColumnVector ### Description Get the entries at the given column index as a vector. Column indices start at 0. ### Method GET ### Endpoint /websites/hipparchus/getColumnVector ### Parameters #### Path Parameters - **column** (int) - Required - The column index to be fetched. ### Returns - **RealVector** - A column vector containing the entries of the specified column. ### Throws - **MathIllegalArgumentException** - if the specified column index is invalid. ```