This class provides miscellaneous functions that are hard to classify. More...
static double quickSelect (double[] A, int n, int k) Returns the \(k^{th}\) smallest item of the array \(A\) of size \(n\). More...t
. More...
C[j]
at \(x\): More...
This class provides miscellaneous functions that are hard to classify.
Some may be moved to another class in the future.
◆ evalPoly() [1/2] static double evalPoly ( int n, double [] X, double [] C, double z ) staticGiven \(n\), \(X\) and \(C\) as described in interpol(n, X, Y, C), this function returns the value of the interpolating polynomial \(P(z)\) evaluated at \(z\) (see eq.
Evaluates the polynomial \(P(x)\) of degree \(n\) with coefficients \(c_j =\) C[j]
at \(x\):
\[ \qquad P(x) = c_0 + c_1 x + c_2 x^2 + \cdots+ c_n x^n \tag{eq.horner} \]
Returns the median of the first \(n\) elements of array \(A\).
Returns the median of the first \(n\) elements of array \(A\).
Returns the index of the time interval corresponding to time t
.
Let \(t_0\le\cdots\le t_n\) be simulation times stored in a subset of times
. This method uses binary search to determine the smallest value \(i\) for which \(t_i\le t < t_{i+1}\), and returns \(i\). The value of \(t_i\) is stored in times[start+i]
whereas \(n\) is defined as end - start
. If \(t<t_0\), this returns \(-1\). If \(t\ge t_n\), this returns \(n\). Otherwise, the returned value is greater than or equal to 0, and smaller than or equal to \(n-1\). start
and end
are only used to set lower and upper limits of the search in the times
array; the index space of the returned value always starts at 0. Note that if the elements of times
with indices start
, …, end
are not sorted in non-decreasing order, the behavior of this method is undefined.
times
is null
. IllegalArgumentException if start
is negative, or if end
is smaller than start
. ArrayIndexOutOfBoundsException if start + end
is greater than or equal to the length of times
.
Computes the Newton interpolating polynomial.
Given the \(n+1\) real distinct points \((x_0, y_0),\) \((x_1, y_1),…, (x_n, y_n)\), with X[i]
\(= x_i\), Y[i]
\(= y_i\), this function computes the \(n+1\) coefficients C[i]
\(= c_i\) of the Newton interpolating polynomial \(P(x)\) of degree \(n\) passing through these points, i.e. such that \(y_i= P(x_i)\), given by
\[ \qquad P(x) = c_0 + c_1(x-x_0) + c_2(x-x_0)(x-x_1) + \cdots+ c_n(x-x_0)(x-x_1) \cdots(x-x_{n-1}). \tag{eq.newton.interpol} \]
Returns the \(k^{th}\) smallest item of the array \(A\) of size \(n\).
Array \(A\) is unchanged by the method. Restriction: \(1 \le k \le n\).
Returns the \(k^{th}\) smallest item of the array \(A\) of size \(n\).
Array \(A\) is unchanged by the method. Restriction: \(1 \le k \le n\).
The documentation for this class was generated from the following file:
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4