1 /* 2 * Copyright (C) 2015 Alberto Irurueta Carro (alberto@irurueta.com) 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 package com.irurueta.numerical; 17 18 /** 19 * Interface to define how multivariate functions can be evaluated. 20 */ 21 public interface MultiVariateFunctionEvaluatorListener { 22 /** 23 * Evaluates a multi variate function such as f1(x1, x2, ...), 24 * f2(x1, x2, ...) at provided multidimensional point and returns the result 25 * as a vectorial value 26 * 27 * @param point multidimensional point where function will be evaluated 28 * @param result vector where function evaluation will be stored 29 * @throws EvaluationException if something failed during the evaluation 30 */ 31 void evaluate(final double[] point, final double[] result) throws EvaluationException; 32 33 /** 34 * Number of variables of function f. This is equal to the length of the 35 * array obtained as function evaluations. Hence, a function f can 36 * be expressed as f = [f1, f2, ... fN], and the number of variables would 37 * be N 38 * 39 * @return number of variables of function f 40 */ 41 int getNumberOfVariables(); 42 }