From d8308c13299daf8777ee06c2e9497b0c2f55b5d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Jonglez?= <clement@jonglez.space> Date: Mon, 9 Sep 2024 11:10:01 +0200 Subject: [PATCH] Add missing Hipparchus stubs due to new HTML format, with Jpype fork https://github.com/jpype-project/jpype/pull/1200 --- org-stubs/hipparchus/__init__.pyi | 874 +- org-stubs/hipparchus/analysis/__init__.pyi | 973 +- .../analysis/differentiation/__init__.pyi | 8557 ++++++++++++++++- .../hipparchus/analysis/function/__init__.pyi | 1677 +++- .../analysis/integration/__init__.pyi | 635 +- .../analysis/integration/gauss/__init__.pyi | 357 +- .../analysis/interpolation/__init__.pyi | 586 +- .../analysis/polynomials/__init__.pyi | 1090 ++- .../hipparchus/analysis/solvers/__init__.pyi | 902 +- org-stubs/hipparchus/complex/__init__.pyi | 2913 +++++- org-stubs/hipparchus/dfp/__init__.pyi | 2370 ++++- .../hipparchus/distribution/__init__.pyi | 389 +- .../distribution/continuous/__init__.pyi | 3070 +++++- .../distribution/discrete/__init__.pyi | 1298 ++- .../distribution/multivariate/__init__.pyi | 216 +- org-stubs/hipparchus/exception/__init__.pyi | 421 +- .../hipparchus/filtering/kalman/__init__.pyi | 214 +- .../filtering/kalman/extended/__init__.pyi | 124 +- .../filtering/kalman/linear/__init__.pyi | 112 +- .../filtering/kalman/unscented/__init__.pyi | 164 +- org-stubs/hipparchus/fitting/__init__.pyi | 392 +- org-stubs/hipparchus/fraction/__init__.pyi | 2142 ++++- org-stubs/hipparchus/geometry/__init__.pyi | 360 +- .../geometry/enclosing/__init__.pyi | 114 +- .../geometry/euclidean/oned/__init__.pyi | 749 +- .../geometry/euclidean/threed/__init__.pyi | 3109 +++++- .../geometry/euclidean/twod/__init__.pyi | 1696 +++- .../geometry/euclidean/twod/hull/__init__.pyi | 79 +- .../hipparchus/geometry/hull/__init__.pyi | 26 +- .../geometry/partitioning/__init__.pyi | 515 +- .../geometry/spherical/oned/__init__.pyi | 535 +- .../geometry/spherical/twod/__init__.pyi | 711 +- org-stubs/hipparchus/linear/__init__.pyi | 8045 +++++++++++++++- org-stubs/hipparchus/ode/__init__.pyi | 2765 +++++- org-stubs/hipparchus/ode/events/__init__.pyi | 1476 ++- .../hipparchus/ode/nonstiff/__init__.pyi | 3213 ++++++- .../hipparchus/ode/sampling/__init__.pyi | 761 +- org-stubs/hipparchus/optim/__init__.pyi | 837 +- .../hipparchus/optim/linear/__init__.pyi | 356 +- .../optim/nonlinear/scalar/__init__.pyi | 357 +- .../nonlinear/scalar/gradient/__init__.pyi | 42 +- .../nonlinear/scalar/noderiv/__init__.pyi | 264 +- .../nonlinear/vector/constrained/__init__.pyi | 1957 +++- .../vector/leastsquares/__init__.pyi | 1124 ++- .../hipparchus/optim/univariate/__init__.pyi | 407 +- org-stubs/hipparchus/random/__init__.pyi | 2143 ++++- org-stubs/hipparchus/special/__init__.pyi | 856 +- .../special/elliptic/carlson/__init__.pyi | 405 +- .../special/elliptic/jacobi/__init__.pyi | 1219 ++- .../special/elliptic/legendre/__init__.pyi | 1111 ++- org-stubs/hipparchus/stat/__init__.pyi | 386 +- .../hipparchus/stat/correlation/__init__.pyi | 380 +- .../hipparchus/stat/descriptive/__init__.pyi | 1752 +++- .../stat/descriptive/moment/__init__.pyi | 1073 ++- .../stat/descriptive/rank/__init__.pyi | 918 +- .../stat/descriptive/summary/__init__.pyi | 515 +- .../stat/descriptive/vector/__init__.pyi | 166 +- .../hipparchus/stat/fitting/__init__.pyi | 231 +- .../hipparchus/stat/inference/__init__.pyi | 709 +- .../hipparchus/stat/interval/__init__.pyi | 63 +- .../hipparchus/stat/projection/__init__.pyi | 121 +- .../hipparchus/stat/ranking/__init__.pyi | 184 +- .../hipparchus/stat/regression/__init__.pyi | 1246 ++- org-stubs/hipparchus/util/__init__.pyi | 8221 +++++++++++++++- 64 files changed, 76514 insertions(+), 4159 deletions(-) diff --git a/org-stubs/hipparchus/__init__.pyi b/org-stubs/hipparchus/__init__.pyi index bb98c37..b8b0b64 100644 --- a/org-stubs/hipparchus/__init__.pyi +++ b/org-stubs/hipparchus/__init__.pyi @@ -28,62 +28,540 @@ import typing _Field__T = typing.TypeVar('_Field__T', bound='FieldElement') # <T> class Field(typing.Generic[_Field__T]): - def getOne(self) -> _Field__T: ... + """ + public interfaceField<T extends :class:`~org.hipparchus.FieldElement`<T>> + + Interface representing a `field <http://mathworld.wolfram.com/Field.html>`. + + Classes implementing this interface will often be singletons. + + Also see: + + - :class:`~org.hipparchus.FieldElement` + """ + def getOne(self) -> _Field__T: + """ + Get the multiplicative identity of the field. + + The multiplicative identity is the element e :sub:`1` of the field such that for all elements a of the field, the + equalities a × e :sub:`1` = e :sub:`1` × a = a hold. + + Returns: + multiplicative identity of the field + + + """ + ... def getRuntimeClass(self) -> typing.Type[_Field__T]: ... - def getZero(self) -> _Field__T: ... + def getZero(self) -> _Field__T: + """ + Get the additive identity of the field. + + The additive identity is the element e :sub:`0` of the field such that for all elements a of the field, the equalities a + + e :sub:`0` = e :sub:`0` + a = a hold. + + Returns: + additive identity of the field + + + """ + ... _FieldElement__T = typing.TypeVar('_FieldElement__T', bound='FieldElement') # <T> class FieldElement(typing.Generic[_FieldElement__T]): + """ + public interfaceFieldElement<T extends FieldElement<T>> + + Interface representing `field <http://mathworld.wolfram.com/Field.html>` elements. + + Also see: + + - :class:`~org.hipparchus.Field` + """ def add(self, t: _FieldElement__T) -> _FieldElement__T: ... def divide(self, t: _FieldElement__T) -> _FieldElement__T: ... def getField(self) -> Field[_FieldElement__T]: ... - def getReal(self) -> float: ... - def isZero(self) -> bool: ... + def getReal(self) -> float: + """ + Get the real value of the number. + + Returns: + real value + + + """ + ... + def isZero(self) -> bool: + """ + Check if an element is semantically equal to zero. + + The default implementation simply calls :code:`equals(getField().getZero())`. However, this may need to be overridden in + some cases as due to compatibility with :code:`hashCode()` some classes implements :code:`equals(Object)` in such a way + that -0.0 and +0.0 are different, which may be a problem. It prevents for example identifying a diagonal element is zero + and should be avoided when doing partial pivoting in LU decomposition. + + Returns: + true if the element is semantically equal to zero + + Since: + 1.8 + + + """ + ... @typing.overload - def multiply(self, int: int) -> _FieldElement__T: ... + def multiply(self, int: int) -> _FieldElement__T: + """ + Compute n × this. Multiplication by an integer number is defined as the following sum \[ n \times \mathrm{this} = + \sum_{i=1}^n \mathrm{this} \] + + Parameters: + n (int): Number of times :code:`this` must be added to itself. + + Returns: + A new element representing n × this. + + :class:`~org.hipparchus.FieldElement` multiply(:class:`~org.hipparchus.FieldElement` a) throws :class:`~org.hipparchus.exception.NullArgumentException` + + Compute this × a. + + Parameters: + a (:class:`~org.hipparchus.FieldElement`): element to multiply + + Returns: + a new element representing this × a + + Raises: + :class:`~org.hipparchus.exception.NullArgumentException`: if :code:`a` is :code:`null`. + + + """ + ... @typing.overload def multiply(self, t: _FieldElement__T) -> _FieldElement__T: ... - def negate(self) -> _FieldElement__T: ... + def negate(self) -> _FieldElement__T: + """ + Returns the additive inverse of :code:`this` element. + + Returns: + the opposite of :code:`this`. + + + """ + ... def reciprocal(self) -> _FieldElement__T: ... def subtract(self, t: _FieldElement__T) -> _FieldElement__T: ... _CalculusFieldElement__T = typing.TypeVar('_CalculusFieldElement__T', bound=FieldElement) # <T> class CalculusFieldElement(FieldElement[_CalculusFieldElement__T], typing.Generic[_CalculusFieldElement__T]): - def abs(self) -> _CalculusFieldElement__T: ... - def acos(self) -> _CalculusFieldElement__T: ... - def acosh(self) -> _CalculusFieldElement__T: ... + """ + public interfaceCalculusFieldElement<T extends :class:`~org.hipparchus.FieldElement`<T>>extends :class:`~org.hipparchus.FieldElement`<T> + + Interface representing a `field <http://mathworld.wolfram.com/Field.html>` with calculus capabilities (sin, cos, ...). + + Since: + 1.7 + + Also see: + + - :class:`~org.hipparchus.FieldElement` + """ + def abs(self) -> _CalculusFieldElement__T: + """ + absolute value. + + Returns: + abs(this) + + + """ + ... + def acos(self) -> _CalculusFieldElement__T: + """ + Arc cosine operation. + + Returns: + acos(this) + + + """ + ... + def acosh(self) -> _CalculusFieldElement__T: + """ + Inverse hyperbolic cosine operation. + + Returns: + acosh(this) + + + """ + ... @typing.overload - def add(self, t: _CalculusFieldElement__T) -> _CalculusFieldElement__T: ... + def add(self, t: _CalculusFieldElement__T) -> _CalculusFieldElement__T: + """ + '+' operator. + + Parameters: + a (double): right hand side parameter of the operator + + Returns: + this+a + + + """ + ... @typing.overload def add(self, double: float) -> _CalculusFieldElement__T: ... - def asin(self) -> _CalculusFieldElement__T: ... - def asinh(self) -> _CalculusFieldElement__T: ... - def atan(self) -> _CalculusFieldElement__T: ... - def atan2(self, t: _CalculusFieldElement__T) -> _CalculusFieldElement__T: ... - def atanh(self) -> _CalculusFieldElement__T: ... - def cbrt(self) -> _CalculusFieldElement__T: ... - def ceil(self) -> _CalculusFieldElement__T: ... + def asin(self) -> _CalculusFieldElement__T: + """ + Arc sine operation. + + Returns: + asin(this) + + + """ + ... + def asinh(self) -> _CalculusFieldElement__T: + """ + Inverse hyperbolic sine operation. + + Returns: + asin(this) + + + """ + ... + def atan(self) -> _CalculusFieldElement__T: + """ + Arc tangent operation. + + Returns: + atan(this) + + + """ + ... + def atan2(self, t: _CalculusFieldElement__T) -> _CalculusFieldElement__T: + """ + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if number of free parameters or orders are inconsistent + + + """ + ... + def atanh(self) -> _CalculusFieldElement__T: + """ + Inverse hyperbolic tangent operation. + + Returns: + atanh(this) + + + """ + ... + def cbrt(self) -> _CalculusFieldElement__T: + """ + Cubic root. + + Returns: + cubic root of the instance + + + """ + ... + def ceil(self) -> _CalculusFieldElement__T: + """ + Get the smallest whole number larger than instance. + + Returns: + ceil(this) + + + """ + ... @typing.overload - def copySign(self, t: _CalculusFieldElement__T) -> _CalculusFieldElement__T: ... + def copySign(self, t: _CalculusFieldElement__T) -> _CalculusFieldElement__T: + """ + Returns the instance with the sign of the argument. A NaN :code:`sign` argument is treated as positive. + + Parameters: + sign (:class:`~org.hipparchus.CalculusFieldElement`): the sign for the returned value + + Returns: + the instance with the same sign as the :code:`sign` argument + + Returns the instance with the sign of the argument. A NaN :code:`sign` argument is treated as positive. + + Parameters: + sign (double): the sign for the returned value + + Returns: + the instance with the same sign as the :code:`sign` argument + + + """ + ... @typing.overload def copySign(self, double: float) -> _CalculusFieldElement__T: ... - def cos(self) -> _CalculusFieldElement__T: ... - def cosh(self) -> _CalculusFieldElement__T: ... + def cos(self) -> _CalculusFieldElement__T: + """ + Cosine operation. + + Returns: + cos(this) + + + """ + ... + def cosh(self) -> _CalculusFieldElement__T: + """ + Hyperbolic cosine operation. + + Returns: + cosh(this) + + + """ + ... @typing.overload - def divide(self, double: float) -> _CalculusFieldElement__T: ... + def divide(self, double: float) -> _CalculusFieldElement__T: + """ + '÷' operator. + + Parameters: + a (double): right hand side parameter of the operator + + Returns: + this÷a + + Compute this ÷ a. + + Specified by: + :meth:`~org.hipparchus.FieldElement.divide` in interface :class:`~org.hipparchus.FieldElement` + + Parameters: + a (:class:`~org.hipparchus.CalculusFieldElement`): element to divide by + + Returns: + a new element representing this ÷ a + + + """ + ... @typing.overload def divide(self, t: _CalculusFieldElement__T) -> _CalculusFieldElement__T: ... - def exp(self) -> _CalculusFieldElement__T: ... - def expm1(self) -> _CalculusFieldElement__T: ... - def floor(self) -> _CalculusFieldElement__T: ... - def getExponent(self) -> int: ... - def getPi(self) -> _CalculusFieldElement__T: ... + def exp(self) -> _CalculusFieldElement__T: + """ + Exponential. + + Returns: + exponential of the instance + + + """ + ... + def expm1(self) -> _CalculusFieldElement__T: + """ + Exponential minus 1. + + Returns: + exponential minus one of the instance + + + """ + ... + def floor(self) -> _CalculusFieldElement__T: + """ + Get the largest whole number smaller than instance. + + Returns: + floor(this) + + + """ + ... + def getExponent(self) -> int: + """ + Return the exponent of the instance, removing the bias. + + For double numbers of the form 2 :sup:`x` , the unbiased exponent is exactly x. + + Returns: + exponent for the instance, without bias + + + """ + ... + def getPi(self) -> _CalculusFieldElement__T: + """ + Get the Archimedes constant Ï€. + + Archimedes constant is the ratio of a circle's circumference to its diameter. + + Returns: + Archimedes constant Ï€ + + Since: + 2.0 + + + """ + ... def hypot(self, t: _CalculusFieldElement__T) -> _CalculusFieldElement__T: ... - def isFinite(self) -> bool: ... - def isInfinite(self) -> bool: ... - def isNaN(self) -> bool: ... + def isFinite(self) -> bool: + """ + Check if the instance is finite (neither infinite nor NaN). + + Returns: + true if the instance is finite (neither infinite nor NaN) + + Since: + 2.0 + + + """ + ... + def isInfinite(self) -> bool: + """ + Check if the instance is infinite. + + Returns: + true if the instance is infinite + + + """ + ... + def isNaN(self) -> bool: + """ + Check if the instance is Not a Number. + + Returns: + true if the instance is Not a Number + + + """ + ... @typing.overload - def linearCombination(self, t: _CalculusFieldElement__T, t2: _CalculusFieldElement__T, t3: _CalculusFieldElement__T, t4: _CalculusFieldElement__T) -> _CalculusFieldElement__T: ... + def linearCombination(self, t: _CalculusFieldElement__T, t2: _CalculusFieldElement__T, t3: _CalculusFieldElement__T, t4: _CalculusFieldElement__T) -> _CalculusFieldElement__T: + """ + Compute a linear combination. + + Parameters: + a1 (:class:`~org.hipparchus.CalculusFieldElement`): first factor of the first term + b1 (:class:`~org.hipparchus.CalculusFieldElement`): second factor of the first term + a2 (:class:`~org.hipparchus.CalculusFieldElement`): first factor of the second term + b2 (:class:`~org.hipparchus.CalculusFieldElement`): second factor of the second term + + Returns: + a :sub:`1` ×b :sub:`1` + a :sub:`2` ×b :sub:`2` + + Also see: + + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + + + Compute a linear combination. + + Parameters: + a1 (double): first factor of the first term + b1 (:class:`~org.hipparchus.CalculusFieldElement`): second factor of the first term + a2 (double): first factor of the second term + b2 (:class:`~org.hipparchus.CalculusFieldElement`): second factor of the second term + + Returns: + a :sub:`1` ×b :sub:`1` + a :sub:`2` ×b :sub:`2` + + Also see: + + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + + + Compute a linear combination. + + Parameters: + a1 (:class:`~org.hipparchus.CalculusFieldElement`): first factor of the first term + b1 (:class:`~org.hipparchus.CalculusFieldElement`): second factor of the first term + a2 (:class:`~org.hipparchus.CalculusFieldElement`): first factor of the second term + b2 (:class:`~org.hipparchus.CalculusFieldElement`): second factor of the second term + a3 (:class:`~org.hipparchus.CalculusFieldElement`): first factor of the third term + b3 (:class:`~org.hipparchus.CalculusFieldElement`): second factor of the third term + + Returns: + a :sub:`1` ×b :sub:`1` + a :sub:`2` ×b :sub:`2` + a :sub:`3` ×b :sub:`3` + + Also see: + + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + + + Compute a linear combination. + + Parameters: + a1 (double): first factor of the first term + b1 (:class:`~org.hipparchus.CalculusFieldElement`): second factor of the first term + a2 (double): first factor of the second term + b2 (:class:`~org.hipparchus.CalculusFieldElement`): second factor of the second term + a3 (double): first factor of the third term + b3 (:class:`~org.hipparchus.CalculusFieldElement`): second factor of the third term + + Returns: + a :sub:`1` ×b :sub:`1` + a :sub:`2` ×b :sub:`2` + a :sub:`3` ×b :sub:`3` + + Also see: + + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + + + Compute a linear combination. + + Parameters: + a1 (:class:`~org.hipparchus.CalculusFieldElement`): first factor of the first term + b1 (:class:`~org.hipparchus.CalculusFieldElement`): second factor of the first term + a2 (:class:`~org.hipparchus.CalculusFieldElement`): first factor of the second term + b2 (:class:`~org.hipparchus.CalculusFieldElement`): second factor of the second term + a3 (:class:`~org.hipparchus.CalculusFieldElement`): first factor of the third term + b3 (:class:`~org.hipparchus.CalculusFieldElement`): second factor of the third term + a4 (:class:`~org.hipparchus.CalculusFieldElement`): first factor of the fourth term + b4 (:class:`~org.hipparchus.CalculusFieldElement`): second factor of the fourth term + + Returns: + a :sub:`1` ×b :sub:`1` + a :sub:`2` ×b :sub:`2` + a :sub:`3` ×b :sub:`3` + a :sub:`4` ×b :sub:`4` + + Also see: + + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + + + Compute a linear combination. + + Parameters: + a1 (double): first factor of the first term + b1 (:class:`~org.hipparchus.CalculusFieldElement`): second factor of the first term + a2 (double): first factor of the second term + b2 (:class:`~org.hipparchus.CalculusFieldElement`): second factor of the second term + a3 (double): first factor of the third term + b3 (:class:`~org.hipparchus.CalculusFieldElement`): second factor of the third term + a4 (double): first factor of the fourth term + b4 (:class:`~org.hipparchus.CalculusFieldElement`): second factor of the fourth term + + Returns: + a :sub:`1` ×b :sub:`1` + a :sub:`2` ×b :sub:`2` + a :sub:`3` ×b :sub:`3` + a :sub:`4` ×b :sub:`4` + + Also see: + + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + + + + """ + ... @typing.overload def linearCombination(self, t: _CalculusFieldElement__T, t2: _CalculusFieldElement__T, t3: _CalculusFieldElement__T, t4: _CalculusFieldElement__T, t5: _CalculusFieldElement__T, t6: _CalculusFieldElement__T) -> _CalculusFieldElement__T: ... @typing.overload @@ -98,47 +576,337 @@ class CalculusFieldElement(FieldElement[_CalculusFieldElement__T], typing.Generi def linearCombination(self, double: float, t: _CalculusFieldElement__T, double2: float, t2: _CalculusFieldElement__T, double3: float, t3: _CalculusFieldElement__T, double4: float, t4: _CalculusFieldElement__T) -> _CalculusFieldElement__T: ... @typing.overload def linearCombination(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], tArray: typing.Union[typing.List[_CalculusFieldElement__T], jpype.JArray]) -> _CalculusFieldElement__T: ... - def log(self) -> _CalculusFieldElement__T: ... - def log10(self) -> _CalculusFieldElement__T: ... - def log1p(self) -> _CalculusFieldElement__T: ... + def log(self) -> _CalculusFieldElement__T: + """ + Natural logarithm. + + Returns: + logarithm of the instance + + + """ + ... + def log10(self) -> _CalculusFieldElement__T: + """ + Base 10 logarithm. + + Returns: + base 10 logarithm of the instance + + + """ + ... + def log1p(self) -> _CalculusFieldElement__T: + """ + Shifted natural logarithm. + + Returns: + logarithm of one plus the instance + + + """ + ... @typing.overload - def multiply(self, t: _CalculusFieldElement__T) -> _CalculusFieldElement__T: ... + def multiply(self, t: _CalculusFieldElement__T) -> _CalculusFieldElement__T: + """ + '×' operator. + + Parameters: + a (double): right hand side parameter of the operator + + Returns: + this×a + + Compute n × this. Multiplication by an integer number is defined as the following sum \[ n \times \mathrm{this} = + \sum_{i=1}^n \mathrm{this} \] + + Specified by: + :meth:`~org.hipparchus.FieldElement.multiply` in interface :class:`~org.hipparchus.FieldElement` + + Parameters: + n (int): Number of times :code:`this` must be added to itself. + + Returns: + A new element representing n × this. + + + """ + ... @typing.overload def multiply(self, double: float) -> _CalculusFieldElement__T: ... @typing.overload def multiply(self, int: int) -> _CalculusFieldElement__T: ... - def newInstance(self, double: float) -> _CalculusFieldElement__T: ... - def norm(self) -> float: ... + def newInstance(self, double: float) -> _CalculusFieldElement__T: + """ + Create an instance corresponding to a constant real value. + + Parameters: + value (double): constant real value + + Returns: + instance corresponding to a constant real value + + + """ + ... + def norm(self) -> float: + """ + norm. + + Returns: + norm(this) + + Since: + 2.0 + + + """ + ... @typing.overload - def pow(self, t: _CalculusFieldElement__T) -> _CalculusFieldElement__T: ... + def pow(self, t: _CalculusFieldElement__T) -> _CalculusFieldElement__T: + """ + Power operation. + + Parameters: + p (double): power to apply + + Returns: + this :sup:`p` + + Integer power operation. + + Parameters: + n (int): power to apply + + Returns: + this :sup:`n` + + :class:`~org.hipparchus.CalculusFieldElement` pow(:class:`~org.hipparchus.CalculusFieldElement` e) throws :class:`~org.hipparchus.exception.MathIllegalArgumentException` + + Power operation. + + Parameters: + e (:class:`~org.hipparchus.CalculusFieldElement`): exponent + + Returns: + this :sup:`e` + + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if number of free parameters or orders are inconsistent + + + """ + ... @typing.overload def pow(self, double: float) -> _CalculusFieldElement__T: ... @typing.overload def pow(self, int: int) -> _CalculusFieldElement__T: ... @typing.overload - def remainder(self, double: float) -> _CalculusFieldElement__T: ... + def remainder(self, double: float) -> _CalculusFieldElement__T: + """ + IEEE remainder operator. + + Parameters: + a (double): right hand side parameter of the operator + + Returns: + this - n × a where n is the closest integer to this/a + + IEEE remainder operator. + + Parameters: + a (:class:`~org.hipparchus.CalculusFieldElement`): right hand side parameter of the operator + + Returns: + this - n × a where n is the closest integer to this/a + + + """ + ... @typing.overload def remainder(self, t: _CalculusFieldElement__T) -> _CalculusFieldElement__T: ... - def rint(self) -> _CalculusFieldElement__T: ... - def rootN(self, int: int) -> _CalculusFieldElement__T: ... - def round(self) -> int: ... - def scalb(self, int: int) -> _CalculusFieldElement__T: ... - def sign(self) -> _CalculusFieldElement__T: ... - def sin(self) -> _CalculusFieldElement__T: ... + def rint(self) -> _CalculusFieldElement__T: + """ + Get the whole number that is the nearest to the instance, or the even one if x is exactly half way between two integers. + + Returns: + a double number r such that r is an integer r - 0.5 ≤ this ≤ r + 0.5 + + + """ + ... + def rootN(self, int: int) -> _CalculusFieldElement__T: + """ + N :sup:`th` root. + + Parameters: + n (int): order of the root + + Returns: + n :sup:`th` root of the instance + + + """ + ... + def round(self) -> int: + """ + Get the closest long to instance real value. + + Returns: + closest long to :meth:`~org.hipparchus.FieldElement.getReal` + + + """ + ... + def scalb(self, int: int) -> _CalculusFieldElement__T: + """ + Multiply the instance by a power of 2. + + Parameters: + n (int): power of 2 + + Returns: + this × 2 :sup:`n` + + + """ + ... + def sign(self) -> _CalculusFieldElement__T: + """ + Compute the sign of the instance. The sign is -1 for negative numbers, +1 for positive numbers and 0 otherwise, for + Complex number, it is extended on the unit circle (equivalent to z/|z|, with special handling for 0 and NaN) + + Returns: + -1.0, -0.0, +0.0, +1.0 or NaN depending on sign of a + + + """ + ... + def sin(self) -> _CalculusFieldElement__T: + """ + Sine operation. + + Returns: + sin(this) + + + """ + ... def sinCos(self) -> org.hipparchus.util.FieldSinCos[_CalculusFieldElement__T]: ... - def sinh(self) -> _CalculusFieldElement__T: ... + def sinh(self) -> _CalculusFieldElement__T: + """ + Hyperbolic sine operation. + + Returns: + sinh(this) + + + """ + ... def sinhCosh(self) -> org.hipparchus.util.FieldSinhCosh[_CalculusFieldElement__T]: ... - def sqrt(self) -> _CalculusFieldElement__T: ... - def square(self) -> _CalculusFieldElement__T: ... + def sqrt(self) -> _CalculusFieldElement__T: + """ + Square root. + + Returns: + square root of the instance + + + """ + ... + def square(self) -> _CalculusFieldElement__T: + """ + Compute this × this. + + Returns: + a new element representing this × this + + Since: + 3.1 + + + """ + ... @typing.overload - def subtract(self, double: float) -> _CalculusFieldElement__T: ... + def subtract(self, double: float) -> _CalculusFieldElement__T: + """ + '-' operator. + + Parameters: + a (double): right hand side parameter of the operator + + Returns: + this-a + + Compute this - a. + + Specified by: + :meth:`~org.hipparchus.FieldElement.subtract` in interface :class:`~org.hipparchus.FieldElement` + + Parameters: + a (:class:`~org.hipparchus.CalculusFieldElement`): element to subtract + + Returns: + a new element representing this - a + + + """ + ... @typing.overload def subtract(self, t: _CalculusFieldElement__T) -> _CalculusFieldElement__T: ... - def tan(self) -> _CalculusFieldElement__T: ... - def tanh(self) -> _CalculusFieldElement__T: ... - def toDegrees(self) -> _CalculusFieldElement__T: ... - def toRadians(self) -> _CalculusFieldElement__T: ... - def ulp(self) -> _CalculusFieldElement__T: ... + def tan(self) -> _CalculusFieldElement__T: + """ + Tangent operation. + + Returns: + tan(this) + + + """ + ... + def tanh(self) -> _CalculusFieldElement__T: + """ + Hyperbolic tangent operation. + + Returns: + tanh(this) + + + """ + ... + def toDegrees(self) -> _CalculusFieldElement__T: + """ + Convert radians to degrees, with error of less than 0.5 ULP + + Returns: + instance converted into degrees + + + """ + ... + def toRadians(self) -> _CalculusFieldElement__T: + """ + Convert degrees to radians, with error of less than 0.5 ULP + + Returns: + instance converted into radians + + + """ + ... + def ulp(self) -> _CalculusFieldElement__T: + """ + Compute least significant bit (Unit in Last Position) for a number. + + Returns: + ulp(this) + + Since: + 2.0 + + + """ + ... class __module_protocol__(Protocol): diff --git a/org-stubs/hipparchus/analysis/__init__.pyi b/org-stubs/hipparchus/analysis/__init__.pyi index e90b57b..41d5982 100644 --- a/org-stubs/hipparchus/analysis/__init__.pyi +++ b/org-stubs/hipparchus/analysis/__init__.pyi @@ -18,112 +18,773 @@ import typing class BivariateFunction: - def value(self, double: float, double2: float) -> float: ... + """ + public interfaceBivariateFunction + + An interface representing a bivariate real function. + """ + def value(self, double: float, double2: float) -> float: + """ + Compute the value for the function. + + Parameters: + x (double): Abscissa for which the function value should be computed. + y (double): Ordinate for which the function value should be computed. + + Returns: + the value. + + + """ + ... _CalculusFieldBivariateFunction__T = typing.TypeVar('_CalculusFieldBivariateFunction__T', bound=org.hipparchus.CalculusFieldElement) # <T> class CalculusFieldBivariateFunction(typing.Generic[_CalculusFieldBivariateFunction__T]): - def value(self, t: _CalculusFieldBivariateFunction__T, t2: _CalculusFieldBivariateFunction__T) -> _CalculusFieldBivariateFunction__T: ... + """ + public interfaceCalculusFieldBivariateFunction<T extends :class:`~org.hipparchus.CalculusFieldElement`<T>> + + An interface representing a bivariate field function. + + Since: + 1.5 + """ + def value(self, t: _CalculusFieldBivariateFunction__T, t2: _CalculusFieldBivariateFunction__T) -> _CalculusFieldBivariateFunction__T: + """ + Compute the value for the function. + + Parameters: + x (:class:`~org.hipparchus.analysis.CalculusFieldBivariateFunction`): Abscissa for which the function value should be computed. + y (:class:`~org.hipparchus.analysis.CalculusFieldBivariateFunction`): Ordinate for which the function value should be computed. + + Returns: + the value. + + + """ + ... _CalculusFieldMultivariateFunction__T = typing.TypeVar('_CalculusFieldMultivariateFunction__T', bound=org.hipparchus.CalculusFieldElement) # <T> class CalculusFieldMultivariateFunction(typing.Generic[_CalculusFieldMultivariateFunction__T]): - def value(self, *t: _CalculusFieldMultivariateFunction__T) -> _CalculusFieldMultivariateFunction__T: ... + """ + public interfaceCalculusFieldMultivariateFunction<T extends :class:`~org.hipparchus.CalculusFieldElement`<T>> + + An interface representing a scalar multivariate function. + + Since: + 2.2 + + Also see: + + - :class:`~org.hipparchus.analysis.MultivariateFunction` + """ + def value(self, *t: _CalculusFieldMultivariateFunction__T) -> _CalculusFieldMultivariateFunction__T: + """ + Compute the value of the function. + + Parameters: + x (:class:`~org.hipparchus.analysis.CalculusFieldMultivariateFunction`...): Point at which the function value should be computed. + + Returns: + the value of the function. + + + """ + ... _CalculusFieldMultivariateMatrixFunction__T = typing.TypeVar('_CalculusFieldMultivariateMatrixFunction__T', bound=org.hipparchus.CalculusFieldElement) # <T> class CalculusFieldMultivariateMatrixFunction(typing.Generic[_CalculusFieldMultivariateMatrixFunction__T]): - def value(self, *t: _CalculusFieldMultivariateMatrixFunction__T) -> typing.MutableSequence[typing.MutableSequence[_CalculusFieldMultivariateMatrixFunction__T]]: ... + """ + public interfaceCalculusFieldMultivariateMatrixFunction<T extends :class:`~org.hipparchus.CalculusFieldElement`<T>> + + An interface representing a matrix multivariate function. + + Since: + 2.2 + + Also see: + + - :class:`~org.hipparchus.analysis.MultivariateMatrixFunction` + """ + def value(self, *t: _CalculusFieldMultivariateMatrixFunction__T) -> typing.MutableSequence[typing.MutableSequence[_CalculusFieldMultivariateMatrixFunction__T]]: + """ + Compute the value of the function. + + Parameters: + x (:class:`~org.hipparchus.analysis.CalculusFieldMultivariateMatrixFunction`...): Point at which the function value should be computed. + + Returns: + the value of the function. + + + """ + ... _CalculusFieldMultivariateVectorFunction__T = typing.TypeVar('_CalculusFieldMultivariateVectorFunction__T', bound=org.hipparchus.CalculusFieldElement) # <T> class CalculusFieldMultivariateVectorFunction(typing.Generic[_CalculusFieldMultivariateVectorFunction__T]): - def value(self, *t: _CalculusFieldMultivariateVectorFunction__T) -> typing.MutableSequence[_CalculusFieldMultivariateVectorFunction__T]: ... + """ + public interfaceCalculusFieldMultivariateVectorFunction<T extends :class:`~org.hipparchus.CalculusFieldElement`<T>> + + An interface representing a vector multivariate function. + + Since: + 2.2 + + Also see: + + - :class:`~org.hipparchus.analysis.MultivariateVectorFunction` + """ + def value(self, *t: _CalculusFieldMultivariateVectorFunction__T) -> typing.MutableSequence[_CalculusFieldMultivariateVectorFunction__T]: + """ + Compute the value of the function. + + Parameters: + x (:class:`~org.hipparchus.analysis.CalculusFieldMultivariateVectorFunction`...): Point at which the function value should be computed. + + Returns: + the value of the function. + + + """ + ... _CalculusFieldUnivariateFunction__T = typing.TypeVar('_CalculusFieldUnivariateFunction__T', bound=org.hipparchus.CalculusFieldElement) # <T> class CalculusFieldUnivariateFunction(typing.Generic[_CalculusFieldUnivariateFunction__T]): - def value(self, t: _CalculusFieldUnivariateFunction__T) -> _CalculusFieldUnivariateFunction__T: ... + """ + public interfaceCalculusFieldUnivariateFunction<T extends :class:`~org.hipparchus.CalculusFieldElement`<T>> + + An interface representing a univariate real function. + + When a *user-defined* function encounters an error during evaluation, the + :meth:`~org.hipparchus.analysis.CalculusFieldUnivariateFunction.value` method should throw a *user-defined* unchecked + exception. + + The following code excerpt shows the recommended way to do that using a root solver as an example, but the same + construct is applicable to ODE integrators or optimizers. + + .. code-block: java + + private static class LocalException extends RuntimeException { + // The x value that caused the problem. + private final SomeFieldType x; + + public LocalException(SomeFieldType x) { + this.x = x; + } + + public double getX() { + return x; + } + } + + private static class MyFunction implements FieldUnivariateFunction<SomeFieldType> { + public SomeFieldType value(SomeFieldType x) { + SomeFieldType y = hugeFormula(x); + if (somethingBadHappens) { + throw new LocalException(x); + } + return y; + } + } + + public void compute() { + try { + solver.solve(maxEval, new MyFunction(a, b, c), min, max); + } catch (LocalException le) { + // Retrieve the x value. + } + } + + + As shown, the exception is local to the user's code and it is guaranteed that Hipparchus will not catch it. + + Also see: + + - :class:`~org.hipparchus.analysis.UnivariateFunction` + - :class:`~org.hipparchus.analysis.FieldUnivariateFunction` + """ + def value(self, t: _CalculusFieldUnivariateFunction__T) -> _CalculusFieldUnivariateFunction__T: + """ + Compute the value of the function. + + Parameters: + x (:class:`~org.hipparchus.analysis.CalculusFieldUnivariateFunction`): Point at which the function value should be computed. + + Returns: + the value of the function. + + Raises: + :class:`~org.hipparchus.analysis.https:.docs.oracle.com.javase.8.docs.api.java.lang.IllegalArgumentException`: when the activated method itself can ascertain that a precondition, specified in the API expressed at the level of the + activated method, has been violated. When Hipparchus throws an :code:`IllegalArgumentException`, it is usually the + consequence of checking the actual parameters passed to the method. + + + """ + ... _CalculusFieldUnivariateMatrixFunction__T = typing.TypeVar('_CalculusFieldUnivariateMatrixFunction__T', bound=org.hipparchus.CalculusFieldElement) # <T> class CalculusFieldUnivariateMatrixFunction(typing.Generic[_CalculusFieldUnivariateMatrixFunction__T]): - def value(self, t: _CalculusFieldUnivariateMatrixFunction__T) -> typing.MutableSequence[typing.MutableSequence[_CalculusFieldUnivariateMatrixFunction__T]]: ... + """ + public interfaceCalculusFieldUnivariateMatrixFunction<T extends :class:`~org.hipparchus.CalculusFieldElement`<T>> + + An interface representing a univariate matrix function. + + Since: + 1.3 + """ + def value(self, t: _CalculusFieldUnivariateMatrixFunction__T) -> typing.MutableSequence[typing.MutableSequence[_CalculusFieldUnivariateMatrixFunction__T]]: + """ + Compute the value for the function. + + Parameters: + x (:class:`~org.hipparchus.analysis.CalculusFieldUnivariateMatrixFunction`): the point for which the function value should be computed + + Returns: + the value + + + """ + ... _CalculusFieldUnivariateVectorFunction__T = typing.TypeVar('_CalculusFieldUnivariateVectorFunction__T', bound=org.hipparchus.CalculusFieldElement) # <T> class CalculusFieldUnivariateVectorFunction(typing.Generic[_CalculusFieldUnivariateVectorFunction__T]): - def value(self, t: _CalculusFieldUnivariateVectorFunction__T) -> typing.MutableSequence[_CalculusFieldUnivariateVectorFunction__T]: ... + """ + public interfaceCalculusFieldUnivariateVectorFunction<T extends :class:`~org.hipparchus.CalculusFieldElement`<T>> + + An interface representing a univariate vectorial function for any field type. + + Since: + 1.3 + """ + def value(self, t: _CalculusFieldUnivariateVectorFunction__T) -> typing.MutableSequence[_CalculusFieldUnivariateVectorFunction__T]: + """ + Compute the value for the function. + + Parameters: + x (:class:`~org.hipparchus.analysis.CalculusFieldUnivariateVectorFunction`): the point for which the function value should be computed + + Returns: + the value + + + """ + ... class FieldBivariateFunction: + """ + public interfaceFieldBivariateFunction + + An interface representing a bivariate field function. + + Since: + 1.5 + """ _toCalculusFieldBivariateFunction__T = typing.TypeVar('_toCalculusFieldBivariateFunction__T', bound=org.hipparchus.CalculusFieldElement) # <T> - def toCalculusFieldBivariateFunction(self, field: org.hipparchus.Field[_toCalculusFieldBivariateFunction__T]) -> CalculusFieldBivariateFunction[_toCalculusFieldBivariateFunction__T]: ... + def toCalculusFieldBivariateFunction(self, field: org.hipparchus.Field[_toCalculusFieldBivariateFunction__T]) -> CalculusFieldBivariateFunction[_toCalculusFieldBivariateFunction__T]: + """ + Convert to a :class:`~org.hipparchus.analysis.CalculusFieldBivariateFunction` with a specific type. + + Parameters: + field (:class:`~org.hipparchus.Field`<T> field): field for the argument and value + + Returns: + converted function + + + """ + ... _value__T = typing.TypeVar('_value__T', bound=org.hipparchus.CalculusFieldElement) # <T> - def value(self, t: _value__T, t2: _value__T) -> _value__T: ... + def value(self, t: _value__T, t2: _value__T) -> _value__T: + """ + Compute the value for the function. + + Parameters: + x (T): Abscissa for which the function value should be computed. + y (T): Ordinate for which the function value should be computed. + + Returns: + the value. + + + """ + ... class FieldMultivariateFunction: + """ + public interfaceFieldMultivariateFunction + + An interface representing a scalar multivariate function for any field type. + + Since: + 2.2 + + Also see: + + - :class:`~org.hipparchus.analysis.MultivariateFunction` + """ _toCalculusFieldMultivariateFunction__T = typing.TypeVar('_toCalculusFieldMultivariateFunction__T', bound=org.hipparchus.CalculusFieldElement) # <T> - def toCalculusFieldMultivariateFunction(self, field: org.hipparchus.Field[_toCalculusFieldMultivariateFunction__T]) -> CalculusFieldMultivariateFunction[_toCalculusFieldMultivariateFunction__T]: ... + def toCalculusFieldMultivariateFunction(self, field: org.hipparchus.Field[_toCalculusFieldMultivariateFunction__T]) -> CalculusFieldMultivariateFunction[_toCalculusFieldMultivariateFunction__T]: + """ + Convert to a :class:`~org.hipparchus.analysis.CalculusFieldMultivariateFunction` with a specific type. + + Parameters: + field (:class:`~org.hipparchus.Field`<T> field): field for the argument and value + + Returns: + converted function + + + """ + ... _value__T = typing.TypeVar('_value__T', bound=org.hipparchus.CalculusFieldElement) # <T> - def value(self, *t: _value__T) -> _value__T: ... + def value(self, *t: _value__T) -> _value__T: + """ + Compute the value of the function. + + Parameters: + x (T...): Point at which the function value should be computed. + + Returns: + the value of the function. + + + """ + ... class FieldMultivariateMatrixFunction: + """ + public interfaceFieldMultivariateMatrixFunction + + An interface representing a matrix multivariate function for any field type. + + Since: + 2.2 + + Also see: + + - :class:`~org.hipparchus.analysis.MultivariateMatrixFunction` + """ _toCalculusFieldMultivariateMatrixFunction__T = typing.TypeVar('_toCalculusFieldMultivariateMatrixFunction__T', bound=org.hipparchus.CalculusFieldElement) # <T> - def toCalculusFieldMultivariateMatrixFunction(self, field: org.hipparchus.Field[_toCalculusFieldMultivariateMatrixFunction__T]) -> CalculusFieldMultivariateMatrixFunction[_toCalculusFieldMultivariateMatrixFunction__T]: ... + def toCalculusFieldMultivariateMatrixFunction(self, field: org.hipparchus.Field[_toCalculusFieldMultivariateMatrixFunction__T]) -> CalculusFieldMultivariateMatrixFunction[_toCalculusFieldMultivariateMatrixFunction__T]: + """ + Convert to a :class:`~org.hipparchus.analysis.CalculusFieldMultivariateMatrixFunction` with a specific type. + + Parameters: + field (:class:`~org.hipparchus.Field`<T> field): field for the argument and value + + Returns: + converted function + + + """ + ... _value__T = typing.TypeVar('_value__T', bound=org.hipparchus.CalculusFieldElement) # <T> - def value(self, *t: _value__T) -> typing.MutableSequence[typing.MutableSequence[_value__T]]: ... + def value(self, *t: _value__T) -> typing.MutableSequence[typing.MutableSequence[_value__T]]: + """ + Compute the value of the function. + + Parameters: + x (T...): Point at which the function value should be computed. + + Returns: + the value of the function. + + + """ + ... class FieldMultivariateVectorFunction: + """ + public interfaceFieldMultivariateVectorFunction + + An interface representing a vector multivariate function for any field type. + + Since: + 2.2 + + Also see: + + - :class:`~org.hipparchus.analysis.MultivariateVectorFunction` + """ _toCalculusFieldMultivariateVectorFunction__T = typing.TypeVar('_toCalculusFieldMultivariateVectorFunction__T', bound=org.hipparchus.CalculusFieldElement) # <T> - def toCalculusFieldMultivariateVectorFunction(self, field: org.hipparchus.Field[_toCalculusFieldMultivariateVectorFunction__T]) -> CalculusFieldMultivariateVectorFunction[_toCalculusFieldMultivariateVectorFunction__T]: ... + def toCalculusFieldMultivariateVectorFunction(self, field: org.hipparchus.Field[_toCalculusFieldMultivariateVectorFunction__T]) -> CalculusFieldMultivariateVectorFunction[_toCalculusFieldMultivariateVectorFunction__T]: + """ + Convert to a :class:`~org.hipparchus.analysis.CalculusFieldMultivariateVectorFunction` with a specific type. + + Parameters: + field (:class:`~org.hipparchus.Field`<T> field): field for the argument and value + + Returns: + converted function + + + """ + ... _value__T = typing.TypeVar('_value__T', bound=org.hipparchus.CalculusFieldElement) # <T> - def value(self, *t: _value__T) -> typing.MutableSequence[_value__T]: ... + def value(self, *t: _value__T) -> typing.MutableSequence[_value__T]: + """ + Compute the value of the function. + + Parameters: + x (T...): Point at which the function value should be computed. + + Returns: + the value of the function. + + + """ + ... class FieldUnivariateFunction: + """ + public interfaceFieldUnivariateFunction + + An interface representing a univariate real function for any field type. + + This interface is more general than :class:`~org.hipparchus.analysis.CalculusFieldUnivariateFunction` because the same + instance can accept any field type, not just one. + + Since: + 1.3 + + Also see: + + - :class:`~org.hipparchus.analysis.UnivariateFunction` + - :class:`~org.hipparchus.analysis.CalculusFieldUnivariateFunction` + """ _toCalculusFieldUnivariateFunction__T = typing.TypeVar('_toCalculusFieldUnivariateFunction__T', bound=org.hipparchus.CalculusFieldElement) # <T> - def toCalculusFieldUnivariateFunction(self, field: org.hipparchus.Field[_toCalculusFieldUnivariateFunction__T]) -> CalculusFieldUnivariateFunction[_toCalculusFieldUnivariateFunction__T]: ... + def toCalculusFieldUnivariateFunction(self, field: org.hipparchus.Field[_toCalculusFieldUnivariateFunction__T]) -> CalculusFieldUnivariateFunction[_toCalculusFieldUnivariateFunction__T]: + """ + Convert to a :class:`~org.hipparchus.analysis.CalculusFieldUnivariateFunction` with a specific type. + + Parameters: + field (:class:`~org.hipparchus.Field`<T> field): field for the argument and value + + Returns: + converted function + + + """ + ... _value__T = typing.TypeVar('_value__T', bound=org.hipparchus.CalculusFieldElement) # <T> - def value(self, t: _value__T) -> _value__T: ... + def value(self, t: _value__T) -> _value__T: + """ + Compute the value of the function. + + Parameters: + x (T): Point at which the function value should be computed. + + Returns: + the value of the function. + + Raises: + :class:`~org.hipparchus.analysis.https:.docs.oracle.com.javase.8.docs.api.java.lang.IllegalArgumentException`: when the activated method itself can ascertain that a precondition, specified in the API expressed at the level of the + activated method, has been violated. When Hipparchus throws an :code:`IllegalArgumentException`, it is usually the + consequence of checking the actual parameters passed to the method. + + + """ + ... class FieldUnivariateMatrixFunction: + """ + public interfaceFieldUnivariateMatrixFunction + + An interface representing a univariate matrix function for any field type. + + Since: + 1.3 + """ _toCalculusFieldUnivariateMatrixFunction__T = typing.TypeVar('_toCalculusFieldUnivariateMatrixFunction__T', bound=org.hipparchus.CalculusFieldElement) # <T> - def toCalculusFieldUnivariateMatrixFunction(self, field: org.hipparchus.Field[_toCalculusFieldUnivariateMatrixFunction__T]) -> CalculusFieldUnivariateMatrixFunction[_toCalculusFieldUnivariateMatrixFunction__T]: ... + def toCalculusFieldUnivariateMatrixFunction(self, field: org.hipparchus.Field[_toCalculusFieldUnivariateMatrixFunction__T]) -> CalculusFieldUnivariateMatrixFunction[_toCalculusFieldUnivariateMatrixFunction__T]: + """ + Convert to a :class:`~org.hipparchus.analysis.CalculusFieldUnivariateMatrixFunction` with a specific type. + + Parameters: + field (:class:`~org.hipparchus.Field`<T> field): field for the argument and value + + Returns: + converted function + + + """ + ... _value__T = typing.TypeVar('_value__T', bound=org.hipparchus.CalculusFieldElement) # <T> - def value(self, t: _value__T) -> typing.MutableSequence[typing.MutableSequence[_value__T]]: ... + def value(self, t: _value__T) -> typing.MutableSequence[typing.MutableSequence[_value__T]]: + """ + Compute the value for the function. + + Parameters: + x (T): the point for which the function value should be computed + + Returns: + the value + + + """ + ... class FieldUnivariateVectorFunction: + """ + public interfaceFieldUnivariateVectorFunction + + An interface representing a univariate vectorial function for any field type. + + Since: + 1.3 + """ _toCalculusFieldUnivariateVectorFunction__T = typing.TypeVar('_toCalculusFieldUnivariateVectorFunction__T', bound=org.hipparchus.CalculusFieldElement) # <T> - def toCalculusFieldUnivariateVectorFunction(self, field: org.hipparchus.Field[_toCalculusFieldUnivariateVectorFunction__T]) -> CalculusFieldUnivariateVectorFunction[_toCalculusFieldUnivariateVectorFunction__T]: ... + def toCalculusFieldUnivariateVectorFunction(self, field: org.hipparchus.Field[_toCalculusFieldUnivariateVectorFunction__T]) -> CalculusFieldUnivariateVectorFunction[_toCalculusFieldUnivariateVectorFunction__T]: + """ + Convert to a :class:`~org.hipparchus.analysis.CalculusFieldUnivariateVectorFunction` with a specific type. + + Parameters: + field (:class:`~org.hipparchus.Field`<T> field): field for the argument and value + + Returns: + converted function + + + """ + ... _value__T = typing.TypeVar('_value__T', bound=org.hipparchus.CalculusFieldElement) # <T> - def value(self, t: _value__T) -> typing.MutableSequence[_value__T]: ... + def value(self, t: _value__T) -> typing.MutableSequence[_value__T]: + """ + Compute the value for the function. + + Parameters: + x (T): the point for which the function value should be computed + + Returns: + the value + + + """ + ... class FunctionUtils: + """ + public classFunctionUtils extends :class:`~org.hipparchus.analysis.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Utilities for manipulating function objects. + """ @typing.overload @staticmethod - def add(*univariateFunction: typing.Union['UnivariateFunction', typing.Callable]) -> 'UnivariateFunction': ... + def add(*univariateFunction: typing.Union['UnivariateFunction', typing.Callable]) -> 'UnivariateFunction': + """ + Adds functions. + + Parameters: + f (:class:`~org.hipparchus.analysis.UnivariateFunction`...): List of functions. + + Returns: + a function that computes the sum of the functions. + + Adds functions. + + Parameters: + f (:class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction`...): List of functions. + + Returns: + a function that computes the sum of the functions. + + + """ + ... @typing.overload @staticmethod def add(*univariateDifferentiableFunction: org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction) -> org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction: ... @typing.overload @staticmethod - def collector(bivariateFunction: typing.Union[BivariateFunction, typing.Callable], double: float) -> 'MultivariateFunction': ... + def collector(bivariateFunction: typing.Union[BivariateFunction, typing.Callable], double: float) -> 'MultivariateFunction': + """ + Returns a MultivariateFunction h(x[]) defined by + + .. code-block: java + + + h(x[]) = combiner(...combiner(combiner(initialValue,f(x[0])),f(x[1]))...),f(x[x.length-1])) + + + Parameters: + combiner (:class:`~org.hipparchus.analysis.BivariateFunction`): Combiner function. + f (:class:`~org.hipparchus.analysis.UnivariateFunction`): Function. + initialValue (double): Initial value. + + Returns: + a collector function. + + Returns a MultivariateFunction h(x[]) defined by + + .. code-block: java + + + h(x[]) = combiner(...combiner(combiner(initialValue,x[0]),x[1])...),x[x.length-1]) + + + Parameters: + combiner (:class:`~org.hipparchus.analysis.BivariateFunction`): Combiner function. + initialValue (double): Initial value. + + Returns: + a collector function. + + + """ + ... @typing.overload @staticmethod def collector(bivariateFunction: typing.Union[BivariateFunction, typing.Callable], univariateFunction: typing.Union['UnivariateFunction', typing.Callable], double: float) -> 'MultivariateFunction': ... @staticmethod - def combine(bivariateFunction: typing.Union[BivariateFunction, typing.Callable], univariateFunction: typing.Union['UnivariateFunction', typing.Callable], univariateFunction2: typing.Union['UnivariateFunction', typing.Callable]) -> 'UnivariateFunction': ... + def combine(bivariateFunction: typing.Union[BivariateFunction, typing.Callable], univariateFunction: typing.Union['UnivariateFunction', typing.Callable], univariateFunction2: typing.Union['UnivariateFunction', typing.Callable]) -> 'UnivariateFunction': + """ + Returns the univariate function :code:`h(x) = combiner(f(x), g(x)).` + + Parameters: + combiner (:class:`~org.hipparchus.analysis.BivariateFunction`): Combiner function. + f (:class:`~org.hipparchus.analysis.UnivariateFunction`): Function. + g (:class:`~org.hipparchus.analysis.UnivariateFunction`): Function. + + Returns: + the composite function. + + + """ + ... @typing.overload @staticmethod - def compose(*univariateFunction: typing.Union['UnivariateFunction', typing.Callable]) -> 'UnivariateFunction': ... + def compose(*univariateFunction: typing.Union['UnivariateFunction', typing.Callable]) -> 'UnivariateFunction': + """ + Composes functions. + + The functions in the argument list are composed sequentially, in the given order. For example, compose(f1,f2,f3) acts + like f1(f2(f3(x))). + + Parameters: + f (:class:`~org.hipparchus.analysis.UnivariateFunction`...): List of functions. + + Returns: + the composite function. + + Composes functions. + + The functions in the argument list are composed sequentially, in the given order. For example, compose(f1,f2,f3) acts + like f1(f2(f3(x))). + + Parameters: + f (:class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction`...): List of functions. + + Returns: + the composite function. + + + """ + ... @typing.overload @staticmethod def compose(*univariateDifferentiableFunction: org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction) -> org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction: ... @typing.overload @staticmethod - def derivative(multivariateDifferentiableFunction: org.hipparchus.analysis.differentiation.MultivariateDifferentiableFunction, intArray: typing.Union[typing.List[int], jpype.JArray]) -> 'MultivariateFunction': ... + def derivative(multivariateDifferentiableFunction: org.hipparchus.analysis.differentiation.MultivariateDifferentiableFunction, intArray: typing.Union[typing.List[int], jpype.JArray]) -> 'MultivariateFunction': + """ + Convert an :class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction` to an + :class:`~org.hipparchus.analysis.UnivariateFunction` computing n :sup:`th` order derivative. + + This converter is only a convenience method. Beware computing only one derivative does not save any computation as the + original function will really be called under the hood. The derivative will be extracted from the full + :class:`~org.hipparchus.analysis.differentiation.DerivativeStructure` result. + + Parameters: + f (:class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction`): original function, with value and all its derivatives + order (int): of the derivative to extract + + Returns: + function computing the derivative at required order + + Also see: + + - :meth:`~org.hipparchus.analysis.FunctionUtils.derivative` + - :meth:`~org.hipparchus.analysis.FunctionUtils.toDifferentiable` + + + Convert an :class:`~org.hipparchus.analysis.differentiation.MultivariateDifferentiableFunction` to an + :class:`~org.hipparchus.analysis.MultivariateFunction` computing n :sup:`th` order derivative. + + This converter is only a convenience method. Beware computing only one derivative does not save any computation as the + original function will really be called under the hood. The derivative will be extracted from the full + :class:`~org.hipparchus.analysis.differentiation.DerivativeStructure` result. + + Parameters: + f (:class:`~org.hipparchus.analysis.differentiation.MultivariateDifferentiableFunction`): original function, with value and all its derivatives + orders (int[]): of the derivative to extract, for each free parameters + + Returns: + function computing the derivative at required order + + Also see: + + - :meth:`~org.hipparchus.analysis.FunctionUtils.derivative` + - :meth:`~org.hipparchus.analysis.FunctionUtils.toDifferentiable` + + + + """ + ... @typing.overload @staticmethod def derivative(univariateDifferentiableFunction: org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction, int: int) -> 'UnivariateFunction': ... @staticmethod - def fix1stArgument(bivariateFunction: typing.Union[BivariateFunction, typing.Callable], double: float) -> 'UnivariateFunction': ... + def fix1stArgument(bivariateFunction: typing.Union[BivariateFunction, typing.Callable], double: float) -> 'UnivariateFunction': + """ + Creates a unary function by fixing the first argument of a binary function. + + Parameters: + f (:class:`~org.hipparchus.analysis.BivariateFunction`): Binary function. + fixed (double): value to which the first argument of :code:`f` is set. + + Returns: + the unary function h(x) = f(fixed, x) + + + """ + ... @staticmethod - def fix2ndArgument(bivariateFunction: typing.Union[BivariateFunction, typing.Callable], double: float) -> 'UnivariateFunction': ... + def fix2ndArgument(bivariateFunction: typing.Union[BivariateFunction, typing.Callable], double: float) -> 'UnivariateFunction': + """ + Creates a unary function by fixing the second argument of a binary function. + + Parameters: + f (:class:`~org.hipparchus.analysis.BivariateFunction`): Binary function. + fixed (double): value to which the second argument of :code:`f` is set. + + Returns: + the unary function h(x) = f(x, fixed) + + + """ + ... @typing.overload @staticmethod - def multiply(*univariateFunction: typing.Union['UnivariateFunction', typing.Callable]) -> 'UnivariateFunction': ... + def multiply(*univariateFunction: typing.Union['UnivariateFunction', typing.Callable]) -> 'UnivariateFunction': + """ + Multiplies functions. + + Parameters: + f (:class:`~org.hipparchus.analysis.UnivariateFunction`...): List of functions. + + Returns: + a function that computes the product of the functions. + + Multiplies functions. + + Parameters: + f (:class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction`...): List of functions. + + Returns: + a function that computes the product of the functions. + + + """ + ... @typing.overload @staticmethod def multiply(*univariateDifferentiableFunction: org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction) -> org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction: ... @@ -131,35 +792,271 @@ class FunctionUtils: def sample(univariateFunction: typing.Union['UnivariateFunction', typing.Callable], double: float, double2: float, int: int) -> typing.MutableSequence[float]: ... @typing.overload @staticmethod - def toDifferentiable(multivariateFunction: typing.Union['MultivariateFunction', typing.Callable], multivariateVectorFunction: typing.Union['MultivariateVectorFunction', typing.Callable]) -> org.hipparchus.analysis.differentiation.MultivariateDifferentiableFunction: ... + def toDifferentiable(multivariateFunction: typing.Union['MultivariateFunction', typing.Callable], multivariateVectorFunction: typing.Union['MultivariateVectorFunction', typing.Callable]) -> org.hipparchus.analysis.differentiation.MultivariateDifferentiableFunction: + """ + Convert regular functions to :class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction`. + + This method handle the case with one free parameter and several derivatives. For the case with several free parameters + and only first order derivatives, see :meth:`~org.hipparchus.analysis.FunctionUtils.toDifferentiable`. There are no + direct support for intermediate cases, with several free parameters and order 2 or more derivatives, as is would be + difficult to specify all the cross derivatives. + + Note that the derivatives are expected to be computed only with respect to the raw parameter x of the base function, + i.e. they are df/dx, df :sup:`2` /dx :sup:`2` , ... Even if the built function is later used in a composition like + f(sin(t)), the provided derivatives should *not* apply the composition with sine and its derivatives by themselves. The + composition will be done automatically here and the result will properly contain f(sin(t)), df(sin(t))/dt, df :sup:`2` + (sin(t))/dt :sup:`2` despite the provided derivatives functions know nothing about the sine function. + + Parameters: + f (:class:`~org.hipparchus.analysis.UnivariateFunction`): base function f(x) + derivatives (:class:`~org.hipparchus.analysis.UnivariateFunction`...): derivatives of the base function, in increasing differentiation order + + Returns: + a differentiable function with value and all specified derivatives + + Also see: + + - :meth:`~org.hipparchus.analysis.FunctionUtils.toDifferentiable` + - :meth:`~org.hipparchus.analysis.FunctionUtils.derivative` + + + Convert regular functions to :class:`~org.hipparchus.analysis.differentiation.MultivariateDifferentiableFunction`. + + This method handle the case with several free parameters and only first order derivatives. For the case with one free + parameter and several derivatives, see :meth:`~org.hipparchus.analysis.FunctionUtils.toDifferentiable`. There are no + direct support for intermediate cases, with several free parameters and order 2 or more derivatives, as is would be + difficult to specify all the cross derivatives. + + Note that the gradient is expected to be computed only with respect to the raw parameter x of the base function, i.e. it + is df/dx :sub:`1` , df/dx :sub:`2` , ... Even if the built function is later used in a composition like f(sin(t), + cos(t)), the provided gradient should *not* apply the composition with sine or cosine and their derivative by itself. + The composition will be done automatically here and the result will properly contain f(sin(t), cos(t)), df(sin(t), + cos(t))/dt despite the provided derivatives functions know nothing about the sine or cosine functions. + + Parameters: + f (:class:`~org.hipparchus.analysis.MultivariateFunction`): base function f(x) + gradient (:class:`~org.hipparchus.analysis.MultivariateVectorFunction`): gradient of the base function + + Returns: + a differentiable function with value and gradient + + Also see: + + - :meth:`~org.hipparchus.analysis.FunctionUtils.toDifferentiable` + - :meth:`~org.hipparchus.analysis.FunctionUtils.derivative` + + + + """ + ... @typing.overload @staticmethod def toDifferentiable(univariateFunction: typing.Union['UnivariateFunction', typing.Callable], *univariateFunction2: typing.Union['UnivariateFunction', typing.Callable]) -> org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction: ... class MultivariateFunction: - def value(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> float: ... + """ + public interfaceMultivariateFunction + + An interface representing a multivariate real function. + """ + def value(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> float: + """ + Compute the value for the function at the given point. + + Parameters: + point (double[]): Point at which the function must be evaluated. + + Returns: + the function value for the given point. + + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if the parameter's dimension is wrong for the function being evaluated. + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: when the activated method itself can ascertain that preconditions, specified in the API expressed at the level of the + activated method, have been violated. In the vast majority of cases where Hipparchus throws this exception, it is the + result of argument checking of actual parameters immediately passed to a method. + + + """ + ... class MultivariateMatrixFunction: + """ + public interfaceMultivariateMatrixFunction + + An interface representing a multivariate matrix function. + """ def value(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> typing.MutableSequence[typing.MutableSequence[float]]: ... class MultivariateVectorFunction: + """ + public interfaceMultivariateVectorFunction + + An interface representing a multivariate vectorial function. + """ def value(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> typing.MutableSequence[float]: ... class ParametricUnivariateFunction: - def gradient(self, double: float, *double2: float) -> typing.MutableSequence[float]: ... - def value(self, double: float, *double2: float) -> float: ... + """ + public interfaceParametricUnivariateFunction + + An interface representing a real function that depends on one independent variable plus some extra parameters. + """ + def gradient(self, double: float, *double2: float) -> typing.MutableSequence[float]: + """ + Compute the gradient of the function with respect to its parameters. + + Parameters: + x (double): Point for which the function value should be computed. + parameters (double...): Function parameters. + + Returns: + the value. + + + """ + ... + def value(self, double: float, *double2: float) -> float: + """ + Compute the value of the function. + + Parameters: + x (double): Point for which the function value should be computed. + parameters (double...): Function parameters. + + Returns: + the value. + + + """ + ... class TrivariateFunction: - def value(self, double: float, double2: float, double3: float) -> float: ... + """ + public interfaceTrivariateFunction + + An interface representing a trivariate real function. + """ + def value(self, double: float, double2: float, double3: float) -> float: + """ + Compute the value for the function. + + Parameters: + x (double): x-coordinate for which the function value should be computed. + y (double): y-coordinate for which the function value should be computed. + z (double): z-coordinate for which the function value should be computed. + + Returns: + the value. + + + """ + ... class UnivariateFunction: - def value(self, double: float) -> float: ... + """ + public interfaceUnivariateFunction + + An interface representing a univariate real function. + + When a *user-defined* function encounters an error during evaluation, the + :meth:`~org.hipparchus.analysis.UnivariateFunction.value` method should throw a *user-defined* unchecked exception. + + The following code excerpt shows the recommended way to do that using a root solver as an example, but the same + construct is applicable to ODE integrators or optimizers. + + .. code-block: java + + private static class LocalException extends RuntimeException { + // The x value that caused the problem. + private final double x; + + public LocalException(double x) { + this.x = x; + } + + public double getX() { + return x; + } + } + + private static class MyFunction implements UnivariateFunction { + public double value(double x) { + double y = hugeFormula(x); + if (somethingBadHappens) { + throw new LocalException(x); + } + return y; + } + } + + public void compute() { + try { + solver.solve(maxEval, new MyFunction(a, b, c), min, max); + } catch (LocalException le) { + // Retrieve the x value. + } + } + + As shown, the exception is local to the user's code and it is guaranteed that Hipparchus will not catch it. + """ + def value(self, double: float) -> float: + """ + Compute the value of the function. + + Parameters: + x (double): Point at which the function value should be computed. + + Returns: + the value of the function. + + Raises: + :class:`~org.hipparchus.analysis.https:.docs.oracle.com.javase.8.docs.api.java.lang.IllegalArgumentException`: when the activated method itself can ascertain that a precondition, specified in the API expressed at the level of the + activated method, has been violated. When Hipparchus throws an :code:`IllegalArgumentException`, it is usually the + consequence of checking the actual parameters passed to the method. + + + """ + ... class UnivariateMatrixFunction: - def value(self, double: float) -> typing.MutableSequence[typing.MutableSequence[float]]: ... + """ + public interfaceUnivariateMatrixFunction + + An interface representing a univariate matrix function. + """ + def value(self, double: float) -> typing.MutableSequence[typing.MutableSequence[float]]: + """ + Compute the value for the function. + + Parameters: + x (double): the point for which the function value should be computed + + Returns: + the value + + + """ + ... class UnivariateVectorFunction: - def value(self, double: float) -> typing.MutableSequence[float]: ... + """ + public interfaceUnivariateVectorFunction + + An interface representing a univariate vectorial function. + """ + def value(self, double: float) -> typing.MutableSequence[float]: + """ + Compute the value for the function. + + Parameters: + x (double): the point for which the function value should be computed + + Returns: + the value + + + """ + ... class __module_protocol__(Protocol): diff --git a/org-stubs/hipparchus/analysis/differentiation/__init__.pyi b/org-stubs/hipparchus/analysis/differentiation/__init__.pyi index 02f1b92..3761b7c 100644 --- a/org-stubs/hipparchus/analysis/differentiation/__init__.pyi +++ b/org-stubs/hipparchus/analysis/differentiation/__init__.pyi @@ -17,88 +17,605 @@ import typing class DSCompiler: + """ + public classDSCompiler extends :class:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Class holding "compiled" computation rules for derivative structures. + + This class implements the computation rules described in Dan Kalman's paper `Doubly Recursive Multivariate Automatic + Differentiation <http://www1.american.edu/cas/mathstat/People/kalman/pdffiles/mmgautodiff.pdf>`, Mathematics Magazine, + vol. 75, no. 3, June 2002. However, in order to avoid performances bottlenecks, the recursive rules are "compiled" once + in an unfold form. This class does this recursion unrolling and stores the computation rules as simple loops with + pre-computed indirection arrays. + + This class maps all derivative computation into single dimension arrays that hold the value and partial derivatives. The + class does not hold these arrays, which remains under the responsibility of the caller. For each combination of number + of free parameters and derivation order, only one compiler is necessary, and this compiler will be used to perform + computations on all arrays provided to it, which can represent hundreds or thousands of different parameters kept + together with all their partial derivatives. + + The arrays on which compilers operate contain only the partial derivatives together with the 0 :sup:`th` derivative, + i.e. the value. The partial derivatives are stored in a compiler-specific order, which can be retrieved using methods + :meth:`~org.hipparchus.analysis.differentiation.DSCompiler.getPartialDerivativeIndex` and + :meth:`~org.hipparchus.analysis.differentiation.DSCompiler.getPartialDerivativeOrders`. The value is guaranteed to be + stored as the first element (i.e. the + :meth:`~org.hipparchus.analysis.differentiation.DSCompiler.getPartialDerivativeIndex` method returns 0 when called with + 0 for all derivation orders and :meth:`~org.hipparchus.analysis.differentiation.DSCompiler.getPartialDerivativeOrders` + returns an array filled with 0 when called with 0 as the index). + + Note that the ordering changes with number of parameters and derivation order. For example given 2 parameters x and y, + df/dy is stored at index 2 when derivation order is set to 1 (in this case the array has three elements: f, df/dx and + df/dy). If derivation order is set to 2, then df/dy will be stored at index 3 (in this case the array has six elements: + f, df/dx, d²f/dxdx, df/dy, d²f/dxdy and d²f/dydy). + + Given this structure, users can perform some simple operations like adding, subtracting or multiplying constants and + negating the elements by themselves, knowing if they want to mutate their array or create a new array. These simple + operations are not provided by the compiler. The compiler provides only the more complex operations between several + arrays. + + This class is mainly used as the engine for scalar variable + :class:`~org.hipparchus.analysis.differentiation.DerivativeStructure`. It can also be used directly to hold several + variables in arrays for more complex data structures. User can for example store a vector of n variables depending on + three x, y and z free parameters in one array as follows: + + .. code-block: java + + // parameter 0 is x, parameter 1 is y, parameter 2 is z + int parameters = 3; + DSCompiler compiler = DSCompiler.getCompiler(parameters, order); + int size = compiler.getSize(); + + // pack all elements in a single array + double[] array = new double[n * size]; + for (int i = 0; i < n; ++i) { + + // we know value is guaranteed to be the first element + array[i * size] = v[i]; + + // we don't know where first derivatives are stored, so we ask the compiler + array[i * size + compiler.getPartialDerivativeIndex(1, 0, 0) = dvOnDx[i][0]; + array[i * size + compiler.getPartialDerivativeIndex(0, 1, 0) = dvOnDy[i][0]; + array[i * size + compiler.getPartialDerivativeIndex(0, 0, 1) = dvOnDz[i][0]; + + // we let all higher order derivatives set to 0 + + } + + + Then in another function, user can perform some operations on all elements stored in the single array, such as a simple + product of all variables: + + .. code-block: java + + // compute the product of all elements + double[] product = new double[size]; + prod[0] = 1.0; + for (int i = 0; i < n; ++i) { + double[] tmp = product.clone(); + compiler.multiply(tmp, 0, array, i * size, product, 0); + } + + // value + double p = product[0]; + + // first derivatives + double dPdX = product[compiler.getPartialDerivativeIndex(1, 0, 0)]; + double dPdY = product[compiler.getPartialDerivativeIndex(0, 1, 0)]; + double dPdZ = product[compiler.getPartialDerivativeIndex(0, 0, 1)]; + + // cross derivatives (assuming order was at least 2) + double dPdXdX = product[compiler.getPartialDerivativeIndex(2, 0, 0)]; + double dPdXdY = product[compiler.getPartialDerivativeIndex(1, 1, 0)]; + double dPdXdZ = product[compiler.getPartialDerivativeIndex(1, 0, 1)]; + double dPdYdY = product[compiler.getPartialDerivativeIndex(0, 2, 0)]; + double dPdYdZ = product[compiler.getPartialDerivativeIndex(0, 1, 1)]; + double dPdZdZ = product[compiler.getPartialDerivativeIndex(0, 0, 2)]; + + + Also see: + + - :class:`~org.hipparchus.analysis.differentiation.DerivativeStructure` + - :class:`~org.hipparchus.analysis.differentiation.FieldDerivativeStructure` + """ _acos_1__T = typing.TypeVar('_acos_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload - def acos(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, doubleArray2: typing.Union[typing.List[float], jpype.JArray], int2: int) -> None: ... - @typing.overload - def acos(self, tArray: typing.Union[typing.List[_acos_1__T], jpype.JArray], int: int, tArray2: typing.Union[typing.List[_acos_1__T], jpype.JArray], int2: int) -> None: ... + def acos(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, doubleArray2: typing.Union[typing.List[float], jpype.JArray], int2: int) -> None: + """ + Compute arc cosine of a derivative structure. + + Parameters: + operand (double[]): array holding the operand + operandOffset (int): offset of the operand in its array + result (double[]): array where result must be stored (for arc cosine the result array *cannot* be the input array) + resultOffset (int): offset of the result in its array + + """ + ... + @typing.overload + def acos(self, tArray: typing.Union[typing.List[_acos_1__T], jpype.JArray], int: int, tArray2: typing.Union[typing.List[_acos_1__T], jpype.JArray], int2: int) -> None: + """ + Compute arc cosine of a derivative structure. + + Parameters: + operand (T[]): array holding the operand + operandOffset (int): offset of the operand in its array + result (T[]): array where result must be stored (for arc cosine the result array *cannot* be the input array) + resultOffset (int): offset of the result in its array + + + """ + ... _acosh_1__T = typing.TypeVar('_acosh_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload - def acosh(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, doubleArray2: typing.Union[typing.List[float], jpype.JArray], int2: int) -> None: ... - @typing.overload - def acosh(self, tArray: typing.Union[typing.List[_acosh_1__T], jpype.JArray], int: int, tArray2: typing.Union[typing.List[_acosh_1__T], jpype.JArray], int2: int) -> None: ... + def acosh(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, doubleArray2: typing.Union[typing.List[float], jpype.JArray], int2: int) -> None: + """ + Compute inverse hyperbolic cosine of a derivative structure. + + Parameters: + operand (double[]): array holding the operand + operandOffset (int): offset of the operand in its array + result (double[]): array where result must be stored (for inverse hyperbolic cosine the result array *cannot* be the input array) + resultOffset (int): offset of the result in its array + + """ + ... + @typing.overload + def acosh(self, tArray: typing.Union[typing.List[_acosh_1__T], jpype.JArray], int: int, tArray2: typing.Union[typing.List[_acosh_1__T], jpype.JArray], int2: int) -> None: + """ + Compute inverse hyperbolic cosine of a derivative structure. + + Parameters: + operand (T[]): array holding the operand + operandOffset (int): offset of the operand in its array + result (T[]): array where result must be stored (for inverse hyperbolic cosine the result array *cannot* be the input array) + resultOffset (int): offset of the result in its array + + + """ + ... _add_1__T = typing.TypeVar('_add_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload - def add(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, doubleArray2: typing.Union[typing.List[float], jpype.JArray], int2: int, doubleArray3: typing.Union[typing.List[float], jpype.JArray], int3: int) -> None: ... - @typing.overload - def add(self, tArray: typing.Union[typing.List[_add_1__T], jpype.JArray], int: int, tArray2: typing.Union[typing.List[_add_1__T], jpype.JArray], int2: int, tArray3: typing.Union[typing.List[_add_1__T], jpype.JArray], int3: int) -> None: ... + def add(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, doubleArray2: typing.Union[typing.List[float], jpype.JArray], int2: int, doubleArray3: typing.Union[typing.List[float], jpype.JArray], int3: int) -> None: + """ + Perform addition of two derivative structures. + + Parameters: + lhs (double[]): array holding left hand side of addition + lhsOffset (int): offset of the left hand side in its array + rhs (double[]): array right hand side of addition + rhsOffset (int): offset of the right hand side in its array + result (double[]): array where result must be stored (it may be one of the input arrays) + resultOffset (int): offset of the result in its array + + """ + ... + @typing.overload + def add(self, tArray: typing.Union[typing.List[_add_1__T], jpype.JArray], int: int, tArray2: typing.Union[typing.List[_add_1__T], jpype.JArray], int2: int, tArray3: typing.Union[typing.List[_add_1__T], jpype.JArray], int3: int) -> None: + """ + Perform addition of two derivative structures. + + Parameters: + lhs (T[]): array holding left hand side of addition + lhsOffset (int): offset of the left hand side in its array + rhs (T[]): array right hand side of addition + rhsOffset (int): offset of the right hand side in its array + result (T[]): array where result must be stored (it may be one of the input arrays) + resultOffset (int): offset of the result in its array + + + """ + ... _asin_1__T = typing.TypeVar('_asin_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload - def asin(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, doubleArray2: typing.Union[typing.List[float], jpype.JArray], int2: int) -> None: ... - @typing.overload - def asin(self, tArray: typing.Union[typing.List[_asin_1__T], jpype.JArray], int: int, tArray2: typing.Union[typing.List[_asin_1__T], jpype.JArray], int2: int) -> None: ... + def asin(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, doubleArray2: typing.Union[typing.List[float], jpype.JArray], int2: int) -> None: + """ + Compute arc sine of a derivative structure. + + Parameters: + operand (double[]): array holding the operand + operandOffset (int): offset of the operand in its array + result (double[]): array where result must be stored (for arc sine the result array *cannot* be the input array) + resultOffset (int): offset of the result in its array + + """ + ... + @typing.overload + def asin(self, tArray: typing.Union[typing.List[_asin_1__T], jpype.JArray], int: int, tArray2: typing.Union[typing.List[_asin_1__T], jpype.JArray], int2: int) -> None: + """ + Compute arc sine of a derivative structure. + + Parameters: + operand (T[]): array holding the operand + operandOffset (int): offset of the operand in its array + result (T[]): array where result must be stored (for arc sine the result array *cannot* be the input array) + resultOffset (int): offset of the result in its array + + + """ + ... _asinh_1__T = typing.TypeVar('_asinh_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload - def asinh(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, doubleArray2: typing.Union[typing.List[float], jpype.JArray], int2: int) -> None: ... - @typing.overload - def asinh(self, tArray: typing.Union[typing.List[_asinh_1__T], jpype.JArray], int: int, tArray2: typing.Union[typing.List[_asinh_1__T], jpype.JArray], int2: int) -> None: ... + def asinh(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, doubleArray2: typing.Union[typing.List[float], jpype.JArray], int2: int) -> None: + """ + Compute inverse hyperbolic sine of a derivative structure. + + Parameters: + operand (double[]): array holding the operand + operandOffset (int): offset of the operand in its array + result (double[]): array where result must be stored (for inverse hyperbolic sine the result array *cannot* be the input array) + resultOffset (int): offset of the result in its array + + """ + ... + @typing.overload + def asinh(self, tArray: typing.Union[typing.List[_asinh_1__T], jpype.JArray], int: int, tArray2: typing.Union[typing.List[_asinh_1__T], jpype.JArray], int2: int) -> None: + """ + Compute inverse hyperbolic sine of a derivative structure. + + Parameters: + operand (T[]): array holding the operand + operandOffset (int): offset of the operand in its array + result (T[]): array where result must be stored (for inverse hyperbolic sine the result array *cannot* be the input array) + resultOffset (int): offset of the result in its array + + + """ + ... _atan_1__T = typing.TypeVar('_atan_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload - def atan(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, doubleArray2: typing.Union[typing.List[float], jpype.JArray], int2: int) -> None: ... - @typing.overload - def atan(self, tArray: typing.Union[typing.List[_atan_1__T], jpype.JArray], int: int, tArray2: typing.Union[typing.List[_atan_1__T], jpype.JArray], int2: int) -> None: ... + def atan(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, doubleArray2: typing.Union[typing.List[float], jpype.JArray], int2: int) -> None: + """ + Compute arc tangent of a derivative structure. + + Parameters: + operand (double[]): array holding the operand + operandOffset (int): offset of the operand in its array + result (double[]): array where result must be stored (for arc tangent the result array *cannot* be the input array) + resultOffset (int): offset of the result in its array + + """ + ... + @typing.overload + def atan(self, tArray: typing.Union[typing.List[_atan_1__T], jpype.JArray], int: int, tArray2: typing.Union[typing.List[_atan_1__T], jpype.JArray], int2: int) -> None: + """ + Compute arc tangent of a derivative structure. + + Parameters: + operand (T[]): array holding the operand + operandOffset (int): offset of the operand in its array + result (T[]): array where result must be stored (for arc tangent the result array *cannot* be the input array) + resultOffset (int): offset of the result in its array + + + """ + ... _atan2_1__T = typing.TypeVar('_atan2_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload - def atan2(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, doubleArray2: typing.Union[typing.List[float], jpype.JArray], int2: int, doubleArray3: typing.Union[typing.List[float], jpype.JArray], int3: int) -> None: ... - @typing.overload - def atan2(self, tArray: typing.Union[typing.List[_atan2_1__T], jpype.JArray], int: int, tArray2: typing.Union[typing.List[_atan2_1__T], jpype.JArray], int2: int, tArray3: typing.Union[typing.List[_atan2_1__T], jpype.JArray], int3: int) -> None: ... + def atan2(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, doubleArray2: typing.Union[typing.List[float], jpype.JArray], int2: int, doubleArray3: typing.Union[typing.List[float], jpype.JArray], int3: int) -> None: + """ + Compute two arguments arc tangent of a derivative structure. + + Parameters: + y (double[]): array holding the first operand + yOffset (int): offset of the first operand in its array + x (double[]): array holding the second operand + xOffset (int): offset of the second operand in its array + result (double[]): array where result must be stored (for two arguments arc tangent the result array *cannot* be the input array) + resultOffset (int): offset of the result in its array + + """ + ... + @typing.overload + def atan2(self, tArray: typing.Union[typing.List[_atan2_1__T], jpype.JArray], int: int, tArray2: typing.Union[typing.List[_atan2_1__T], jpype.JArray], int2: int, tArray3: typing.Union[typing.List[_atan2_1__T], jpype.JArray], int3: int) -> None: + """ + Compute two arguments arc tangent of a derivative structure. + + Parameters: + y (T[]): array holding the first operand + yOffset (int): offset of the first operand in its array + x (T[]): array holding the second operand + xOffset (int): offset of the second operand in its array + result (T[]): array where result must be stored (for two arguments arc tangent the result array *cannot* be the input array) + resultOffset (int): offset of the result in its array + + + """ + ... _atanh_1__T = typing.TypeVar('_atanh_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload - def atanh(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, doubleArray2: typing.Union[typing.List[float], jpype.JArray], int2: int) -> None: ... - @typing.overload - def atanh(self, tArray: typing.Union[typing.List[_atanh_1__T], jpype.JArray], int: int, tArray2: typing.Union[typing.List[_atanh_1__T], jpype.JArray], int2: int) -> None: ... + def atanh(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, doubleArray2: typing.Union[typing.List[float], jpype.JArray], int2: int) -> None: + """ + Compute inverse hyperbolic tangent of a derivative structure. + + Parameters: + operand (double[]): array holding the operand + operandOffset (int): offset of the operand in its array + result (double[]): array where result must be stored (for inverse hyperbolic tangent the result array *cannot* be the input array) + resultOffset (int): offset of the result in its array + + """ + ... + @typing.overload + def atanh(self, tArray: typing.Union[typing.List[_atanh_1__T], jpype.JArray], int: int, tArray2: typing.Union[typing.List[_atanh_1__T], jpype.JArray], int2: int) -> None: + """ + Compute inverse hyperbolic tangent of a derivative structure. + + Parameters: + operand (T[]): array holding the operand + operandOffset (int): offset of the operand in its array + result (T[]): array where result must be stored (for inverse hyperbolic tangent the result array *cannot* be the input array) + resultOffset (int): offset of the result in its array + + + """ + ... def checkCompatibility(self, dSCompiler: 'DSCompiler') -> None: ... _compose_1__T = typing.TypeVar('_compose_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> _compose_2__T = typing.TypeVar('_compose_2__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload - def compose(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, doubleArray2: typing.Union[typing.List[float], jpype.JArray], doubleArray3: typing.Union[typing.List[float], jpype.JArray], int2: int) -> None: ... - @typing.overload - def compose(self, tArray: typing.Union[typing.List[_compose_1__T], jpype.JArray], int: int, doubleArray: typing.Union[typing.List[float], jpype.JArray], tArray2: typing.Union[typing.List[_compose_1__T], jpype.JArray], int2: int) -> None: ... + def compose(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, doubleArray2: typing.Union[typing.List[float], jpype.JArray], doubleArray3: typing.Union[typing.List[float], jpype.JArray], int2: int) -> None: + """ + Compute composition of a derivative structure by a function. + + Parameters: + operand (double[]): array holding the operand + operandOffset (int): offset of the operand in its array + f (double[]): array of value and derivatives of the function at the current point (i.e. at :code:`operand[operandOffset]`). + result (double[]): array where result must be stored (for composition the result array *cannot* be the input array) + resultOffset (int): offset of the result in its array + + """ + ... + @typing.overload + def compose(self, tArray: typing.Union[typing.List[_compose_1__T], jpype.JArray], int: int, doubleArray: typing.Union[typing.List[float], jpype.JArray], tArray2: typing.Union[typing.List[_compose_1__T], jpype.JArray], int2: int) -> None: + """ + Compute composition of a derivative structure by a function. + + Parameters: + operand (T[]): array holding the operand + operandOffset (int): offset of the operand in its array + f (T[]): array of value and derivatives of the function at the current point (i.e. at :code:`operand[operandOffset]`). + result (T[]): array where result must be stored (for composition the result array *cannot* be the input array) + resultOffset (int): offset of the result in its array + + Compute composition of a derivative structure by a function. + + Parameters: + operand (T[]): array holding the operand + operandOffset (int): offset of the operand in its array + f (double[]): array of value and derivatives of the function at the current point (i.e. at :code:`operand[operandOffset]`). + result (T[]): array where result must be stored (for composition the result array *cannot* be the input array) + resultOffset (int): offset of the result in its array + + + """ + ... @typing.overload def compose(self, tArray: typing.Union[typing.List[_compose_2__T], jpype.JArray], int: int, tArray2: typing.Union[typing.List[_compose_2__T], jpype.JArray], tArray3: typing.Union[typing.List[_compose_2__T], jpype.JArray], int2: int) -> None: ... _cos_1__T = typing.TypeVar('_cos_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload - def cos(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, doubleArray2: typing.Union[typing.List[float], jpype.JArray], int2: int) -> None: ... - @typing.overload - def cos(self, tArray: typing.Union[typing.List[_cos_1__T], jpype.JArray], int: int, tArray2: typing.Union[typing.List[_cos_1__T], jpype.JArray], int2: int) -> None: ... + def cos(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, doubleArray2: typing.Union[typing.List[float], jpype.JArray], int2: int) -> None: + """ + Compute cosine of a derivative structure. + + Parameters: + operand (double[]): array holding the operand + operandOffset (int): offset of the operand in its array + result (double[]): array where result must be stored (for cosine the result array *cannot* be the input array) + resultOffset (int): offset of the result in its array + + """ + ... + @typing.overload + def cos(self, tArray: typing.Union[typing.List[_cos_1__T], jpype.JArray], int: int, tArray2: typing.Union[typing.List[_cos_1__T], jpype.JArray], int2: int) -> None: + """ + Compute cosine of a derivative structure. + + Parameters: + operand (T[]): array holding the operand + operandOffset (int): offset of the operand in its array + result (T[]): array where result must be stored (for cosine the result array *cannot* be the input array) + resultOffset (int): offset of the result in its array + + + """ + ... _cosh_1__T = typing.TypeVar('_cosh_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload - def cosh(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, doubleArray2: typing.Union[typing.List[float], jpype.JArray], int2: int) -> None: ... - @typing.overload - def cosh(self, tArray: typing.Union[typing.List[_cosh_1__T], jpype.JArray], int: int, tArray2: typing.Union[typing.List[_cosh_1__T], jpype.JArray], int2: int) -> None: ... + def cosh(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, doubleArray2: typing.Union[typing.List[float], jpype.JArray], int2: int) -> None: + """ + Compute hyperbolic cosine of a derivative structure. + + Parameters: + operand (double[]): array holding the operand + operandOffset (int): offset of the operand in its array + result (double[]): array where result must be stored (for hyperbolic cosine the result array *cannot* be the input array) + resultOffset (int): offset of the result in its array + + """ + ... + @typing.overload + def cosh(self, tArray: typing.Union[typing.List[_cosh_1__T], jpype.JArray], int: int, tArray2: typing.Union[typing.List[_cosh_1__T], jpype.JArray], int2: int) -> None: + """ + Compute hyperbolic cosine of a derivative structure. + + Parameters: + operand (T[]): array holding the operand + operandOffset (int): offset of the operand in its array + result (T[]): array where result must be stored (for hyperbolic cosine the result array *cannot* be the input array) + resultOffset (int): offset of the result in its array + + + """ + ... _divide_1__T = typing.TypeVar('_divide_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload - def divide(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, doubleArray2: typing.Union[typing.List[float], jpype.JArray], int2: int, doubleArray3: typing.Union[typing.List[float], jpype.JArray], int3: int) -> None: ... - @typing.overload - def divide(self, tArray: typing.Union[typing.List[_divide_1__T], jpype.JArray], int: int, tArray2: typing.Union[typing.List[_divide_1__T], jpype.JArray], int2: int, tArray3: typing.Union[typing.List[_divide_1__T], jpype.JArray], int3: int) -> None: ... + def divide(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, doubleArray2: typing.Union[typing.List[float], jpype.JArray], int2: int, doubleArray3: typing.Union[typing.List[float], jpype.JArray], int3: int) -> None: + """ + Perform division of two derivative structures. Based on the multiplication operator. + + Parameters: + lhs (double[]): array holding left hand side of division + lhsOffset (int): offset of the left hand side in its array + rhs (double[]): array right hand side of division + rhsOffset (int): offset of the right hand side in its array + result (double[]): array where result must be stored (for division the result array *cannot* be one of the input arrays) + resultOffset (int): offset of the result in its array + + """ + ... + @typing.overload + def divide(self, tArray: typing.Union[typing.List[_divide_1__T], jpype.JArray], int: int, tArray2: typing.Union[typing.List[_divide_1__T], jpype.JArray], int2: int, tArray3: typing.Union[typing.List[_divide_1__T], jpype.JArray], int3: int) -> None: + """ + Perform division of two derivative structures. Based on the multiplication operator. + + Parameters: + lhs (T[]): array holding left hand side of division + lhsOffset (int): offset of the left hand side in its array + rhs (T[]): array right hand side of division + rhsOffset (int): offset of the right hand side in its array + result (T[]): array where result must be stored (for division the result array *cannot* be one of the input arrays) + resultOffset (int): offset of the result in its array + + + """ + ... _exp_1__T = typing.TypeVar('_exp_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload - def exp(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, doubleArray2: typing.Union[typing.List[float], jpype.JArray], int2: int) -> None: ... - @typing.overload - def exp(self, tArray: typing.Union[typing.List[_exp_1__T], jpype.JArray], int: int, tArray2: typing.Union[typing.List[_exp_1__T], jpype.JArray], int2: int) -> None: ... + def exp(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, doubleArray2: typing.Union[typing.List[float], jpype.JArray], int2: int) -> None: + """ + Compute exponential of a derivative structure. + + Parameters: + operand (double[]): array holding the operand + operandOffset (int): offset of the operand in its array + result (double[]): array where result must be stored (for exponential the result array *cannot* be the input array) + resultOffset (int): offset of the result in its array + + """ + ... + @typing.overload + def exp(self, tArray: typing.Union[typing.List[_exp_1__T], jpype.JArray], int: int, tArray2: typing.Union[typing.List[_exp_1__T], jpype.JArray], int2: int) -> None: + """ + Compute exponential of a derivative structure. + + Parameters: + operand (T[]): array holding the operand + operandOffset (int): offset of the operand in its array + result (T[]): array where result must be stored (for exponential the result array *cannot* be the input array) + resultOffset (int): offset of the result in its array + + + """ + ... _expm1_1__T = typing.TypeVar('_expm1_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload - def expm1(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, doubleArray2: typing.Union[typing.List[float], jpype.JArray], int2: int) -> None: ... - @typing.overload - def expm1(self, tArray: typing.Union[typing.List[_expm1_1__T], jpype.JArray], int: int, tArray2: typing.Union[typing.List[_expm1_1__T], jpype.JArray], int2: int) -> None: ... + def expm1(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, doubleArray2: typing.Union[typing.List[float], jpype.JArray], int2: int) -> None: + """ + Compute exp(x) - 1 of a derivative structure. + + Parameters: + operand (double[]): array holding the operand + operandOffset (int): offset of the operand in its array + result (double[]): array where result must be stored (for exponential the result array *cannot* be the input array) + resultOffset (int): offset of the result in its array + + """ + ... + @typing.overload + def expm1(self, tArray: typing.Union[typing.List[_expm1_1__T], jpype.JArray], int: int, tArray2: typing.Union[typing.List[_expm1_1__T], jpype.JArray], int2: int) -> None: + """ + Compute exp(x) - 1 of a derivative structure. + + Parameters: + operand (T[]): array holding the operand + operandOffset (int): offset of the operand in its array + result (T[]): array where result must be stored (for exponential the result array *cannot* be the input array) + resultOffset (int): offset of the result in its array + + + """ + ... @staticmethod def getCompiler(int: int, int2: int) -> 'DSCompiler': ... - def getFreeParameters(self) -> int: ... - def getOrder(self) -> int: ... + def getFreeParameters(self) -> int: + """ + Get the number of free parameters. + + Returns: + number of free parameters + + + """ + ... + def getOrder(self) -> int: + """ + Get the derivation order. + + Returns: + derivation order + + + """ + ... def getPartialDerivativeIndex(self, *int: int) -> int: ... - def getPartialDerivativeOrders(self, int: int) -> typing.MutableSequence[int]: ... - def getPartialDerivativeOrdersSum(self, int: int) -> int: ... - def getSize(self) -> int: ... + def getPartialDerivativeOrders(self, int: int) -> typing.MutableSequence[int]: + """ + Get the derivation orders for a specific index in the array. + + This method is the inverse of :meth:`~org.hipparchus.analysis.differentiation.DSCompiler.getPartialDerivativeIndex`. + + Parameters: + index (int): of the partial derivative + + Returns: + derivation orders with respect to each parameter + + Also see: + + - :meth:`~org.hipparchus.analysis.differentiation.DSCompiler.getPartialDerivativeIndex` + + + + """ + ... + def getPartialDerivativeOrdersSum(self, int: int) -> int: + """ + Get the sum of derivation orders for a specific index in the array. + + This method return the sum of the elements returned by + :meth:`~org.hipparchus.analysis.differentiation.DSCompiler.getPartialDerivativeIndex`, using precomputed values + + Parameters: + index (int): of the partial derivative + + Returns: + sum of derivation orders with respect to each parameter + + Since: + 2.2 + + Also see: + + - :meth:`~org.hipparchus.analysis.differentiation.DSCompiler.getPartialDerivativeIndex` + + + + """ + ... + def getSize(self) -> int: + """ + Get the array size required for holding partial derivatives data. + + This number includes the single 0 order derivative element, which is guaranteed to be stored in the first element of the + array. + + Returns: + array size required for holding partial derivatives data + + + """ + ... _linearCombination_3__T = typing.TypeVar('_linearCombination_3__T', bound=org.hipparchus.CalculusFieldElement) # <T> _linearCombination_4__T = typing.TypeVar('_linearCombination_4__T', bound=org.hipparchus.CalculusFieldElement) # <T> _linearCombination_5__T = typing.TypeVar('_linearCombination_5__T', bound=org.hipparchus.CalculusFieldElement) # <T> @@ -106,17 +623,171 @@ class DSCompiler: _linearCombination_7__T = typing.TypeVar('_linearCombination_7__T', bound=org.hipparchus.CalculusFieldElement) # <T> _linearCombination_8__T = typing.TypeVar('_linearCombination_8__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload - def linearCombination(self, double: float, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, double3: float, doubleArray2: typing.Union[typing.List[float], jpype.JArray], int2: int, double5: float, doubleArray3: typing.Union[typing.List[float], jpype.JArray], int3: int, double7: float, doubleArray4: typing.Union[typing.List[float], jpype.JArray], int4: int, doubleArray5: typing.Union[typing.List[float], jpype.JArray], int5: int) -> None: ... - @typing.overload - def linearCombination(self, double: float, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, double3: float, doubleArray2: typing.Union[typing.List[float], jpype.JArray], int2: int, double5: float, doubleArray3: typing.Union[typing.List[float], jpype.JArray], int3: int, doubleArray4: typing.Union[typing.List[float], jpype.JArray], int4: int) -> None: ... - @typing.overload - def linearCombination(self, double: float, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, double3: float, doubleArray2: typing.Union[typing.List[float], jpype.JArray], int2: int, doubleArray3: typing.Union[typing.List[float], jpype.JArray], int3: int) -> None: ... - @typing.overload - def linearCombination(self, double: float, tArray: typing.Union[typing.List[_linearCombination_3__T], jpype.JArray], int: int, double2: float, tArray2: typing.Union[typing.List[_linearCombination_3__T], jpype.JArray], int2: int, double3: float, tArray3: typing.Union[typing.List[_linearCombination_3__T], jpype.JArray], int3: int, double4: float, tArray4: typing.Union[typing.List[_linearCombination_3__T], jpype.JArray], int4: int, tArray5: typing.Union[typing.List[_linearCombination_3__T], jpype.JArray], int5: int) -> None: ... - @typing.overload - def linearCombination(self, double: float, tArray: typing.Union[typing.List[_linearCombination_4__T], jpype.JArray], int: int, double2: float, tArray2: typing.Union[typing.List[_linearCombination_4__T], jpype.JArray], int2: int, double3: float, tArray3: typing.Union[typing.List[_linearCombination_4__T], jpype.JArray], int3: int, tArray4: typing.Union[typing.List[_linearCombination_4__T], jpype.JArray], int4: int) -> None: ... - @typing.overload - def linearCombination(self, double: float, tArray: typing.Union[typing.List[_linearCombination_5__T], jpype.JArray], int: int, double2: float, tArray2: typing.Union[typing.List[_linearCombination_5__T], jpype.JArray], int2: int, tArray3: typing.Union[typing.List[_linearCombination_5__T], jpype.JArray], int3: int) -> None: ... + def linearCombination(self, double: float, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, double3: float, doubleArray2: typing.Union[typing.List[float], jpype.JArray], int2: int, double5: float, doubleArray3: typing.Union[typing.List[float], jpype.JArray], int3: int, double7: float, doubleArray4: typing.Union[typing.List[float], jpype.JArray], int4: int, doubleArray5: typing.Union[typing.List[float], jpype.JArray], int5: int) -> None: + """ + Compute linear combination. The derivative structure built will be a1 * ds1 + a2 * ds2 + a3 * ds3 + a4 * ds4 + + Parameters: + a1 (double): first scale factor + c1 (double[]): first base (unscaled) component + offset1 (int): offset of first operand in its array + a2 (double): second scale factor + c2 (double[]): second base (unscaled) component + offset2 (int): offset of second operand in its array + a3 (double): third scale factor + c3 (double[]): third base (unscaled) component + offset3 (int): offset of third operand in its array + a4 (double): fourth scale factor + c4 (double[]): fourth base (unscaled) component + offset4 (int): offset of fourth operand in its array + result (double[]): array where result must be stored (it may be one of the input arrays) + resultOffset (int): offset of the result in its array + + """ + ... + @typing.overload + def linearCombination(self, double: float, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, double3: float, doubleArray2: typing.Union[typing.List[float], jpype.JArray], int2: int, double5: float, doubleArray3: typing.Union[typing.List[float], jpype.JArray], int3: int, doubleArray4: typing.Union[typing.List[float], jpype.JArray], int4: int) -> None: + """ + Compute linear combination. The derivative structure built will be a1 * ds1 + a2 * ds2 + a3 * ds3 + a4 * ds4 + + Parameters: + a1 (double): first scale factor + c1 (double[]): first base (unscaled) component + offset1 (int): offset of first operand in its array + a2 (double): second scale factor + c2 (double[]): second base (unscaled) component + offset2 (int): offset of second operand in its array + a3 (double): third scale factor + c3 (double[]): third base (unscaled) component + offset3 (int): offset of third operand in its array + result (double[]): array where result must be stored (it may be one of the input arrays) + resultOffset (int): offset of the result in its array + + """ + ... + @typing.overload + def linearCombination(self, double: float, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, double3: float, doubleArray2: typing.Union[typing.List[float], jpype.JArray], int2: int, doubleArray3: typing.Union[typing.List[float], jpype.JArray], int3: int) -> None: + """ + Compute linear combination. The derivative structure built will be a1 * ds1 + a2 * ds2 + + Parameters: + a1 (double): first scale factor + c1 (double[]): first base (unscaled) component + offset1 (int): offset of first operand in its array + a2 (double): second scale factor + c2 (double[]): second base (unscaled) component + offset2 (int): offset of second operand in its array + result (double[]): array where result must be stored (it may be one of the input arrays) + resultOffset (int): offset of the result in its array + + """ + ... + @typing.overload + def linearCombination(self, double: float, tArray: typing.Union[typing.List[_linearCombination_3__T], jpype.JArray], int: int, double2: float, tArray2: typing.Union[typing.List[_linearCombination_3__T], jpype.JArray], int2: int, double3: float, tArray3: typing.Union[typing.List[_linearCombination_3__T], jpype.JArray], int3: int, double4: float, tArray4: typing.Union[typing.List[_linearCombination_3__T], jpype.JArray], int4: int, tArray5: typing.Union[typing.List[_linearCombination_3__T], jpype.JArray], int5: int) -> None: + """ + Compute linear combination. The derivative structure built will be a1 * ds1 + a2 * ds2 + a3 * ds3 + a4 * ds4 + + Parameters: + a1 (T): first scale factor + c1 (T[]): first base (unscaled) component + offset1 (int): offset of first operand in its array + a2 (T): second scale factor + c2 (T[]): second base (unscaled) component + offset2 (int): offset of second operand in its array + a3 (T): third scale factor + c3 (T[]): third base (unscaled) component + offset3 (int): offset of third operand in its array + a4 (T): fourth scale factor + c4 (T[]): fourth base (unscaled) component + offset4 (int): offset of fourth operand in its array + result (T[]): array where result must be stored (it may be one of the input arrays) + resultOffset (int): offset of the result in its array + + Compute linear combination. The derivative structure built will be a1 * ds1 + a2 * ds2 + a3 * ds3 + a4 * ds4 + + Parameters: + a1 (double): first scale factor + c1 (T[]): first base (unscaled) component + offset1 (int): offset of first operand in its array + a2 (double): second scale factor + c2 (T[]): second base (unscaled) component + offset2 (int): offset of second operand in its array + a3 (double): third scale factor + c3 (T[]): third base (unscaled) component + offset3 (int): offset of third operand in its array + a4 (double): fourth scale factor + c4 (T[]): fourth base (unscaled) component + offset4 (int): offset of fourth operand in its array + result (T[]): array where result must be stored (it may be one of the input arrays) + resultOffset (int): offset of the result in its array + + + """ + ... + @typing.overload + def linearCombination(self, double: float, tArray: typing.Union[typing.List[_linearCombination_4__T], jpype.JArray], int: int, double2: float, tArray2: typing.Union[typing.List[_linearCombination_4__T], jpype.JArray], int2: int, double3: float, tArray3: typing.Union[typing.List[_linearCombination_4__T], jpype.JArray], int3: int, tArray4: typing.Union[typing.List[_linearCombination_4__T], jpype.JArray], int4: int) -> None: + """ + Compute linear combination. The derivative structure built will be a1 * ds1 + a2 * ds2 + a3 * ds3 + a4 * ds4 + + Parameters: + a1 (T): first scale factor + c1 (T[]): first base (unscaled) component + offset1 (int): offset of first operand in its array + a2 (T): second scale factor + c2 (T[]): second base (unscaled) component + offset2 (int): offset of second operand in its array + a3 (T): third scale factor + c3 (T[]): third base (unscaled) component + offset3 (int): offset of third operand in its array + result (T[]): array where result must be stored (it may be one of the input arrays) + resultOffset (int): offset of the result in its array + + Compute linear combination. The derivative structure built will be a1 * ds1 + a2 * ds2 + a3 * ds3 + a4 * ds4 + + Parameters: + a1 (double): first scale factor + c1 (T[]): first base (unscaled) component + offset1 (int): offset of first operand in its array + a2 (double): second scale factor + c2 (T[]): second base (unscaled) component + offset2 (int): offset of second operand in its array + a3 (double): third scale factor + c3 (T[]): third base (unscaled) component + offset3 (int): offset of third operand in its array + result (T[]): array where result must be stored (it may be one of the input arrays) + resultOffset (int): offset of the result in its array + + """ + ... + @typing.overload + def linearCombination(self, double: float, tArray: typing.Union[typing.List[_linearCombination_5__T], jpype.JArray], int: int, double2: float, tArray2: typing.Union[typing.List[_linearCombination_5__T], jpype.JArray], int2: int, tArray3: typing.Union[typing.List[_linearCombination_5__T], jpype.JArray], int3: int) -> None: + """ + Compute linear combination. The derivative structure built will be a1 * ds1 + a2 * ds2 + + Parameters: + a1 (T): first scale factor + c1 (T[]): first base (unscaled) component + offset1 (int): offset of first operand in its array + a2 (T): second scale factor + c2 (T[]): second base (unscaled) component + offset2 (int): offset of second operand in its array + result (T[]): array where result must be stored (it may be one of the input arrays) + resultOffset (int): offset of the result in its array + + Compute linear combination. The derivative structure built will be a1 * ds1 + a2 * ds2 + + Parameters: + a1 (double): first scale factor + c1 (T[]): first base (unscaled) component + offset1 (int): offset of first operand in its array + a2 (double): second scale factor + c2 (T[]): second base (unscaled) component + offset2 (int): offset of second operand in its array + result (T[]): array where result must be stored (it may be one of the input arrays) + resultOffset (int): offset of the result in its array + + """ + ... @typing.overload def linearCombination(self, t: _linearCombination_6__T, tArray: typing.Union[typing.List[_linearCombination_6__T], jpype.JArray], int: int, t3: _linearCombination_6__T, tArray2: typing.Union[typing.List[_linearCombination_6__T], jpype.JArray], int2: int, t5: _linearCombination_6__T, tArray3: typing.Union[typing.List[_linearCombination_6__T], jpype.JArray], int3: int, t7: _linearCombination_6__T, tArray4: typing.Union[typing.List[_linearCombination_6__T], jpype.JArray], int4: int, tArray5: typing.Union[typing.List[_linearCombination_6__T], jpype.JArray], int5: int) -> None: ... @typing.overload @@ -125,32 +796,209 @@ class DSCompiler: def linearCombination(self, t: _linearCombination_8__T, tArray: typing.Union[typing.List[_linearCombination_8__T], jpype.JArray], int: int, t3: _linearCombination_8__T, tArray2: typing.Union[typing.List[_linearCombination_8__T], jpype.JArray], int2: int, tArray3: typing.Union[typing.List[_linearCombination_8__T], jpype.JArray], int3: int) -> None: ... _log_1__T = typing.TypeVar('_log_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload - def log(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, doubleArray2: typing.Union[typing.List[float], jpype.JArray], int2: int) -> None: ... - @typing.overload - def log(self, tArray: typing.Union[typing.List[_log_1__T], jpype.JArray], int: int, tArray2: typing.Union[typing.List[_log_1__T], jpype.JArray], int2: int) -> None: ... + def log(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, doubleArray2: typing.Union[typing.List[float], jpype.JArray], int2: int) -> None: + """ + Compute natural logarithm of a derivative structure. + + Parameters: + operand (double[]): array holding the operand + operandOffset (int): offset of the operand in its array + result (double[]): array where result must be stored (for logarithm the result array *cannot* be the input array) + resultOffset (int): offset of the result in its array + + """ + ... + @typing.overload + def log(self, tArray: typing.Union[typing.List[_log_1__T], jpype.JArray], int: int, tArray2: typing.Union[typing.List[_log_1__T], jpype.JArray], int2: int) -> None: + """ + Compute natural logarithm of a derivative structure. + + Parameters: + operand (T[]): array holding the operand + operandOffset (int): offset of the operand in its array + result (T[]): array where result must be stored (for logarithm the result array *cannot* be the input array) + resultOffset (int): offset of the result in its array + + + """ + ... _log10_1__T = typing.TypeVar('_log10_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload - def log10(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, doubleArray2: typing.Union[typing.List[float], jpype.JArray], int2: int) -> None: ... - @typing.overload - def log10(self, tArray: typing.Union[typing.List[_log10_1__T], jpype.JArray], int: int, tArray2: typing.Union[typing.List[_log10_1__T], jpype.JArray], int2: int) -> None: ... + def log10(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, doubleArray2: typing.Union[typing.List[float], jpype.JArray], int2: int) -> None: + """ + Computes base 10 logarithm of a derivative structure. + + Parameters: + operand (double[]): array holding the operand + operandOffset (int): offset of the operand in its array + result (double[]): array where result must be stored (for base 10 logarithm the result array *cannot* be the input array) + resultOffset (int): offset of the result in its array + + """ + ... + @typing.overload + def log10(self, tArray: typing.Union[typing.List[_log10_1__T], jpype.JArray], int: int, tArray2: typing.Union[typing.List[_log10_1__T], jpype.JArray], int2: int) -> None: + """ + Computes base 10 logarithm of a derivative structure. + + Parameters: + operand (T[]): array holding the operand + operandOffset (int): offset of the operand in its array + result (T[]): array where result must be stored (for base 10 logarithm the result array *cannot* be the input array) + resultOffset (int): offset of the result in its array + + + """ + ... _log1p_1__T = typing.TypeVar('_log1p_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload - def log1p(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, doubleArray2: typing.Union[typing.List[float], jpype.JArray], int2: int) -> None: ... - @typing.overload - def log1p(self, tArray: typing.Union[typing.List[_log1p_1__T], jpype.JArray], int: int, tArray2: typing.Union[typing.List[_log1p_1__T], jpype.JArray], int2: int) -> None: ... + def log1p(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, doubleArray2: typing.Union[typing.List[float], jpype.JArray], int2: int) -> None: + """ + Computes shifted logarithm of a derivative structure. + + Parameters: + operand (double[]): array holding the operand + operandOffset (int): offset of the operand in its array + result (double[]): array where result must be stored (for shifted logarithm the result array *cannot* be the input array) + resultOffset (int): offset of the result in its array + + """ + ... + @typing.overload + def log1p(self, tArray: typing.Union[typing.List[_log1p_1__T], jpype.JArray], int: int, tArray2: typing.Union[typing.List[_log1p_1__T], jpype.JArray], int2: int) -> None: + """ + Computes shifted logarithm of a derivative structure. + + Parameters: + operand (T[]): array holding the operand + operandOffset (int): offset of the operand in its array + result (T[]): array where result must be stored (for shifted logarithm the result array *cannot* be the input array) + resultOffset (int): offset of the result in its array + + + """ + ... _multiply_1__T = typing.TypeVar('_multiply_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload - def multiply(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, doubleArray2: typing.Union[typing.List[float], jpype.JArray], int2: int, doubleArray3: typing.Union[typing.List[float], jpype.JArray], int3: int) -> None: ... - @typing.overload - def multiply(self, tArray: typing.Union[typing.List[_multiply_1__T], jpype.JArray], int: int, tArray2: typing.Union[typing.List[_multiply_1__T], jpype.JArray], int2: int, tArray3: typing.Union[typing.List[_multiply_1__T], jpype.JArray], int3: int) -> None: ... + def multiply(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, doubleArray2: typing.Union[typing.List[float], jpype.JArray], int2: int, doubleArray3: typing.Union[typing.List[float], jpype.JArray], int3: int) -> None: + """ + Perform multiplication of two derivative structures. + + Parameters: + lhs (double[]): array holding left hand side of multiplication + lhsOffset (int): offset of the left hand side in its array + rhs (double[]): array right hand side of multiplication + rhsOffset (int): offset of the right hand side in its array + result (double[]): array where result must be stored (for multiplication the result array *cannot* be one of the input arrays) + resultOffset (int): offset of the result in its array + + """ + ... + @typing.overload + def multiply(self, tArray: typing.Union[typing.List[_multiply_1__T], jpype.JArray], int: int, tArray2: typing.Union[typing.List[_multiply_1__T], jpype.JArray], int2: int, tArray3: typing.Union[typing.List[_multiply_1__T], jpype.JArray], int3: int) -> None: + """ + Perform multiplication of two derivative structures. + + Parameters: + lhs (T[]): array holding left hand side of multiplication + lhsOffset (int): offset of the left hand side in its array + rhs (T[]): array right hand side of multiplication + rhsOffset (int): offset of the right hand side in its array + result (T[]): array where result must be stored (for multiplication the result array *cannot* be one of the input arrays) + resultOffset (int): offset of the result in its array + + + """ + ... _pow_1__T = typing.TypeVar('_pow_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> _pow_5__T = typing.TypeVar('_pow_5__T', bound=org.hipparchus.CalculusFieldElement) # <T> _pow_6__T = typing.TypeVar('_pow_6__T', bound=org.hipparchus.CalculusFieldElement) # <T> _pow_7__T = typing.TypeVar('_pow_7__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload - def pow(self, double: float, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, doubleArray2: typing.Union[typing.List[float], jpype.JArray], int2: int) -> None: ... - @typing.overload - def pow(self, double: float, tArray: typing.Union[typing.List[_pow_1__T], jpype.JArray], int: int, tArray2: typing.Union[typing.List[_pow_1__T], jpype.JArray], int2: int) -> None: ... + def pow(self, double: float, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, doubleArray2: typing.Union[typing.List[float], jpype.JArray], int2: int) -> None: + """ + Compute power of a double to a derivative structure. + + Parameters: + a (double): number to exponentiate + operand (double[]): array holding the power + operandOffset (int): offset of the power in its array + result (double[]): array where result must be stored (for power the result array *cannot* be the input array) + resultOffset (int): offset of the result in its array + + Compute power of a derivative structure. + + Parameters: + operand (double[]): array holding the operand + operandOffset (int): offset of the operand in its array + p (double): power to apply + result (double[]): array where result must be stored (for power the result array *cannot* be the input array) + resultOffset (int): offset of the result in its array + + Compute integer power of a derivative structure. + + Parameters: + operand (double[]): array holding the operand + operandOffset (int): offset of the operand in its array + n (int): power to apply + result (double[]): array where result must be stored (for power the result array *cannot* be the input array) + resultOffset (int): offset of the result in its array + + Compute power of a derivative structure. + + Parameters: + x (double[]): array holding the base + xOffset (int): offset of the base in its array + y (double[]): array holding the exponent + yOffset (int): offset of the exponent in its array + result (double[]): array where result must be stored (for power the result array *cannot* be the input array) + resultOffset (int): offset of the result in its array + + """ + ... + @typing.overload + def pow(self, double: float, tArray: typing.Union[typing.List[_pow_1__T], jpype.JArray], int: int, tArray2: typing.Union[typing.List[_pow_1__T], jpype.JArray], int2: int) -> None: + """ + Compute power of a double to a derivative structure. + + Parameters: + a (double): number to exponentiate + operand (T[]): array holding the power + operandOffset (int): offset of the power in its array + result (T[]): array where result must be stored (for power the result array *cannot* be the input array) + resultOffset (int): offset of the result in its array + + Compute power of a derivative structure. + + Parameters: + operand (T[]): array holding the operand + operandOffset (int): offset of the operand in its array + p (double): power to apply + result (T[]): array where result must be stored (for power the result array *cannot* be the input array) + resultOffset (int): offset of the result in its array + + Compute integer power of a derivative structure. + + Parameters: + operand (T[]): array holding the operand + operandOffset (int): offset of the operand in its array + n (int): power to apply + result (T[]): array where result must be stored (for power the result array *cannot* be the input array) + resultOffset (int): offset of the result in its array + + Compute power of a derivative structure. + + Parameters: + x (T[]): array holding the base + xOffset (int): offset of the base in its array + y (T[]): array holding the exponent + yOffset (int): offset of the exponent in its array + result (T[]): array where result must be stored (for power the result array *cannot* be the input array) + resultOffset (int): offset of the result in its array + + + """ + ... @typing.overload def pow(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, double2: float, doubleArray2: typing.Union[typing.List[float], jpype.JArray], int2: int) -> None: ... @typing.overload @@ -165,64 +1013,380 @@ class DSCompiler: def pow(self, tArray: typing.Union[typing.List[_pow_7__T], jpype.JArray], int: int, tArray2: typing.Union[typing.List[_pow_7__T], jpype.JArray], int2: int, tArray3: typing.Union[typing.List[_pow_7__T], jpype.JArray], int3: int) -> None: ... _rebase_1__T = typing.TypeVar('_rebase_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload - def rebase(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, dSCompiler: 'DSCompiler', doubleArray2: typing.Union[typing.List[float], jpype.JArray], doubleArray3: typing.Union[typing.List[float], jpype.JArray], int2: int) -> None: ... - @typing.overload - def rebase(self, tArray: typing.Union[typing.List[_rebase_1__T], jpype.JArray], int: int, dSCompiler: 'DSCompiler', tArray2: typing.Union[typing.List[_rebase_1__T], jpype.JArray], tArray3: typing.Union[typing.List[_rebase_1__T], jpype.JArray], int2: int) -> None: ... + def rebase(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, dSCompiler: 'DSCompiler', doubleArray2: typing.Union[typing.List[float], jpype.JArray], doubleArray3: typing.Union[typing.List[float], jpype.JArray], int2: int) -> None: + """ + Rebase derivative structure with respect to low level parameter functions. + + Parameters: + ds (double[]): array holding the derivative structure + dsOffset (int): offset of the derivative structure in its array + baseCompiler (:class:`~org.hipparchus.analysis.differentiation.DSCompiler`): compiler associated with the low level parameter functions + p (double[]): array holding the low level parameter functions (one flat array) + result (double[]): array where result must be stored (for composition the result array *cannot* be the input + resultOffset (int): offset of the result in its array + + Since: + 2.2 + + """ + ... + @typing.overload + def rebase(self, tArray: typing.Union[typing.List[_rebase_1__T], jpype.JArray], int: int, dSCompiler: 'DSCompiler', tArray2: typing.Union[typing.List[_rebase_1__T], jpype.JArray], tArray3: typing.Union[typing.List[_rebase_1__T], jpype.JArray], int2: int) -> None: + """ + Rebase derivative structure with respect to low level parameter functions. + + Parameters: + ds (T[]): array holding the derivative structure + dsOffset (int): offset of the derivative structure in its array + baseCompiler (:class:`~org.hipparchus.analysis.differentiation.DSCompiler`): compiler associated with the low level parameter functions + p (T[]): array holding the low level parameter functions (one flat array) + result (T[]): array where result must be stored (for composition the result array *cannot* be the input + resultOffset (int): offset of the result in its array + + Since: + 2.2 + + + """ + ... _reciprocal_1__T = typing.TypeVar('_reciprocal_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload - def reciprocal(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, doubleArray2: typing.Union[typing.List[float], jpype.JArray], int2: int) -> None: ... - @typing.overload - def reciprocal(self, tArray: typing.Union[typing.List[_reciprocal_1__T], jpype.JArray], int: int, tArray2: typing.Union[typing.List[_reciprocal_1__T], jpype.JArray], int2: int) -> None: ... + def reciprocal(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, doubleArray2: typing.Union[typing.List[float], jpype.JArray], int2: int) -> None: + """ + Compute reciprocal of derivative structure. Based on the multiplication operator. + + Parameters: + operand (double[]): array holding the operand + operandOffset (int): offset of the operand in its array + result (double[]): array where result must be stored + resultOffset (int): offset of the result in its array + + """ + ... + @typing.overload + def reciprocal(self, tArray: typing.Union[typing.List[_reciprocal_1__T], jpype.JArray], int: int, tArray2: typing.Union[typing.List[_reciprocal_1__T], jpype.JArray], int2: int) -> None: + """ + Compute reciprocal of derivative structure. Based on the multiplication operator. + + Parameters: + operand (T[]): array holding the operand + operandOffset (int): offset of the operand in its array + result (T[]): array where result must be stored + resultOffset (int): offset of the result in its array + + + """ + ... _remainder_1__T = typing.TypeVar('_remainder_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload - def remainder(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, doubleArray2: typing.Union[typing.List[float], jpype.JArray], int2: int, doubleArray3: typing.Union[typing.List[float], jpype.JArray], int3: int) -> None: ... - @typing.overload - def remainder(self, tArray: typing.Union[typing.List[_remainder_1__T], jpype.JArray], int: int, tArray2: typing.Union[typing.List[_remainder_1__T], jpype.JArray], int2: int, tArray3: typing.Union[typing.List[_remainder_1__T], jpype.JArray], int3: int) -> None: ... + def remainder(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, doubleArray2: typing.Union[typing.List[float], jpype.JArray], int2: int, doubleArray3: typing.Union[typing.List[float], jpype.JArray], int3: int) -> None: + """ + Perform remainder of two derivative structures. + + Parameters: + lhs (double[]): array holding left hand side of remainder + lhsOffset (int): offset of the left hand side in its array + rhs (double[]): array right hand side of remainder + rhsOffset (int): offset of the right hand side in its array + result (double[]): array where result must be stored (it may be one of the input arrays) + resultOffset (int): offset of the result in its array + + """ + ... + @typing.overload + def remainder(self, tArray: typing.Union[typing.List[_remainder_1__T], jpype.JArray], int: int, tArray2: typing.Union[typing.List[_remainder_1__T], jpype.JArray], int2: int, tArray3: typing.Union[typing.List[_remainder_1__T], jpype.JArray], int3: int) -> None: + """ + Perform remainder of two derivative structures. + + Parameters: + lhs (T[]): array holding left hand side of remainder + lhsOffset (int): offset of the left hand side in its array + rhs (T[]): array right hand side of remainder + rhsOffset (int): offset of the right hand side in its array + result (T[]): array where result must be stored (it may be one of the input arrays) + resultOffset (int): offset of the result in its array + + + """ + ... _rootN_1__T = typing.TypeVar('_rootN_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload - def rootN(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, int2: int, doubleArray2: typing.Union[typing.List[float], jpype.JArray], int3: int) -> None: ... - @typing.overload - def rootN(self, tArray: typing.Union[typing.List[_rootN_1__T], jpype.JArray], int: int, int2: int, tArray2: typing.Union[typing.List[_rootN_1__T], jpype.JArray], int3: int) -> None: ... + def rootN(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, int2: int, doubleArray2: typing.Union[typing.List[float], jpype.JArray], int3: int) -> None: + """ + Compute n :sup:`th` root of a derivative structure. + + Parameters: + operand (double[]): array holding the operand + operandOffset (int): offset of the operand in its array + n (int): order of the root + result (double[]): array where result must be stored (for n :sup:`th` root the result array *cannot* be the input array) + resultOffset (int): offset of the result in its array + + """ + ... + @typing.overload + def rootN(self, tArray: typing.Union[typing.List[_rootN_1__T], jpype.JArray], int: int, int2: int, tArray2: typing.Union[typing.List[_rootN_1__T], jpype.JArray], int3: int) -> None: + """ + Compute n :sup:`th` root of a derivative structure. + + Parameters: + operand (T[]): array holding the operand + operandOffset (int): offset of the operand in its array + n (int): order of the root + result (T[]): array where result must be stored (for n :sup:`th` root the result array *cannot* be the input array) + resultOffset (int): offset of the result in its array + + + """ + ... _sin_1__T = typing.TypeVar('_sin_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload - def sin(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, doubleArray2: typing.Union[typing.List[float], jpype.JArray], int2: int) -> None: ... - @typing.overload - def sin(self, tArray: typing.Union[typing.List[_sin_1__T], jpype.JArray], int: int, tArray2: typing.Union[typing.List[_sin_1__T], jpype.JArray], int2: int) -> None: ... + def sin(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, doubleArray2: typing.Union[typing.List[float], jpype.JArray], int2: int) -> None: + """ + Compute sine of a derivative structure. + + Parameters: + operand (double[]): array holding the operand + operandOffset (int): offset of the operand in its array + result (double[]): array where result must be stored (for sine the result array *cannot* be the input array) + resultOffset (int): offset of the result in its array + + """ + ... + @typing.overload + def sin(self, tArray: typing.Union[typing.List[_sin_1__T], jpype.JArray], int: int, tArray2: typing.Union[typing.List[_sin_1__T], jpype.JArray], int2: int) -> None: + """ + Compute sine of a derivative structure. + + Parameters: + operand (T[]): array holding the operand + operandOffset (int): offset of the operand in its array + result (T[]): array where result must be stored (for sine the result array *cannot* be the input array) + resultOffset (int): offset of the result in its array + + + """ + ... _sinCos_1__T = typing.TypeVar('_sinCos_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload - def sinCos(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, doubleArray2: typing.Union[typing.List[float], jpype.JArray], int2: int, doubleArray3: typing.Union[typing.List[float], jpype.JArray], int3: int) -> None: ... - @typing.overload - def sinCos(self, tArray: typing.Union[typing.List[_sinCos_1__T], jpype.JArray], int: int, tArray2: typing.Union[typing.List[_sinCos_1__T], jpype.JArray], int2: int, tArray3: typing.Union[typing.List[_sinCos_1__T], jpype.JArray], int3: int) -> None: ... + def sinCos(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, doubleArray2: typing.Union[typing.List[float], jpype.JArray], int2: int, doubleArray3: typing.Union[typing.List[float], jpype.JArray], int3: int) -> None: + """ + Compute combined sine and cosine of a derivative structure. + + Parameters: + operand (double[]): array holding the operand + operandOffset (int): offset of the operand in its array + sin (double[]): array where sine must be stored (for sine the result array *cannot* be the input array) + sinOffset (int): offset of the result in its array + cos (double[]): array where cosine must be stored (for cosine the result array *cannot* be the input array) + cosOffset (int): offset of the result in its array + + Since: + 1.4 + + """ + ... + @typing.overload + def sinCos(self, tArray: typing.Union[typing.List[_sinCos_1__T], jpype.JArray], int: int, tArray2: typing.Union[typing.List[_sinCos_1__T], jpype.JArray], int2: int, tArray3: typing.Union[typing.List[_sinCos_1__T], jpype.JArray], int3: int) -> None: + """ + Compute combined sine and cosine of a derivative structure. + + Parameters: + operand (T[]): array holding the operand + operandOffset (int): offset of the operand in its array + sin (T[]): array where sine must be stored (for sine the result array *cannot* be the input array) + sinOffset (int): offset of the result in its array + cos (T[]): array where cosine must be stored (for cosine the result array *cannot* be the input array) + cosOffset (int): offset of the result in its array + + Since: + 1.4 + + + """ + ... _sinh_1__T = typing.TypeVar('_sinh_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload - def sinh(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, doubleArray2: typing.Union[typing.List[float], jpype.JArray], int2: int) -> None: ... - @typing.overload - def sinh(self, tArray: typing.Union[typing.List[_sinh_1__T], jpype.JArray], int: int, tArray2: typing.Union[typing.List[_sinh_1__T], jpype.JArray], int2: int) -> None: ... + def sinh(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, doubleArray2: typing.Union[typing.List[float], jpype.JArray], int2: int) -> None: + """ + Compute hyperbolic sine of a derivative structure. + + Parameters: + operand (double[]): array holding the operand + operandOffset (int): offset of the operand in its array + result (double[]): array where result must be stored (for hyperbolic sine the result array *cannot* be the input array) + resultOffset (int): offset of the result in its array + + """ + ... + @typing.overload + def sinh(self, tArray: typing.Union[typing.List[_sinh_1__T], jpype.JArray], int: int, tArray2: typing.Union[typing.List[_sinh_1__T], jpype.JArray], int2: int) -> None: + """ + Compute hyperbolic sine of a derivative structure. + + Parameters: + operand (T[]): array holding the operand + operandOffset (int): offset of the operand in its array + result (T[]): array where result must be stored (for hyperbolic sine the result array *cannot* be the input array) + resultOffset (int): offset of the result in its array + + + """ + ... _sinhCosh_1__T = typing.TypeVar('_sinhCosh_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload - def sinhCosh(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, doubleArray2: typing.Union[typing.List[float], jpype.JArray], int2: int, doubleArray3: typing.Union[typing.List[float], jpype.JArray], int3: int) -> None: ... - @typing.overload - def sinhCosh(self, tArray: typing.Union[typing.List[_sinhCosh_1__T], jpype.JArray], int: int, tArray2: typing.Union[typing.List[_sinhCosh_1__T], jpype.JArray], int2: int, tArray3: typing.Union[typing.List[_sinhCosh_1__T], jpype.JArray], int3: int) -> None: ... + def sinhCosh(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, doubleArray2: typing.Union[typing.List[float], jpype.JArray], int2: int, doubleArray3: typing.Union[typing.List[float], jpype.JArray], int3: int) -> None: + """ + Compute combined hyperbolic sine and cosine of a derivative structure. + + Parameters: + operand (double[]): array holding the operand + operandOffset (int): offset of the operand in its array + sinh (double[]): array where hyperbolic sine must be stored (for sine the result array *cannot* be the input array) + sinhOffset (int): offset of the result in its array + cosh (double[]): array where hyperbolic *cannot* be the input array) + coshOffset (int): offset of the result in its array + + Since: + 2.0 + + """ + ... + @typing.overload + def sinhCosh(self, tArray: typing.Union[typing.List[_sinhCosh_1__T], jpype.JArray], int: int, tArray2: typing.Union[typing.List[_sinhCosh_1__T], jpype.JArray], int2: int, tArray3: typing.Union[typing.List[_sinhCosh_1__T], jpype.JArray], int3: int) -> None: + """ + Compute combined hyperbolic sine and cosine of a derivative structure. + + Parameters: + operand (T[]): array holding the operand + operandOffset (int): offset of the operand in its array + sinh (T[]): array where hyperbolic sine must be stored (for sine the result array *cannot* be the input array) + sinhOffset (int): offset of the result in its array + cosh (T[]): array where hyperbolic cosine must be stored (for cosine the result array *cannot* be the input array) + coshOffset (int): offset of the result in its array + + Since: + 1.4 + + + """ + ... _sqrt_1__T = typing.TypeVar('_sqrt_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload - def sqrt(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, doubleArray2: typing.Union[typing.List[float], jpype.JArray], int2: int) -> None: ... - @typing.overload - def sqrt(self, tArray: typing.Union[typing.List[_sqrt_1__T], jpype.JArray], int: int, tArray2: typing.Union[typing.List[_sqrt_1__T], jpype.JArray], int2: int) -> None: ... + def sqrt(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, doubleArray2: typing.Union[typing.List[float], jpype.JArray], int2: int) -> None: + """ + Compute square root of a derivative structure. Based on the multiplication operator. + + Parameters: + operand (double[]): array holding the operand + operandOffset (int): offset of the operand in its array + result (double[]): array where result must be stored (for square root the result array *cannot* be the input array) + resultOffset (int): offset of the result in its array + + """ + ... + @typing.overload + def sqrt(self, tArray: typing.Union[typing.List[_sqrt_1__T], jpype.JArray], int: int, tArray2: typing.Union[typing.List[_sqrt_1__T], jpype.JArray], int2: int) -> None: + """ + Compute square root of a derivative structure. Based on the multiplication operator. + + Parameters: + operand (T[]): array holding the operand + operandOffset (int): offset of the operand in its array + result (T[]): array where result must be stored (for square root the result array *cannot* be the input array) + resultOffset (int): offset of the result in its array + + + """ + ... _subtract_1__T = typing.TypeVar('_subtract_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload - def subtract(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, doubleArray2: typing.Union[typing.List[float], jpype.JArray], int2: int, doubleArray3: typing.Union[typing.List[float], jpype.JArray], int3: int) -> None: ... - @typing.overload - def subtract(self, tArray: typing.Union[typing.List[_subtract_1__T], jpype.JArray], int: int, tArray2: typing.Union[typing.List[_subtract_1__T], jpype.JArray], int2: int, tArray3: typing.Union[typing.List[_subtract_1__T], jpype.JArray], int3: int) -> None: ... + def subtract(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, doubleArray2: typing.Union[typing.List[float], jpype.JArray], int2: int, doubleArray3: typing.Union[typing.List[float], jpype.JArray], int3: int) -> None: + """ + Perform subtraction of two derivative structures. + + Parameters: + lhs (double[]): array holding left hand side of subtraction + lhsOffset (int): offset of the left hand side in its array + rhs (double[]): array right hand side of subtraction + rhsOffset (int): offset of the right hand side in its array + result (double[]): array where result must be stored (it may be one of the input arrays) + resultOffset (int): offset of the result in its array + + """ + ... + @typing.overload + def subtract(self, tArray: typing.Union[typing.List[_subtract_1__T], jpype.JArray], int: int, tArray2: typing.Union[typing.List[_subtract_1__T], jpype.JArray], int2: int, tArray3: typing.Union[typing.List[_subtract_1__T], jpype.JArray], int3: int) -> None: + """ + Perform subtraction of two derivative structures. + + Parameters: + lhs (T[]): array holding left hand side of subtraction + lhsOffset (int): offset of the left hand side in its array + rhs (T[]): array right hand side of subtraction + rhsOffset (int): offset of the right hand side in its array + result (T[]): array where result must be stored (it may be one of the input arrays) + resultOffset (int): offset of the result in its array + + + """ + ... _tan_1__T = typing.TypeVar('_tan_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload - def tan(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, doubleArray2: typing.Union[typing.List[float], jpype.JArray], int2: int) -> None: ... - @typing.overload - def tan(self, tArray: typing.Union[typing.List[_tan_1__T], jpype.JArray], int: int, tArray2: typing.Union[typing.List[_tan_1__T], jpype.JArray], int2: int) -> None: ... + def tan(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, doubleArray2: typing.Union[typing.List[float], jpype.JArray], int2: int) -> None: + """ + Compute tangent of a derivative structure. + + Parameters: + operand (double[]): array holding the operand + operandOffset (int): offset of the operand in its array + result (double[]): array where result must be stored (for tangent the result array *cannot* be the input array) + resultOffset (int): offset of the result in its array + + """ + ... + @typing.overload + def tan(self, tArray: typing.Union[typing.List[_tan_1__T], jpype.JArray], int: int, tArray2: typing.Union[typing.List[_tan_1__T], jpype.JArray], int2: int) -> None: + """ + Compute tangent of a derivative structure. + + Parameters: + operand (T[]): array holding the operand + operandOffset (int): offset of the operand in its array + result (T[]): array where result must be stored (for tangent the result array *cannot* be the input array) + resultOffset (int): offset of the result in its array + + + """ + ... _tanh_1__T = typing.TypeVar('_tanh_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload - def tanh(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, doubleArray2: typing.Union[typing.List[float], jpype.JArray], int2: int) -> None: ... - @typing.overload - def tanh(self, tArray: typing.Union[typing.List[_tanh_1__T], jpype.JArray], int: int, tArray2: typing.Union[typing.List[_tanh_1__T], jpype.JArray], int2: int) -> None: ... + def tanh(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, doubleArray2: typing.Union[typing.List[float], jpype.JArray], int2: int) -> None: + """ + Compute hyperbolic tangent of a derivative structure. + + Parameters: + operand (double[]): array holding the operand + operandOffset (int): offset of the operand in its array + result (double[]): array where result must be stored (for hyperbolic tangent the result array *cannot* be the input array) + resultOffset (int): offset of the result in its array + + """ + ... + @typing.overload + def tanh(self, tArray: typing.Union[typing.List[_tanh_1__T], jpype.JArray], int: int, tArray2: typing.Union[typing.List[_tanh_1__T], jpype.JArray], int2: int) -> None: + """ + Compute hyperbolic tangent of a derivative structure. + + Parameters: + operand (T[]): array holding the operand + operandOffset (int): offset of the operand in its array + result (T[]): array where result must be stored (for hyperbolic tangent the result array *cannot* be the input array) + resultOffset (int): offset of the result in its array + + + """ + ... _taylor_1__T = typing.TypeVar('_taylor_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> _taylor_2__T = typing.TypeVar('_taylor_2__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload @@ -233,11 +1397,61 @@ class DSCompiler: def taylor(self, tArray: typing.Union[typing.List[_taylor_2__T], jpype.JArray], int: int, *double: float) -> _taylor_2__T: ... class DSFactory(java.io.Serializable): + """ + public classDSFactory extends :class:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + Factory for :class:`~org.hipparchus.analysis.differentiation.DerivativeStructure`. + + This class is a factory for :class:`~org.hipparchus.analysis.differentiation.DerivativeStructure` instances. + + Instances of this class are guaranteed to be immutable. + + Since: + 1.1 + + Also see: + + - :class:`~org.hipparchus.analysis.differentiation.DerivativeStructure` + - :meth:`~serialized` + """ def __init__(self, int: int, int2: int): ... def build(self, *double: float) -> 'DerivativeStructure': ... - def constant(self, double: float) -> 'DerivativeStructure': ... - def getCompiler(self) -> DSCompiler: ... - def getDerivativeField(self) -> 'DSFactory.DSField': ... + def constant(self, double: float) -> 'DerivativeStructure': + """ + Build a :class:`~org.hipparchus.analysis.differentiation.DerivativeStructure` representing a constant value. + + Parameters: + value (double): value of the constant + + Returns: + a :class:`~org.hipparchus.analysis.differentiation.DerivativeStructure` representing a constant value + + + """ + ... + def getCompiler(self) -> DSCompiler: + """ + Get the compiler for the current dimensions. + + Returns: + compiler for the current dimensions + + + """ + ... + def getDerivativeField(self) -> 'DSFactory.DSField': + """ + Get the :class:`~org.hipparchus.Field` the :class:`~org.hipparchus.analysis.differentiation.DerivativeStructure` + instances belong to. + + Returns: + :class:`~org.hipparchus.Field` the :class:`~org.hipparchus.analysis.differentiation.DerivativeStructure` instances + belong to + + + """ + ... def variable(self, int: int, double: float) -> 'DerivativeStructure': ... class DSField(org.hipparchus.Field['DerivativeStructure']): def equals(self, object: typing.Any) -> bool: ... @@ -248,12 +1462,58 @@ class DSFactory(java.io.Serializable): def hashCode(self) -> int: ... class DifferentialAlgebra: - def getFreeParameters(self) -> int: ... - def getOrder(self) -> int: ... + """ + public interfaceDifferentialAlgebra + + Interface representing an object holding partial derivatives. + + Since: + 3.1 + + Also see: + + - :class:`~org.hipparchus.analysis.differentiation.Derivative` + - :class:`~org.hipparchus.analysis.differentiation.TaylorMap` + - :class:`~org.hipparchus.analysis.differentiation.FieldDerivative` + - :class:`~org.hipparchus.analysis.differentiation.FieldTaylorMap` + """ + def getFreeParameters(self) -> int: + """ + Get the number of free parameters. + + Returns: + number of free parameters + + + """ + ... + def getOrder(self) -> int: + """ + Get the maximum derivation order. + + Returns: + maximum derivation order + + + """ + ... _FDSFactory__DerivativeField__T = typing.TypeVar('_FDSFactory__DerivativeField__T', bound=org.hipparchus.CalculusFieldElement) # <T> _FDSFactory__T = typing.TypeVar('_FDSFactory__T', bound=org.hipparchus.CalculusFieldElement) # <T> class FDSFactory(typing.Generic[_FDSFactory__T]): + """ + public classFDSFactory<T extends :class:`~org.hipparchus.CalculusFieldElement`<T>> extends :class:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Factory for :class:`~org.hipparchus.analysis.differentiation.FieldDerivativeStructure`. + + This class is a factory for :class:`~org.hipparchus.analysis.differentiation.FieldDerivativeStructure` instances. + + Instances of this class are guaranteed to be immutable. + + Also see: + + - :class:`~org.hipparchus.analysis.differentiation.FieldDerivativeStructure` + """ def __init__(self, field: org.hipparchus.Field[_FDSFactory__T], int: int, int2: int): ... @typing.overload def build(self, *t: _FDSFactory__T) -> 'FieldDerivativeStructure'[_FDSFactory__T]: ... @@ -263,7 +1523,16 @@ class FDSFactory(typing.Generic[_FDSFactory__T]): def constant(self, double: float) -> 'FieldDerivativeStructure'[_FDSFactory__T]: ... @typing.overload def constant(self, t: _FDSFactory__T) -> 'FieldDerivativeStructure'[_FDSFactory__T]: ... - def getCompiler(self) -> DSCompiler: ... + def getCompiler(self) -> DSCompiler: + """ + Get the compiler for the current dimensions. + + Returns: + compiler for the current dimensions + + + """ + ... def getDerivativeField(self) -> 'FDSFactory.DerivativeField'[_FDSFactory__T]: ... def getValueField(self) -> org.hipparchus.Field[_FDSFactory__T]: ... @typing.overload @@ -280,85 +1549,491 @@ class FDSFactory(typing.Generic[_FDSFactory__T]): _FieldGradientField__T = typing.TypeVar('_FieldGradientField__T', bound=org.hipparchus.CalculusFieldElement) # <T> class FieldGradientField(org.hipparchus.Field['FieldGradient'[_FieldGradientField__T]], typing.Generic[_FieldGradientField__T]): - def equals(self, object: typing.Any) -> bool: ... + """ + public classFieldGradientField<T extends :class:`~org.hipparchus.CalculusFieldElement`<T>> extends :class:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.Field`<:class:`~org.hipparchus.analysis.differentiation.FieldGradient`<T>> + + Field for :class:`~org.hipparchus.analysis.differentiation.Gradient` instances. + + Since: + 1.7 + """ + def equals(self, object: typing.Any) -> bool: + """ + + Overrides: + :meth:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.equals` in + class :class:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + + """ + ... _getField__T = typing.TypeVar('_getField__T', bound=org.hipparchus.CalculusFieldElement) # <T> @staticmethod - def getField(field: org.hipparchus.Field[_getField__T], int: int) -> 'FieldGradientField'[_getField__T]: ... + def getField(field: org.hipparchus.Field[_getField__T], int: int) -> 'FieldGradientField'[_getField__T]: + """ + Get the field for number of free parameters. + + Parameters: + valueField (:class:`~org.hipparchus.Field`<T> valueField): field for the function parameters and value + parameters (int): number of free parameters + + Returns: + cached field + + + """ + ... def getOne(self) -> 'FieldGradient'[_FieldGradientField__T]: ... def getRuntimeClass(self) -> typing.Type['FieldGradient'[_FieldGradientField__T]]: ... def getZero(self) -> 'FieldGradient'[_FieldGradientField__T]: ... - def hashCode(self) -> int: ... + def hashCode(self) -> int: + """ + + Overrides: + :meth:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.hashCode` in + class :class:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + + """ + ... _FieldUnivariateDerivative1Field__T = typing.TypeVar('_FieldUnivariateDerivative1Field__T', bound=org.hipparchus.CalculusFieldElement) # <T> class FieldUnivariateDerivative1Field(org.hipparchus.Field['FieldUnivariateDerivative1'[_FieldUnivariateDerivative1Field__T]], typing.Generic[_FieldUnivariateDerivative1Field__T]): - def equals(self, object: typing.Any) -> bool: ... + """ + public classFieldUnivariateDerivative1Field<T extends :class:`~org.hipparchus.CalculusFieldElement`<T>> extends :class:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.Field`<:class:`~org.hipparchus.analysis.differentiation.FieldUnivariateDerivative1`<T>> + + Field for :class:`~org.hipparchus.analysis.differentiation.FieldUnivariateDerivative1` instances. + + Since: + 1.7 + """ + def equals(self, object: typing.Any) -> bool: + """ + + Overrides: + :meth:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.equals` in + class :class:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + + """ + ... def getOne(self) -> 'FieldUnivariateDerivative1'[_FieldUnivariateDerivative1Field__T]: ... def getRuntimeClass(self) -> typing.Type['FieldUnivariateDerivative1'[_FieldUnivariateDerivative1Field__T]]: ... _getUnivariateDerivative1Field__T = typing.TypeVar('_getUnivariateDerivative1Field__T', bound=org.hipparchus.CalculusFieldElement) # <T> @staticmethod - def getUnivariateDerivative1Field(field: org.hipparchus.Field[_getUnivariateDerivative1Field__T]) -> 'FieldUnivariateDerivative1Field'[_getUnivariateDerivative1Field__T]: ... + def getUnivariateDerivative1Field(field: org.hipparchus.Field[_getUnivariateDerivative1Field__T]) -> 'FieldUnivariateDerivative1Field'[_getUnivariateDerivative1Field__T]: + """ + Get the univariate derivative field corresponding to a value field. + + Parameters: + valueField (:class:`~org.hipparchus.Field`<T> valueField): field for the function parameters and value + + Returns: + univariate derivative field + + + """ + ... def getZero(self) -> 'FieldUnivariateDerivative1'[_FieldUnivariateDerivative1Field__T]: ... - def hashCode(self) -> int: ... + def hashCode(self) -> int: + """ + + Overrides: + :meth:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.hashCode` in + class :class:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + + """ + ... _FieldUnivariateDerivative2Field__T = typing.TypeVar('_FieldUnivariateDerivative2Field__T', bound=org.hipparchus.CalculusFieldElement) # <T> class FieldUnivariateDerivative2Field(org.hipparchus.Field['FieldUnivariateDerivative2'[_FieldUnivariateDerivative2Field__T]], typing.Generic[_FieldUnivariateDerivative2Field__T]): - def equals(self, object: typing.Any) -> bool: ... + """ + public classFieldUnivariateDerivative2Field<T extends :class:`~org.hipparchus.CalculusFieldElement`<T>> extends :class:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.Field`<:class:`~org.hipparchus.analysis.differentiation.FieldUnivariateDerivative2`<T>> + + Field for :class:`~org.hipparchus.analysis.differentiation.FieldUnivariateDerivative2` instances. + + Since: + 1.7 + """ + def equals(self, object: typing.Any) -> bool: + """ + + Overrides: + :meth:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.equals` in + class :class:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + + """ + ... def getOne(self) -> 'FieldUnivariateDerivative2'[_FieldUnivariateDerivative2Field__T]: ... def getRuntimeClass(self) -> typing.Type['FieldUnivariateDerivative2'[_FieldUnivariateDerivative2Field__T]]: ... _getUnivariateDerivative2Field__T = typing.TypeVar('_getUnivariateDerivative2Field__T', bound=org.hipparchus.CalculusFieldElement) # <T> @staticmethod - def getUnivariateDerivative2Field(field: org.hipparchus.Field[_getUnivariateDerivative2Field__T]) -> 'FieldUnivariateDerivative2Field'[_getUnivariateDerivative2Field__T]: ... + def getUnivariateDerivative2Field(field: org.hipparchus.Field[_getUnivariateDerivative2Field__T]) -> 'FieldUnivariateDerivative2Field'[_getUnivariateDerivative2Field__T]: + """ + Get the univariate derivative field corresponding to a value field. + + Parameters: + valueField (:class:`~org.hipparchus.Field`<T> valueField): field for the function parameters and value + + Returns: + univariate derivative field + + + """ + ... def getZero(self) -> 'FieldUnivariateDerivative2'[_FieldUnivariateDerivative2Field__T]: ... - def hashCode(self) -> int: ... + def hashCode(self) -> int: + """ + + Overrides: + :meth:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.hashCode` in + class :class:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + + """ + ... class GradientField(org.hipparchus.Field['Gradient']): - def equals(self, object: typing.Any) -> bool: ... + """ + public classGradientField extends :class:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.Field`<:class:`~org.hipparchus.analysis.differentiation.Gradient`> + + Field for :class:`~org.hipparchus.analysis.differentiation.Gradient` instances. + + Since: + 1.7 + """ + def equals(self, object: typing.Any) -> bool: + """ + + Overrides: + :meth:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.equals` in + class :class:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + + """ + ... @staticmethod - def getField(int: int) -> 'GradientField': ... - def getOne(self) -> 'Gradient': ... + def getField(int: int) -> 'GradientField': + """ + Get the field for number of free parameters. + + Parameters: + parameters (int): number of free parameters + + Returns: + cached field + + + """ + ... + def getOne(self) -> 'Gradient': + """ + Get the multiplicative identity of the field. + + The multiplicative identity is the element e :sub:`1` of the field such that for all elements a of the field, the + equalities a × e :sub:`1` = e :sub:`1` × a = a hold. + + Specified by: + :meth:`~org.hipparchus.Field.getOne` in interface :class:`~org.hipparchus.Field` + + Returns: + multiplicative identity of the field + + + """ + ... def getRuntimeClass(self) -> typing.Type['Gradient']: ... - def getZero(self) -> 'Gradient': ... - def hashCode(self) -> int: ... + def getZero(self) -> 'Gradient': + """ + Get the additive identity of the field. + + The additive identity is the element e :sub:`0` of the field such that for all elements a of the field, the equalities a + + e :sub:`0` = e :sub:`0` + a = a hold. + + Specified by: + :meth:`~org.hipparchus.Field.getZero` in interface :class:`~org.hipparchus.Field` + + Returns: + additive identity of the field + + + """ + ... + def hashCode(self) -> int: + """ + + Overrides: + :meth:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.hashCode` in + class :class:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + + """ + ... class GradientFunction(org.hipparchus.analysis.MultivariateVectorFunction): + """ + public classGradientFunction extends :class:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.analysis.MultivariateVectorFunction` + + Class representing the gradient of a multivariate function. + + The vectorial components of the function represent the derivatives with respect to each function parameters. + """ def __init__(self, multivariateDifferentiableFunction: 'MultivariateDifferentiableFunction'): ... - def value(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> typing.MutableSequence[float]: ... + def value(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> typing.MutableSequence[float]: + """ + Compute the value for the function at the given point. + + Specified by: + :meth:`~org.hipparchus.analysis.MultivariateVectorFunction.value` in + interface :class:`~org.hipparchus.analysis.MultivariateVectorFunction` + + Parameters: + point (double[]): point at which the function must be evaluated + + Returns: + function value for the given point + + + """ + ... class JacobianFunction(org.hipparchus.analysis.MultivariateMatrixFunction): + """ + public classJacobianFunction extends :class:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.analysis.MultivariateMatrixFunction` + + Class representing the Jacobian of a multivariate vector function. + + The rows iterate on the model functions while the columns iterate on the parameters; thus, the numbers of rows is equal + to the dimension of the underlying function vector value and the number of columns is equal to the number of free + parameters of the underlying function. + """ def __init__(self, multivariateDifferentiableVectorFunction: 'MultivariateDifferentiableVectorFunction'): ... - def value(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> typing.MutableSequence[typing.MutableSequence[float]]: ... + def value(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> typing.MutableSequence[typing.MutableSequence[float]]: + """ + Compute the value for the function at the given point. + + Specified by: + :meth:`~org.hipparchus.analysis.MultivariateMatrixFunction.value` in + interface :class:`~org.hipparchus.analysis.MultivariateMatrixFunction` + + Parameters: + point (double[]): point at which the function must be evaluated + + Returns: + function value for the given point + + + """ + ... class MultivariateDifferentiableFunction(org.hipparchus.analysis.MultivariateFunction): + """ + public interfaceMultivariateDifferentiableFunctionextends :class:`~org.hipparchus.analysis.MultivariateFunction` + + Extension of :class:`~org.hipparchus.analysis.MultivariateFunction` representing a multivariate differentiable real + function. + """ @typing.overload def value(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> float: ... @typing.overload def value(self, derivativeStructureArray: typing.Union[typing.List['DerivativeStructure'], jpype.JArray]) -> 'DerivativeStructure': ... class MultivariateDifferentiableVectorFunction(org.hipparchus.analysis.MultivariateVectorFunction): + """ + public interfaceMultivariateDifferentiableVectorFunctionextends :class:`~org.hipparchus.analysis.MultivariateVectorFunction` + + Extension of :class:`~org.hipparchus.analysis.MultivariateVectorFunction` representing a multivariate differentiable + vectorial function. + """ @typing.overload def value(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> typing.MutableSequence[float]: ... @typing.overload def value(self, derivativeStructureArray: typing.Union[typing.List['DerivativeStructure'], jpype.JArray]) -> typing.MutableSequence['DerivativeStructure']: ... class UnivariateDerivative1Field(org.hipparchus.Field['UnivariateDerivative1'], java.io.Serializable): - def equals(self, object: typing.Any) -> bool: ... + """ + public classUnivariateDerivative1Field extends :class:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.Field`<:class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative1`>, :class:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + Field for :class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative1` instances. + + This class is a singleton. + + Since: + 1.7 + + Also see: + + - :meth:`~serialized` + """ + def equals(self, object: typing.Any) -> bool: + """ + + Overrides: + :meth:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.equals` in + class :class:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + + """ + ... @staticmethod - def getInstance() -> 'UnivariateDerivative1Field': ... - def getOne(self) -> 'UnivariateDerivative1': ... + def getInstance() -> 'UnivariateDerivative1Field': + """ + Get the unique instance. + + Returns: + the unique instance + + + """ + ... + def getOne(self) -> 'UnivariateDerivative1': + """ + Get the multiplicative identity of the field. + + The multiplicative identity is the element e :sub:`1` of the field such that for all elements a of the field, the + equalities a × e :sub:`1` = e :sub:`1` × a = a hold. + + Specified by: + :meth:`~org.hipparchus.Field.getOne` in interface :class:`~org.hipparchus.Field` + + Returns: + multiplicative identity of the field + + + """ + ... def getRuntimeClass(self) -> typing.Type['UnivariateDerivative1']: ... - def getZero(self) -> 'UnivariateDerivative1': ... - def hashCode(self) -> int: ... + def getZero(self) -> 'UnivariateDerivative1': + """ + Get the additive identity of the field. + + The additive identity is the element e :sub:`0` of the field such that for all elements a of the field, the equalities a + + e :sub:`0` = e :sub:`0` + a = a hold. + + Specified by: + :meth:`~org.hipparchus.Field.getZero` in interface :class:`~org.hipparchus.Field` + + Returns: + additive identity of the field + + + """ + ... + def hashCode(self) -> int: + """ + + Overrides: + :meth:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.hashCode` in + class :class:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + + """ + ... class UnivariateDerivative2Field(org.hipparchus.Field['UnivariateDerivative2'], java.io.Serializable): - def equals(self, object: typing.Any) -> bool: ... + """ + public classUnivariateDerivative2Field extends :class:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.Field`<:class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative2`>, :class:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + Field for :class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative2` instances. + + This class is a singleton. + + Since: + 1.7 + + Also see: + + - :meth:`~serialized` + """ + def equals(self, object: typing.Any) -> bool: + """ + + Overrides: + :meth:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.equals` in + class :class:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + + """ + ... @staticmethod - def getInstance() -> 'UnivariateDerivative2Field': ... - def getOne(self) -> 'UnivariateDerivative2': ... + def getInstance() -> 'UnivariateDerivative2Field': + """ + Get the unique instance. + + Returns: + the unique instance + + + """ + ... + def getOne(self) -> 'UnivariateDerivative2': + """ + Get the multiplicative identity of the field. + + The multiplicative identity is the element e :sub:`1` of the field such that for all elements a of the field, the + equalities a × e :sub:`1` = e :sub:`1` × a = a hold. + + Specified by: + :meth:`~org.hipparchus.Field.getOne` in interface :class:`~org.hipparchus.Field` + + Returns: + multiplicative identity of the field + + + """ + ... def getRuntimeClass(self) -> typing.Type['UnivariateDerivative2']: ... - def getZero(self) -> 'UnivariateDerivative2': ... - def hashCode(self) -> int: ... + def getZero(self) -> 'UnivariateDerivative2': + """ + Get the additive identity of the field. + + The additive identity is the element e :sub:`0` of the field such that for all elements a of the field, the equalities a + + e :sub:`0` = e :sub:`0` + a = a hold. + + Specified by: + :meth:`~org.hipparchus.Field.getZero` in interface :class:`~org.hipparchus.Field` + + Returns: + additive identity of the field + + + """ + ... + def hashCode(self) -> int: + """ + + Overrides: + :meth:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.hashCode` in + class :class:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + + """ + ... class UnivariateDifferentiableFunction(org.hipparchus.analysis.UnivariateFunction): + """ + public interfaceUnivariateDifferentiableFunctionextends :class:`~org.hipparchus.analysis.UnivariateFunction` + + Interface for univariate functions derivatives. + + This interface represents a simple function which computes both the value and the first derivative of a mathematical + function. The derivative is computed with respect to the input variable. + + Also see: + + - :class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction` + - :class:`~org.hipparchus.analysis.differentiation.UnivariateFunctionDifferentiator` + """ _value_1__T = typing.TypeVar('_value_1__T', bound='Derivative') # <T> @typing.overload def value(self, double: float) -> float: ... @@ -366,6 +2041,12 @@ class UnivariateDifferentiableFunction(org.hipparchus.analysis.UnivariateFunctio def value(self, t: _value_1__T) -> _value_1__T: ... class UnivariateDifferentiableMatrixFunction(org.hipparchus.analysis.UnivariateMatrixFunction): + """ + public interfaceUnivariateDifferentiableMatrixFunctionextends :class:`~org.hipparchus.analysis.UnivariateMatrixFunction` + + Extension of :class:`~org.hipparchus.analysis.UnivariateMatrixFunction` representing a univariate differentiable matrix + function. + """ _value_1__T = typing.TypeVar('_value_1__T', bound='Derivative') # <T> @typing.overload def value(self, double: float) -> typing.MutableSequence[typing.MutableSequence[float]]: ... @@ -373,6 +2054,12 @@ class UnivariateDifferentiableMatrixFunction(org.hipparchus.analysis.UnivariateM def value(self, t: _value_1__T) -> typing.MutableSequence[typing.MutableSequence[_value_1__T]]: ... class UnivariateDifferentiableVectorFunction(org.hipparchus.analysis.UnivariateVectorFunction): + """ + public interfaceUnivariateDifferentiableVectorFunctionextends :class:`~org.hipparchus.analysis.UnivariateVectorFunction` + + Extension of :class:`~org.hipparchus.analysis.UnivariateVectorFunction` representing a univariate differentiable + vectorial function. + """ _value_1__T = typing.TypeVar('_value_1__T', bound='Derivative') # <T> @typing.overload def value(self, double: float) -> typing.MutableSequence[float]: ... @@ -380,212 +2067,1723 @@ class UnivariateDifferentiableVectorFunction(org.hipparchus.analysis.UnivariateV def value(self, t: _value_1__T) -> typing.MutableSequence[_value_1__T]: ... class UnivariateFunctionDifferentiator: - def differentiate(self, univariateFunction: typing.Union[org.hipparchus.analysis.UnivariateFunction, typing.Callable]) -> UnivariateDifferentiableFunction: ... + """ + public interfaceUnivariateFunctionDifferentiator + + Interface defining the function differentiation operation. + """ + def differentiate(self, univariateFunction: typing.Union[org.hipparchus.analysis.UnivariateFunction, typing.Callable]) -> UnivariateDifferentiableFunction: + """ + Create an implementation of a :class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction` from a + regular :class:`~org.hipparchus.analysis.UnivariateFunction`. + + Parameters: + function (:class:`~org.hipparchus.analysis.UnivariateFunction`): function to differentiate + + Returns: + differential function + + + """ + ... class UnivariateMatrixFunctionDifferentiator: - def differentiate(self, univariateMatrixFunction: typing.Union[org.hipparchus.analysis.UnivariateMatrixFunction, typing.Callable]) -> UnivariateDifferentiableMatrixFunction: ... + """ + public interfaceUnivariateMatrixFunctionDifferentiator + + Interface defining the function differentiation operation. + """ + def differentiate(self, univariateMatrixFunction: typing.Union[org.hipparchus.analysis.UnivariateMatrixFunction, typing.Callable]) -> UnivariateDifferentiableMatrixFunction: + """ + Create an implementation of a :class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableMatrixFunction` + from a regular :class:`~org.hipparchus.analysis.UnivariateMatrixFunction`. + + Parameters: + function (:class:`~org.hipparchus.analysis.UnivariateMatrixFunction`): function to differentiate + + Returns: + differential function + + + """ + ... class UnivariateVectorFunctionDifferentiator: - def differentiate(self, univariateVectorFunction: typing.Union[org.hipparchus.analysis.UnivariateVectorFunction, typing.Callable]) -> UnivariateDifferentiableVectorFunction: ... + """ + public interfaceUnivariateVectorFunctionDifferentiator + + Interface defining the function differentiation operation. + """ + def differentiate(self, univariateVectorFunction: typing.Union[org.hipparchus.analysis.UnivariateVectorFunction, typing.Callable]) -> UnivariateDifferentiableVectorFunction: + """ + Create an implementation of a :class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableVectorFunction` + from a regular :class:`~org.hipparchus.analysis.UnivariateVectorFunction`. + + Parameters: + function (:class:`~org.hipparchus.analysis.UnivariateVectorFunction`): function to differentiate + + Returns: + differential function + + + """ + ... _Derivative__T = typing.TypeVar('_Derivative__T', bound=org.hipparchus.CalculusFieldElement) # <T> class Derivative(org.hipparchus.CalculusFieldElement[_Derivative__T], DifferentialAlgebra, typing.Generic[_Derivative__T]): - def acos(self) -> _Derivative__T: ... - @typing.overload - def add(self, t: _Derivative__T) -> _Derivative__T: ... + """ + public interfaceDerivative<T extends :class:`~org.hipparchus.CalculusFieldElement`<T>>extends :class:`~org.hipparchus.CalculusFieldElement`<T>, :class:`~org.hipparchus.analysis.differentiation.DifferentialAlgebra` + + Interface representing both the value and the differentials of a function. + + Since: + 1.7 + """ + def acos(self) -> _Derivative__T: + """ + Arc cosine operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.acos` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + acos(this) + + + """ + ... + @typing.overload + def add(self, t: _Derivative__T) -> _Derivative__T: + """ + '+' operator. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.add` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + a (double): right hand side parameter of the operator + + Returns: + this+a + + + """ + ... @typing.overload def add(self, double: float) -> _Derivative__T: ... def compose(self, *double: float) -> _Derivative__T: ... - def cosh(self) -> _Derivative__T: ... - def getExponent(self) -> int: ... + def cosh(self) -> _Derivative__T: + """ + Hyperbolic cosine operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.cosh` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + cosh(this) + + + """ + ... + def getExponent(self) -> int: + """ + Return the exponent of the instance, removing the bias. + + For double numbers of the form 2 :sup:`x` , the unbiased exponent is exactly x. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.getExponent` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + exponent for the instance, without bias + + + """ + ... def getPartialDerivative(self, *int: int) -> float: ... - def getReal(self) -> float: ... - def getValue(self) -> float: ... - def log10(self) -> _Derivative__T: ... - @typing.overload - def pow(self, t: _Derivative__T) -> _Derivative__T: ... + def getReal(self) -> float: + """ + Get the real value of the number. + + Specified by: + :meth:`~org.hipparchus.FieldElement.getReal` in interface :class:`~org.hipparchus.FieldElement` + + Returns: + real value + + + """ + ... + def getValue(self) -> float: + """ + Get the value part of the function. + + Returns: + value part of the value of the function + + + """ + ... + def log10(self) -> _Derivative__T: + """ + Base 10 logarithm. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.log10` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + base 10 logarithm of the instance + + + """ + ... + @typing.overload + def pow(self, t: _Derivative__T) -> _Derivative__T: + """ + Power operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.pow` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + e (:class:`~org.hipparchus.analysis.differentiation.Derivative`): exponent + + Returns: + this :sup:`e` + + + """ + ... @typing.overload def pow(self, double: float) -> _Derivative__T: ... @typing.overload def pow(self, int: int) -> _Derivative__T: ... @typing.overload - def remainder(self, t: _Derivative__T) -> _Derivative__T: ... + def remainder(self, t: _Derivative__T) -> _Derivative__T: + """ + IEEE remainder operator. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.remainder` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + a (double): right hand side parameter of the operator + + Returns: + this - n × a where n is the closest integer to this/a + + + """ + ... @typing.overload def remainder(self, double: float) -> _Derivative__T: ... - def sinh(self) -> _Derivative__T: ... - @typing.overload - def subtract(self, double: float) -> _Derivative__T: ... + def sinh(self) -> _Derivative__T: + """ + Hyperbolic sine operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.sinh` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + sinh(this) + + + """ + ... + @typing.overload + def subtract(self, double: float) -> _Derivative__T: + """ + '-' operator. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.subtract` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + a (double): right hand side parameter of the operator + + Returns: + this-a + + + """ + ... @typing.overload def subtract(self, t: _Derivative__T) -> _Derivative__T: ... - def withValue(self, double: float) -> _Derivative__T: ... + def withValue(self, double: float) -> _Derivative__T: + """ + Create a new object with new value (zeroth-order derivative, as passed as input) and same derivatives of order one and + above. + + This default implementation is there so that no API gets broken by the next release, which is not a major one. Custom + inheritors should probably overwrite it. + + Parameters: + value (double): zeroth-order derivative of new represented function + + Returns: + new object with changed value + + Since: + 3.1 + + + """ + ... _FieldDerivative__S = typing.TypeVar('_FieldDerivative__S', bound=org.hipparchus.CalculusFieldElement) # <S> _FieldDerivative__T = typing.TypeVar('_FieldDerivative__T', bound='FieldDerivative') # <T> class FieldDerivative(org.hipparchus.CalculusFieldElement[_FieldDerivative__T], DifferentialAlgebra, typing.Generic[_FieldDerivative__S, _FieldDerivative__T]): - def acos(self) -> _FieldDerivative__T: ... - @typing.overload - def add(self, t: _FieldDerivative__T) -> _FieldDerivative__T: ... + """ + public interfaceFieldDerivative<S extends :class:`~org.hipparchus.CalculusFieldElement`<S>,T extends FieldDerivative<S,T>>extends :class:`~org.hipparchus.CalculusFieldElement`<T>, :class:`~org.hipparchus.analysis.differentiation.DifferentialAlgebra` + + Interface representing both the value and the differentials of a function. + + Since: + 1.7 + + Also see: + + - :class:`~org.hipparchus.analysis.differentiation.Derivative` + """ + def acos(self) -> _FieldDerivative__T: + """ + Arc cosine operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.acos` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + acos(this) + + + """ + ... + @typing.overload + def add(self, t: _FieldDerivative__T) -> _FieldDerivative__T: + """ + '+' operator. + + Parameters: + a (:class:`~org.hipparchus.analysis.differentiation.FieldDerivative`): right hand side parameter of the operator + + Returns: + this+a + + Since: + 3.1 + + + """ + ... @typing.overload def add(self, double: float) -> _FieldDerivative__T: ... @typing.overload def add(self, s2: _FieldDerivative__S) -> _FieldDerivative__T: ... - def ceil(self) -> _FieldDerivative__T: ... - def cosh(self) -> _FieldDerivative__T: ... - def floor(self) -> _FieldDerivative__T: ... - def getExponent(self) -> int: ... + def ceil(self) -> _FieldDerivative__T: + """ + Get the smallest whole number larger than instance. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.ceil` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + ceil(this) + + + """ + ... + def cosh(self) -> _FieldDerivative__T: + """ + Hyperbolic cosine operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.cosh` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + cosh(this) + + + """ + ... + def floor(self) -> _FieldDerivative__T: + """ + Get the largest whole number smaller than instance. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.floor` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + floor(this) + + + """ + ... + def getExponent(self) -> int: + """ + Return the exponent of the instance, removing the bias. + + For double numbers of the form 2 :sup:`x` , the unbiased exponent is exactly x. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.getExponent` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + exponent for the instance, without bias + + + """ + ... def getPartialDerivative(self, *int: int) -> _FieldDerivative__S: ... - def getReal(self) -> float: ... - def getValue(self) -> _FieldDerivative__S: ... - def log10(self) -> _FieldDerivative__T: ... - @typing.overload - def newInstance(self, double: float) -> _FieldDerivative__T: ... + def getReal(self) -> float: + """ + Get the real value of the number. + + Specified by: + :meth:`~org.hipparchus.FieldElement.getReal` in interface :class:`~org.hipparchus.FieldElement` + + Returns: + real value + + + """ + ... + def getValue(self) -> _FieldDerivative__S: + """ + Get the value part of the function. + + Returns: + value part of the value of the function + + + """ + ... + def log10(self) -> _FieldDerivative__T: + """ + Base 10 logarithm. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.log10` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + base 10 logarithm of the instance + + + """ + ... + @typing.overload + def newInstance(self, double: float) -> _FieldDerivative__T: + """ + Create an instance corresponding to a constant Field value. + + This default implementation is there so that no API gets broken by the next release, which is not a major one. Custom + inheritors should probably overwrite it. + + Parameters: + value (:class:`~org.hipparchus.analysis.differentiation.FieldDerivative`): constant value + + Returns: + instance corresponding to a constant Field value + + Since: + 3.1 + + + """ + ... @typing.overload def newInstance(self, s2: _FieldDerivative__S) -> _FieldDerivative__T: ... @typing.overload - def pow(self, double: float) -> _FieldDerivative__T: ... + def pow(self, double: float) -> _FieldDerivative__T: + """ + Power operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.pow` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + e (:class:`~org.hipparchus.analysis.differentiation.FieldDerivative`): exponent + + Returns: + this :sup:`e` + + + """ + ... @typing.overload def pow(self, int: int) -> _FieldDerivative__T: ... @typing.overload def pow(self, t: _FieldDerivative__T) -> _FieldDerivative__T: ... - def rint(self) -> _FieldDerivative__T: ... - def sign(self) -> _FieldDerivative__T: ... - def sinh(self) -> _FieldDerivative__T: ... - @typing.overload - def subtract(self, double: float) -> _FieldDerivative__T: ... + def rint(self) -> _FieldDerivative__T: + """ + Get the whole number that is the nearest to the instance, or the even one if x is exactly half way between two integers. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.rint` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + a double number r such that r is an integer r - 0.5 ≤ this ≤ r + 0.5 + + + """ + ... + def sign(self) -> _FieldDerivative__T: + """ + Compute the sign of the instance. The sign is -1 for negative numbers, +1 for positive numbers and 0 otherwise, for + Complex number, it is extended on the unit circle (equivalent to z/|z|, with special handling for 0 and NaN) + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.sign` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + -1.0, -0.0, +0.0, +1.0 or NaN depending on sign of a + + + """ + ... + def sinh(self) -> _FieldDerivative__T: + """ + Hyperbolic sine operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.sinh` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + sinh(this) + + + """ + ... + @typing.overload + def subtract(self, double: float) -> _FieldDerivative__T: + """ + '-' operator. + + Parameters: + a (:class:`~org.hipparchus.analysis.differentiation.FieldDerivative`): right hand side parameter of the operator + + Returns: + this-a + + Since: + 3.1 + + + """ + ... @typing.overload def subtract(self, t: _FieldDerivative__T) -> _FieldDerivative__T: ... @typing.overload def subtract(self, s2: _FieldDerivative__S) -> _FieldDerivative__T: ... - def ulp(self) -> _FieldDerivative__T: ... - def withValue(self, s2: _FieldDerivative__S) -> _FieldDerivative__T: ... + def ulp(self) -> _FieldDerivative__T: + """ + Compute least significant bit (Unit in Last Position) for a number. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.ulp` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + ulp(this) + + + """ + ... + def withValue(self, s2: _FieldDerivative__S) -> _FieldDerivative__T: + """ + Create a new object with new value (zeroth-order derivative, as passed as input) and same derivatives of order one and + above. + + This default implementation is there so that no API gets broken by the next release, which is not a major one. Custom + inheritors should probably overwrite it. + + Parameters: + value (:class:`~org.hipparchus.analysis.differentiation.FieldDerivative`): zeroth-order derivative of new represented function + + Returns: + new object with changed value + + Since: + 3.1 + + + """ + ... _FieldTaylorMap__T = typing.TypeVar('_FieldTaylorMap__T', bound=org.hipparchus.CalculusFieldElement) # <T> class FieldTaylorMap(DifferentialAlgebra, typing.Generic[_FieldTaylorMap__T]): + """ + public classFieldTaylorMap<T extends :class:`~org.hipparchus.CalculusFieldElement`<T>> extends :class:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.analysis.differentiation.DifferentialAlgebra` + + Container for a Taylor map. + + A Taylor map is a set of n :class:`~org.hipparchus.analysis.differentiation.DerivativeStructure` \((f_1, f_2, \ldots, + f_n)\) depending on m parameters \((p_1, p_2, \ldots, p_m)\), with positive n and m. + + Since: + 2.2 + """ @typing.overload def __init__(self, tArray: typing.Union[typing.List[_FieldTaylorMap__T], jpype.JArray], fieldDerivativeStructureArray: typing.Union[typing.List['FieldDerivativeStructure'[_FieldTaylorMap__T]], jpype.JArray]): ... @typing.overload def __init__(self, field: org.hipparchus.Field[_FieldTaylorMap__T], int: int, int2: int, int3: int): ... def compose(self, fieldTaylorMap: 'FieldTaylorMap'[_FieldTaylorMap__T]) -> 'FieldTaylorMap'[_FieldTaylorMap__T]: ... - def getFreeParameters(self) -> int: ... + def getFreeParameters(self) -> int: + """ + Get the number of free parameters. + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.DifferentialAlgebra.getFreeParameters` in + interface :class:`~org.hipparchus.analysis.differentiation.DifferentialAlgebra` + + Returns: + number of free parameters + + + """ + ... def getFunction(self, int: int) -> 'FieldDerivativeStructure'[_FieldTaylorMap__T]: ... - def getNbFunctions(self) -> int: ... - def getNbParameters(self) -> int: ... - def getOrder(self) -> int: ... - def getPoint(self) -> typing.MutableSequence[_FieldTaylorMap__T]: ... + def getNbFunctions(self) -> int: + """ + Get the number of functions of the map. + + Returns: + number of functions of the map + + + """ + ... + def getNbParameters(self) -> int: + """ + Deprecated. + Get the number of parameters of the map. + + Returns: + number of parameters of the map + + + """ + ... + def getOrder(self) -> int: + """ + Get the maximum derivation order. + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.DifferentialAlgebra.getOrder` in + interface :class:`~org.hipparchus.analysis.differentiation.DifferentialAlgebra` + + Returns: + maximum derivation order + + + """ + ... + def getPoint(self) -> typing.MutableSequence[_FieldTaylorMap__T]: + """ + Get the point at which map is evaluated. + + Returns: + point at which map is evaluated + + + """ + ... def invert(self, fieldMatrixDecomposer: typing.Union[org.hipparchus.linear.FieldMatrixDecomposer[_FieldTaylorMap__T], typing.Callable[[org.hipparchus.linear.FieldMatrix[org.hipparchus.FieldElement]], org.hipparchus.linear.FieldDecompositionSolver[org.hipparchus.FieldElement]]]) -> 'FieldTaylorMap'[_FieldTaylorMap__T]: ... @typing.overload - def value(self, *double: float) -> typing.MutableSequence[_FieldTaylorMap__T]: ... + def value(self, *double: float) -> typing.MutableSequence[_FieldTaylorMap__T]: + """ + Evaluate Taylor expansion of the map at some offset. + + Parameters: + deltaP (double...): parameters offsets \((\Delta p_1, \Delta p_2, \ldots, \Delta p_n)\) + + Returns: + value of the Taylor expansion at \((p_1 + \Delta p_1, p_2 + \Delta p_2, \ldots, p_n + \Delta p_n)\) + + Evaluate Taylor expansion of the map at some offset. + + Parameters: + deltaP (:class:`~org.hipparchus.analysis.differentiation.FieldTaylorMap`...): parameters offsets \((\Delta p_1, \Delta p_2, \ldots, \Delta p_n)\) + + Returns: + value of the Taylor expansion at \((p_1 + \Delta p_1, p_2 + \Delta p_2, \ldots, p_n + \Delta p_n)\) + + + """ + ... @typing.overload def value(self, *t: _FieldTaylorMap__T) -> typing.MutableSequence[_FieldTaylorMap__T]: ... class FiniteDifferencesDifferentiator(UnivariateFunctionDifferentiator, UnivariateVectorFunctionDifferentiator, UnivariateMatrixFunctionDifferentiator, java.io.Serializable): + """ + public classFiniteDifferencesDifferentiator extends :class:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.analysis.differentiation.UnivariateFunctionDifferentiator`, :class:`~org.hipparchus.analysis.differentiation.UnivariateVectorFunctionDifferentiator`, :class:`~org.hipparchus.analysis.differentiation.UnivariateMatrixFunctionDifferentiator`, :class:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + Univariate functions differentiator using finite differences. + + This class creates some wrapper objects around regular :class:`~org.hipparchus.analysis.UnivariateFunction` (or + :class:`~org.hipparchus.analysis.UnivariateVectorFunction` or + :class:`~org.hipparchus.analysis.UnivariateMatrixFunction`). These wrapper objects compute derivatives in addition to + function values. + + The wrapper objects work by calling the underlying function on a sampling grid around the current point and performing + polynomial interpolation. A finite differences scheme with n points is theoretically able to compute derivatives up to + order n-1, but it is generally better to have a slight margin. The step size must also be small enough in order for the + polynomial approximation to be good in the current point neighborhood, but it should not be too small because numerical + instability appears quickly (there are several differences of close points). Choosing the number of points and the step + size is highly problem dependent. + + As an example of good and bad settings, lets consider the quintic polynomial function :code:`f(x) = + (x-1)*(x-0.5)*x*(x+0.5)*(x+1)`. Since it is a polynomial, finite differences with at least 6 points should theoretically + recover the exact same polynomial and hence compute accurate derivatives for any order. However, due to numerical + errors, we get the following results for a 7 points finite differences for abscissae in the [-10, 10] range: + + - step size = 0.25, second order derivative error about 9.97e-10 + - step size = 0.25, fourth order derivative error about 5.43e-8 + - step size = 1.0e-6, second order derivative error about 148 + - step size = 1.0e-6, fourth order derivative error about 6.35e+14 + + + This example shows that the small step size is really bad, even simply for second order derivative! + + Also see: + + - :meth:`~serialized` + """ @typing.overload def __init__(self, int: int, double: float): ... @typing.overload def __init__(self, int: int, double: float, double2: float, double3: float): ... @typing.overload - def differentiate(self, univariateFunction: typing.Union[org.hipparchus.analysis.UnivariateFunction, typing.Callable]) -> UnivariateDifferentiableFunction: ... + def differentiate(self, univariateFunction: typing.Union[org.hipparchus.analysis.UnivariateFunction, typing.Callable]) -> UnivariateDifferentiableFunction: + """ + Create an implementation of a :class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction` from a + regular :class:`~org.hipparchus.analysis.UnivariateFunction`. + + The returned object cannot compute derivatives to arbitrary orders. The value function will throw a + :class:`~org.hipparchus.exception.MathIllegalArgumentException` if the requested derivation order is larger or equal to + the number of points. + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.UnivariateFunctionDifferentiator.differentiate` in + interface :class:`~org.hipparchus.analysis.differentiation.UnivariateFunctionDifferentiator` + + Parameters: + function (:class:`~org.hipparchus.analysis.UnivariateFunction`): function to differentiate + + Returns: + differential function + + Create an implementation of a :class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableVectorFunction` + from a regular :class:`~org.hipparchus.analysis.UnivariateVectorFunction`. + + The returned object cannot compute derivatives to arbitrary orders. The value function will throw a + :class:`~org.hipparchus.exception.MathIllegalArgumentException` if the requested derivation order is larger or equal to + the number of points. + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.UnivariateVectorFunctionDifferentiator.differentiate` in + interface :class:`~org.hipparchus.analysis.differentiation.UnivariateVectorFunctionDifferentiator` + + Parameters: + function (:class:`~org.hipparchus.analysis.UnivariateVectorFunction`): function to differentiate + + Returns: + differential function + + Create an implementation of a :class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableMatrixFunction` + from a regular :class:`~org.hipparchus.analysis.UnivariateMatrixFunction`. + + The returned object cannot compute derivatives to arbitrary orders. The value function will throw a + :class:`~org.hipparchus.exception.MathIllegalArgumentException` if the requested derivation order is larger or equal to + the number of points. + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.UnivariateMatrixFunctionDifferentiator.differentiate` in + interface :class:`~org.hipparchus.analysis.differentiation.UnivariateMatrixFunctionDifferentiator` + + Parameters: + function (:class:`~org.hipparchus.analysis.UnivariateMatrixFunction`): function to differentiate + + Returns: + differential function + + + """ + ... @typing.overload def differentiate(self, univariateMatrixFunction: typing.Union[org.hipparchus.analysis.UnivariateMatrixFunction, typing.Callable]) -> UnivariateDifferentiableMatrixFunction: ... @typing.overload def differentiate(self, univariateVectorFunction: typing.Union[org.hipparchus.analysis.UnivariateVectorFunction, typing.Callable]) -> UnivariateDifferentiableVectorFunction: ... - def getNbPoints(self) -> int: ... - def getStepSize(self) -> float: ... + def getNbPoints(self) -> int: + """ + Get the number of points to use. + + Returns: + number of points to use + + + """ + ... + def getStepSize(self) -> float: + """ + Get the step size. + + Returns: + step size + + + """ + ... class TaylorMap(DifferentialAlgebra): + """ + public classTaylorMap extends :class:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.analysis.differentiation.DifferentialAlgebra` + + Container for a Taylor map. + + A Taylor map is a set of n :class:`~org.hipparchus.analysis.differentiation.DerivativeStructure` \((f_1, f_2, \ldots, + f_n)\) depending on m parameters \((p_1, p_2, \ldots, p_m)\), with positive n and m. + + Since: + 2.2 + """ @typing.overload def __init__(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], derivativeStructureArray: typing.Union[typing.List['DerivativeStructure'], jpype.JArray]): ... @typing.overload def __init__(self, int: int, int2: int, int3: int): ... - def compose(self, taylorMap: 'TaylorMap') -> 'TaylorMap': ... - def getFreeParameters(self) -> int: ... - def getFunction(self, int: int) -> 'DerivativeStructure': ... - def getNbFunctions(self) -> int: ... - def getNbParameters(self) -> int: ... - def getOrder(self) -> int: ... - def getPoint(self) -> typing.MutableSequence[float]: ... - def invert(self, matrixDecomposer: typing.Union[org.hipparchus.linear.MatrixDecomposer, typing.Callable]) -> 'TaylorMap': ... - def value(self, *double: float) -> typing.MutableSequence[float]: ... + def compose(self, taylorMap: 'TaylorMap') -> 'TaylorMap': + """ + Compose the instance with another Taylor map as \(\mathrm{this} \circ \mathrm{other}\). + + Parameters: + other (:class:`~org.hipparchus.analysis.differentiation.TaylorMap`): map with which instance must be composed + + Returns: + composed map \(\mathrm{this} \circ \mathrm{other}\) + + + """ + ... + def getFreeParameters(self) -> int: + """ + Get the number of free parameters. + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.DifferentialAlgebra.getFreeParameters` in + interface :class:`~org.hipparchus.analysis.differentiation.DifferentialAlgebra` + + Returns: + number of free parameters + + + """ + ... + def getFunction(self, int: int) -> 'DerivativeStructure': + """ + Get a function from the map. + + Parameters: + i (int): index of the function (must be between 0 included and + :meth:`~org.hipparchus.analysis.differentiation.TaylorMap.getNbFunctions` excluded + + Returns: + function at index i + + + """ + ... + def getNbFunctions(self) -> int: + """ + Get the number of functions of the map. + + Returns: + number of functions of the map + + + """ + ... + def getNbParameters(self) -> int: + """ + Deprecated. + Get the number of parameters of the map. + + Returns: + number of parameters of the map + + + """ + ... + def getOrder(self) -> int: + """ + Get the maximum derivation order. + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.DifferentialAlgebra.getOrder` in + interface :class:`~org.hipparchus.analysis.differentiation.DifferentialAlgebra` + + Returns: + maximum derivation order + + + """ + ... + def getPoint(self) -> typing.MutableSequence[float]: + """ + Get the point at which map is evaluated. + + Returns: + point at which map is evaluated + + + """ + ... + def invert(self, matrixDecomposer: typing.Union[org.hipparchus.linear.MatrixDecomposer, typing.Callable]) -> 'TaylorMap': + """ + Invert the instance. + + Consider :meth:`~org.hipparchus.analysis.differentiation.TaylorMap.value` of the map with small parameters offsets + \((\Delta p_1, \Delta p_2, \ldots, \Delta p_n)\) which leads to evaluation offsets \((f_1 + df_1, f_2 + df_2, \ldots, + f_n + df_n)\). The map inversion defines a Taylor map that computes \((\Delta p_1, \Delta p_2, \ldots, \Delta p_n)\) + from \((df_1, df_2, \ldots, df_n)\). + + The map must be square to be invertible (i.e. the number of functions and the number of parameters in the functions must + match) + + Parameters: + decomposer (:class:`~org.hipparchus.linear.MatrixDecomposer`): matrix decomposer to user for inverting the linear part + + Returns: + inverted map + + Also see: + + - :class:`~org.hipparchus.analysis.differentiation.https:.doi.org.10.1016.S1076` + + + + """ + ... + def value(self, *double: float) -> typing.MutableSequence[float]: + """ + Evaluate Taylor expansion of the map at some offset. + + Parameters: + deltaP (double...): parameters offsets \((\Delta p_1, \Delta p_2, \ldots, \Delta p_n)\) + + Returns: + value of the Taylor expansion at \((p_1 + \Delta p_1, p_2 + \Delta p_2, \ldots, p_n + \Delta p_n)\) + + + """ + ... _Derivative1__T = typing.TypeVar('_Derivative1__T', bound=org.hipparchus.CalculusFieldElement) # <T> class Derivative1(Derivative[_Derivative1__T], typing.Generic[_Derivative1__T]): - def acos(self) -> _Derivative1__T: ... - def acosh(self) -> _Derivative1__T: ... - def asin(self) -> _Derivative1__T: ... - def asinh(self) -> _Derivative1__T: ... - def atan(self) -> _Derivative1__T: ... - def atanh(self) -> _Derivative1__T: ... - def cbrt(self) -> _Derivative1__T: ... - @typing.overload - def compose(self, *double: float) -> _Derivative1__T: ... + """ + public interfaceDerivative1<T extends :class:`~org.hipparchus.CalculusFieldElement`<T>>extends :class:`~org.hipparchus.analysis.differentiation.Derivative`<T> + + Interface representing an object holding partial derivatives up to first order. + + Since: + 3.1 + + Also see: + + - :class:`~org.hipparchus.analysis.differentiation.Derivative` + - :class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative1` + - :class:`~org.hipparchus.analysis.differentiation.Gradient` + - :class:`~org.hipparchus.analysis.differentiation.SparseGradient` + """ + def acos(self) -> _Derivative1__T: + """ + Arc cosine operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.acos` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.Derivative.acos` in + interface :class:`~org.hipparchus.analysis.differentiation.Derivative` + + Returns: + acos(this) + + + """ + ... + def acosh(self) -> _Derivative1__T: + """ + Inverse hyperbolic cosine operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.acosh` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + acosh(this) + + + """ + ... + def asin(self) -> _Derivative1__T: + """ + Arc sine operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.asin` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + asin(this) + + + """ + ... + def asinh(self) -> _Derivative1__T: + """ + Inverse hyperbolic sine operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.asinh` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + asin(this) + + + """ + ... + def atan(self) -> _Derivative1__T: + """ + Arc tangent operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.atan` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + atan(this) + + + """ + ... + def atanh(self) -> _Derivative1__T: + """ + Inverse hyperbolic tangent operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.atanh` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + atanh(this) + + + """ + ... + def cbrt(self) -> _Derivative1__T: + """ + Cubic root. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.cbrt` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + cubic root of the instance + + + """ + ... + @typing.overload + def compose(self, *double: float) -> _Derivative1__T: + """ + Compute composition of the instance by a univariate function differentiable at order 1. + + Parameters: + f0 (double): value of function + f1 (double): first-order derivative + + Returns: + f(this) + + + """ + ... @typing.overload def compose(self, double: float, double2: float) -> _Derivative1__T: ... - def cos(self) -> _Derivative1__T: ... - def cosh(self) -> _Derivative1__T: ... - def exp(self) -> _Derivative1__T: ... - def expm1(self) -> _Derivative1__T: ... - def getOrder(self) -> int: ... - def log(self) -> _Derivative1__T: ... - def log10(self) -> _Derivative1__T: ... - def log1p(self) -> _Derivative1__T: ... - def reciprocal(self) -> _Derivative1__T: ... - def rootN(self, int: int) -> _Derivative1__T: ... - def sin(self) -> _Derivative1__T: ... + def cos(self) -> _Derivative1__T: + """ + Cosine operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.cos` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + cos(this) + + + """ + ... + def cosh(self) -> _Derivative1__T: + """ + Hyperbolic cosine operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.cosh` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.Derivative.cosh` in + interface :class:`~org.hipparchus.analysis.differentiation.Derivative` + + Returns: + cosh(this) + + + """ + ... + def exp(self) -> _Derivative1__T: + """ + Exponential. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.exp` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + exponential of the instance + + + """ + ... + def expm1(self) -> _Derivative1__T: + """ + Exponential minus 1. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.expm1` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + exponential minus one of the instance + + + """ + ... + def getOrder(self) -> int: + """ + Get the maximum derivation order. + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.DifferentialAlgebra.getOrder` in + interface :class:`~org.hipparchus.analysis.differentiation.DifferentialAlgebra` + + Returns: + maximum derivation order + + + """ + ... + def log(self) -> _Derivative1__T: + """ + Natural logarithm. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.log` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + logarithm of the instance + + + """ + ... + def log10(self) -> _Derivative1__T: + """ + Base 10 logarithm. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.log10` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.Derivative.log10` in + interface :class:`~org.hipparchus.analysis.differentiation.Derivative` + + Returns: + base 10 logarithm of the instance + + + """ + ... + def log1p(self) -> _Derivative1__T: + """ + Shifted natural logarithm. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.log1p` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + logarithm of one plus the instance + + + """ + ... + def reciprocal(self) -> _Derivative1__T: + """ + Returns the multiplicative inverse of :code:`this` element. + + Specified by: + :meth:`~org.hipparchus.FieldElement.reciprocal` in interface :class:`~org.hipparchus.FieldElement` + + Returns: + the inverse of :code:`this`. + + + """ + ... + def rootN(self, int: int) -> _Derivative1__T: + """ + N :sup:`th` root. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.rootN` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + n (int): order of the root + + Returns: + n :sup:`th` root of the instance + + + """ + ... + def sin(self) -> _Derivative1__T: + """ + Sine operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.sin` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + sin(this) + + + """ + ... def sinCos(self) -> org.hipparchus.util.FieldSinCos[_Derivative1__T]: ... - def sinh(self) -> _Derivative1__T: ... + def sinh(self) -> _Derivative1__T: + """ + Hyperbolic sine operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.sinh` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.Derivative.sinh` in + interface :class:`~org.hipparchus.analysis.differentiation.Derivative` + + Returns: + sinh(this) + + + """ + ... def sinhCosh(self) -> org.hipparchus.util.FieldSinhCosh[_Derivative1__T]: ... - def sqrt(self) -> _Derivative1__T: ... - def square(self) -> _Derivative1__T: ... - def tan(self) -> _Derivative1__T: ... - def tanh(self) -> _Derivative1__T: ... + def sqrt(self) -> _Derivative1__T: + """ + Square root. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.sqrt` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + square root of the instance + + + """ + ... + def square(self) -> _Derivative1__T: + """ + Compute this × this. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.square` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + a new element representing this × this + + + """ + ... + def tan(self) -> _Derivative1__T: + """ + Tangent operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.tan` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + tan(this) + + + """ + ... + def tanh(self) -> _Derivative1__T: + """ + Hyperbolic tangent operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.tanh` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + tanh(this) + + + """ + ... class DerivativeStructure(Derivative['DerivativeStructure'], java.io.Serializable): - def abs(self) -> 'DerivativeStructure': ... - def acos(self) -> 'DerivativeStructure': ... - def acosh(self) -> 'DerivativeStructure': ... + """ + public classDerivativeStructure extends :class:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.analysis.differentiation.Derivative`<:class:`~org.hipparchus.analysis.differentiation.DerivativeStructure`>, :class:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + Class representing both the value and the differentials of a function. + + This class is the workhorse of the differentiation package. + + This class is an implementation of the extension to Rall's numbers described in Dan Kalman's paper `Doubly Recursive + Multivariate Automatic Differentiation <http://www.dankalman.net/AUhome/pdffiles/mmgautodiff.pdf>`, Mathematics + Magazine, vol. 75, no. 3, June 2002. Rall's numbers are an extension to the real numbers used throughout mathematical + expressions; they hold the derivative together with the value of a function. Dan Kalman's derivative structures hold all + partial derivatives up to any specified order, with respect to any number of free parameters. Rall's numbers therefore + can be seen as derivative structures for order one derivative and one free parameter, and real numbers can be seen as + derivative structures with zero order derivative and no free parameters. + + :class:`~org.hipparchus.analysis.differentiation.DerivativeStructure` instances can be used directly thanks to the + arithmetic operators to the mathematical functions provided as methods by this class (+, -, *, /, %, sin, cos ...). + + Implementing complex expressions by hand using these classes is a tedious and error-prone task but has the advantage of + having no limitation on the derivation order despite not requiring users to compute the derivatives by themselves. + Implementing complex expression can also be done by developing computation code using standard primitive double values + and to use :class:`~org.hipparchus.analysis.differentiation.UnivariateFunctionDifferentiator` to create the + :class:`~org.hipparchus.analysis.differentiation.DerivativeStructure`-based instances. This method is simpler but may be + limited in the accuracy and derivation orders and may be computationally intensive (this is typically the case for + :class:`~org.hipparchus.analysis.differentiation.FiniteDifferencesDifferentiator`. + + Instances of this class are guaranteed to be immutable. + + Also see: + + - :class:`~org.hipparchus.analysis.differentiation.DSCompiler` + - :class:`~org.hipparchus.analysis.differentiation.FieldDerivativeStructure` + - :meth:`~serialized` + """ + def abs(self) -> 'DerivativeStructure': + """ + absolute value. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.abs` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + abs(this) + + + """ + ... + def acos(self) -> 'DerivativeStructure': + """ + Arc cosine operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.acos` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.Derivative.acos` in + interface :class:`~org.hipparchus.analysis.differentiation.Derivative` + + Returns: + acos(this) + + + """ + ... + def acosh(self) -> 'DerivativeStructure': + """ + Inverse hyperbolic cosine operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.acosh` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + acosh(this) + + + """ + ... @typing.overload def add(self, double: float) -> org.hipparchus.CalculusFieldElement: ... @typing.overload def add(self, derivativeStructure: 'DerivativeStructure') -> 'DerivativeStructure': ... - def asin(self) -> 'DerivativeStructure': ... - def asinh(self) -> 'DerivativeStructure': ... - def atan(self) -> 'DerivativeStructure': ... - @typing.overload - def atan2(self, derivativeStructure: 'DerivativeStructure') -> 'DerivativeStructure': ... + def asin(self) -> 'DerivativeStructure': + """ + Arc sine operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.asin` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + asin(this) + + + """ + ... + def asinh(self) -> 'DerivativeStructure': + """ + Inverse hyperbolic sine operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.asinh` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + asin(this) + + + """ + ... + def atan(self) -> 'DerivativeStructure': + """ + Arc tangent operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.atan` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + atan(this) + + + """ + ... + @typing.overload + def atan2(self, derivativeStructure: 'DerivativeStructure') -> 'DerivativeStructure': + """ + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if number of free parameters or orders are inconsistent + + public static :class:`~org.hipparchus.analysis.differentiation.DerivativeStructure` atan2(:class:`~org.hipparchus.analysis.differentiation.DerivativeStructure` y, :class:`~org.hipparchus.analysis.differentiation.DerivativeStructure` x) throws :class:`~org.hipparchus.exception.MathIllegalArgumentException` + + Two arguments arc tangent operation. + + Parameters: + y (:class:`~org.hipparchus.analysis.differentiation.DerivativeStructure`): first argument of the arc tangent + x (:class:`~org.hipparchus.analysis.differentiation.DerivativeStructure`): second argument of the arc tangent + + Returns: + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if number of free parameters or orders do not match + + + """ + ... @typing.overload @staticmethod def atan2(derivativeStructure: 'DerivativeStructure', derivativeStructure2: 'DerivativeStructure') -> 'DerivativeStructure': ... - def atanh(self) -> 'DerivativeStructure': ... + def atanh(self) -> 'DerivativeStructure': + """ + Inverse hyperbolic tangent operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.atanh` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + atanh(this) + + + """ + ... def compose(self, *double: float) -> 'DerivativeStructure': ... @typing.overload - def copySign(self, double: float) -> 'DerivativeStructure': ... + def copySign(self, double: float) -> 'DerivativeStructure': + """ + Returns the instance with the sign of the argument. A NaN :code:`sign` argument is treated as positive. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.copySign` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + sign (:class:`~org.hipparchus.analysis.differentiation.DerivativeStructure`): the sign for the returned value + + Returns: + the instance with the same sign as the :code:`sign` argument + + Returns the instance with the sign of the argument. A NaN :code:`sign` argument is treated as positive. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.copySign` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + sign (double): the sign for the returned value + + Returns: + the instance with the same sign as the :code:`sign` argument + + + """ + ... @typing.overload def copySign(self, derivativeStructure: 'DerivativeStructure') -> 'DerivativeStructure': ... - def cos(self) -> 'DerivativeStructure': ... - def cosh(self) -> 'DerivativeStructure': ... - def differentiate(self, int: int, int2: int) -> 'DerivativeStructure': ... - @typing.overload - def divide(self, double: float) -> 'DerivativeStructure': ... + def cos(self) -> 'DerivativeStructure': + """ + Cosine operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.cos` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + cos(this) + + + """ + ... + def cosh(self) -> 'DerivativeStructure': + """ + Hyperbolic cosine operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.cosh` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.Derivative.cosh` in + interface :class:`~org.hipparchus.analysis.differentiation.Derivative` + + Returns: + cosh(this) + + + """ + ... + def differentiate(self, int: int, int2: int) -> 'DerivativeStructure': + """ + Differentiate w.r.t. one independent variable. + + Rigorously, if the derivatives of a function are known up to order N, the ones of its M-th derivative w.r.t. a given + variable (seen as a function itself) are only known up to order N-M. However, this method still casts the output as a + DerivativeStructure of order N with zeroes for the higher order terms. + + Parameters: + varIndex (int): Index of independent variable w.r.t. which differentiation is done. + differentiationOrder (int): Number of times the differentiation operator must be applied. If non-positive, call the integration operator instead. + + Returns: + DerivativeStructure on which differentiation operator has been applied a certain number of times + + Since: + 2.2 + + + """ + ... + @typing.overload + def divide(self, double: float) -> 'DerivativeStructure': + """ + '÷' operator. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.divide` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + a (double): right hand side parameter of the operator + + Returns: + this÷a + + public :class:`~org.hipparchus.analysis.differentiation.DerivativeStructure` divide(:class:`~org.hipparchus.analysis.differentiation.DerivativeStructure` a) throws :class:`~org.hipparchus.exception.MathIllegalArgumentException` + + Compute this ÷ a. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.divide` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Specified by: + :meth:`~org.hipparchus.FieldElement.divide` in interface :class:`~org.hipparchus.FieldElement` + + Parameters: + a (:class:`~org.hipparchus.analysis.differentiation.DerivativeStructure`): element to divide by + + Returns: + a new element representing this ÷ a + + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if number of free parameters or orders do not match + + + """ + ... @typing.overload def divide(self, derivativeStructure: 'DerivativeStructure') -> 'DerivativeStructure': ... - def equals(self, object: typing.Any) -> bool: ... - def exp(self) -> 'DerivativeStructure': ... - def expm1(self) -> 'DerivativeStructure': ... - def getAllDerivatives(self) -> typing.MutableSequence[float]: ... - def getFactory(self) -> DSFactory: ... + def equals(self, object: typing.Any) -> bool: + """ + Test for the equality of two derivative structures. + + Derivative structures are considered equal if they have the same number of free parameters, the same derivation order, + and the same derivatives. + + Overrides: + :meth:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.equals` in + class :class:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Parameters: + other (:class:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object`): Object to test for equality to this + + Returns: + true if two derivative structures are equal + + + """ + ... + def exp(self) -> 'DerivativeStructure': + """ + Exponential. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.exp` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + exponential of the instance + + + """ + ... + def expm1(self) -> 'DerivativeStructure': + """ + Exponential minus 1. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.expm1` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + exponential minus one of the instance + + + """ + ... + def getAllDerivatives(self) -> typing.MutableSequence[float]: + """ + Get all partial derivatives. + + Returns: + a fresh copy of partial derivatives, in an array sorted according to + :meth:`~org.hipparchus.analysis.differentiation.DSCompiler.getPartialDerivativeIndex` + + + """ + ... + def getFactory(self) -> DSFactory: + """ + Get the factory that built the instance. + + Returns: + factory that built the instance + + + """ + ... def getField(self) -> org.hipparchus.Field['DerivativeStructure']: ... - def getFreeParameters(self) -> int: ... - def getOrder(self) -> int: ... + def getFreeParameters(self) -> int: + """ + Get the number of free parameters. + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.DifferentialAlgebra.getFreeParameters` in + interface :class:`~org.hipparchus.analysis.differentiation.DifferentialAlgebra` + + Returns: + number of free parameters + + + """ + ... + def getOrder(self) -> int: + """ + Get the maximum derivation order. + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.DifferentialAlgebra.getOrder` in + interface :class:`~org.hipparchus.analysis.differentiation.DifferentialAlgebra` + + Returns: + maximum derivation order + + + """ + ... def getPartialDerivative(self, *int: int) -> float: ... - def getPi(self) -> 'DerivativeStructure': ... - def getValue(self) -> float: ... - def hashCode(self) -> int: ... + def getPi(self) -> 'DerivativeStructure': + """ + Get the Archimedes constant Ï€. + + Archimedes constant is the ratio of a circle's circumference to its diameter. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.getPi` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + Archimedes constant Ï€ + + + """ + ... + def getValue(self) -> float: + """ + Get the value part of the derivative structure. + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.Derivative.getValue` in + interface :class:`~org.hipparchus.analysis.differentiation.Derivative` + + Returns: + value part of the derivative structure + + Also see: + + - :meth:`~org.hipparchus.analysis.differentiation.DerivativeStructure.getPartialDerivative` + + + + """ + ... + def hashCode(self) -> int: + """ + Get a hashCode for the derivative structure. + + Overrides: + :meth:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.hashCode` in + class :class:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Returns: + a hash code value for this object + + + """ + ... @typing.overload def hypot(self, derivativeStructure: 'DerivativeStructure') -> 'DerivativeStructure': ... @typing.overload @staticmethod def hypot(derivativeStructure: 'DerivativeStructure', derivativeStructure2: 'DerivativeStructure') -> 'DerivativeStructure': ... - def integrate(self, int: int, int2: int) -> 'DerivativeStructure': ... + def integrate(self, int: int, int2: int) -> 'DerivativeStructure': + """ + Integrate w.r.t. one independent variable. + + Rigorously, if the derivatives of a function are known up to order N, the ones of its M-th integral w.r.t. a given + variable (seen as a function itself) are actually known up to order N+M. However, this method still casts the output as + a DerivativeStructure of order N. The integration constants are systematically set to zero. + + Parameters: + varIndex (int): Index of independent variable w.r.t. which integration is done. + integrationOrder (int): Number of times the integration operator must be applied. If non-positive, call the differentiation operator. + + Returns: + DerivativeStructure on which integration operator has been applied a certain number of times. + + Since: + 2.2 + + + """ + ... @typing.overload def linearCombination(self, double: float, derivativeStructure: 'DerivativeStructure', double2: float, derivativeStructure2: 'DerivativeStructure') -> 'DerivativeStructure': ... @typing.overload @@ -602,19 +3800,172 @@ class DerivativeStructure(Derivative['DerivativeStructure'], java.io.Serializabl def linearCombination(self, derivativeStructure: 'DerivativeStructure', derivativeStructure2: 'DerivativeStructure', derivativeStructure3: 'DerivativeStructure', derivativeStructure4: 'DerivativeStructure', derivativeStructure5: 'DerivativeStructure', derivativeStructure6: 'DerivativeStructure', derivativeStructure7: 'DerivativeStructure', derivativeStructure8: 'DerivativeStructure') -> 'DerivativeStructure': ... @typing.overload def linearCombination(self, derivativeStructureArray: typing.Union[typing.List['DerivativeStructure'], jpype.JArray], derivativeStructureArray2: typing.Union[typing.List['DerivativeStructure'], jpype.JArray]) -> 'DerivativeStructure': ... - def log(self) -> 'DerivativeStructure': ... - def log10(self) -> 'DerivativeStructure': ... - def log1p(self) -> 'DerivativeStructure': ... - @typing.overload - def multiply(self, int: int) -> org.hipparchus.FieldElement: ... + def log(self) -> 'DerivativeStructure': + """ + Natural logarithm. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.log` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + logarithm of the instance + + + """ + ... + def log10(self) -> 'DerivativeStructure': + """ + Base 10 logarithm. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.log10` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.Derivative.log10` in + interface :class:`~org.hipparchus.analysis.differentiation.Derivative` + + Returns: + base 10 logarithm of the instance + + + """ + ... + def log1p(self) -> 'DerivativeStructure': + """ + Shifted natural logarithm. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.log1p` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + logarithm of one plus the instance + + + """ + ... + @typing.overload + def multiply(self, int: int) -> org.hipparchus.FieldElement: + """ + '×' operator. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.multiply` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + a (double): right hand side parameter of the operator + + Returns: + this×a + + public :class:`~org.hipparchus.analysis.differentiation.DerivativeStructure` multiply(:class:`~org.hipparchus.analysis.differentiation.DerivativeStructure` a) throws :class:`~org.hipparchus.exception.MathIllegalArgumentException` + + Compute this × a. + + Specified by: + :meth:`~org.hipparchus.FieldElement.multiply` in interface :class:`~org.hipparchus.FieldElement` + + Parameters: + a (:class:`~org.hipparchus.analysis.differentiation.DerivativeStructure`): element to multiply + + Returns: + a new element representing this × a + + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if number of free parameters or orders do not match + + + """ + ... @typing.overload def multiply(self, double: float) -> 'DerivativeStructure': ... @typing.overload def multiply(self, derivativeStructure: 'DerivativeStructure') -> 'DerivativeStructure': ... - def negate(self) -> 'DerivativeStructure': ... - def newInstance(self, double: float) -> 'DerivativeStructure': ... - @typing.overload - def pow(self, double: float) -> 'DerivativeStructure': ... + def negate(self) -> 'DerivativeStructure': + """ + Returns the additive inverse of :code:`this` element. + + Specified by: + :meth:`~org.hipparchus.FieldElement.negate` in interface :class:`~org.hipparchus.FieldElement` + + Returns: + the opposite of :code:`this`. + + + """ + ... + def newInstance(self, double: float) -> 'DerivativeStructure': + """ + Create an instance corresponding to a constant real value. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.newInstance` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + value (double): constant real value + + Returns: + instance corresponding to a constant real value + + + """ + ... + @typing.overload + def pow(self, double: float) -> 'DerivativeStructure': + """ + Compute a :sup:`x` where a is a double and x a :class:`~org.hipparchus.analysis.differentiation.DerivativeStructure` + + Parameters: + a (double): number to exponentiate + x (:class:`~org.hipparchus.analysis.differentiation.DerivativeStructure`): power to apply + + Returns: + a :sup:`x` + + Power operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.pow` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + p (double): power to apply + + Returns: + this :sup:`p` + + Integer power operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.pow` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + n (int): power to apply + + Returns: + this :sup:`n` + + public :class:`~org.hipparchus.analysis.differentiation.DerivativeStructure` pow(:class:`~org.hipparchus.analysis.differentiation.DerivativeStructure` e) throws :class:`~org.hipparchus.exception.MathIllegalArgumentException` + + Power operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.pow` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.Derivative.pow` in + interface :class:`~org.hipparchus.analysis.differentiation.Derivative` + + Parameters: + e (:class:`~org.hipparchus.analysis.differentiation.DerivativeStructure`): exponent + + Returns: + this :sup:`e` + + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if number of free parameters or orders do not match + + + """ + ... @typing.overload def pow(self, int: int) -> 'DerivativeStructure': ... @typing.overload @@ -622,62 +3973,585 @@ class DerivativeStructure(Derivative['DerivativeStructure'], java.io.Serializabl @typing.overload @staticmethod def pow(double: float, derivativeStructure: 'DerivativeStructure') -> 'DerivativeStructure': ... - def rebase(self, *derivativeStructure: 'DerivativeStructure') -> 'DerivativeStructure': ... - def reciprocal(self) -> 'DerivativeStructure': ... + def rebase(self, *derivativeStructure: 'DerivativeStructure') -> 'DerivativeStructure': + """ + Rebase instance with respect to low level parameter functions. + + The instance is considered to be a function of + :meth:`~org.hipparchus.analysis.differentiation.DerivativeStructure.getFreeParameters` up to order + :meth:`~org.hipparchus.analysis.differentiation.DerivativeStructure.getOrder` \(f(p_0, p_1, \ldots p_{n-1})\). Its + :meth:`~org.hipparchus.analysis.differentiation.DerivativeStructure.getPartialDerivative` are therefore \(f, + \frac{\partial f}{\partial p_0}, \frac{\partial f}{\partial p_1}, \ldots \frac{\partial^2 f}{\partial p_0^2}, + \frac{\partial^2 f}{\partial p_0 p_1}, \ldots \frac{\partial^o f}{\partial p_{n-1}^o}\). The free parameters \(p_0, p_1, + \ldots p_{n-1}\) are considered to be functions of \(m\) lower level other parameters \(q_0, q_1, \ldots q_{m-1}\). + \( \begin{align} p_0 & = p_0(q_0, q_1, \ldots q_{m-1})\\ p_1 & = p_1(q_0, q_1, \ldots q_{m-1})\\ p_{n-1} & = + p_{n-1}(q_0, q_1, \ldots q_{m-1}) \end{align}\) + + This method compute the composition of the partial derivatives of \(f\) and the partial derivatives of \(p_0, p_1, + \ldots p_{n-1}\), i.e. the :meth:`~org.hipparchus.analysis.differentiation.DerivativeStructure.getPartialDerivative` of + the value returned will be \(f, \frac{\partial f}{\partial q_0}, \frac{\partial f}{\partial q_1}, \ldots + \frac{\partial^2 f}{\partial q_0^2}, \frac{\partial^2 f}{\partial q_0 q_1}, \ldots \frac{\partial^o f}{\partial + q_{m-1}^o}\). + + The number of parameters must match + :meth:`~org.hipparchus.analysis.differentiation.DerivativeStructure.getFreeParameters` and the derivation orders of the + instance and parameters must also match. + + Parameters: + p (:class:`~org.hipparchus.analysis.differentiation.DerivativeStructure`...): base parameters with respect to which partial derivatives were computed in the instance + + Returns: + derivative structure with partial derivatives computed with respect to the lower level parameters used in the \(p_i\) + + Since: + 2.2 + + + """ + ... + def reciprocal(self) -> 'DerivativeStructure': + """ + Returns the multiplicative inverse of :code:`this` element. + + Specified by: + :meth:`~org.hipparchus.FieldElement.reciprocal` in interface :class:`~org.hipparchus.FieldElement` + + Returns: + the inverse of :code:`this`. + + + """ + ... @typing.overload def remainder(self, double: float) -> org.hipparchus.CalculusFieldElement: ... @typing.overload def remainder(self, derivativeStructure: 'DerivativeStructure') -> 'DerivativeStructure': ... - def rootN(self, int: int) -> 'DerivativeStructure': ... - def scalb(self, int: int) -> 'DerivativeStructure': ... - def sin(self) -> 'DerivativeStructure': ... + def rootN(self, int: int) -> 'DerivativeStructure': + """ + N :sup:`th` root. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.rootN` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + n (int): order of the root + + Returns: + n :sup:`th` root of the instance + + + """ + ... + def scalb(self, int: int) -> 'DerivativeStructure': + """ + Multiply the instance by a power of 2. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.scalb` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + n (int): power of 2 + + Returns: + this × 2 :sup:`n` + + + """ + ... + def sin(self) -> 'DerivativeStructure': + """ + Sine operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.sin` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + sin(this) + + + """ + ... def sinCos(self) -> org.hipparchus.util.FieldSinCos['DerivativeStructure']: ... - def sinh(self) -> 'DerivativeStructure': ... + def sinh(self) -> 'DerivativeStructure': + """ + Hyperbolic sine operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.sinh` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.Derivative.sinh` in + interface :class:`~org.hipparchus.analysis.differentiation.Derivative` + + Returns: + sinh(this) + + + """ + ... def sinhCosh(self) -> org.hipparchus.util.FieldSinhCosh['DerivativeStructure']: ... - def sqrt(self) -> 'DerivativeStructure': ... - def square(self) -> 'DerivativeStructure': ... + def sqrt(self) -> 'DerivativeStructure': + """ + Square root. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.sqrt` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + square root of the instance + + + """ + ... + def square(self) -> 'DerivativeStructure': + """ + Compute this × this. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.square` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + a new element representing this × this + + + """ + ... @typing.overload def subtract(self, double: float) -> org.hipparchus.CalculusFieldElement: ... @typing.overload def subtract(self, derivativeStructure: 'DerivativeStructure') -> 'DerivativeStructure': ... - def tan(self) -> 'DerivativeStructure': ... - def tanh(self) -> 'DerivativeStructure': ... + def tan(self) -> 'DerivativeStructure': + """ + Tangent operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.tan` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + tan(this) + + + """ + ... + def tanh(self) -> 'DerivativeStructure': + """ + Hyperbolic tangent operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.tanh` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + tanh(this) + + + """ + ... def taylor(self, *double: float) -> float: ... - def toDegrees(self) -> 'DerivativeStructure': ... - def toRadians(self) -> 'DerivativeStructure': ... - def withValue(self, double: float) -> 'DerivativeStructure': ... + def toDegrees(self) -> 'DerivativeStructure': + """ + Convert radians to degrees, with error of less than 0.5 ULP + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.toDegrees` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + instance converted into degrees + + + """ + ... + def toRadians(self) -> 'DerivativeStructure': + """ + Convert degrees to radians, with error of less than 0.5 ULP + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.toRadians` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + instance converted into radians + + + """ + ... + def withValue(self, double: float) -> 'DerivativeStructure': + """ + Create a new object with new value (zeroth-order derivative, as passed as input) and same derivatives of order one and + above. + + This default implementation is there so that no API gets broken by the next release, which is not a major one. Custom + inheritors should probably overwrite it. + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.Derivative.withValue` in + interface :class:`~org.hipparchus.analysis.differentiation.Derivative` + + Parameters: + value (double): zeroth-order derivative of new represented function + + Returns: + new object with changed value + + + """ + ... _FieldDerivative1__S = typing.TypeVar('_FieldDerivative1__S', bound=org.hipparchus.CalculusFieldElement) # <S> _FieldDerivative1__T = typing.TypeVar('_FieldDerivative1__T', bound=FieldDerivative) # <T> class FieldDerivative1(FieldDerivative[_FieldDerivative1__S, _FieldDerivative1__T], typing.Generic[_FieldDerivative1__S, _FieldDerivative1__T]): - def acos(self) -> _FieldDerivative1__T: ... - def acosh(self) -> _FieldDerivative1__T: ... - def asin(self) -> _FieldDerivative1__T: ... - def asinh(self) -> _FieldDerivative1__T: ... - def atan(self) -> _FieldDerivative1__T: ... - def atanh(self) -> _FieldDerivative1__T: ... - def cbrt(self) -> _FieldDerivative1__T: ... - def compose(self, s2: _FieldDerivative1__S, s3: _FieldDerivative1__S) -> _FieldDerivative1__T: ... - def cos(self) -> _FieldDerivative1__T: ... - def cosh(self) -> _FieldDerivative1__T: ... - def exp(self) -> _FieldDerivative1__T: ... - def expm1(self) -> _FieldDerivative1__T: ... - def getOrder(self) -> int: ... - def log(self) -> _FieldDerivative1__T: ... - def log10(self) -> _FieldDerivative1__T: ... - def log1p(self) -> _FieldDerivative1__T: ... - def reciprocal(self) -> _FieldDerivative1__T: ... - def sin(self) -> _FieldDerivative1__T: ... + """ + public interfaceFieldDerivative1<S extends :class:`~org.hipparchus.CalculusFieldElement`<S>,T extends :class:`~org.hipparchus.analysis.differentiation.FieldDerivative`<S,T>>extends :class:`~org.hipparchus.analysis.differentiation.FieldDerivative`<S,T> + + Interface representing a Field object holding partial derivatives up to first order. + + Since: + 3.1 + + Also see: + + - :class:`~org.hipparchus.analysis.differentiation.FieldDerivative` + - :class:`~org.hipparchus.analysis.differentiation.FieldUnivariateDerivative1` + - :class:`~org.hipparchus.analysis.differentiation.FieldGradient` + - :class:`~org.hipparchus.analysis.differentiation.Derivative1` + """ + def acos(self) -> _FieldDerivative1__T: + """ + Arc cosine operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.acos` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.FieldDerivative.acos` in + interface :class:`~org.hipparchus.analysis.differentiation.FieldDerivative` + + Returns: + acos(this) + + + """ + ... + def acosh(self) -> _FieldDerivative1__T: + """ + Inverse hyperbolic cosine operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.acosh` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + acosh(this) + + + """ + ... + def asin(self) -> _FieldDerivative1__T: + """ + Arc sine operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.asin` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + asin(this) + + + """ + ... + def asinh(self) -> _FieldDerivative1__T: + """ + Inverse hyperbolic sine operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.asinh` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + asin(this) + + + """ + ... + def atan(self) -> _FieldDerivative1__T: + """ + Arc tangent operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.atan` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + atan(this) + + + """ + ... + def atanh(self) -> _FieldDerivative1__T: + """ + Inverse hyperbolic tangent operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.atanh` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + atanh(this) + + + """ + ... + def cbrt(self) -> _FieldDerivative1__T: + """ + Cubic root. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.cbrt` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + cubic root of the instance + + + """ + ... + def compose(self, s2: _FieldDerivative1__S, s3: _FieldDerivative1__S) -> _FieldDerivative1__T: + """ + Compute composition of the instance by a univariate function differentiable at order 1. + + Parameters: + f0 (:class:`~org.hipparchus.analysis.differentiation.FieldDerivative1`): value of function + f1 (:class:`~org.hipparchus.analysis.differentiation.FieldDerivative1`): first-order derivative + + Returns: + f(this) + + + """ + ... + def cos(self) -> _FieldDerivative1__T: + """ + Cosine operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.cos` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + cos(this) + + + """ + ... + def cosh(self) -> _FieldDerivative1__T: + """ + Hyperbolic cosine operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.cosh` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.FieldDerivative.cosh` in + interface :class:`~org.hipparchus.analysis.differentiation.FieldDerivative` + + Returns: + cosh(this) + + + """ + ... + def exp(self) -> _FieldDerivative1__T: + """ + Exponential. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.exp` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + exponential of the instance + + + """ + ... + def expm1(self) -> _FieldDerivative1__T: + """ + Exponential minus 1. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.expm1` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + exponential minus one of the instance + + + """ + ... + def getOrder(self) -> int: + """ + Get the maximum derivation order. + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.DifferentialAlgebra.getOrder` in + interface :class:`~org.hipparchus.analysis.differentiation.DifferentialAlgebra` + + Returns: + maximum derivation order + + + """ + ... + def log(self) -> _FieldDerivative1__T: + """ + Natural logarithm. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.log` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + logarithm of the instance + + + """ + ... + def log10(self) -> _FieldDerivative1__T: + """ + Base 10 logarithm. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.log10` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.FieldDerivative.log10` in + interface :class:`~org.hipparchus.analysis.differentiation.FieldDerivative` + + Returns: + base 10 logarithm of the instance + + + """ + ... + def log1p(self) -> _FieldDerivative1__T: + """ + Shifted natural logarithm. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.log1p` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + logarithm of one plus the instance + + + """ + ... + def reciprocal(self) -> _FieldDerivative1__T: + """ + Returns the multiplicative inverse of :code:`this` element. + + Specified by: + :meth:`~org.hipparchus.FieldElement.reciprocal` in interface :class:`~org.hipparchus.FieldElement` + + Returns: + the inverse of :code:`this`. + + + """ + ... + def sin(self) -> _FieldDerivative1__T: + """ + Sine operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.sin` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + sin(this) + + + """ + ... def sinCos(self) -> org.hipparchus.util.FieldSinCos[_FieldDerivative1__T]: ... - def sinh(self) -> _FieldDerivative1__T: ... + def sinh(self) -> _FieldDerivative1__T: + """ + Hyperbolic sine operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.sinh` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.FieldDerivative.sinh` in + interface :class:`~org.hipparchus.analysis.differentiation.FieldDerivative` + + Returns: + sinh(this) + + + """ + ... def sinhCosh(self) -> org.hipparchus.util.FieldSinhCosh[_FieldDerivative1__T]: ... - def sqrt(self) -> _FieldDerivative1__T: ... - def square(self) -> _FieldDerivative1__T: ... - def tan(self) -> _FieldDerivative1__T: ... - def tanh(self) -> _FieldDerivative1__T: ... + def sqrt(self) -> _FieldDerivative1__T: + """ + Square root. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.sqrt` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + square root of the instance + + + """ + ... + def square(self) -> _FieldDerivative1__T: + """ + Compute this × this. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.square` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + a new element representing this × this + + + """ + ... + def tan(self) -> _FieldDerivative1__T: + """ + Tangent operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.tan` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + tan(this) + + + """ + ... + def tanh(self) -> _FieldDerivative1__T: + """ + Hyperbolic tangent operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.tanh` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + tanh(this) + + + """ + ... _FieldDerivativeStructure__T = typing.TypeVar('_FieldDerivativeStructure__T', bound=org.hipparchus.CalculusFieldElement) # <T> class FieldDerivativeStructure(FieldDerivative[_FieldDerivativeStructure__T, 'FieldDerivativeStructure'[_FieldDerivativeStructure__T]], typing.Generic[_FieldDerivativeStructure__T]): + """ + public classFieldDerivativeStructure<T extends :class:`~org.hipparchus.CalculusFieldElement`<T>> extends :class:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.analysis.differentiation.FieldDerivative`<T,:class:`~org.hipparchus.analysis.differentiation.FieldDerivativeStructure`<T>> + + Class representing both the value and the differentials of a function. + + This class is similar to :class:`~org.hipparchus.analysis.differentiation.DerivativeStructure` except function + parameters and value can be any :class:`~org.hipparchus.CalculusFieldElement`. + + Instances of this class are guaranteed to be immutable. + + Also see: + + - :class:`~org.hipparchus.analysis.differentiation.DerivativeStructure` + - :class:`~org.hipparchus.analysis.differentiation.FDSFactory` + - :class:`~org.hipparchus.analysis.differentiation.DSCompiler` + """ def abs(self) -> 'FieldDerivativeStructure'[_FieldDerivativeStructure__T]: ... def acos(self) -> 'FieldDerivativeStructure'[_FieldDerivativeStructure__T]: ... def acosh(self) -> 'FieldDerivativeStructure'[_FieldDerivativeStructure__T]: ... @@ -692,7 +4566,26 @@ class FieldDerivativeStructure(FieldDerivative[_FieldDerivativeStructure__T, 'Fi def atan(self) -> 'FieldDerivativeStructure'[_FieldDerivativeStructure__T]: ... _atan2_1__T = typing.TypeVar('_atan2_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload - def atan2(self, fieldDerivativeStructure: 'FieldDerivativeStructure'[_FieldDerivativeStructure__T]) -> 'FieldDerivativeStructure'[_FieldDerivativeStructure__T]: ... + def atan2(self, fieldDerivativeStructure: 'FieldDerivativeStructure'[_FieldDerivativeStructure__T]) -> 'FieldDerivativeStructure'[_FieldDerivativeStructure__T]: + """ + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if number of free parameters or orders are inconsistent + + public static <T extends :class:`~org.hipparchus.CalculusFieldElement`<T>> :class:`~org.hipparchus.analysis.differentiation.FieldDerivativeStructure`<T> atan2(:class:`~org.hipparchus.analysis.differentiation.FieldDerivativeStructure`<T> y, :class:`~org.hipparchus.analysis.differentiation.FieldDerivativeStructure`<T> x) throws :class:`~org.hipparchus.exception.MathIllegalArgumentException` + + Two arguments arc tangent operation. + + Parameters: + y (:class:`~org.hipparchus.analysis.differentiation.FieldDerivativeStructure`<T> y): first argument of the arc tangent + x (:class:`~org.hipparchus.analysis.differentiation.FieldDerivativeStructure`<T> x): second argument of the arc tangent + + Returns: + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if number of free parameters or orders do not match + + + """ + ... @typing.overload @staticmethod def atan2(fieldDerivativeStructure: 'FieldDerivativeStructure'[_atan2_1__T], fieldDerivativeStructure2: 'FieldDerivativeStructure'[_atan2_1__T]) -> 'FieldDerivativeStructure'[_atan2_1__T]: ... @@ -718,14 +4611,71 @@ class FieldDerivativeStructure(FieldDerivative[_FieldDerivativeStructure__T, 'Fi def divide(self, fieldDerivativeStructure: 'FieldDerivativeStructure'[_FieldDerivativeStructure__T]) -> 'FieldDerivativeStructure'[_FieldDerivativeStructure__T]: ... def exp(self) -> 'FieldDerivativeStructure'[_FieldDerivativeStructure__T]: ... def expm1(self) -> 'FieldDerivativeStructure'[_FieldDerivativeStructure__T]: ... - def getAllDerivatives(self) -> typing.MutableSequence[_FieldDerivativeStructure__T]: ... + def getAllDerivatives(self) -> typing.MutableSequence[_FieldDerivativeStructure__T]: + """ + Get all partial derivatives. + + Returns: + a fresh copy of partial derivatives, in an array sorted according to + :meth:`~org.hipparchus.analysis.differentiation.DSCompiler.getPartialDerivativeIndex` + + + """ + ... def getFactory(self) -> FDSFactory[_FieldDerivativeStructure__T]: ... def getField(self) -> org.hipparchus.Field['FieldDerivativeStructure'[_FieldDerivativeStructure__T]]: ... - def getFreeParameters(self) -> int: ... - def getOrder(self) -> int: ... + def getFreeParameters(self) -> int: + """ + Description copied from + interface: :meth:`~org.hipparchus.analysis.differentiation.DifferentialAlgebra.getFreeParameters` + Get the number of free parameters. + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.DifferentialAlgebra.getFreeParameters` in + interface :class:`~org.hipparchus.analysis.differentiation.DifferentialAlgebra` + + Returns: + number of free parameters + + + """ + ... + def getOrder(self) -> int: + """ + Description copied from interface: :meth:`~org.hipparchus.analysis.differentiation.DifferentialAlgebra.getOrder` + Get the maximum derivation order. + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.DifferentialAlgebra.getOrder` in + interface :class:`~org.hipparchus.analysis.differentiation.DifferentialAlgebra` + + Returns: + maximum derivation order + + + """ + ... def getPartialDerivative(self, *int: int) -> _FieldDerivativeStructure__T: ... def getPi(self) -> 'FieldDerivativeStructure'[_FieldDerivativeStructure__T]: ... - def getValue(self) -> _FieldDerivativeStructure__T: ... + def getValue(self) -> _FieldDerivativeStructure__T: + """ + Get the value part of the derivative structure. + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.FieldDerivative.getValue` in + interface :class:`~org.hipparchus.analysis.differentiation.FieldDerivative` + + Returns: + value part of the derivative structure + + Also see: + + - :meth:`~org.hipparchus.analysis.differentiation.FieldDerivativeStructure.getPartialDerivative` + + + + """ + ... _hypot_1__T = typing.TypeVar('_hypot_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload def hypot(self, fieldDerivativeStructure: 'FieldDerivativeStructure'[_FieldDerivativeStructure__T]) -> 'FieldDerivativeStructure'[_FieldDerivativeStructure__T]: ... @@ -782,7 +4732,67 @@ class FieldDerivativeStructure(FieldDerivative[_FieldDerivativeStructure__T, 'Fi def pow(self, fieldDerivativeStructure: 'FieldDerivativeStructure'[_FieldDerivativeStructure__T]) -> 'FieldDerivativeStructure'[_FieldDerivativeStructure__T]: ... @typing.overload @staticmethod - def pow(double: float, fieldDerivativeStructure: 'FieldDerivativeStructure'[_pow_3__T]) -> 'FieldDerivativeStructure'[_pow_3__T]: ... + def pow(double: float, fieldDerivativeStructure: 'FieldDerivativeStructure'[_pow_3__T]) -> 'FieldDerivativeStructure'[_pow_3__T]: + """ + Compute a :sup:`x` where a is a double and x a + :class:`~org.hipparchus.analysis.differentiation.FieldDerivativeStructure` + + Parameters: + a (double): number to exponentiate + x (:class:`~org.hipparchus.analysis.differentiation.FieldDerivativeStructure`<T> x): power to apply + + Returns: + a :sup:`x` + + public :class:`~org.hipparchus.analysis.differentiation.FieldDerivativeStructure`<:class:`~org.hipparchus.analysis.differentiation.FieldDerivativeStructure`> pow(double p) + + Power operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.pow` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + p (double): power to apply + + Returns: + this :sup:`p` + + public :class:`~org.hipparchus.analysis.differentiation.FieldDerivativeStructure`<:class:`~org.hipparchus.analysis.differentiation.FieldDerivativeStructure`> pow(int n) + + Integer power operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.pow` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + n (int): power to apply + + Returns: + this :sup:`n` + + public :class:`~org.hipparchus.analysis.differentiation.FieldDerivativeStructure`<:class:`~org.hipparchus.analysis.differentiation.FieldDerivativeStructure`> pow(:class:`~org.hipparchus.analysis.differentiation.FieldDerivativeStructure`<:class:`~org.hipparchus.analysis.differentiation.FieldDerivativeStructure`> e) throws :class:`~org.hipparchus.exception.MathIllegalArgumentException` + + Power operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.pow` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.FieldDerivative.pow` in + interface :class:`~org.hipparchus.analysis.differentiation.FieldDerivative` + + Parameters: + e (:class:`~org.hipparchus.analysis.differentiation.FieldDerivativeStructure`<:class:`~org.hipparchus.analysis.differentiation.FieldDerivativeStructure`> e): exponent + + Returns: + this :sup:`e` + + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if number of free parameters or orders do not match + + + """ + ... def rebase(self, *fieldDerivativeStructure: 'FieldDerivativeStructure'[_FieldDerivativeStructure__T]) -> 'FieldDerivativeStructure'[_FieldDerivativeStructure__T]: ... def reciprocal(self) -> 'FieldDerivativeStructure'[_FieldDerivativeStructure__T]: ... @typing.overload @@ -818,22 +4828,113 @@ class FieldDerivativeStructure(FieldDerivative[_FieldDerivativeStructure__T, 'Fi _FieldUnivariateDerivative__S = typing.TypeVar('_FieldUnivariateDerivative__S', bound=org.hipparchus.CalculusFieldElement) # <S> _FieldUnivariateDerivative__T = typing.TypeVar('_FieldUnivariateDerivative__T', bound='FieldUnivariateDerivative') # <T> class FieldUnivariateDerivative(FieldDerivative[_FieldUnivariateDerivative__S, _FieldUnivariateDerivative__T], typing.Generic[_FieldUnivariateDerivative__S, _FieldUnivariateDerivative__T]): + """ + public abstract classFieldUnivariateDerivative<S extends :class:`~org.hipparchus.CalculusFieldElement`<S>,T extends FieldUnivariateDerivative<S,T>> extends :class:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.analysis.differentiation.FieldDerivative`<S,T> + + Abstract class representing both the value and the differentials of a function. + + Since: + 1.7 + """ def __init__(self): ... def getDerivative(self, int: int) -> _FieldUnivariateDerivative__S: ... - def getFreeParameters(self) -> int: ... + def getFreeParameters(self) -> int: + """ + Get the number of free parameters. + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.DifferentialAlgebra.getFreeParameters` in + interface :class:`~org.hipparchus.analysis.differentiation.DifferentialAlgebra` + + Returns: + number of free parameters + + + """ + ... def getPartialDerivative(self, *int: int) -> _FieldUnivariateDerivative__S: ... def toDerivativeStructure(self) -> FieldDerivativeStructure[_FieldUnivariateDerivative__S]: ... _UnivariateDerivative__T = typing.TypeVar('_UnivariateDerivative__T', bound='UnivariateDerivative') # <T> class UnivariateDerivative(Derivative[_UnivariateDerivative__T], java.io.Serializable, java.lang.Comparable[_UnivariateDerivative__T], typing.Generic[_UnivariateDerivative__T]): + """ + public abstract classUnivariateDerivative<T extends UnivariateDerivative<T>> extends :class:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.analysis.differentiation.Derivative`<T>, :class:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable`, :class:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Comparable`<T> + + Abstract class representing both the value and the differentials of a function. + + Since: + 1.7 + + Also see: + + - :meth:`~serialized` + """ def __init__(self): ... def getDerivative(self, int: int) -> float: ... - def getFreeParameters(self) -> int: ... + def getFreeParameters(self) -> int: + """ + Get the number of free parameters. + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.DifferentialAlgebra.getFreeParameters` in + interface :class:`~org.hipparchus.analysis.differentiation.DifferentialAlgebra` + + Returns: + number of free parameters + + + """ + ... def getPartialDerivative(self, *int: int) -> float: ... - def toDerivativeStructure(self) -> DerivativeStructure: ... + def toDerivativeStructure(self) -> DerivativeStructure: + """ + Convert the instance to a :class:`~org.hipparchus.analysis.differentiation.DerivativeStructure`. + + Returns: + derivative structure with same value and derivative as the instance + + + """ + ... _FieldGradient__T = typing.TypeVar('_FieldGradient__T', bound=org.hipparchus.CalculusFieldElement) # <T> class FieldGradient(FieldDerivative1[_FieldGradient__T, 'FieldGradient'[_FieldGradient__T]], typing.Generic[_FieldGradient__T]): + """ + public classFieldGradient<T extends :class:`~org.hipparchus.CalculusFieldElement`<T>> extends :class:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.analysis.differentiation.FieldDerivative1`<T,:class:`~org.hipparchus.analysis.differentiation.FieldGradient`<T>> + + Class representing both the value and the differentials of a function. + + This class is a stripped-down version of :class:`~org.hipparchus.analysis.differentiation.FieldDerivativeStructure` with + :meth:`~org.hipparchus.analysis.differentiation.FieldDerivativeStructure.getOrder` limited to one. It should have less + overhead than :class:`~org.hipparchus.analysis.differentiation.FieldDerivativeStructure` in its domain. + + This class is an implementation of Rall's numbers. Rall's numbers are an extension to the real numbers used throughout + mathematical expressions; they hold the derivative together with the value of a function. + + :class:`~org.hipparchus.analysis.differentiation.FieldGradient` instances can be used directly thanks to the arithmetic + operators to the mathematical functions provided as methods by this class (+, -, *, /, %, sin, cos ...). + + Implementing complex expressions by hand using these classes is a tedious and error-prone task but has the advantage of + having no limitation on the derivation order despite not requiring users to compute the derivatives by themselves. + + Instances of this class are guaranteed to be immutable. + + Since: + 1.7 + + Also see: + + - :class:`~org.hipparchus.analysis.differentiation.DerivativeStructure` + - :class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative1` + - :class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative2` + - :class:`~org.hipparchus.analysis.differentiation.Gradient` + - :class:`~org.hipparchus.analysis.differentiation.FieldDerivativeStructure` + - :class:`~org.hipparchus.analysis.differentiation.FieldUnivariateDerivative1` + - :class:`~org.hipparchus.analysis.differentiation.FieldUnivariateDerivative2` + """ @typing.overload def __init__(self, t: _FieldGradient__T, *t2: _FieldGradient__T): ... @typing.overload @@ -849,7 +4950,20 @@ class FieldGradient(FieldDerivative1[_FieldGradient__T, 'FieldGradient'[_FieldGr def compose(self, t: _FieldGradient__T, t2: _FieldGradient__T) -> 'FieldGradient'[_FieldGradient__T]: ... _constant__T = typing.TypeVar('_constant__T', bound=org.hipparchus.CalculusFieldElement) # <T> @staticmethod - def constant(int: int, t: _constant__T) -> 'FieldGradient'[_constant__T]: ... + def constant(int: int, t: _constant__T) -> 'FieldGradient'[_constant__T]: + """ + Build an instance corresponding to a constant value. + + Parameters: + freeParameters (int): number of free parameters (i.e. dimension of the gradient) + value (T): constant value of the function + + Returns: + a :code:`FieldGradient` with a constant value and all derivatives set to 0.0 + + + """ + ... @typing.overload def copySign(self, double: float) -> 'FieldGradient'[_FieldGradient__T]: ... @typing.overload @@ -862,18 +4976,84 @@ class FieldGradient(FieldDerivative1[_FieldGradient__T, 'FieldGradient'[_FieldGr def divide(self, t: _FieldGradient__T) -> 'FieldGradient'[_FieldGradient__T]: ... @typing.overload def divide(self, fieldGradient: 'FieldGradient'[_FieldGradient__T]) -> 'FieldGradient'[_FieldGradient__T]: ... - def equals(self, object: typing.Any) -> bool: ... + def equals(self, object: typing.Any) -> bool: + """ + Test for the equality of two univariate derivatives. + + univariate derivatives are considered equal if they have the same derivatives. + + Overrides: + :meth:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.equals` in + class :class:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Parameters: + other (:class:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object`): Object to test for equality to this + + Returns: + true if two univariate derivatives are equal + + + """ + ... def getField(self) -> FieldGradientField[_FieldGradient__T]: ... - def getFreeParameters(self) -> int: ... - def getGradient(self) -> typing.MutableSequence[_FieldGradient__T]: ... + def getFreeParameters(self) -> int: + """ + Get the number of free parameters. + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.DifferentialAlgebra.getFreeParameters` in + interface :class:`~org.hipparchus.analysis.differentiation.DifferentialAlgebra` + + Returns: + number of free parameters + + + """ + ... + def getGradient(self) -> typing.MutableSequence[_FieldGradient__T]: + """ + Get the gradient part of the function. + + Returns: + gradient part of the value of the function + + + """ + ... @typing.overload def getPartialDerivative(self, int: int) -> _FieldGradient__T: ... @typing.overload def getPartialDerivative(self, *int: int) -> _FieldGradient__T: ... def getPi(self) -> 'FieldGradient'[_FieldGradient__T]: ... - def getValue(self) -> _FieldGradient__T: ... + def getValue(self) -> _FieldGradient__T: + """ + Get the value part of the function. + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.FieldDerivative.getValue` in + interface :class:`~org.hipparchus.analysis.differentiation.FieldDerivative` + + Returns: + value part of the value of the function + + + """ + ... def getValueField(self) -> org.hipparchus.Field[_FieldGradient__T]: ... - def hashCode(self) -> int: ... + def hashCode(self) -> int: + """ + Get a hashCode for the univariate derivative. + + Overrides: + :meth:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.hashCode` in + class :class:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Returns: + a hash code value for this object + + + """ + ... def hypot(self, fieldGradient: 'FieldGradient'[_FieldGradient__T]) -> 'FieldGradient'[_FieldGradient__T]: ... @typing.overload def linearCombination(self, double: float, fieldGradient: 'FieldGradient'[_FieldGradient__T], double2: float, fieldGradient2: 'FieldGradient'[_FieldGradient__T]) -> 'FieldGradient'[_FieldGradient__T]: ... @@ -917,7 +5097,46 @@ class FieldGradient(FieldDerivative1[_FieldGradient__T, 'FieldGradient'[_FieldGr def pow(self, int: int) -> 'FieldGradient'[_FieldGradient__T]: ... @typing.overload @staticmethod - def pow(double: float, fieldGradient: 'FieldGradient'[_pow_3__T]) -> 'FieldGradient'[_pow_3__T]: ... + def pow(double: float, fieldGradient: 'FieldGradient'[_pow_3__T]) -> 'FieldGradient'[_pow_3__T]: + """ + Compute a :sup:`x` where a is a double and x a :class:`~org.hipparchus.analysis.differentiation.FieldGradient` + + Parameters: + a (double): number to exponentiate + x (:class:`~org.hipparchus.analysis.differentiation.FieldGradient`<T> x): power to apply + + Returns: + a :sup:`x` + + public :class:`~org.hipparchus.analysis.differentiation.FieldGradient`<:class:`~org.hipparchus.analysis.differentiation.FieldGradient`> pow(double p) + + Power operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.pow` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + p (double): power to apply + + Returns: + this :sup:`p` + + public :class:`~org.hipparchus.analysis.differentiation.FieldGradient`<:class:`~org.hipparchus.analysis.differentiation.FieldGradient`> pow(int n) + + Integer power operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.pow` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + n (int): power to apply + + Returns: + this :sup:`n` + + + """ + ... @typing.overload def remainder(self, double: float) -> 'FieldGradient'[_FieldGradient__T]: ... @typing.overload @@ -935,7 +5154,27 @@ class FieldGradient(FieldDerivative1[_FieldGradient__T, 'FieldGradient'[_FieldGr @typing.overload def subtract(self, fieldGradient: 'FieldGradient'[_FieldGradient__T]) -> 'FieldGradient'[_FieldGradient__T]: ... @typing.overload - def taylor(self, *double: float) -> _FieldGradient__T: ... + def taylor(self, *double: float) -> _FieldGradient__T: + """ + Evaluate Taylor expansion of a gradient. + + Parameters: + delta (double...): parameters offsets (Δx, Δy, ...) + + Returns: + value of the Taylor expansion at x + Δx, y + Δy, ... + + Evaluate Taylor expansion of a gradient. + + Parameters: + delta (:class:`~org.hipparchus.analysis.differentiation.FieldGradient`...): parameters offsets (Δx, Δy, ...) + + Returns: + value of the Taylor expansion at x + Δx, y + Δy, ... + + + """ + ... @typing.overload def taylor(self, *t: _FieldGradient__T) -> _FieldGradient__T: ... def toDegrees(self) -> 'FieldGradient'[_FieldGradient__T]: ... @@ -943,11 +5182,64 @@ class FieldGradient(FieldDerivative1[_FieldGradient__T, 'FieldGradient'[_FieldGr def toRadians(self) -> 'FieldGradient'[_FieldGradient__T]: ... _variable__T = typing.TypeVar('_variable__T', bound=org.hipparchus.CalculusFieldElement) # <T> @staticmethod - def variable(int: int, int2: int, t: _variable__T) -> 'FieldGradient'[_variable__T]: ... + def variable(int: int, int2: int, t: _variable__T) -> 'FieldGradient'[_variable__T]: + """ + Build a :code:`Gradient` representing a variable. + + Instances built using this method are considered to be the free variables with respect to which differentials are + computed. As such, their differential with respect to themselves is +1. + + Parameters: + freeParameters (int): number of free parameters (i.e. dimension of the gradient) + index (int): index of the variable (from 0 to :meth:`~org.hipparchus.analysis.differentiation.FieldGradient.getFreeParameters` - 1) + value (T): value of the variable + + Returns: + a :code:`FieldGradient` with a constant value and all derivatives set to 0.0 except the one at :code:`index` which will + be set to 1.0 + + + """ + ... def withValue(self, t: _FieldGradient__T) -> 'FieldGradient'[_FieldGradient__T]: ... _FieldUnivariateDerivative1__T = typing.TypeVar('_FieldUnivariateDerivative1__T', bound=org.hipparchus.CalculusFieldElement) # <T> class FieldUnivariateDerivative1(FieldUnivariateDerivative[_FieldUnivariateDerivative1__T, 'FieldUnivariateDerivative1'[_FieldUnivariateDerivative1__T]], FieldDerivative1[_FieldUnivariateDerivative1__T, 'FieldUnivariateDerivative1'[_FieldUnivariateDerivative1__T]], typing.Generic[_FieldUnivariateDerivative1__T]): + """ + public classFieldUnivariateDerivative1<T extends :class:`~org.hipparchus.CalculusFieldElement`<T>> extends :class:`~org.hipparchus.analysis.differentiation.FieldUnivariateDerivative`<T,:class:`~org.hipparchus.analysis.differentiation.FieldUnivariateDerivative1`<T>> + implements :class:`~org.hipparchus.analysis.differentiation.FieldDerivative1`<T,:class:`~org.hipparchus.analysis.differentiation.FieldUnivariateDerivative1`<T>> + + Class representing both the value and the differentials of a function. + + This class is a stripped-down version of :class:`~org.hipparchus.analysis.differentiation.FieldDerivativeStructure` with + only one :meth:`~org.hipparchus.analysis.differentiation.FieldDerivativeStructure.getFreeParameters` and + :meth:`~org.hipparchus.analysis.differentiation.FieldDerivativeStructure.getOrder` also limited to one. It should have + less overhead than :class:`~org.hipparchus.analysis.differentiation.FieldDerivativeStructure` in its domain. + + This class is an implementation of Rall's numbers. Rall's numbers are an extension to the real numbers used throughout + mathematical expressions; they hold the derivative together with the value of a function. + + :class:`~org.hipparchus.analysis.differentiation.FieldUnivariateDerivative1` instances can be used directly thanks to + the arithmetic operators to the mathematical functions provided as methods by this class (+, -, *, /, %, sin, cos ...). + + Implementing complex expressions by hand using these classes is a tedious and error-prone task but has the advantage of + having no limitation on the derivation order despite not requiring users to compute the derivatives by themselves. + + Instances of this class are guaranteed to be immutable. + + Since: + 1.7 + + Also see: + + - :class:`~org.hipparchus.analysis.differentiation.DerivativeStructure` + - :class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative1` + - :class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative2` + - :class:`~org.hipparchus.analysis.differentiation.Gradient` + - :class:`~org.hipparchus.analysis.differentiation.FieldDerivativeStructure` + - :class:`~org.hipparchus.analysis.differentiation.FieldUnivariateDerivative2` + - :class:`~org.hipparchus.analysis.differentiation.FieldGradient` + """ @typing.overload def __init__(self, t: _FieldUnivariateDerivative1__T, t2: _FieldUnivariateDerivative1__T): ... @typing.overload @@ -973,14 +5265,90 @@ class FieldUnivariateDerivative1(FieldUnivariateDerivative[_FieldUnivariateDeriv def divide(self, t: _FieldUnivariateDerivative1__T) -> 'FieldUnivariateDerivative1'[_FieldUnivariateDerivative1__T]: ... @typing.overload def divide(self, fieldUnivariateDerivative1: 'FieldUnivariateDerivative1'[_FieldUnivariateDerivative1__T]) -> 'FieldUnivariateDerivative1'[_FieldUnivariateDerivative1__T]: ... - def equals(self, object: typing.Any) -> bool: ... - def getDerivative(self, int: int) -> _FieldUnivariateDerivative1__T: ... + def equals(self, object: typing.Any) -> bool: + """ + Test for the equality of two univariate derivatives. + + univariate derivatives are considered equal if they have the same derivatives. + + Overrides: + :meth:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.equals` in + class :class:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Parameters: + other (:class:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object`): Object to test for equality to this + + Returns: + true if two univariate derivatives are equal + + + """ + ... + def getDerivative(self, int: int) -> _FieldUnivariateDerivative1__T: + """ + Get a derivative from the univariate derivative. + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.FieldUnivariateDerivative.getDerivative` in + class :class:`~org.hipparchus.analysis.differentiation.FieldUnivariateDerivative` + + Parameters: + n (int): derivation order (must be between 0 and :meth:`~org.hipparchus.analysis.differentiation.DifferentialAlgebra.getOrder`, + both inclusive) + + Returns: + n :sup:`th` derivative, or :code:`NaN` if n is either negative or strictly larger than + :meth:`~org.hipparchus.analysis.differentiation.DifferentialAlgebra.getOrder` + + + """ + ... def getField(self) -> FieldUnivariateDerivative1Field[_FieldUnivariateDerivative1__T]: ... - def getFirstDerivative(self) -> _FieldUnivariateDerivative1__T: ... + def getFirstDerivative(self) -> _FieldUnivariateDerivative1__T: + """ + Get the first derivative. + + Returns: + first derivative + + Also see: + + - :meth:`~org.hipparchus.analysis.differentiation.FieldUnivariateDerivative1.getValue` + + + + """ + ... def getPi(self) -> 'FieldUnivariateDerivative1'[_FieldUnivariateDerivative1__T]: ... - def getValue(self) -> _FieldUnivariateDerivative1__T: ... + def getValue(self) -> _FieldUnivariateDerivative1__T: + """ + Get the value part of the univariate derivative. + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.FieldDerivative.getValue` in + interface :class:`~org.hipparchus.analysis.differentiation.FieldDerivative` + + Returns: + value part of the univariate derivative + + + """ + ... def getValueField(self) -> org.hipparchus.Field[_FieldUnivariateDerivative1__T]: ... - def hashCode(self) -> int: ... + def hashCode(self) -> int: + """ + Get a hashCode for the univariate derivative. + + Overrides: + :meth:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.hashCode` in + class :class:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Returns: + a hash code value for this object + + + """ + ... def hypot(self, fieldUnivariateDerivative1: 'FieldUnivariateDerivative1'[_FieldUnivariateDerivative1__T]) -> 'FieldUnivariateDerivative1'[_FieldUnivariateDerivative1__T]: ... @typing.overload def linearCombination(self, double: float, fieldUnivariateDerivative1: 'FieldUnivariateDerivative1'[_FieldUnivariateDerivative1__T], double2: float, fieldUnivariateDerivative12: 'FieldUnivariateDerivative1'[_FieldUnivariateDerivative1__T]) -> 'FieldUnivariateDerivative1'[_FieldUnivariateDerivative1__T]: ... @@ -1024,7 +5392,47 @@ class FieldUnivariateDerivative1(FieldUnivariateDerivative[_FieldUnivariateDeriv def pow(self, int: int) -> 'FieldUnivariateDerivative1'[_FieldUnivariateDerivative1__T]: ... @typing.overload @staticmethod - def pow(double: float, fieldUnivariateDerivative1: 'FieldUnivariateDerivative1'[_pow_3__T]) -> 'FieldUnivariateDerivative1'[_pow_3__T]: ... + def pow(double: float, fieldUnivariateDerivative1: 'FieldUnivariateDerivative1'[_pow_3__T]) -> 'FieldUnivariateDerivative1'[_pow_3__T]: + """ + Compute a :sup:`x` where a is a double and x a + :class:`~org.hipparchus.analysis.differentiation.FieldUnivariateDerivative1` + + Parameters: + a (double): number to exponentiate + x (:class:`~org.hipparchus.analysis.differentiation.FieldUnivariateDerivative1`<T> x): power to apply + + Returns: + a :sup:`x` + + public :class:`~org.hipparchus.analysis.differentiation.FieldUnivariateDerivative1`<:class:`~org.hipparchus.analysis.differentiation.FieldUnivariateDerivative1`> pow(double p) + + Power operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.pow` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + p (double): power to apply + + Returns: + this :sup:`p` + + public :class:`~org.hipparchus.analysis.differentiation.FieldUnivariateDerivative1`<:class:`~org.hipparchus.analysis.differentiation.FieldUnivariateDerivative1`> pow(int n) + + Integer power operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.pow` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + n (int): power to apply + + Returns: + this :sup:`n` + + + """ + ... @typing.overload def remainder(self, double: float) -> 'FieldUnivariateDerivative1'[_FieldUnivariateDerivative1__T]: ... @typing.overload @@ -1040,7 +5448,27 @@ class FieldUnivariateDerivative1(FieldUnivariateDerivative[_FieldUnivariateDeriv @typing.overload def subtract(self, fieldUnivariateDerivative1: 'FieldUnivariateDerivative1'[_FieldUnivariateDerivative1__T]) -> 'FieldUnivariateDerivative1'[_FieldUnivariateDerivative1__T]: ... @typing.overload - def taylor(self, double: float) -> _FieldUnivariateDerivative1__T: ... + def taylor(self, double: float) -> _FieldUnivariateDerivative1__T: + """ + Evaluate Taylor expansion of a univariate derivative. + + Parameters: + delta (double): parameter offset Δx + + Returns: + value of the Taylor expansion at x + Δx + + Evaluate Taylor expansion of a univariate derivative. + + Parameters: + delta (:class:`~org.hipparchus.analysis.differentiation.FieldUnivariateDerivative1`): parameter offset Δx + + Returns: + value of the Taylor expansion at x + Δx + + + """ + ... @typing.overload def taylor(self, t: _FieldUnivariateDerivative1__T) -> _FieldUnivariateDerivative1__T: ... def toDegrees(self) -> 'FieldUnivariateDerivative1'[_FieldUnivariateDerivative1__T]: ... @@ -1050,6 +5478,40 @@ class FieldUnivariateDerivative1(FieldUnivariateDerivative[_FieldUnivariateDeriv _FieldUnivariateDerivative2__T = typing.TypeVar('_FieldUnivariateDerivative2__T', bound=org.hipparchus.CalculusFieldElement) # <T> class FieldUnivariateDerivative2(FieldUnivariateDerivative[_FieldUnivariateDerivative2__T, 'FieldUnivariateDerivative2'[_FieldUnivariateDerivative2__T]], typing.Generic[_FieldUnivariateDerivative2__T]): + """ + public classFieldUnivariateDerivative2<T extends :class:`~org.hipparchus.CalculusFieldElement`<T>> extends :class:`~org.hipparchus.analysis.differentiation.FieldUnivariateDerivative`<T,:class:`~org.hipparchus.analysis.differentiation.FieldUnivariateDerivative2`<T>> + + Class representing both the value and the differentials of a function. + + This class is a stripped-down version of :class:`~org.hipparchus.analysis.differentiation.FieldDerivativeStructure` with + only one :meth:`~org.hipparchus.analysis.differentiation.FieldDerivativeStructure.getFreeParameters` and + :meth:`~org.hipparchus.analysis.differentiation.FieldDerivativeStructure.getOrder` limited to two. It should have less + overhead than :class:`~org.hipparchus.analysis.differentiation.FieldDerivativeStructure` in its domain. + + This class is an implementation of Rall's numbers. Rall's numbers are an extension to the real numbers used throughout + mathematical expressions; they hold the derivative together with the value of a function. + + :class:`~org.hipparchus.analysis.differentiation.FieldUnivariateDerivative2` instances can be used directly thanks to + the arithmetic operators to the mathematical functions provided as methods by this class (+, -, *, /, %, sin, cos ...). + + Implementing complex expressions by hand using these classes is a tedious and error-prone task but has the advantage of + having no limitation on the derivation order despite not requiring users to compute the derivatives by themselves. + + Instances of this class are guaranteed to be immutable. + + Since: + 1.7 + + Also see: + + - :class:`~org.hipparchus.analysis.differentiation.DerivativeStructure` + - :class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative1` + - :class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative2` + - :class:`~org.hipparchus.analysis.differentiation.Gradient` + - :class:`~org.hipparchus.analysis.differentiation.FieldDerivativeStructure` + - :class:`~org.hipparchus.analysis.differentiation.FieldUnivariateDerivative1` + - :class:`~org.hipparchus.analysis.differentiation.FieldGradient` + """ @typing.overload def __init__(self, t: _FieldUnivariateDerivative2__T, t2: _FieldUnivariateDerivative2__T, t3: _FieldUnivariateDerivative2__T): ... @typing.overload @@ -1084,18 +5546,114 @@ class FieldUnivariateDerivative2(FieldUnivariateDerivative[_FieldUnivariateDeriv def divide(self, t: _FieldUnivariateDerivative2__T) -> 'FieldUnivariateDerivative2'[_FieldUnivariateDerivative2__T]: ... @typing.overload def divide(self, fieldUnivariateDerivative2: 'FieldUnivariateDerivative2'[_FieldUnivariateDerivative2__T]) -> 'FieldUnivariateDerivative2'[_FieldUnivariateDerivative2__T]: ... - def equals(self, object: typing.Any) -> bool: ... + def equals(self, object: typing.Any) -> bool: + """ + Test for the equality of two univariate derivatives. + + univariate derivatives are considered equal if they have the same derivatives. + + Overrides: + :meth:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.equals` in + class :class:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Parameters: + other (:class:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object`): Object to test for equality to this + + Returns: + true if two univariate derivatives are equal + + + """ + ... def exp(self) -> 'FieldUnivariateDerivative2'[_FieldUnivariateDerivative2__T]: ... def expm1(self) -> 'FieldUnivariateDerivative2'[_FieldUnivariateDerivative2__T]: ... - def getDerivative(self, int: int) -> _FieldUnivariateDerivative2__T: ... + def getDerivative(self, int: int) -> _FieldUnivariateDerivative2__T: + """ + Get a derivative from the univariate derivative. + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.FieldUnivariateDerivative.getDerivative` in + class :class:`~org.hipparchus.analysis.differentiation.FieldUnivariateDerivative` + + Parameters: + n (int): derivation order (must be between 0 and + :meth:`~org.hipparchus.analysis.differentiation.FieldUnivariateDerivative2.getOrder`, both inclusive) + + Returns: + n :sup:`th` derivative, or :code:`NaN` if n is either negative or strictly larger than + :meth:`~org.hipparchus.analysis.differentiation.FieldUnivariateDerivative2.getOrder` + + + """ + ... def getField(self) -> FieldUnivariateDerivative2Field[_FieldUnivariateDerivative2__T]: ... - def getFirstDerivative(self) -> _FieldUnivariateDerivative2__T: ... - def getOrder(self) -> int: ... + def getFirstDerivative(self) -> _FieldUnivariateDerivative2__T: + """ + Get the first derivative. + + Returns: + first derivative + + Also see: + + - :meth:`~org.hipparchus.analysis.differentiation.FieldUnivariateDerivative2.getValue` + + + + """ + ... + def getOrder(self) -> int: + """ + Get the derivation order. + + Returns: + derivation order + + + """ + ... def getPi(self) -> 'FieldUnivariateDerivative2'[_FieldUnivariateDerivative2__T]: ... - def getSecondDerivative(self) -> _FieldUnivariateDerivative2__T: ... - def getValue(self) -> _FieldUnivariateDerivative2__T: ... + def getSecondDerivative(self) -> _FieldUnivariateDerivative2__T: + """ + Get the second derivative. + + Returns: + second derivative + + Also see: + + - :meth:`~org.hipparchus.analysis.differentiation.FieldUnivariateDerivative2.getValue` + - :meth:`~org.hipparchus.analysis.differentiation.FieldUnivariateDerivative2.getFirstDerivative` + + + + """ + ... + def getValue(self) -> _FieldUnivariateDerivative2__T: + """ + Get the value part of the univariate derivative. + + Returns: + value part of the univariate derivative + + + """ + ... def getValueField(self) -> org.hipparchus.Field[_FieldUnivariateDerivative2__T]: ... - def hashCode(self) -> int: ... + def hashCode(self) -> int: + """ + Get a hashCode for the univariate derivative. + + Overrides: + :meth:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.hashCode` in + class :class:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Returns: + a hash code value for this object + + + """ + ... def hypot(self, fieldUnivariateDerivative2: 'FieldUnivariateDerivative2'[_FieldUnivariateDerivative2__T]) -> 'FieldUnivariateDerivative2'[_FieldUnivariateDerivative2__T]: ... @typing.overload def linearCombination(self, double: float, fieldUnivariateDerivative2: 'FieldUnivariateDerivative2'[_FieldUnivariateDerivative2__T], double2: float, fieldUnivariateDerivative22: 'FieldUnivariateDerivative2'[_FieldUnivariateDerivative2__T]) -> 'FieldUnivariateDerivative2'[_FieldUnivariateDerivative2__T]: ... @@ -1142,7 +5700,41 @@ class FieldUnivariateDerivative2(FieldUnivariateDerivative[_FieldUnivariateDeriv def pow(self, int: int) -> 'FieldUnivariateDerivative2'[_FieldUnivariateDerivative2__T]: ... @typing.overload @staticmethod - def pow(double: float, fieldUnivariateDerivative2: 'FieldUnivariateDerivative2'[_pow_3__T]) -> 'FieldUnivariateDerivative2'[_pow_3__T]: ... + def pow(double: float, fieldUnivariateDerivative2: 'FieldUnivariateDerivative2'[_pow_3__T]) -> 'FieldUnivariateDerivative2'[_pow_3__T]: + """ + Compute a :sup:`x` where a is a double and x a + :class:`~org.hipparchus.analysis.differentiation.FieldUnivariateDerivative2` + + Parameters: + a (double): number to exponentiate + x (:class:`~org.hipparchus.analysis.differentiation.FieldUnivariateDerivative2`<T> x): power to apply + + Returns: + a :sup:`x` + + public :class:`~org.hipparchus.analysis.differentiation.FieldUnivariateDerivative2`<:class:`~org.hipparchus.analysis.differentiation.FieldUnivariateDerivative2`> pow(double p) + + Power operation. + + Parameters: + p (double): power to apply + + Returns: + this :sup:`p` + + public :class:`~org.hipparchus.analysis.differentiation.FieldUnivariateDerivative2`<:class:`~org.hipparchus.analysis.differentiation.FieldUnivariateDerivative2`> pow(int n) + + Integer power operation. + + Parameters: + n (int): power to apply + + Returns: + this :sup:`n` + + + """ + ... def reciprocal(self) -> 'FieldUnivariateDerivative2'[_FieldUnivariateDerivative2__T]: ... @typing.overload def remainder(self, double: float) -> 'FieldUnivariateDerivative2'[_FieldUnivariateDerivative2__T]: ... @@ -1167,7 +5759,27 @@ class FieldUnivariateDerivative2(FieldUnivariateDerivative[_FieldUnivariateDeriv def tan(self) -> 'FieldUnivariateDerivative2'[_FieldUnivariateDerivative2__T]: ... def tanh(self) -> 'FieldUnivariateDerivative2'[_FieldUnivariateDerivative2__T]: ... @typing.overload - def taylor(self, double: float) -> _FieldUnivariateDerivative2__T: ... + def taylor(self, double: float) -> _FieldUnivariateDerivative2__T: + """ + Evaluate Taylor expansion a univariate derivative. + + Parameters: + delta (double): parameter offset Δx + + Returns: + value of the Taylor expansion at x + Δx + + Evaluate Taylor expansion a univariate derivative. + + Parameters: + delta (:class:`~org.hipparchus.analysis.differentiation.FieldUnivariateDerivative2`): parameter offset Δx + + Returns: + value of the Taylor expansion at x + Δx + + + """ + ... @typing.overload def taylor(self, t: _FieldUnivariateDerivative2__T) -> _FieldUnivariateDerivative2__T: ... def toDegrees(self) -> 'FieldUnivariateDerivative2'[_FieldUnivariateDerivative2__T]: ... @@ -1176,49 +5788,508 @@ class FieldUnivariateDerivative2(FieldUnivariateDerivative[_FieldUnivariateDeriv def withValue(self, t: _FieldUnivariateDerivative2__T) -> 'FieldUnivariateDerivative2'[_FieldUnivariateDerivative2__T]: ... class Gradient(Derivative1['Gradient'], java.io.Serializable): + """ + public classGradient extends :class:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.analysis.differentiation.Derivative1`<:class:`~org.hipparchus.analysis.differentiation.Gradient`>, :class:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + Class representing both the value and the differentials of a function. + + This class is a stripped-down version of :class:`~org.hipparchus.analysis.differentiation.DerivativeStructure` with + :meth:`~org.hipparchus.analysis.differentiation.DerivativeStructure.getOrder` limited to one. It should have less + overhead than :class:`~org.hipparchus.analysis.differentiation.DerivativeStructure` in its domain. + + This class is an implementation of Rall's numbers. Rall's numbers are an extension to the real numbers used throughout + mathematical expressions; they hold the derivative together with the value of a function. + + :class:`~org.hipparchus.analysis.differentiation.Gradient` instances can be used directly thanks to the arithmetic + operators to the mathematical functions provided as methods by this class (+, -, *, /, %, sin, cos ...). + + Implementing complex expressions by hand using these classes is a tedious and error-prone task but has the advantage of + having no limitation on the derivation order despite not requiring users to compute the derivatives by themselves. + + Instances of this class are guaranteed to be immutable. + + Since: + 1.7 + + Also see: + + - :class:`~org.hipparchus.analysis.differentiation.DerivativeStructure` + - :class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative1` + - :class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative2` + - :class:`~org.hipparchus.analysis.differentiation.FieldDerivativeStructure` + - :class:`~org.hipparchus.analysis.differentiation.FieldUnivariateDerivative1` + - :class:`~org.hipparchus.analysis.differentiation.FieldUnivariateDerivative2` + - :class:`~org.hipparchus.analysis.differentiation.FieldGradient` + - :meth:`~serialized` + """ @typing.overload def __init__(self, double: float, *double2: float): ... @typing.overload def __init__(self, derivativeStructure: DerivativeStructure): ... - def abs(self) -> 'Gradient': ... - @typing.overload - def add(self, double: float) -> org.hipparchus.CalculusFieldElement: ... + def abs(self) -> 'Gradient': + """ + absolute value. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.abs` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + abs(this) + + + """ + ... + @typing.overload + def add(self, double: float) -> org.hipparchus.CalculusFieldElement: + """ + Compute this + a. + + Specified by: + :meth:`~org.hipparchus.FieldElement.add` in interface :class:`~org.hipparchus.FieldElement` + + Parameters: + a (:class:`~org.hipparchus.analysis.differentiation.Gradient`): element to add + + Returns: + a new element representing this + a + + + """ + ... @typing.overload def add(self, gradient: 'Gradient') -> 'Gradient': ... - def atan2(self, gradient: 'Gradient') -> 'Gradient': ... - @typing.overload - def compose(self, double: float, double2: float) -> 'Gradient': ... - @typing.overload - def compose(self, *double: float) -> 'Gradient': ... + def atan2(self, gradient: 'Gradient') -> 'Gradient': + """ + Two arguments arc tangent operation. + + Beware of the order or arguments! As this is based on a two-arguments functions, in order to be consistent with + arguments order, the instance is the *first* argument and the single provided argument is the *second* argument. In + order to be consistent with programming languages :code:`atan2`, this method computes :code:`atan2(this, x)`, i.e. the + instance represents the :code:`y` argument and the :code:`x` argument is the one passed as a single argument. This may + seem confusing especially for users of Wolfram alpha, as this site is *not* consistent with programming languages + :code:`atan2` two-arguments arc tangent and puts :code:`x` as its first argument. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.atan2` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + x (:class:`~org.hipparchus.analysis.differentiation.Gradient`): second argument of the arc tangent + + Returns: + + """ + ... + @typing.overload + def compose(self, double: float, double2: float) -> 'Gradient': + """ + Compute composition of the instance by a univariate function differentiable at order 1. + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.Derivative1.compose` in + interface :class:`~org.hipparchus.analysis.differentiation.Derivative1` + + Parameters: + f0 (double): value of function + f1 (double): first-order derivative + + Returns: + f(this) + + + """ + ... + @typing.overload + def compose(self, *double: float) -> 'Gradient': + """ + Compute composition of the instance by a univariate function. + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.Derivative.compose` in + interface :class:`~org.hipparchus.analysis.differentiation.Derivative` + + Parameters: + f (double...): array of value and derivatives of the function at the current point (i.e. + [f(:meth:`~org.hipparchus.analysis.differentiation.Derivative.getValue`), + f'(:meth:`~org.hipparchus.analysis.differentiation.Derivative.getValue`), + f''(:meth:`~org.hipparchus.analysis.differentiation.Derivative.getValue`)...]). + + Returns: + f(this) + + """ + ... @staticmethod - def constant(int: int, double: float) -> 'Gradient': ... - @typing.overload - def copySign(self, double: float) -> 'Gradient': ... + def constant(int: int, double: float) -> 'Gradient': + """ + Build an instance corresponding to a constant value. + + Parameters: + freeParameters (int): number of free parameters (i.e. dimension of the gradient) + value (double): constant value of the function + + Returns: + a :code:`Gradient` with a constant value and all derivatives set to 0.0 + + + """ + ... + @typing.overload + def copySign(self, double: float) -> 'Gradient': + """ + Returns the instance with the sign of the argument. A NaN :code:`sign` argument is treated as positive. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.copySign` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + sign (:class:`~org.hipparchus.analysis.differentiation.Gradient`): the sign for the returned value + + Returns: + the instance with the same sign as the :code:`sign` argument + + Returns the instance with the sign of the argument. A NaN :code:`sign` argument is treated as positive. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.copySign` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + sign (double): the sign for the returned value + + Returns: + the instance with the same sign as the :code:`sign` argument + + + """ + ... @typing.overload def copySign(self, gradient: 'Gradient') -> 'Gradient': ... @typing.overload - def divide(self, double: float) -> 'Gradient': ... + def divide(self, double: float) -> 'Gradient': + """ + '÷' operator. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.divide` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + a (double): right hand side parameter of the operator + + Returns: + this÷a + + Compute this ÷ a. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.divide` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Specified by: + :meth:`~org.hipparchus.FieldElement.divide` in interface :class:`~org.hipparchus.FieldElement` + + Parameters: + a (:class:`~org.hipparchus.analysis.differentiation.Gradient`): element to divide by + + Returns: + a new element representing this ÷ a + + + """ + ... @typing.overload def divide(self, gradient: 'Gradient') -> 'Gradient': ... - def equals(self, object: typing.Any) -> bool: ... - def getField(self) -> GradientField: ... - def getFreeParameters(self) -> int: ... - def getGradient(self) -> typing.MutableSequence[float]: ... + def equals(self, object: typing.Any) -> bool: + """ + Test for the equality of two univariate derivatives. + + univariate derivatives are considered equal if they have the same derivatives. + + Overrides: + :meth:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.equals` in + class :class:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Parameters: + other (:class:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object`): Object to test for equality to this + + Returns: + true if two univariate derivatives are equal + + + """ + ... + def getField(self) -> GradientField: + """ + Get the :class:`~org.hipparchus.Field` to which the instance belongs. + + Specified by: + :meth:`~org.hipparchus.FieldElement.getField` in interface :class:`~org.hipparchus.FieldElement` + + Returns: + :class:`~org.hipparchus.Field` to which the instance belongs + + + """ + ... + def getFreeParameters(self) -> int: + """ + Get the number of free parameters. + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.DifferentialAlgebra.getFreeParameters` in + interface :class:`~org.hipparchus.analysis.differentiation.DifferentialAlgebra` + + Returns: + number of free parameters + + + """ + ... + def getGradient(self) -> typing.MutableSequence[float]: + """ + Get the gradient part of the function. + + Returns: + gradient part of the value of the function + + Also see: + + - :meth:`~org.hipparchus.analysis.differentiation.Gradient.getPartialDerivative` + + + + """ + ... @typing.overload def getPartialDerivative(self, int: int) -> float: ... @typing.overload def getPartialDerivative(self, *int: int) -> float: ... - def getValue(self) -> float: ... - def hashCode(self) -> int: ... - def hypot(self, gradient: 'Gradient') -> 'Gradient': ... - @typing.overload - def linearCombination(self, double: float, gradient: 'Gradient', double2: float, gradient2: 'Gradient') -> 'Gradient': ... + def getValue(self) -> float: + """ + Get the value part of the function. + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.Derivative.getValue` in + interface :class:`~org.hipparchus.analysis.differentiation.Derivative` + + Returns: + value part of the value of the function + + + """ + ... + def hashCode(self) -> int: + """ + Get a hashCode for the univariate derivative. + + Overrides: + :meth:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.hashCode` in + class :class:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Returns: + a hash code value for this object + + + """ + ... + def hypot(self, gradient: 'Gradient') -> 'Gradient': + """ + Returns the hypotenuse of a triangle with sides :code:`this` and :code:`y` - sqrt(*this* :sup:`2` +*y* :sup:`2` ) + avoiding intermediate overflow or underflow. + + - If either argument is infinite, then the result is positive infinity. + - else, if either argument is NaN then the result is NaN. + + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.hypot` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + y (:class:`~org.hipparchus.analysis.differentiation.Gradient`): a value + + Returns: + sqrt(*this* :sup:`2` +*y* :sup:`2` ) + + + """ + ... + @typing.overload + def linearCombination(self, double: float, gradient: 'Gradient', double2: float, gradient2: 'Gradient') -> 'Gradient': + """ + Compute a linear combination. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` in + interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + a1 (:class:`~org.hipparchus.analysis.differentiation.Gradient`): first factor of the first term + b1 (:class:`~org.hipparchus.analysis.differentiation.Gradient`): second factor of the first term + a2 (:class:`~org.hipparchus.analysis.differentiation.Gradient`): first factor of the second term + b2 (:class:`~org.hipparchus.analysis.differentiation.Gradient`): second factor of the second term + + Returns: + a :sub:`1` ×b :sub:`1` + a :sub:`2` ×b :sub:`2` + + Also see: + + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + + + Compute a linear combination. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` in + interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + a1 (double): first factor of the first term + b1 (:class:`~org.hipparchus.analysis.differentiation.Gradient`): second factor of the first term + a2 (double): first factor of the second term + b2 (:class:`~org.hipparchus.analysis.differentiation.Gradient`): second factor of the second term + + Returns: + a :sub:`1` ×b :sub:`1` + a :sub:`2` ×b :sub:`2` + + Also see: + + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + + + Compute a linear combination. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` in + interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + a1 (:class:`~org.hipparchus.analysis.differentiation.Gradient`): first factor of the first term + b1 (:class:`~org.hipparchus.analysis.differentiation.Gradient`): second factor of the first term + a2 (:class:`~org.hipparchus.analysis.differentiation.Gradient`): first factor of the second term + b2 (:class:`~org.hipparchus.analysis.differentiation.Gradient`): second factor of the second term + a3 (:class:`~org.hipparchus.analysis.differentiation.Gradient`): first factor of the third term + b3 (:class:`~org.hipparchus.analysis.differentiation.Gradient`): second factor of the third term + + Returns: + a :sub:`1` ×b :sub:`1` + a :sub:`2` ×b :sub:`2` + a :sub:`3` ×b :sub:`3` + + Also see: + + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + + + Compute a linear combination. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` in + interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + a1 (double): first factor of the first term + b1 (:class:`~org.hipparchus.analysis.differentiation.Gradient`): second factor of the first term + a2 (double): first factor of the second term + b2 (:class:`~org.hipparchus.analysis.differentiation.Gradient`): second factor of the second term + a3 (double): first factor of the third term + b3 (:class:`~org.hipparchus.analysis.differentiation.Gradient`): second factor of the third term + + Returns: + a :sub:`1` ×b :sub:`1` + a :sub:`2` ×b :sub:`2` + a :sub:`3` ×b :sub:`3` + + Also see: + + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + + + Compute a linear combination. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` in + interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + a1 (:class:`~org.hipparchus.analysis.differentiation.Gradient`): first factor of the first term + b1 (:class:`~org.hipparchus.analysis.differentiation.Gradient`): second factor of the first term + a2 (:class:`~org.hipparchus.analysis.differentiation.Gradient`): first factor of the second term + b2 (:class:`~org.hipparchus.analysis.differentiation.Gradient`): second factor of the second term + a3 (:class:`~org.hipparchus.analysis.differentiation.Gradient`): first factor of the third term + b3 (:class:`~org.hipparchus.analysis.differentiation.Gradient`): second factor of the third term + a4 (:class:`~org.hipparchus.analysis.differentiation.Gradient`): first factor of the fourth term + b4 (:class:`~org.hipparchus.analysis.differentiation.Gradient`): second factor of the fourth term + + Returns: + a :sub:`1` ×b :sub:`1` + a :sub:`2` ×b :sub:`2` + a :sub:`3` ×b :sub:`3` + a :sub:`4` ×b :sub:`4` + + Also see: + + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + + + Compute a linear combination. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` in + interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + a1 (double): first factor of the first term + b1 (:class:`~org.hipparchus.analysis.differentiation.Gradient`): second factor of the first term + a2 (double): first factor of the second term + b2 (:class:`~org.hipparchus.analysis.differentiation.Gradient`): second factor of the second term + a3 (double): first factor of the third term + b3 (:class:`~org.hipparchus.analysis.differentiation.Gradient`): second factor of the third term + a4 (double): first factor of the fourth term + b4 (:class:`~org.hipparchus.analysis.differentiation.Gradient`): second factor of the fourth term + + Returns: + a :sub:`1` ×b :sub:`1` + a :sub:`2` ×b :sub:`2` + a :sub:`3` ×b :sub:`3` + a :sub:`4` ×b :sub:`4` + + Also see: + + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + + + + """ + ... @typing.overload def linearCombination(self, double: float, gradient: 'Gradient', double2: float, gradient2: 'Gradient', double3: float, gradient3: 'Gradient') -> 'Gradient': ... @typing.overload def linearCombination(self, double: float, gradient: 'Gradient', double2: float, gradient2: 'Gradient', double3: float, gradient3: 'Gradient', double4: float, gradient4: 'Gradient') -> 'Gradient': ... @typing.overload - def linearCombination(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], gradientArray: typing.Union[typing.List['Gradient'], jpype.JArray]) -> 'Gradient': ... + def linearCombination(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], gradientArray: typing.Union[typing.List['Gradient'], jpype.JArray]) -> 'Gradient': + """ + Compute a linear combination. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` in + interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + a (:class:`~org.hipparchus.analysis.differentiation.Gradient`[]): Factors. + b (:class:`~org.hipparchus.analysis.differentiation.Gradient`[]): Factors. + + Returns: + :code:`Σ :sub:`i` a :sub:`i` b :sub:`i``. + + Compute a linear combination. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` in + interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + a (double[]): Factors. + b (:class:`~org.hipparchus.analysis.differentiation.Gradient`[]): Factors. + + Returns: + :code:`Σ :sub:`i` a :sub:`i` b :sub:`i``. + + """ + ... @typing.overload def linearCombination(self, gradient: 'Gradient', gradient2: 'Gradient', gradient3: 'Gradient', gradient4: 'Gradient') -> 'Gradient': ... @typing.overload @@ -1228,15 +6299,118 @@ class Gradient(Derivative1['Gradient'], java.io.Serializable): @typing.overload def linearCombination(self, gradientArray: typing.Union[typing.List['Gradient'], jpype.JArray], gradientArray2: typing.Union[typing.List['Gradient'], jpype.JArray]) -> 'Gradient': ... @typing.overload - def multiply(self, double: float) -> 'Gradient': ... + def multiply(self, double: float) -> 'Gradient': + """ + Compute n × this. Multiplication by an integer number is defined as the following sum \[ n \times \mathrm{this} = + \sum_{i=1}^n \mathrm{this} \] + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.multiply` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Specified by: + :meth:`~org.hipparchus.FieldElement.multiply` in interface :class:`~org.hipparchus.FieldElement` + + Parameters: + n (int): Number of times :code:`this` must be added to itself. + + Returns: + A new element representing n × this. + + '×' operator. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.multiply` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + a (double): right hand side parameter of the operator + + Returns: + this×a + + Compute this × a. + + Specified by: + :meth:`~org.hipparchus.FieldElement.multiply` in interface :class:`~org.hipparchus.FieldElement` + + Parameters: + a (:class:`~org.hipparchus.analysis.differentiation.Gradient`): element to multiply + + Returns: + a new element representing this × a + + + """ + ... @typing.overload def multiply(self, int: int) -> 'Gradient': ... @typing.overload def multiply(self, gradient: 'Gradient') -> 'Gradient': ... - def negate(self) -> 'Gradient': ... - def newInstance(self, double: float) -> 'Gradient': ... - @typing.overload - def pow(self, t: org.hipparchus.CalculusFieldElement) -> org.hipparchus.CalculusFieldElement: ... + def negate(self) -> 'Gradient': + """ + Returns the additive inverse of :code:`this` element. + + Specified by: + :meth:`~org.hipparchus.FieldElement.negate` in interface :class:`~org.hipparchus.FieldElement` + + Returns: + the opposite of :code:`this`. + + + """ + ... + def newInstance(self, double: float) -> 'Gradient': + """ + Create an instance corresponding to a constant real value. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.newInstance` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + c (double): constant real value + + Returns: + instance corresponding to a constant real value + + + """ + ... + @typing.overload + def pow(self, t: org.hipparchus.CalculusFieldElement) -> org.hipparchus.CalculusFieldElement: + """ + Compute a :sup:`x` where a is a double and x a :class:`~org.hipparchus.analysis.differentiation.Gradient` + + Parameters: + a (double): number to exponentiate + x (:class:`~org.hipparchus.analysis.differentiation.Gradient`): power to apply + + Returns: + a :sup:`x` + + Power operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.pow` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + p (double): power to apply + + Returns: + this :sup:`p` + + Integer power operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.pow` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + n (int): power to apply + + Returns: + this :sup:`n` + + + """ + ... @typing.overload def pow(self, double: float) -> 'Gradient': ... @typing.overload @@ -1245,73 +6419,682 @@ class Gradient(Derivative1['Gradient'], java.io.Serializable): @staticmethod def pow(double: float, gradient: 'Gradient') -> 'Gradient': ... @typing.overload - def remainder(self, double: float) -> org.hipparchus.CalculusFieldElement: ... + def remainder(self, double: float) -> org.hipparchus.CalculusFieldElement: + """ + IEEE remainder operator. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.remainder` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + a (:class:`~org.hipparchus.analysis.differentiation.Gradient`): right hand side parameter of the operator + + Returns: + this - n × a where n is the closest integer to this/a + + + """ + ... @typing.overload def remainder(self, gradient: 'Gradient') -> 'Gradient': ... - def scalb(self, int: int) -> 'Gradient': ... + def scalb(self, int: int) -> 'Gradient': + """ + Multiply the instance by a power of 2. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.scalb` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + n (int): power of 2 + + Returns: + this × 2 :sup:`n` + + + """ + ... def sinCos(self) -> org.hipparchus.util.FieldSinCos['Gradient']: ... def sinhCosh(self) -> org.hipparchus.util.FieldSinhCosh['Gradient']: ... @typing.overload - def subtract(self, double: float) -> org.hipparchus.CalculusFieldElement: ... + def subtract(self, double: float) -> org.hipparchus.CalculusFieldElement: + """ + Compute this - a. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.subtract` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Specified by: + :meth:`~org.hipparchus.FieldElement.subtract` in interface :class:`~org.hipparchus.FieldElement` + + Parameters: + a (:class:`~org.hipparchus.analysis.differentiation.Gradient`): element to subtract + + Returns: + a new element representing this - a + + + """ + ... @typing.overload def subtract(self, gradient: 'Gradient') -> 'Gradient': ... - def taylor(self, *double: float) -> float: ... - def toDegrees(self) -> 'Gradient': ... - def toDerivativeStructure(self) -> DerivativeStructure: ... - def toRadians(self) -> 'Gradient': ... + def taylor(self, *double: float) -> float: + """ + Evaluate Taylor expansion a derivative structure. + + Parameters: + delta (double...): parameters offsets (Δx, Δy, ...) + + Returns: + value of the Taylor expansion at x + Δx, y + Δy, ... + + + """ + ... + def toDegrees(self) -> 'Gradient': + """ + Convert radians to degrees, with error of less than 0.5 ULP + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.toDegrees` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + instance converted into degrees + + + """ + ... + def toDerivativeStructure(self) -> DerivativeStructure: + """ + Convert the instance to a :class:`~org.hipparchus.analysis.differentiation.DerivativeStructure`. + + Returns: + derivative structure with same value and derivative as the instance + + + """ + ... + def toRadians(self) -> 'Gradient': + """ + Convert degrees to radians, with error of less than 0.5 ULP + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.toRadians` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + instance converted into radians + + + """ + ... @staticmethod - def variable(int: int, int2: int, double: float) -> 'Gradient': ... - def withValue(self, double: float) -> 'Gradient': ... + def variable(int: int, int2: int, double: float) -> 'Gradient': + """ + Build a :code:`Gradient` representing a variable. + + Instances built using this method are considered to be the free variables with respect to which differentials are + computed. As such, their differential with respect to themselves is +1. + + Parameters: + freeParameters (int): number of free parameters (i.e. dimension of the gradient) + index (int): index of the variable (from 0 to :meth:`~org.hipparchus.analysis.differentiation.Gradient.getFreeParameters` - 1) + value (double): value of the variable + + Returns: + a :code:`Gradient` with a constant value and all derivatives set to 0.0 except the one at :code:`index` which will be + set to 1.0 + + + """ + ... + def withValue(self, double: float) -> 'Gradient': + """ + Create a new object with new value (zeroth-order derivative, as passed as input) and same derivatives of order one and + above. + + This default implementation is there so that no API gets broken by the next release, which is not a major one. Custom + inheritors should probably overwrite it. + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.Derivative.withValue` in + interface :class:`~org.hipparchus.analysis.differentiation.Derivative` + + Parameters: + v (double): zeroth-order derivative of new represented function + + Returns: + new object with changed value + + + """ + ... class SparseGradient(Derivative1['SparseGradient'], java.io.Serializable): - def abs(self) -> 'SparseGradient': ... - @typing.overload - def add(self, double: float) -> org.hipparchus.CalculusFieldElement: ... + """ + public classSparseGradient extends :class:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.analysis.differentiation.Derivative1`<:class:`~org.hipparchus.analysis.differentiation.SparseGradient`>, :class:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + First derivative computation with large number of variables. + + This class plays a similar role to :class:`~org.hipparchus.analysis.differentiation.DerivativeStructure`, with a focus + on efficiency when dealing with large number of independent variables and most computation depend only on a few of them, + and when only first derivative is desired. When these conditions are met, this class should be much faster than + :class:`~org.hipparchus.analysis.differentiation.DerivativeStructure` and use less memory. + + Also see: + + - :meth:`~serialized` + """ + def abs(self) -> 'SparseGradient': + """ + absolute value. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.abs` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + abs(this) + + + """ + ... + @typing.overload + def add(self, double: float) -> org.hipparchus.CalculusFieldElement: + """ + Compute this + a. + + Specified by: + :meth:`~org.hipparchus.FieldElement.add` in interface :class:`~org.hipparchus.FieldElement` + + Parameters: + a (:class:`~org.hipparchus.analysis.differentiation.SparseGradient`): element to add + + Returns: + a new element representing this + a + + + """ + ... @typing.overload def add(self, sparseGradient: 'SparseGradient') -> 'SparseGradient': ... - def addInPlace(self, sparseGradient: 'SparseGradient') -> None: ... - @typing.overload - def atan2(self, sparseGradient: 'SparseGradient') -> 'SparseGradient': ... + def addInPlace(self, sparseGradient: 'SparseGradient') -> None: + """ + Add in place. + + This method is designed to be faster when used multiple times in a loop. + + The instance is changed here, in order to not change the instance the + :meth:`~org.hipparchus.analysis.differentiation.SparseGradient.add` method should be used. + + Parameters: + a (:class:`~org.hipparchus.analysis.differentiation.SparseGradient`): instance to add + + + """ + ... + @typing.overload + def atan2(self, sparseGradient: 'SparseGradient') -> 'SparseGradient': + """ + Two arguments arc tangent operation. + + Beware of the order or arguments! As this is based on a two-arguments functions, in order to be consistent with + arguments order, the instance is the *first* argument and the single provided argument is the *second* argument. In + order to be consistent with programming languages :code:`atan2`, this method computes :code:`atan2(this, x)`, i.e. the + instance represents the :code:`y` argument and the :code:`x` argument is the one passed as a single argument. This may + seem confusing especially for users of Wolfram alpha, as this site is *not* consistent with programming languages + :code:`atan2` two-arguments arc tangent and puts :code:`x` as its first argument. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.atan2` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + x (:class:`~org.hipparchus.analysis.differentiation.SparseGradient`): second argument of the arc tangent + + Returns: + public static :class:`~org.hipparchus.analysis.differentiation.SparseGradient` atan2(:class:`~org.hipparchus.analysis.differentiation.SparseGradient` y, :class:`~org.hipparchus.analysis.differentiation.SparseGradient` x) + + Two arguments arc tangent operation. + + Parameters: + y (:class:`~org.hipparchus.analysis.differentiation.SparseGradient`): first argument of the arc tangent + x (:class:`~org.hipparchus.analysis.differentiation.SparseGradient`): second argument of the arc tangent + + Returns: + + """ + ... @typing.overload @staticmethod def atan2(sparseGradient: 'SparseGradient', sparseGradient2: 'SparseGradient') -> 'SparseGradient': ... @typing.overload - def compose(self, double: float, double2: float) -> 'SparseGradient': ... - @typing.overload - def compose(self, *double: float) -> 'SparseGradient': ... - @typing.overload - def copySign(self, double: float) -> 'SparseGradient': ... + def compose(self, double: float, double2: float) -> 'SparseGradient': + """ + Compute composition of the instance by a univariate function differentiable at order 1. + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.Derivative1.compose` in + interface :class:`~org.hipparchus.analysis.differentiation.Derivative1` + + Parameters: + f0 (double): value of function + f1 (double): first-order derivative + + Returns: + f(this) + + + """ + ... + @typing.overload + def compose(self, *double: float) -> 'SparseGradient': + """ + Compute composition of the instance by a univariate function. + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.Derivative.compose` in + interface :class:`~org.hipparchus.analysis.differentiation.Derivative` + + Parameters: + f (double...): array of value and derivatives of the function at the current point (i.e. + [f(:meth:`~org.hipparchus.analysis.differentiation.SparseGradient.getValue`), + f'(:meth:`~org.hipparchus.analysis.differentiation.SparseGradient.getValue`), + f''(:meth:`~org.hipparchus.analysis.differentiation.SparseGradient.getValue`)...]). + + Returns: + f(this) + + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if the number of elements in the array is not equal to 2 (i.e. value and first derivative) + + """ + ... + @typing.overload + def copySign(self, double: float) -> 'SparseGradient': + """ + Returns the instance with the sign of the argument. A NaN :code:`sign` argument is treated as positive. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.copySign` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + sign (:class:`~org.hipparchus.analysis.differentiation.SparseGradient`): the sign for the returned value + + Returns: + the instance with the same sign as the :code:`sign` argument + + Returns the instance with the sign of the argument. A NaN :code:`sign` argument is treated as positive. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.copySign` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + sign (double): the sign for the returned value + + Returns: + the instance with the same sign as the :code:`sign` argument + + + """ + ... @typing.overload def copySign(self, sparseGradient: 'SparseGradient') -> 'SparseGradient': ... @staticmethod - def createConstant(double: float) -> 'SparseGradient': ... + def createConstant(double: float) -> 'SparseGradient': + """ + Factory method creating a constant. + + Parameters: + value (double): value of the constant + + Returns: + a new instance + + + """ + ... @staticmethod - def createVariable(int: int, double: float) -> 'SparseGradient': ... - @typing.overload - def divide(self, double: float) -> 'SparseGradient': ... + def createVariable(int: int, double: float) -> 'SparseGradient': + """ + Factory method creating an independent variable. + + Parameters: + idx (int): index of the variable + value (double): value of the variable + + Returns: + a new instance + + + """ + ... + @typing.overload + def divide(self, double: float) -> 'SparseGradient': + """ + Compute this ÷ a. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.divide` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Specified by: + :meth:`~org.hipparchus.FieldElement.divide` in interface :class:`~org.hipparchus.FieldElement` + + Parameters: + a (:class:`~org.hipparchus.analysis.differentiation.SparseGradient`): element to divide by + + Returns: + a new element representing this ÷ a + + '÷' operator. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.divide` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + c (double): right hand side parameter of the operator + + Returns: + this÷a + + + """ + ... @typing.overload def divide(self, sparseGradient: 'SparseGradient') -> 'SparseGradient': ... - def equals(self, object: typing.Any) -> bool: ... - def getDerivative(self, int: int) -> float: ... + def equals(self, object: typing.Any) -> bool: + """ + Test for the equality of two sparse gradients. + + Sparse gradients are considered equal if they have the same value and the same derivatives. + + Overrides: + :meth:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.equals` in + class :class:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Parameters: + other (:class:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object`): Object to test for equality to this + + Returns: + true if two sparse gradients are equal + + + """ + ... + def getDerivative(self, int: int) -> float: + """ + Get the derivative with respect to a particular index variable. + + Parameters: + index (int): index to differentiate with. + + Returns: + derivative with respect to a particular index variable + + + """ + ... def getField(self) -> org.hipparchus.Field['SparseGradient']: ... - def getFreeParameters(self) -> int: ... + def getFreeParameters(self) -> int: + """ + Get the number of free parameters. + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.DifferentialAlgebra.getFreeParameters` in + interface :class:`~org.hipparchus.analysis.differentiation.DifferentialAlgebra` + + Returns: + number of free parameters + + + """ + ... def getPartialDerivative(self, *int: int) -> float: ... - def getPi(self) -> 'SparseGradient': ... - def getValue(self) -> float: ... - def hashCode(self) -> int: ... - @typing.overload - def hypot(self, sparseGradient: 'SparseGradient') -> 'SparseGradient': ... + def getPi(self) -> 'SparseGradient': + """ + Get the Archimedes constant Ï€. + + Archimedes constant is the ratio of a circle's circumference to its diameter. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.getPi` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + Archimedes constant Ï€ + + + """ + ... + def getValue(self) -> float: + """ + Get the value of the function. + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.Derivative.getValue` in + interface :class:`~org.hipparchus.analysis.differentiation.Derivative` + + Returns: + value of the function. + + + """ + ... + def hashCode(self) -> int: + """ + Get a hashCode for the derivative structure. + + Overrides: + :meth:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.hashCode` in + class :class:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Returns: + a hash code value for this object + + + """ + ... + @typing.overload + def hypot(self, sparseGradient: 'SparseGradient') -> 'SparseGradient': + """ + Returns the hypotenuse of a triangle with sides :code:`this` and :code:`y` - sqrt(*this* :sup:`2` +*y* :sup:`2` ) + avoiding intermediate overflow or underflow. + + - If either argument is infinite, then the result is positive infinity. + - else, if either argument is NaN then the result is NaN. + + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.hypot` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + y (:class:`~org.hipparchus.analysis.differentiation.SparseGradient`): a value + + Returns: + sqrt(*this* :sup:`2` +*y* :sup:`2` ) + + Returns the hypotenuse of a triangle with sides :code:`x` and :code:`y` - sqrt(*x* :sup:`2` +*y* :sup:`2` ) avoiding + intermediate overflow or underflow. + + - If either argument is infinite, then the result is positive infinity. + - else, if either argument is NaN then the result is NaN. + + + Parameters: + x (:class:`~org.hipparchus.analysis.differentiation.SparseGradient`): a value + y (:class:`~org.hipparchus.analysis.differentiation.SparseGradient`): a value + + Returns: + sqrt(*x* :sup:`2` +*y* :sup:`2` ) + + + """ + ... @typing.overload @staticmethod def hypot(sparseGradient: 'SparseGradient', sparseGradient2: 'SparseGradient') -> 'SparseGradient': ... @typing.overload - def linearCombination(self, double: float, sparseGradient: 'SparseGradient', double2: float, sparseGradient2: 'SparseGradient') -> 'SparseGradient': ... + def linearCombination(self, double: float, sparseGradient: 'SparseGradient', double2: float, sparseGradient2: 'SparseGradient') -> 'SparseGradient': + """ + Compute a linear combination. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` in + interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + a1 (:class:`~org.hipparchus.analysis.differentiation.SparseGradient`): first factor of the first term + b1 (:class:`~org.hipparchus.analysis.differentiation.SparseGradient`): second factor of the first term + a2 (:class:`~org.hipparchus.analysis.differentiation.SparseGradient`): first factor of the second term + b2 (:class:`~org.hipparchus.analysis.differentiation.SparseGradient`): second factor of the second term + + Returns: + a :sub:`1` ×b :sub:`1` + a :sub:`2` ×b :sub:`2` + + Also see: + + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + + + Compute a linear combination. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` in + interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + a1 (double): first factor of the first term + b1 (:class:`~org.hipparchus.analysis.differentiation.SparseGradient`): second factor of the first term + a2 (double): first factor of the second term + b2 (:class:`~org.hipparchus.analysis.differentiation.SparseGradient`): second factor of the second term + + Returns: + a :sub:`1` ×b :sub:`1` + a :sub:`2` ×b :sub:`2` + + Also see: + + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + + + Compute a linear combination. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` in + interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + a1 (:class:`~org.hipparchus.analysis.differentiation.SparseGradient`): first factor of the first term + b1 (:class:`~org.hipparchus.analysis.differentiation.SparseGradient`): second factor of the first term + a2 (:class:`~org.hipparchus.analysis.differentiation.SparseGradient`): first factor of the second term + b2 (:class:`~org.hipparchus.analysis.differentiation.SparseGradient`): second factor of the second term + a3 (:class:`~org.hipparchus.analysis.differentiation.SparseGradient`): first factor of the third term + b3 (:class:`~org.hipparchus.analysis.differentiation.SparseGradient`): second factor of the third term + + Returns: + a :sub:`1` ×b :sub:`1` + a :sub:`2` ×b :sub:`2` + a :sub:`3` ×b :sub:`3` + + Also see: + + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + + + Compute a linear combination. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` in + interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + a1 (double): first factor of the first term + b1 (:class:`~org.hipparchus.analysis.differentiation.SparseGradient`): second factor of the first term + a2 (double): first factor of the second term + b2 (:class:`~org.hipparchus.analysis.differentiation.SparseGradient`): second factor of the second term + a3 (double): first factor of the third term + b3 (:class:`~org.hipparchus.analysis.differentiation.SparseGradient`): second factor of the third term + + Returns: + a :sub:`1` ×b :sub:`1` + a :sub:`2` ×b :sub:`2` + a :sub:`3` ×b :sub:`3` + + Also see: + + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + + + Compute a linear combination. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` in + interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + a1 (:class:`~org.hipparchus.analysis.differentiation.SparseGradient`): first factor of the first term + b1 (:class:`~org.hipparchus.analysis.differentiation.SparseGradient`): second factor of the first term + a2 (:class:`~org.hipparchus.analysis.differentiation.SparseGradient`): first factor of the second term + b2 (:class:`~org.hipparchus.analysis.differentiation.SparseGradient`): second factor of the second term + a3 (:class:`~org.hipparchus.analysis.differentiation.SparseGradient`): first factor of the third term + b3 (:class:`~org.hipparchus.analysis.differentiation.SparseGradient`): second factor of the third term + a4 (:class:`~org.hipparchus.analysis.differentiation.SparseGradient`): first factor of the fourth term + b4 (:class:`~org.hipparchus.analysis.differentiation.SparseGradient`): second factor of the fourth term + + Returns: + a :sub:`1` ×b :sub:`1` + a :sub:`2` ×b :sub:`2` + a :sub:`3` ×b :sub:`3` + a :sub:`4` ×b :sub:`4` + + Also see: + + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + + + Compute a linear combination. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` in + interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + a1 (double): first factor of the first term + b1 (:class:`~org.hipparchus.analysis.differentiation.SparseGradient`): second factor of the first term + a2 (double): first factor of the second term + b2 (:class:`~org.hipparchus.analysis.differentiation.SparseGradient`): second factor of the second term + a3 (double): first factor of the third term + b3 (:class:`~org.hipparchus.analysis.differentiation.SparseGradient`): second factor of the third term + a4 (double): first factor of the fourth term + b4 (:class:`~org.hipparchus.analysis.differentiation.SparseGradient`): second factor of the fourth term + + Returns: + a :sub:`1` ×b :sub:`1` + a :sub:`2` ×b :sub:`2` + a :sub:`3` ×b :sub:`3` + a :sub:`4` ×b :sub:`4` + + Also see: + + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + + + + """ + ... @typing.overload def linearCombination(self, double: float, sparseGradient: 'SparseGradient', double2: float, sparseGradient2: 'SparseGradient', double3: float, sparseGradient3: 'SparseGradient') -> 'SparseGradient': ... @typing.overload def linearCombination(self, double: float, sparseGradient: 'SparseGradient', double2: float, sparseGradient2: 'SparseGradient', double3: float, sparseGradient3: 'SparseGradient', double4: float, sparseGradient4: 'SparseGradient') -> 'SparseGradient': ... @typing.overload - def linearCombination(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], sparseGradientArray: typing.Union[typing.List['SparseGradient'], jpype.JArray]) -> 'SparseGradient': ... + def linearCombination(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], sparseGradientArray: typing.Union[typing.List['SparseGradient'], jpype.JArray]) -> 'SparseGradient': + """ + Compute a linear combination. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` in + interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + a (double[]): Factors. + b (:class:`~org.hipparchus.analysis.differentiation.SparseGradient`[]): Factors. + + Returns: + :code:`Σ :sub:`i` a :sub:`i` b :sub:`i``. + + """ + ... @typing.overload def linearCombination(self, sparseGradient: 'SparseGradient', sparseGradient2: 'SparseGradient', sparseGradient3: 'SparseGradient', sparseGradient4: 'SparseGradient') -> 'SparseGradient': ... @typing.overload @@ -1321,17 +7104,144 @@ class SparseGradient(Derivative1['SparseGradient'], java.io.Serializable): @typing.overload def linearCombination(self, sparseGradientArray: typing.Union[typing.List['SparseGradient'], jpype.JArray], sparseGradientArray2: typing.Union[typing.List['SparseGradient'], jpype.JArray]) -> 'SparseGradient': ... @typing.overload - def multiply(self, double: float) -> 'SparseGradient': ... + def multiply(self, double: float) -> 'SparseGradient': + """ + Compute this × a. + + Specified by: + :meth:`~org.hipparchus.FieldElement.multiply` in interface :class:`~org.hipparchus.FieldElement` + + Parameters: + a (:class:`~org.hipparchus.analysis.differentiation.SparseGradient`): element to multiply + + Returns: + a new element representing this × a + + '×' operator. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.multiply` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + c (double): right hand side parameter of the operator + + Returns: + this×a + + Compute n × this. Multiplication by an integer number is defined as the following sum \[ n \times \mathrm{this} = + \sum_{i=1}^n \mathrm{this} \] + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.multiply` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Specified by: + :meth:`~org.hipparchus.FieldElement.multiply` in interface :class:`~org.hipparchus.FieldElement` + + Parameters: + n (int): Number of times :code:`this` must be added to itself. + + Returns: + A new element representing n × this. + + + """ + ... @typing.overload def multiply(self, int: int) -> 'SparseGradient': ... @typing.overload def multiply(self, sparseGradient: 'SparseGradient') -> 'SparseGradient': ... - def multiplyInPlace(self, sparseGradient: 'SparseGradient') -> None: ... - def negate(self) -> 'SparseGradient': ... - def newInstance(self, double: float) -> 'SparseGradient': ... - def numVars(self) -> int: ... - @typing.overload - def pow(self, t: org.hipparchus.CalculusFieldElement) -> org.hipparchus.CalculusFieldElement: ... + def multiplyInPlace(self, sparseGradient: 'SparseGradient') -> None: + """ + Multiply in place. + + This method is designed to be faster when used multiple times in a loop. + + The instance is changed here, in order to not change the instance the + :meth:`~org.hipparchus.analysis.differentiation.SparseGradient.add` method should be used. + + Parameters: + a (:class:`~org.hipparchus.analysis.differentiation.SparseGradient`): instance to multiply + + + """ + ... + def negate(self) -> 'SparseGradient': + """ + Returns the additive inverse of :code:`this` element. + + Specified by: + :meth:`~org.hipparchus.FieldElement.negate` in interface :class:`~org.hipparchus.FieldElement` + + Returns: + the opposite of :code:`this`. + + + """ + ... + def newInstance(self, double: float) -> 'SparseGradient': + """ + Create an instance corresponding to a constant real value. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.newInstance` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + v (double): constant real value + + Returns: + instance corresponding to a constant real value + + + """ + ... + def numVars(self) -> int: + """ + Deprecated. + Find the number of variables. + + Returns: + number of variables + + + """ + ... + @typing.overload + def pow(self, t: org.hipparchus.CalculusFieldElement) -> org.hipparchus.CalculusFieldElement: + """ + Power operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.pow` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + p (double): power to apply + + Returns: + this :sup:`p` + + Integer power operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.pow` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + n (int): power to apply + + Returns: + this :sup:`n` + + Compute a :sup:`x` where a is a double and x a :class:`~org.hipparchus.analysis.differentiation.SparseGradient` + + Parameters: + a (double): number to exponentiate + x (:class:`~org.hipparchus.analysis.differentiation.SparseGradient`): power to apply + + Returns: + a :sup:`x` + + + """ + ... @typing.overload def pow(self, double: float) -> 'SparseGradient': ... @typing.overload @@ -1340,61 +7250,687 @@ class SparseGradient(Derivative1['SparseGradient'], java.io.Serializable): @staticmethod def pow(double: float, sparseGradient: 'SparseGradient') -> 'SparseGradient': ... @typing.overload - def remainder(self, double: float) -> 'SparseGradient': ... + def remainder(self, double: float) -> 'SparseGradient': + """ + IEEE remainder operator. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.remainder` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.Derivative.remainder` in + interface :class:`~org.hipparchus.analysis.differentiation.Derivative` + + Parameters: + a (double): right hand side parameter of the operator + + Returns: + this - n × a where n is the closest integer to this/a + + IEEE remainder operator. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.remainder` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + a (:class:`~org.hipparchus.analysis.differentiation.SparseGradient`): right hand side parameter of the operator + + Returns: + this - n × a where n is the closest integer to this/a + + + """ + ... @typing.overload def remainder(self, sparseGradient: 'SparseGradient') -> 'SparseGradient': ... - def scalb(self, int: int) -> 'SparseGradient': ... - def sqrt(self) -> 'SparseGradient': ... - @typing.overload - def subtract(self, double: float) -> org.hipparchus.CalculusFieldElement: ... + def scalb(self, int: int) -> 'SparseGradient': + """ + Multiply the instance by a power of 2. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.scalb` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + n (int): power of 2 + + Returns: + this × 2 :sup:`n` + + + """ + ... + def sqrt(self) -> 'SparseGradient': + """ + Square root. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.sqrt` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.Derivative1.sqrt` in + interface :class:`~org.hipparchus.analysis.differentiation.Derivative1` + + Returns: + square root of the instance + + + """ + ... + @typing.overload + def subtract(self, double: float) -> org.hipparchus.CalculusFieldElement: + """ + Compute this - a. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.subtract` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Specified by: + :meth:`~org.hipparchus.FieldElement.subtract` in interface :class:`~org.hipparchus.FieldElement` + + Parameters: + a (:class:`~org.hipparchus.analysis.differentiation.SparseGradient`): element to subtract + + Returns: + a new element representing this - a + + + """ + ... @typing.overload def subtract(self, sparseGradient: 'SparseGradient') -> 'SparseGradient': ... - def taylor(self, *double: float) -> float: ... - def toDegrees(self) -> 'SparseGradient': ... - def toRadians(self) -> 'SparseGradient': ... - def withValue(self, double: float) -> 'SparseGradient': ... + def taylor(self, *double: float) -> float: + """ + Evaluate Taylor expansion of a sparse gradient. + + Parameters: + delta (double...): parameters offsets (Δx, Δy, ...) + + Returns: + value of the Taylor expansion at x + Δx, y + Δy, ... + + + """ + ... + def toDegrees(self) -> 'SparseGradient': + """ + Convert radians to degrees, with error of less than 0.5 ULP + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.toDegrees` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + instance converted into degrees + + + """ + ... + def toRadians(self) -> 'SparseGradient': + """ + Convert degrees to radians, with error of less than 0.5 ULP + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.toRadians` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + instance converted into radians + + + """ + ... + def withValue(self, double: float) -> 'SparseGradient': + """ + Create a new object with new value (zeroth-order derivative, as passed as input) and same derivatives of order one and + above. + + This default implementation is there so that no API gets broken by the next release, which is not a major one. Custom + inheritors should probably overwrite it. + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.Derivative.withValue` in + interface :class:`~org.hipparchus.analysis.differentiation.Derivative` + + Parameters: + v (double): zeroth-order derivative of new represented function + + Returns: + new object with changed value + + + """ + ... class UnivariateDerivative1(UnivariateDerivative['UnivariateDerivative1'], Derivative1['UnivariateDerivative1']): + """ + public classUnivariateDerivative1 extends :class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative`<:class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative1`> + implements :class:`~org.hipparchus.analysis.differentiation.Derivative1`<:class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative1`> + + Class representing both the value and the differentials of a function. + + This class is a stripped-down version of :class:`~org.hipparchus.analysis.differentiation.DerivativeStructure` with only + one :meth:`~org.hipparchus.analysis.differentiation.DerivativeStructure.getFreeParameters` and + :meth:`~org.hipparchus.analysis.differentiation.DerivativeStructure.getOrder` also limited to one. It should have less + overhead than :class:`~org.hipparchus.analysis.differentiation.DerivativeStructure` in its domain. + + This class is an implementation of Rall's numbers. Rall's numbers are an extension to the real numbers used throughout + mathematical expressions; they hold the derivative together with the value of a function. + + :class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative1` instances can be used directly thanks to the + arithmetic operators to the mathematical functions provided as methods by this class (+, -, *, /, %, sin, cos ...). + + Implementing complex expressions by hand using these classes is a tedious and error-prone task but has the advantage of + having no limitation on the derivation order despite not requiring users to compute the derivatives by themselves. + + Instances of this class are guaranteed to be immutable. + + Since: + 1.7 + + Also see: + + - :class:`~org.hipparchus.analysis.differentiation.DerivativeStructure` + - :class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative2` + - :class:`~org.hipparchus.analysis.differentiation.Gradient` + - :class:`~org.hipparchus.analysis.differentiation.FieldDerivativeStructure` + - :class:`~org.hipparchus.analysis.differentiation.FieldUnivariateDerivative1` + - :class:`~org.hipparchus.analysis.differentiation.FieldUnivariateDerivative2` + - :class:`~org.hipparchus.analysis.differentiation.FieldGradient` + - :meth:`~serialized` + """ PI: typing.ClassVar['UnivariateDerivative1'] = ... + """ + public static final :class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative1` PI + + The constant value of Ï€ as a :code:`UnivariateDerivative1`. + + Since: + 2.0 + + + """ @typing.overload def __init__(self, double: float, double2: float): ... @typing.overload def __init__(self, derivativeStructure: DerivativeStructure): ... - def abs(self) -> 'UnivariateDerivative1': ... - @typing.overload - def add(self, double: float) -> org.hipparchus.CalculusFieldElement: ... + def abs(self) -> 'UnivariateDerivative1': + """ + absolute value. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.abs` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + abs(this) + + + """ + ... + @typing.overload + def add(self, double: float) -> org.hipparchus.CalculusFieldElement: + """ + Compute this + a. + + Specified by: + :meth:`~org.hipparchus.FieldElement.add` in interface :class:`~org.hipparchus.FieldElement` + + Parameters: + a (:class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative1`): element to add + + Returns: + a new element representing this + a + + + """ + ... @typing.overload def add(self, univariateDerivative1: 'UnivariateDerivative1') -> 'UnivariateDerivative1': ... - def atan2(self, univariateDerivative1: 'UnivariateDerivative1') -> 'UnivariateDerivative1': ... - def compareTo(self, univariateDerivative1: 'UnivariateDerivative1') -> int: ... - @typing.overload - def compose(self, double: float, double2: float) -> 'UnivariateDerivative1': ... - @typing.overload - def compose(self, *double: float) -> 'UnivariateDerivative1': ... - @typing.overload - def copySign(self, double: float) -> 'UnivariateDerivative1': ... + def atan2(self, univariateDerivative1: 'UnivariateDerivative1') -> 'UnivariateDerivative1': + """ + Two arguments arc tangent operation. + + Beware of the order or arguments! As this is based on a two-arguments functions, in order to be consistent with + arguments order, the instance is the *first* argument and the single provided argument is the *second* argument. In + order to be consistent with programming languages :code:`atan2`, this method computes :code:`atan2(this, x)`, i.e. the + instance represents the :code:`y` argument and the :code:`x` argument is the one passed as a single argument. This may + seem confusing especially for users of Wolfram alpha, as this site is *not* consistent with programming languages + :code:`atan2` two-arguments arc tangent and puts :code:`x` as its first argument. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.atan2` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + x (:class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative1`): second argument of the arc tangent + + Returns: + + """ + ... + def compareTo(self, univariateDerivative1: 'UnivariateDerivative1') -> int: + """ + + Comparison performed considering that derivatives are intrinsically linked to monomials in the corresponding Taylor + expansion and that the higher the degree, the smaller the term. + + Specified by: + + meth:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Comparable.compareTo` in + interface :class:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Comparable` + + Since: + 3.0 + + + """ + ... + @typing.overload + def compose(self, double: float, double2: float) -> 'UnivariateDerivative1': + """ + Compute composition of the instance by a univariate function differentiable at order 1. + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.Derivative1.compose` in + interface :class:`~org.hipparchus.analysis.differentiation.Derivative1` + + Parameters: + ff0 (double): value of function + ff1 (double): first-order derivative + + Returns: + f(this) + + + """ + ... + @typing.overload + def compose(self, *double: float) -> 'UnivariateDerivative1': + """ + Compute composition of the instance by a univariate function. + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.Derivative.compose` in + interface :class:`~org.hipparchus.analysis.differentiation.Derivative` + + Parameters: + f (double...): array of value and derivatives of the function at the current point (i.e. + [f(:meth:`~org.hipparchus.analysis.differentiation.Derivative.getValue`), + f'(:meth:`~org.hipparchus.analysis.differentiation.Derivative.getValue`), + f''(:meth:`~org.hipparchus.analysis.differentiation.Derivative.getValue`)...]). + + Returns: + f(this) + + """ + ... + @typing.overload + def copySign(self, double: float) -> 'UnivariateDerivative1': + """ + Returns the instance with the sign of the argument. A NaN :code:`sign` argument is treated as positive. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.copySign` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + sign (:class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative1`): the sign for the returned value + + Returns: + the instance with the same sign as the :code:`sign` argument + + Returns the instance with the sign of the argument. A NaN :code:`sign` argument is treated as positive. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.copySign` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + sign (double): the sign for the returned value + + Returns: + the instance with the same sign as the :code:`sign` argument + + + """ + ... @typing.overload def copySign(self, univariateDerivative1: 'UnivariateDerivative1') -> 'UnivariateDerivative1': ... @typing.overload - def divide(self, double: float) -> 'UnivariateDerivative1': ... + def divide(self, double: float) -> 'UnivariateDerivative1': + """ + '÷' operator. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.divide` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + a (double): right hand side parameter of the operator + + Returns: + this÷a + + Compute this ÷ a. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.divide` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Specified by: + :meth:`~org.hipparchus.FieldElement.divide` in interface :class:`~org.hipparchus.FieldElement` + + Parameters: + a (:class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative1`): element to divide by + + Returns: + a new element representing this ÷ a + + + """ + ... @typing.overload def divide(self, univariateDerivative1: 'UnivariateDerivative1') -> 'UnivariateDerivative1': ... - def equals(self, object: typing.Any) -> bool: ... - def getDerivative(self, int: int) -> float: ... - def getField(self) -> UnivariateDerivative1Field: ... - def getFirstDerivative(self) -> float: ... - def getPi(self) -> 'UnivariateDerivative1': ... - def getValue(self) -> float: ... - def hashCode(self) -> int: ... - def hypot(self, univariateDerivative1: 'UnivariateDerivative1') -> 'UnivariateDerivative1': ... - @typing.overload - def linearCombination(self, double: float, univariateDerivative1: 'UnivariateDerivative1', double2: float, univariateDerivative12: 'UnivariateDerivative1') -> 'UnivariateDerivative1': ... + def equals(self, object: typing.Any) -> bool: + """ + Test for the equality of two univariate derivatives. + + univariate derivatives are considered equal if they have the same derivatives. + + Overrides: + :meth:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.equals` in + class :class:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Parameters: + other (:class:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object`): Object to test for equality to this + + Returns: + true if two univariate derivatives are equal + + + """ + ... + def getDerivative(self, int: int) -> float: + """ + Get a derivative from the univariate derivative. + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.UnivariateDerivative.getDerivative` in + class :class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative` + + Parameters: + n (int): derivation order (must be between 0 and :meth:`~org.hipparchus.analysis.differentiation.DifferentialAlgebra.getOrder`, + both inclusive) + + Returns: + n :sup:`th` derivative + + + """ + ... + def getField(self) -> UnivariateDerivative1Field: + """ + Get the :class:`~org.hipparchus.Field` to which the instance belongs. + + Specified by: + :meth:`~org.hipparchus.FieldElement.getField` in interface :class:`~org.hipparchus.FieldElement` + + Returns: + :class:`~org.hipparchus.Field` to which the instance belongs + + + """ + ... + def getFirstDerivative(self) -> float: + """ + Get the first derivative. + + Returns: + first derivative + + Also see: + + - :meth:`~org.hipparchus.analysis.differentiation.UnivariateDerivative1.getValue` + + + + """ + ... + def getPi(self) -> 'UnivariateDerivative1': + """ + Get the Archimedes constant Ï€. + + Archimedes constant is the ratio of a circle's circumference to its diameter. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.getPi` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + Archimedes constant Ï€ + + + """ + ... + def getValue(self) -> float: + """ + Get the value part of the function. + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.Derivative.getValue` in + interface :class:`~org.hipparchus.analysis.differentiation.Derivative` + + Returns: + value part of the value of the function + + + """ + ... + def hashCode(self) -> int: + """ + Get a hashCode for the univariate derivative. + + Overrides: + :meth:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.hashCode` in + class :class:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Returns: + a hash code value for this object + + + """ + ... + def hypot(self, univariateDerivative1: 'UnivariateDerivative1') -> 'UnivariateDerivative1': + """ + Returns the hypotenuse of a triangle with sides :code:`this` and :code:`y` - sqrt(*this* :sup:`2` +*y* :sup:`2` ) + avoiding intermediate overflow or underflow. + + - If either argument is infinite, then the result is positive infinity. + - else, if either argument is NaN then the result is NaN. + + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.hypot` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + y (:class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative1`): a value + + Returns: + sqrt(*this* :sup:`2` +*y* :sup:`2` ) + + + """ + ... + @typing.overload + def linearCombination(self, double: float, univariateDerivative1: 'UnivariateDerivative1', double2: float, univariateDerivative12: 'UnivariateDerivative1') -> 'UnivariateDerivative1': + """ + Compute a linear combination. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` in + interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + a1 (:class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative1`): first factor of the first term + b1 (:class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative1`): second factor of the first term + a2 (:class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative1`): first factor of the second term + b2 (:class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative1`): second factor of the second term + + Returns: + a :sub:`1` ×b :sub:`1` + a :sub:`2` ×b :sub:`2` + + Also see: + + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + + + Compute a linear combination. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` in + interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + a1 (double): first factor of the first term + b1 (:class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative1`): second factor of the first term + a2 (double): first factor of the second term + b2 (:class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative1`): second factor of the second term + + Returns: + a :sub:`1` ×b :sub:`1` + a :sub:`2` ×b :sub:`2` + + Also see: + + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + + + Compute a linear combination. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` in + interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + a1 (:class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative1`): first factor of the first term + b1 (:class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative1`): second factor of the first term + a2 (:class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative1`): first factor of the second term + b2 (:class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative1`): second factor of the second term + a3 (:class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative1`): first factor of the third term + b3 (:class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative1`): second factor of the third term + + Returns: + a :sub:`1` ×b :sub:`1` + a :sub:`2` ×b :sub:`2` + a :sub:`3` ×b :sub:`3` + + Also see: + + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + + + Compute a linear combination. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` in + interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + a1 (double): first factor of the first term + b1 (:class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative1`): second factor of the first term + a2 (double): first factor of the second term + b2 (:class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative1`): second factor of the second term + a3 (double): first factor of the third term + b3 (:class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative1`): second factor of the third term + + Returns: + a :sub:`1` ×b :sub:`1` + a :sub:`2` ×b :sub:`2` + a :sub:`3` ×b :sub:`3` + + Also see: + + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + + + Compute a linear combination. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` in + interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + a1 (:class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative1`): first factor of the first term + b1 (:class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative1`): second factor of the first term + a2 (:class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative1`): first factor of the second term + b2 (:class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative1`): second factor of the second term + a3 (:class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative1`): first factor of the third term + b3 (:class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative1`): second factor of the third term + a4 (:class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative1`): first factor of the fourth term + b4 (:class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative1`): second factor of the fourth term + + Returns: + a :sub:`1` ×b :sub:`1` + a :sub:`2` ×b :sub:`2` + a :sub:`3` ×b :sub:`3` + a :sub:`4` ×b :sub:`4` + + Also see: + + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + + + Compute a linear combination. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` in + interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + a1 (double): first factor of the first term + b1 (:class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative1`): second factor of the first term + a2 (double): first factor of the second term + b2 (:class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative1`): second factor of the second term + a3 (double): first factor of the third term + b3 (:class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative1`): second factor of the third term + a4 (double): first factor of the fourth term + b4 (:class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative1`): second factor of the fourth term + + Returns: + a :sub:`1` ×b :sub:`1` + a :sub:`2` ×b :sub:`2` + a :sub:`3` ×b :sub:`3` + a :sub:`4` ×b :sub:`4` + + Also see: + + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + + + + """ + ... @typing.overload def linearCombination(self, double: float, univariateDerivative1: 'UnivariateDerivative1', double2: float, univariateDerivative12: 'UnivariateDerivative1', double3: float, univariateDerivative13: 'UnivariateDerivative1') -> 'UnivariateDerivative1': ... @typing.overload def linearCombination(self, double: float, univariateDerivative1: 'UnivariateDerivative1', double2: float, univariateDerivative12: 'UnivariateDerivative1', double3: float, univariateDerivative13: 'UnivariateDerivative1', double4: float, univariateDerivative14: 'UnivariateDerivative1') -> 'UnivariateDerivative1': ... @typing.overload - def linearCombination(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], univariateDerivative1Array: typing.Union[typing.List['UnivariateDerivative1'], jpype.JArray]) -> 'UnivariateDerivative1': ... + def linearCombination(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], univariateDerivative1Array: typing.Union[typing.List['UnivariateDerivative1'], jpype.JArray]) -> 'UnivariateDerivative1': + """ + Compute a linear combination. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` in + interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + a (:class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative1`[]): Factors. + b (:class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative1`[]): Factors. + + Returns: + :code:`Σ :sub:`i` a :sub:`i` b :sub:`i``. + + Compute a linear combination. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` in + interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + a (double[]): Factors. + b (:class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative1`[]): Factors. + + Returns: + :code:`Σ :sub:`i` a :sub:`i` b :sub:`i``. + + """ + ... @typing.overload def linearCombination(self, univariateDerivative1: 'UnivariateDerivative1', univariateDerivative12: 'UnivariateDerivative1', univariateDerivative13: 'UnivariateDerivative1', univariateDerivative14: 'UnivariateDerivative1') -> 'UnivariateDerivative1': ... @typing.overload @@ -1404,15 +7940,118 @@ class UnivariateDerivative1(UnivariateDerivative['UnivariateDerivative1'], Deriv @typing.overload def linearCombination(self, univariateDerivative1Array: typing.Union[typing.List['UnivariateDerivative1'], jpype.JArray], univariateDerivative1Array2: typing.Union[typing.List['UnivariateDerivative1'], jpype.JArray]) -> 'UnivariateDerivative1': ... @typing.overload - def multiply(self, double: float) -> 'UnivariateDerivative1': ... + def multiply(self, double: float) -> 'UnivariateDerivative1': + """ + Compute n × this. Multiplication by an integer number is defined as the following sum \[ n \times \mathrm{this} = + \sum_{i=1}^n \mathrm{this} \] + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.multiply` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Specified by: + :meth:`~org.hipparchus.FieldElement.multiply` in interface :class:`~org.hipparchus.FieldElement` + + Parameters: + n (int): Number of times :code:`this` must be added to itself. + + Returns: + A new element representing n × this. + + '×' operator. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.multiply` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + a (double): right hand side parameter of the operator + + Returns: + this×a + + Compute this × a. + + Specified by: + :meth:`~org.hipparchus.FieldElement.multiply` in interface :class:`~org.hipparchus.FieldElement` + + Parameters: + a (:class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative1`): element to multiply + + Returns: + a new element representing this × a + + + """ + ... @typing.overload def multiply(self, int: int) -> 'UnivariateDerivative1': ... @typing.overload def multiply(self, univariateDerivative1: 'UnivariateDerivative1') -> 'UnivariateDerivative1': ... - def negate(self) -> 'UnivariateDerivative1': ... - def newInstance(self, double: float) -> 'UnivariateDerivative1': ... - @typing.overload - def pow(self, t: org.hipparchus.CalculusFieldElement) -> org.hipparchus.CalculusFieldElement: ... + def negate(self) -> 'UnivariateDerivative1': + """ + Returns the additive inverse of :code:`this` element. + + Specified by: + :meth:`~org.hipparchus.FieldElement.negate` in interface :class:`~org.hipparchus.FieldElement` + + Returns: + the opposite of :code:`this`. + + + """ + ... + def newInstance(self, double: float) -> 'UnivariateDerivative1': + """ + Create an instance corresponding to a constant real value. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.newInstance` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + value (double): constant real value + + Returns: + instance corresponding to a constant real value + + + """ + ... + @typing.overload + def pow(self, t: org.hipparchus.CalculusFieldElement) -> org.hipparchus.CalculusFieldElement: + """ + Compute a :sup:`x` where a is a double and x a :class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative1` + + Parameters: + a (double): number to exponentiate + x (:class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative1`): power to apply + + Returns: + a :sup:`x` + + Power operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.pow` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + p (double): power to apply + + Returns: + this :sup:`p` + + Integer power operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.pow` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + n (int): power to apply + + Returns: + this :sup:`n` + + + """ + ... @typing.overload def pow(self, double: float) -> 'UnivariateDerivative1': ... @typing.overload @@ -1421,71 +8060,708 @@ class UnivariateDerivative1(UnivariateDerivative['UnivariateDerivative1'], Deriv @staticmethod def pow(double: float, univariateDerivative1: 'UnivariateDerivative1') -> 'UnivariateDerivative1': ... @typing.overload - def remainder(self, double: float) -> org.hipparchus.CalculusFieldElement: ... + def remainder(self, double: float) -> org.hipparchus.CalculusFieldElement: + """ + IEEE remainder operator. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.remainder` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + a (:class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative1`): right hand side parameter of the operator + + Returns: + this - n × a where n is the closest integer to this/a + + + """ + ... @typing.overload def remainder(self, univariateDerivative1: 'UnivariateDerivative1') -> 'UnivariateDerivative1': ... - def scalb(self, int: int) -> 'UnivariateDerivative1': ... - @typing.overload - def subtract(self, double: float) -> org.hipparchus.CalculusFieldElement: ... + def scalb(self, int: int) -> 'UnivariateDerivative1': + """ + Multiply the instance by a power of 2. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.scalb` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + n (int): power of 2 + + Returns: + this × 2 :sup:`n` + + + """ + ... + @typing.overload + def subtract(self, double: float) -> org.hipparchus.CalculusFieldElement: + """ + Compute this - a. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.subtract` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Specified by: + :meth:`~org.hipparchus.FieldElement.subtract` in interface :class:`~org.hipparchus.FieldElement` + + Parameters: + a (:class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative1`): element to subtract + + Returns: + a new element representing this - a + + + """ + ... @typing.overload def subtract(self, univariateDerivative1: 'UnivariateDerivative1') -> 'UnivariateDerivative1': ... - def taylor(self, double: float) -> float: ... - def toDegrees(self) -> 'UnivariateDerivative1': ... - def toDerivativeStructure(self) -> DerivativeStructure: ... - def toRadians(self) -> 'UnivariateDerivative1': ... - def withValue(self, double: float) -> 'UnivariateDerivative1': ... + def taylor(self, double: float) -> float: + """ + Evaluate Taylor expansion a univariate derivative. + + Parameters: + delta (double): parameter offset Δx + + Returns: + value of the Taylor expansion at x + Δx + + + """ + ... + def toDegrees(self) -> 'UnivariateDerivative1': + """ + Convert radians to degrees, with error of less than 0.5 ULP + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.toDegrees` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + instance converted into degrees + + + """ + ... + def toDerivativeStructure(self) -> DerivativeStructure: + """ + Convert the instance to a :class:`~org.hipparchus.analysis.differentiation.DerivativeStructure`. + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.UnivariateDerivative.toDerivativeStructure` in + class :class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative` + + Returns: + derivative structure with same value and derivative as the instance + + + """ + ... + def toRadians(self) -> 'UnivariateDerivative1': + """ + Convert degrees to radians, with error of less than 0.5 ULP + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.toRadians` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + instance converted into radians + + + """ + ... + def withValue(self, double: float) -> 'UnivariateDerivative1': + """ + Create a new object with new value (zeroth-order derivative, as passed as input) and same derivatives of order one and + above. + + This default implementation is there so that no API gets broken by the next release, which is not a major one. Custom + inheritors should probably overwrite it. + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.Derivative.withValue` in + interface :class:`~org.hipparchus.analysis.differentiation.Derivative` + + Parameters: + value (double): zeroth-order derivative of new represented function + + Returns: + new object with changed value + + + """ + ... class UnivariateDerivative2(UnivariateDerivative['UnivariateDerivative2']): + """ + public classUnivariateDerivative2 extends :class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative`<:class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative2`> + + Class representing both the value and the differentials of a function. + + This class is a stripped-down version of :class:`~org.hipparchus.analysis.differentiation.DerivativeStructure` with only + one :meth:`~org.hipparchus.analysis.differentiation.DerivativeStructure.getFreeParameters` and + :meth:`~org.hipparchus.analysis.differentiation.DerivativeStructure.getOrder` also limited to two. It should have less + overhead than :class:`~org.hipparchus.analysis.differentiation.DerivativeStructure` in its domain. + + This class is an implementation of Rall's numbers. Rall's numbers are an extension to the real numbers used throughout + mathematical expressions; they hold the derivative together with the value of a function. + + :class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative2` instances can be used directly thanks to the + arithmetic operators to the mathematical functions provided as methods by this class (+, -, *, /, %, sin, cos ...). + + Implementing complex expressions by hand using these classes is a tedious and error-prone task but has the advantage of + having no limitation on the derivation order despite not requiring users to compute the derivatives by themselves. + + Instances of this class are guaranteed to be immutable. + + Since: + 1.7 + + Also see: + + - :class:`~org.hipparchus.analysis.differentiation.DerivativeStructure` + - :class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative2` + - :class:`~org.hipparchus.analysis.differentiation.Gradient` + - :class:`~org.hipparchus.analysis.differentiation.FieldDerivativeStructure` + - :class:`~org.hipparchus.analysis.differentiation.FieldUnivariateDerivative2` + - :class:`~org.hipparchus.analysis.differentiation.FieldUnivariateDerivative2` + - :class:`~org.hipparchus.analysis.differentiation.FieldGradient` + - :meth:`~serialized` + """ PI: typing.ClassVar['UnivariateDerivative2'] = ... + """ + public static final :class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative2` PI + + The constant value of Ï€ as a :code:`UnivariateDerivative2`. + + Since: + 2.0 + + + """ @typing.overload def __init__(self, double: float, double2: float, double3: float): ... @typing.overload def __init__(self, derivativeStructure: DerivativeStructure): ... - def abs(self) -> 'UnivariateDerivative2': ... - def acos(self) -> 'UnivariateDerivative2': ... - def acosh(self) -> 'UnivariateDerivative2': ... - @typing.overload - def add(self, double: float) -> org.hipparchus.CalculusFieldElement: ... + def abs(self) -> 'UnivariateDerivative2': + """ + absolute value. + + Returns: + abs(this) + + + """ + ... + def acos(self) -> 'UnivariateDerivative2': + """ + Arc cosine operation. + + Returns: + acos(this) + + + """ + ... + def acosh(self) -> 'UnivariateDerivative2': + """ + Inverse hyperbolic cosine operation. + + Returns: + acosh(this) + + + """ + ... + @typing.overload + def add(self, double: float) -> org.hipparchus.CalculusFieldElement: + """ + Compute this + a. + + Parameters: + a (:class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative2`): element to add + + Returns: + a new element representing this + a + + + """ + ... @typing.overload def add(self, univariateDerivative2: 'UnivariateDerivative2') -> 'UnivariateDerivative2': ... - def asin(self) -> 'UnivariateDerivative2': ... - def asinh(self) -> 'UnivariateDerivative2': ... - def atan(self) -> 'UnivariateDerivative2': ... - def atan2(self, univariateDerivative2: 'UnivariateDerivative2') -> 'UnivariateDerivative2': ... - def atanh(self) -> 'UnivariateDerivative2': ... - def cbrt(self) -> 'UnivariateDerivative2': ... - def compareTo(self, univariateDerivative2: 'UnivariateDerivative2') -> int: ... - def compose(self, *double: float) -> 'UnivariateDerivative2': ... - @typing.overload - def copySign(self, double: float) -> 'UnivariateDerivative2': ... + def asin(self) -> 'UnivariateDerivative2': + """ + Arc sine operation. + + Returns: + asin(this) + + + """ + ... + def asinh(self) -> 'UnivariateDerivative2': + """ + Inverse hyperbolic sine operation. + + Returns: + asin(this) + + + """ + ... + def atan(self) -> 'UnivariateDerivative2': + """ + Arc tangent operation. + + Returns: + atan(this) + + + """ + ... + def atan2(self, univariateDerivative2: 'UnivariateDerivative2') -> 'UnivariateDerivative2': + """ + Two arguments arc tangent operation. + + Beware of the order or arguments! As this is based on a two-arguments functions, in order to be consistent with + arguments order, the instance is the *first* argument and the single provided argument is the *second* argument. In + order to be consistent with programming languages :code:`atan2`, this method computes :code:`atan2(this, x)`, i.e. the + instance represents the :code:`y` argument and the :code:`x` argument is the one passed as a single argument. This may + seem confusing especially for users of Wolfram alpha, as this site is *not* consistent with programming languages + :code:`atan2` two-arguments arc tangent and puts :code:`x` as its first argument. + + Parameters: + x (:class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative2`): second argument of the arc tangent + + Returns: + + """ + ... + def atanh(self) -> 'UnivariateDerivative2': + """ + Inverse hyperbolic tangent operation. + + Returns: + atanh(this) + + + """ + ... + def cbrt(self) -> 'UnivariateDerivative2': + """ + Cubic root. + + Returns: + cubic root of the instance + + + """ + ... + def compareTo(self, univariateDerivative2: 'UnivariateDerivative2') -> int: + """ + + Comparison performed considering that derivatives are intrinsically linked to monomials in the corresponding Taylor + expansion and that the higher the degree, the smaller the term. + + Since: + 3.0 + + + """ + ... + def compose(self, *double: float) -> 'UnivariateDerivative2': + """ + Compute composition of the instance by a univariate function. + + Parameters: + f (double...): array of value and derivatives of the function at the current point (i.e. + [f(:meth:`~org.hipparchus.analysis.differentiation.Derivative.getValue`), + f'(:meth:`~org.hipparchus.analysis.differentiation.Derivative.getValue`), + f''(:meth:`~org.hipparchus.analysis.differentiation.Derivative.getValue`)...]). + + Returns: + f(this) + + + """ + ... + @typing.overload + def copySign(self, double: float) -> 'UnivariateDerivative2': + """ + Returns the instance with the sign of the argument. A NaN :code:`sign` argument is treated as positive. + + Parameters: + sign (:class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative2`): the sign for the returned value + + Returns: + the instance with the same sign as the :code:`sign` argument + + Returns the instance with the sign of the argument. A NaN :code:`sign` argument is treated as positive. + + Parameters: + sign (double): the sign for the returned value + + Returns: + the instance with the same sign as the :code:`sign` argument + + + """ + ... @typing.overload def copySign(self, univariateDerivative2: 'UnivariateDerivative2') -> 'UnivariateDerivative2': ... - def cos(self) -> 'UnivariateDerivative2': ... - def cosh(self) -> 'UnivariateDerivative2': ... - @typing.overload - def divide(self, double: float) -> 'UnivariateDerivative2': ... + def cos(self) -> 'UnivariateDerivative2': + """ + Cosine operation. + + Returns: + cos(this) + + + """ + ... + def cosh(self) -> 'UnivariateDerivative2': + """ + Hyperbolic cosine operation. + + Returns: + cosh(this) + + + """ + ... + @typing.overload + def divide(self, double: float) -> 'UnivariateDerivative2': + """ + '÷' operator. + + Parameters: + a (double): right hand side parameter of the operator + + Returns: + this÷a + + Compute this ÷ a. + + Parameters: + a (:class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative2`): element to divide by + + Returns: + a new element representing this ÷ a + + + """ + ... @typing.overload def divide(self, univariateDerivative2: 'UnivariateDerivative2') -> 'UnivariateDerivative2': ... - def equals(self, object: typing.Any) -> bool: ... - def exp(self) -> 'UnivariateDerivative2': ... - def expm1(self) -> 'UnivariateDerivative2': ... - def getDerivative(self, int: int) -> float: ... - def getField(self) -> UnivariateDerivative2Field: ... - def getFirstDerivative(self) -> float: ... - def getOrder(self) -> int: ... - def getPi(self) -> 'UnivariateDerivative2': ... - def getSecondDerivative(self) -> float: ... - def getValue(self) -> float: ... - def hashCode(self) -> int: ... - def hypot(self, univariateDerivative2: 'UnivariateDerivative2') -> 'UnivariateDerivative2': ... - @typing.overload - def linearCombination(self, double: float, univariateDerivative2: 'UnivariateDerivative2', double2: float, univariateDerivative22: 'UnivariateDerivative2') -> 'UnivariateDerivative2': ... + def equals(self, object: typing.Any) -> bool: + """ + Test for the equality of two univariate derivatives. + + univariate derivatives are considered equal if they have the same derivatives. + + Overrides: + :meth:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.equals` in + class :class:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Parameters: + other (:class:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object`): Object to test for equality to this + + Returns: + true if two univariate derivatives are equal + + + """ + ... + def exp(self) -> 'UnivariateDerivative2': + """ + Exponential. + + Returns: + exponential of the instance + + + """ + ... + def expm1(self) -> 'UnivariateDerivative2': + """ + Exponential minus 1. + + Returns: + exponential minus one of the instance + + + """ + ... + def getDerivative(self, int: int) -> float: + """ + Get a derivative from the univariate derivative. + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.UnivariateDerivative.getDerivative` in + class :class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative` + + Parameters: + n (int): derivation order (must be between 0 and :meth:`~org.hipparchus.analysis.differentiation.DifferentialAlgebra.getOrder`, + both inclusive) + + Returns: + n :sup:`th` derivative + + + """ + ... + def getField(self) -> UnivariateDerivative2Field: + """ + Get the :class:`~org.hipparchus.Field` to which the instance belongs. + + Returns: + :class:`~org.hipparchus.Field` to which the instance belongs + + + """ + ... + def getFirstDerivative(self) -> float: + """ + Get the first derivative. + + Returns: + first derivative + + Also see: + + - :meth:`~org.hipparchus.analysis.differentiation.UnivariateDerivative2.getValue` + - :meth:`~org.hipparchus.analysis.differentiation.UnivariateDerivative2.getSecondDerivative` + + + + """ + ... + def getOrder(self) -> int: + """ + Get the maximum derivation order. + + Returns: + maximum derivation order + + + """ + ... + def getPi(self) -> 'UnivariateDerivative2': + """ + Get the Archimedes constant Ï€. + + Archimedes constant is the ratio of a circle's circumference to its diameter. + + Returns: + Archimedes constant Ï€ + + + """ + ... + def getSecondDerivative(self) -> float: + """ + Get the second derivative. + + Returns: + second derivative + + Also see: + + - :meth:`~org.hipparchus.analysis.differentiation.UnivariateDerivative2.getValue` + - :meth:`~org.hipparchus.analysis.differentiation.UnivariateDerivative2.getFirstDerivative` + + + + """ + ... + def getValue(self) -> float: + """ + Get the value part of the function. + + Returns: + value part of the value of the function + + + """ + ... + def hashCode(self) -> int: + """ + Get a hashCode for the univariate derivative. + + Overrides: + :meth:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.hashCode` in + class :class:`~org.hipparchus.analysis.differentiation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Returns: + a hash code value for this object + + + """ + ... + def hypot(self, univariateDerivative2: 'UnivariateDerivative2') -> 'UnivariateDerivative2': + """ + Returns the hypotenuse of a triangle with sides :code:`this` and :code:`y` - sqrt(*this* :sup:`2` +*y* :sup:`2` ) + avoiding intermediate overflow or underflow. + + - If either argument is infinite, then the result is positive infinity. + - else, if either argument is NaN then the result is NaN. + + + Parameters: + y (:class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative2`): a value + + Returns: + sqrt(*this* :sup:`2` +*y* :sup:`2` ) + + + """ + ... + @typing.overload + def linearCombination(self, double: float, univariateDerivative2: 'UnivariateDerivative2', double2: float, univariateDerivative22: 'UnivariateDerivative2') -> 'UnivariateDerivative2': + """ + Compute a linear combination. + + Parameters: + a1 (:class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative2`): first factor of the first term + b1 (:class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative2`): second factor of the first term + a2 (:class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative2`): first factor of the second term + b2 (:class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative2`): second factor of the second term + + Returns: + a :sub:`1` ×b :sub:`1` + a :sub:`2` ×b :sub:`2` + + Also see: + + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + + + Compute a linear combination. + + Parameters: + a1 (double): first factor of the first term + b1 (:class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative2`): second factor of the first term + a2 (double): first factor of the second term + b2 (:class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative2`): second factor of the second term + + Returns: + a :sub:`1` ×b :sub:`1` + a :sub:`2` ×b :sub:`2` + + Also see: + + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + + + Compute a linear combination. + + Parameters: + a1 (:class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative2`): first factor of the first term + b1 (:class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative2`): second factor of the first term + a2 (:class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative2`): first factor of the second term + b2 (:class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative2`): second factor of the second term + a3 (:class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative2`): first factor of the third term + b3 (:class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative2`): second factor of the third term + + Returns: + a :sub:`1` ×b :sub:`1` + a :sub:`2` ×b :sub:`2` + a :sub:`3` ×b :sub:`3` + + Also see: + + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + + + Compute a linear combination. + + Parameters: + a1 (double): first factor of the first term + b1 (:class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative2`): second factor of the first term + a2 (double): first factor of the second term + b2 (:class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative2`): second factor of the second term + a3 (double): first factor of the third term + b3 (:class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative2`): second factor of the third term + + Returns: + a :sub:`1` ×b :sub:`1` + a :sub:`2` ×b :sub:`2` + a :sub:`3` ×b :sub:`3` + + Also see: + + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + + + Compute a linear combination. + + Parameters: + a1 (:class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative2`): first factor of the first term + b1 (:class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative2`): second factor of the first term + a2 (:class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative2`): first factor of the second term + b2 (:class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative2`): second factor of the second term + a3 (:class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative2`): first factor of the third term + b3 (:class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative2`): second factor of the third term + a4 (:class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative2`): first factor of the fourth term + b4 (:class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative2`): second factor of the fourth term + + Returns: + a :sub:`1` ×b :sub:`1` + a :sub:`2` ×b :sub:`2` + a :sub:`3` ×b :sub:`3` + a :sub:`4` ×b :sub:`4` + + Also see: + + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + + + Compute a linear combination. + + Parameters: + a1 (double): first factor of the first term + b1 (:class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative2`): second factor of the first term + a2 (double): first factor of the second term + b2 (:class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative2`): second factor of the second term + a3 (double): first factor of the third term + b3 (:class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative2`): second factor of the third term + a4 (double): first factor of the fourth term + b4 (:class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative2`): second factor of the fourth term + + Returns: + a :sub:`1` ×b :sub:`1` + a :sub:`2` ×b :sub:`2` + a :sub:`3` ×b :sub:`3` + a :sub:`4` ×b :sub:`4` + + Also see: + + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + + + + """ + ... @typing.overload def linearCombination(self, double: float, univariateDerivative2: 'UnivariateDerivative2', double2: float, univariateDerivative22: 'UnivariateDerivative2', double3: float, univariateDerivative23: 'UnivariateDerivative2') -> 'UnivariateDerivative2': ... @typing.overload def linearCombination(self, double: float, univariateDerivative2: 'UnivariateDerivative2', double2: float, univariateDerivative22: 'UnivariateDerivative2', double3: float, univariateDerivative23: 'UnivariateDerivative2', double4: float, univariateDerivative24: 'UnivariateDerivative2') -> 'UnivariateDerivative2': ... @typing.overload - def linearCombination(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], univariateDerivative2Array: typing.Union[typing.List['UnivariateDerivative2'], jpype.JArray]) -> 'UnivariateDerivative2': ... + def linearCombination(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], univariateDerivative2Array: typing.Union[typing.List['UnivariateDerivative2'], jpype.JArray]) -> 'UnivariateDerivative2': + """ + Compute a linear combination. + + Parameters: + a (:class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative2`[]): Factors. + b (:class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative2`[]): Factors. + + Returns: + :code:`Σ :sub:`i` a :sub:`i` b :sub:`i``. + + Compute a linear combination. + + Parameters: + a (double[]): Factors. + b (:class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative2`[]): Factors. + + Returns: + :code:`Σ :sub:`i` a :sub:`i` b :sub:`i``. + + """ + ... @typing.overload def linearCombination(self, univariateDerivative2: 'UnivariateDerivative2', univariateDerivative22: 'UnivariateDerivative2', univariateDerivative23: 'UnivariateDerivative2', univariateDerivative24: 'UnivariateDerivative2') -> 'UnivariateDerivative2': ... @typing.overload @@ -1494,19 +8770,125 @@ class UnivariateDerivative2(UnivariateDerivative['UnivariateDerivative2']): def linearCombination(self, univariateDerivative2: 'UnivariateDerivative2', univariateDerivative22: 'UnivariateDerivative2', univariateDerivative23: 'UnivariateDerivative2', univariateDerivative24: 'UnivariateDerivative2', univariateDerivative25: 'UnivariateDerivative2', univariateDerivative26: 'UnivariateDerivative2', univariateDerivative27: 'UnivariateDerivative2', univariateDerivative28: 'UnivariateDerivative2') -> 'UnivariateDerivative2': ... @typing.overload def linearCombination(self, univariateDerivative2Array: typing.Union[typing.List['UnivariateDerivative2'], jpype.JArray], univariateDerivative2Array2: typing.Union[typing.List['UnivariateDerivative2'], jpype.JArray]) -> 'UnivariateDerivative2': ... - def log(self) -> 'UnivariateDerivative2': ... - def log10(self) -> 'UnivariateDerivative2': ... - def log1p(self) -> 'UnivariateDerivative2': ... - @typing.overload - def multiply(self, double: float) -> 'UnivariateDerivative2': ... + def log(self) -> 'UnivariateDerivative2': + """ + Natural logarithm. + + Returns: + logarithm of the instance + + + """ + ... + def log10(self) -> 'UnivariateDerivative2': + """ + Base 10 logarithm. + + Returns: + base 10 logarithm of the instance + + + """ + ... + def log1p(self) -> 'UnivariateDerivative2': + """ + Shifted natural logarithm. + + Returns: + logarithm of one plus the instance + + + """ + ... + @typing.overload + def multiply(self, double: float) -> 'UnivariateDerivative2': + """ + Compute n × this. Multiplication by an integer number is defined as the following sum \[ n \times \mathrm{this} = + \sum_{i=1}^n \mathrm{this} \] + + Parameters: + n (int): Number of times :code:`this` must be added to itself. + + Returns: + A new element representing n × this. + + '×' operator. + + Parameters: + a (double): right hand side parameter of the operator + + Returns: + this×a + + Compute this × a. + + Parameters: + a (:class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative2`): element to multiply + + Returns: + a new element representing this × a + + + """ + ... @typing.overload def multiply(self, int: int) -> 'UnivariateDerivative2': ... @typing.overload def multiply(self, univariateDerivative2: 'UnivariateDerivative2') -> 'UnivariateDerivative2': ... - def negate(self) -> 'UnivariateDerivative2': ... - def newInstance(self, double: float) -> 'UnivariateDerivative2': ... - @typing.overload - def pow(self, t: org.hipparchus.CalculusFieldElement) -> org.hipparchus.CalculusFieldElement: ... + def negate(self) -> 'UnivariateDerivative2': + """ + Returns the additive inverse of :code:`this` element. + + Returns: + the opposite of :code:`this`. + + + """ + ... + def newInstance(self, double: float) -> 'UnivariateDerivative2': + """ + Create an instance corresponding to a constant real value. + + Parameters: + value (double): constant real value + + Returns: + instance corresponding to a constant real value + + + """ + ... + @typing.overload + def pow(self, t: org.hipparchus.CalculusFieldElement) -> org.hipparchus.CalculusFieldElement: + """ + Compute a :sup:`x` where a is a double and x a :class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative2` + + Parameters: + a (double): number to exponentiate + x (:class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative2`): power to apply + + Returns: + a :sup:`x` + + Power operation. + + Parameters: + p (double): power to apply + + Returns: + this :sup:`p` + + Integer power operation. + + Parameters: + n (int): power to apply + + Returns: + this :sup:`n` + + + """ + ... @typing.overload def pow(self, double: float) -> 'UnivariateDerivative2': ... @typing.overload @@ -1514,30 +8896,201 @@ class UnivariateDerivative2(UnivariateDerivative['UnivariateDerivative2']): @typing.overload @staticmethod def pow(double: float, univariateDerivative2: 'UnivariateDerivative2') -> 'UnivariateDerivative2': ... - def reciprocal(self) -> 'UnivariateDerivative2': ... - @typing.overload - def remainder(self, double: float) -> org.hipparchus.CalculusFieldElement: ... + def reciprocal(self) -> 'UnivariateDerivative2': + """ + Returns the multiplicative inverse of :code:`this` element. + + Returns: + the inverse of :code:`this`. + + + """ + ... + @typing.overload + def remainder(self, double: float) -> org.hipparchus.CalculusFieldElement: + """ + IEEE remainder operator. + + Parameters: + a (:class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative2`): right hand side parameter of the operator + + Returns: + this - n × a where n is the closest integer to this/a + + + """ + ... @typing.overload def remainder(self, univariateDerivative2: 'UnivariateDerivative2') -> 'UnivariateDerivative2': ... - def rootN(self, int: int) -> 'UnivariateDerivative2': ... - def scalb(self, int: int) -> 'UnivariateDerivative2': ... - def sin(self) -> 'UnivariateDerivative2': ... + def rootN(self, int: int) -> 'UnivariateDerivative2': + """ + N :sup:`th` root. + + Parameters: + n (int): order of the root + + Returns: + n :sup:`th` root of the instance + + + """ + ... + def scalb(self, int: int) -> 'UnivariateDerivative2': + """ + Multiply the instance by a power of 2. + + Parameters: + n (int): power of 2 + + Returns: + this × 2 :sup:`n` + + + """ + ... + def sin(self) -> 'UnivariateDerivative2': + """ + Sine operation. + + Returns: + sin(this) + + + """ + ... def sinCos(self) -> org.hipparchus.util.FieldSinCos['UnivariateDerivative2']: ... - def sinh(self) -> 'UnivariateDerivative2': ... + def sinh(self) -> 'UnivariateDerivative2': + """ + Hyperbolic sine operation. + + Returns: + sinh(this) + + + """ + ... def sinhCosh(self) -> org.hipparchus.util.FieldSinhCosh['UnivariateDerivative2']: ... - def sqrt(self) -> 'UnivariateDerivative2': ... - def square(self) -> 'UnivariateDerivative2': ... - @typing.overload - def subtract(self, double: float) -> org.hipparchus.CalculusFieldElement: ... + def sqrt(self) -> 'UnivariateDerivative2': + """ + Square root. + + Returns: + square root of the instance + + + """ + ... + def square(self) -> 'UnivariateDerivative2': + """ + Compute this × this. + + Returns: + a new element representing this × this + + + """ + ... + @typing.overload + def subtract(self, double: float) -> org.hipparchus.CalculusFieldElement: + """ + Compute this - a. + + Parameters: + a (:class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative2`): element to subtract + + Returns: + a new element representing this - a + + + """ + ... @typing.overload def subtract(self, univariateDerivative2: 'UnivariateDerivative2') -> 'UnivariateDerivative2': ... - def tan(self) -> 'UnivariateDerivative2': ... - def tanh(self) -> 'UnivariateDerivative2': ... - def taylor(self, double: float) -> float: ... - def toDegrees(self) -> 'UnivariateDerivative2': ... - def toDerivativeStructure(self) -> DerivativeStructure: ... - def toRadians(self) -> 'UnivariateDerivative2': ... - def withValue(self, double: float) -> 'UnivariateDerivative2': ... + def tan(self) -> 'UnivariateDerivative2': + """ + Tangent operation. + + Returns: + tan(this) + + + """ + ... + def tanh(self) -> 'UnivariateDerivative2': + """ + Hyperbolic tangent operation. + + Returns: + tanh(this) + + + """ + ... + def taylor(self, double: float) -> float: + """ + Evaluate Taylor expansion a univariate derivative. + + Parameters: + delta (double): parameter offset Δx + + Returns: + value of the Taylor expansion at x + Δx + + + """ + ... + def toDegrees(self) -> 'UnivariateDerivative2': + """ + Convert radians to degrees, with error of less than 0.5 ULP + + Returns: + instance converted into degrees + + + """ + ... + def toDerivativeStructure(self) -> DerivativeStructure: + """ + Convert the instance to a :class:`~org.hipparchus.analysis.differentiation.DerivativeStructure`. + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.UnivariateDerivative.toDerivativeStructure` in + class :class:`~org.hipparchus.analysis.differentiation.UnivariateDerivative` + + Returns: + derivative structure with same value and derivative as the instance + + + """ + ... + def toRadians(self) -> 'UnivariateDerivative2': + """ + Convert degrees to radians, with error of less than 0.5 ULP + + Returns: + instance converted into radians + + + """ + ... + def withValue(self, double: float) -> 'UnivariateDerivative2': + """ + Description copied from interface: :meth:`~org.hipparchus.analysis.differentiation.Derivative.withValue` + Create a new object with new value (zeroth-order derivative, as passed as input) and same derivatives of order one and + above. + + This default implementation is there so that no API gets broken by the next release, which is not a major one. Custom + inheritors should probably overwrite it. + + Parameters: + value (double): zeroth-order derivative of new represented function + + Returns: + new object with changed value + + + """ + ... class __module_protocol__(Protocol): diff --git a/org-stubs/hipparchus/analysis/function/__init__.pyi b/org-stubs/hipparchus/analysis/function/__init__.pyi index ca577d0..136aa36 100644 --- a/org-stubs/hipparchus/analysis/function/__init__.pyi +++ b/org-stubs/hipparchus/analysis/function/__init__.pyi @@ -13,138 +13,768 @@ import typing class Abs(org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction): + """ + public classAbs extends :class:`~org.hipparchus.analysis.function.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction` + + Absolute value function. + """ def __init__(self): ... _value_1__T = typing.TypeVar('_value_1__T', bound=org.hipparchus.analysis.differentiation.Derivative) # <T> @typing.overload - def value(self, double: float) -> float: ... - @typing.overload - def value(self, t: _value_1__T) -> _value_1__T: ... + def value(self, double: float) -> float: + """ + Compute the value of the function. + + Specified by: + :meth:`~org.hipparchus.analysis.UnivariateFunction.value` in + interface :class:`~org.hipparchus.analysis.UnivariateFunction` + + Parameters: + x (double): Point at which the function value should be computed. + + Returns: + the value of the function. + + """ + ... + @typing.overload + def value(self, t: _value_1__T) -> _value_1__T: + """ + Compute the value for the function. + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction.value` in + interface :class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction` + + Parameters: + x (T): the point for which the function value should be computed + + Returns: + the value + + + """ + ... class Acos(org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction): + """ + public classAcos extends :class:`~org.hipparchus.analysis.function.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction` + + Arc-cosine function. + """ def __init__(self): ... _value_1__T = typing.TypeVar('_value_1__T', bound=org.hipparchus.analysis.differentiation.Derivative) # <T> @typing.overload - def value(self, double: float) -> float: ... - @typing.overload - def value(self, t: _value_1__T) -> _value_1__T: ... + def value(self, double: float) -> float: + """ + Compute the value of the function. + + Specified by: + :meth:`~org.hipparchus.analysis.UnivariateFunction.value` in + interface :class:`~org.hipparchus.analysis.UnivariateFunction` + + Parameters: + x (double): Point at which the function value should be computed. + + Returns: + the value of the function. + + """ + ... + @typing.overload + def value(self, t: _value_1__T) -> _value_1__T: + """ + Compute the value for the function. + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction.value` in + interface :class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction` + + Parameters: + x (T): the point for which the function value should be computed + + Returns: + the value + + + """ + ... class Acosh(org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction): + """ + public classAcosh extends :class:`~org.hipparchus.analysis.function.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction` + + Hyperbolic arc-cosine function. + """ def __init__(self): ... _value_1__T = typing.TypeVar('_value_1__T', bound=org.hipparchus.analysis.differentiation.Derivative) # <T> @typing.overload - def value(self, double: float) -> float: ... - @typing.overload - def value(self, t: _value_1__T) -> _value_1__T: ... + def value(self, double: float) -> float: + """ + Compute the value of the function. + + Specified by: + :meth:`~org.hipparchus.analysis.UnivariateFunction.value` in + interface :class:`~org.hipparchus.analysis.UnivariateFunction` + + Parameters: + x (double): Point at which the function value should be computed. + + Returns: + the value of the function. + + """ + ... + @typing.overload + def value(self, t: _value_1__T) -> _value_1__T: + """ + Compute the value for the function. + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction.value` in + interface :class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction` + + Parameters: + x (T): the point for which the function value should be computed + + Returns: + the value + + + """ + ... class Add(org.hipparchus.analysis.BivariateFunction): + """ + public classAdd extends :class:`~org.hipparchus.analysis.function.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.analysis.BivariateFunction` + + Add the two operands. + """ def __init__(self): ... - def value(self, double: float, double2: float) -> float: ... + def value(self, double: float, double2: float) -> float: + """ + Compute the value for the function. + + Specified by: + :meth:`~org.hipparchus.analysis.BivariateFunction.value` in + interface :class:`~org.hipparchus.analysis.BivariateFunction` + + Parameters: + x (double): Abscissa for which the function value should be computed. + y (double): Ordinate for which the function value should be computed. + + Returns: + the value. + + + """ + ... class Asin(org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction): + """ + public classAsin extends :class:`~org.hipparchus.analysis.function.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction` + + Arc-sine function. + """ def __init__(self): ... _value_1__T = typing.TypeVar('_value_1__T', bound=org.hipparchus.analysis.differentiation.Derivative) # <T> @typing.overload - def value(self, double: float) -> float: ... - @typing.overload - def value(self, t: _value_1__T) -> _value_1__T: ... + def value(self, double: float) -> float: + """ + Compute the value of the function. + + Specified by: + :meth:`~org.hipparchus.analysis.UnivariateFunction.value` in + interface :class:`~org.hipparchus.analysis.UnivariateFunction` + + Parameters: + x (double): Point at which the function value should be computed. + + Returns: + the value of the function. + + """ + ... + @typing.overload + def value(self, t: _value_1__T) -> _value_1__T: + """ + Compute the value for the function. + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction.value` in + interface :class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction` + + Parameters: + x (T): the point for which the function value should be computed + + Returns: + the value + + + """ + ... class Asinh(org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction): + """ + public classAsinh extends :class:`~org.hipparchus.analysis.function.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction` + + Hyperbolic arc-sine function. + """ def __init__(self): ... _value_1__T = typing.TypeVar('_value_1__T', bound=org.hipparchus.analysis.differentiation.Derivative) # <T> @typing.overload - def value(self, double: float) -> float: ... - @typing.overload - def value(self, t: _value_1__T) -> _value_1__T: ... + def value(self, double: float) -> float: + """ + Compute the value of the function. + + Specified by: + :meth:`~org.hipparchus.analysis.UnivariateFunction.value` in + interface :class:`~org.hipparchus.analysis.UnivariateFunction` + + Parameters: + x (double): Point at which the function value should be computed. + + Returns: + the value of the function. + + """ + ... + @typing.overload + def value(self, t: _value_1__T) -> _value_1__T: + """ + Compute the value for the function. + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction.value` in + interface :class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction` + + Parameters: + x (T): the point for which the function value should be computed + + Returns: + the value + + + """ + ... class Atan(org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction): + """ + public classAtan extends :class:`~org.hipparchus.analysis.function.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction` + + Arc-tangent function. + """ def __init__(self): ... _value_1__T = typing.TypeVar('_value_1__T', bound=org.hipparchus.analysis.differentiation.Derivative) # <T> @typing.overload - def value(self, double: float) -> float: ... - @typing.overload - def value(self, t: _value_1__T) -> _value_1__T: ... + def value(self, double: float) -> float: + """ + Compute the value of the function. + + Specified by: + :meth:`~org.hipparchus.analysis.UnivariateFunction.value` in + interface :class:`~org.hipparchus.analysis.UnivariateFunction` + + Parameters: + x (double): Point at which the function value should be computed. + + Returns: + the value of the function. + + """ + ... + @typing.overload + def value(self, t: _value_1__T) -> _value_1__T: + """ + Compute the value for the function. + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction.value` in + interface :class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction` + + Parameters: + x (T): the point for which the function value should be computed + + Returns: + the value + + + """ + ... class Atan2(org.hipparchus.analysis.BivariateFunction): + """ + public classAtan2 extends :class:`~org.hipparchus.analysis.function.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.analysis.BivariateFunction` + + Arc-tangent function. + """ def __init__(self): ... - def value(self, double: float, double2: float) -> float: ... + def value(self, double: float, double2: float) -> float: + """ + Compute the value for the function. + + Specified by: + :meth:`~org.hipparchus.analysis.BivariateFunction.value` in + interface :class:`~org.hipparchus.analysis.BivariateFunction` + + Parameters: + x (double): Abscissa for which the function value should be computed. + y (double): Ordinate for which the function value should be computed. + + Returns: + the value. + + + """ + ... class Atanh(org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction): + """ + public classAtanh extends :class:`~org.hipparchus.analysis.function.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction` + + Hyperbolic arc-tangent function. + """ def __init__(self): ... _value_1__T = typing.TypeVar('_value_1__T', bound=org.hipparchus.analysis.differentiation.Derivative) # <T> @typing.overload - def value(self, double: float) -> float: ... - @typing.overload - def value(self, t: _value_1__T) -> _value_1__T: ... + def value(self, double: float) -> float: + """ + Compute the value of the function. + + Specified by: + :meth:`~org.hipparchus.analysis.UnivariateFunction.value` in + interface :class:`~org.hipparchus.analysis.UnivariateFunction` + + Parameters: + x (double): Point at which the function value should be computed. + + Returns: + the value of the function. + + """ + ... + @typing.overload + def value(self, t: _value_1__T) -> _value_1__T: + """ + Compute the value for the function. + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction.value` in + interface :class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction` + + Parameters: + x (T): the point for which the function value should be computed + + Returns: + the value + + + """ + ... class Cbrt(org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction): + """ + public classCbrt extends :class:`~org.hipparchus.analysis.function.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction` + + Cube root function. + """ def __init__(self): ... _value_1__T = typing.TypeVar('_value_1__T', bound=org.hipparchus.analysis.differentiation.Derivative) # <T> @typing.overload - def value(self, double: float) -> float: ... - @typing.overload - def value(self, t: _value_1__T) -> _value_1__T: ... + def value(self, double: float) -> float: + """ + Compute the value of the function. + + Specified by: + :meth:`~org.hipparchus.analysis.UnivariateFunction.value` in + interface :class:`~org.hipparchus.analysis.UnivariateFunction` + + Parameters: + x (double): Point at which the function value should be computed. + + Returns: + the value of the function. + + """ + ... + @typing.overload + def value(self, t: _value_1__T) -> _value_1__T: + """ + Compute the value for the function. + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction.value` in + interface :class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction` + + Parameters: + x (T): the point for which the function value should be computed + + Returns: + the value + + + """ + ... class Ceil(org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction): + """ + public classCeil extends :class:`~org.hipparchus.analysis.function.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction` + + :code:`ceil` function. + """ def __init__(self): ... _value_1__T = typing.TypeVar('_value_1__T', bound=org.hipparchus.analysis.differentiation.Derivative) # <T> @typing.overload - def value(self, double: float) -> float: ... - @typing.overload - def value(self, t: _value_1__T) -> _value_1__T: ... + def value(self, double: float) -> float: + """ + Compute the value of the function. + + Specified by: + :meth:`~org.hipparchus.analysis.UnivariateFunction.value` in + interface :class:`~org.hipparchus.analysis.UnivariateFunction` + + Parameters: + x (double): Point at which the function value should be computed. + + Returns: + the value of the function. + + """ + ... + @typing.overload + def value(self, t: _value_1__T) -> _value_1__T: + """ + Compute the value for the function. + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction.value` in + interface :class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction` + + Parameters: + x (T): the point for which the function value should be computed + + Returns: + the value + + + """ + ... class Constant(org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction): + """ + public classConstant extends :class:`~org.hipparchus.analysis.function.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction` + + Constant function. + """ def __init__(self, double: float): ... _value_1__T = typing.TypeVar('_value_1__T', bound=org.hipparchus.analysis.differentiation.Derivative) # <T> @typing.overload - def value(self, double: float) -> float: ... - @typing.overload - def value(self, t: _value_1__T) -> _value_1__T: ... + def value(self, double: float) -> float: + """ + Compute the value of the function. + + Specified by: + :meth:`~org.hipparchus.analysis.UnivariateFunction.value` in + interface :class:`~org.hipparchus.analysis.UnivariateFunction` + + Parameters: + x (double): Point at which the function value should be computed. + + Returns: + the value of the function. + + """ + ... + @typing.overload + def value(self, t: _value_1__T) -> _value_1__T: + """ + Compute the value for the function. + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction.value` in + interface :class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction` + + Parameters: + t (T): the point for which the function value should be computed + + Returns: + the value + + + """ + ... class Cos(org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction): + """ + public classCos extends :class:`~org.hipparchus.analysis.function.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction` + + Cosine function. + """ def __init__(self): ... _value_1__T = typing.TypeVar('_value_1__T', bound=org.hipparchus.analysis.differentiation.Derivative) # <T> @typing.overload - def value(self, double: float) -> float: ... - @typing.overload - def value(self, t: _value_1__T) -> _value_1__T: ... + def value(self, double: float) -> float: + """ + Compute the value of the function. + + Specified by: + :meth:`~org.hipparchus.analysis.UnivariateFunction.value` in + interface :class:`~org.hipparchus.analysis.UnivariateFunction` + + Parameters: + x (double): Point at which the function value should be computed. + + Returns: + the value of the function. + + """ + ... + @typing.overload + def value(self, t: _value_1__T) -> _value_1__T: + """ + Compute the value for the function. + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction.value` in + interface :class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction` + + Parameters: + x (T): the point for which the function value should be computed + + Returns: + the value + + + """ + ... class Cosh(org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction): + """ + public classCosh extends :class:`~org.hipparchus.analysis.function.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction` + + Hyperbolic cosine function. + """ def __init__(self): ... _value_1__T = typing.TypeVar('_value_1__T', bound=org.hipparchus.analysis.differentiation.Derivative) # <T> @typing.overload - def value(self, double: float) -> float: ... - @typing.overload - def value(self, t: _value_1__T) -> _value_1__T: ... + def value(self, double: float) -> float: + """ + Compute the value of the function. + + Specified by: + :meth:`~org.hipparchus.analysis.UnivariateFunction.value` in + interface :class:`~org.hipparchus.analysis.UnivariateFunction` + + Parameters: + x (double): Point at which the function value should be computed. + + Returns: + the value of the function. + + """ + ... + @typing.overload + def value(self, t: _value_1__T) -> _value_1__T: + """ + Compute the value for the function. + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction.value` in + interface :class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction` + + Parameters: + x (T): the point for which the function value should be computed + + Returns: + the value + + + """ + ... class Divide(org.hipparchus.analysis.BivariateFunction): + """ + public classDivide extends :class:`~org.hipparchus.analysis.function.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.analysis.BivariateFunction` + + Divide the first operand by the second. + """ def __init__(self): ... - def value(self, double: float, double2: float) -> float: ... + def value(self, double: float, double2: float) -> float: + """ + Compute the value for the function. + + Specified by: + :meth:`~org.hipparchus.analysis.BivariateFunction.value` in + interface :class:`~org.hipparchus.analysis.BivariateFunction` + + Parameters: + x (double): Abscissa for which the function value should be computed. + y (double): Ordinate for which the function value should be computed. + + Returns: + the value. + + + """ + ... class Exp(org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction): + """ + public classExp extends :class:`~org.hipparchus.analysis.function.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction` + + Exponential function. + """ def __init__(self): ... _value_1__T = typing.TypeVar('_value_1__T', bound=org.hipparchus.analysis.differentiation.Derivative) # <T> @typing.overload - def value(self, double: float) -> float: ... - @typing.overload - def value(self, t: _value_1__T) -> _value_1__T: ... + def value(self, double: float) -> float: + """ + Compute the value of the function. + + Specified by: + :meth:`~org.hipparchus.analysis.UnivariateFunction.value` in + interface :class:`~org.hipparchus.analysis.UnivariateFunction` + + Parameters: + x (double): Point at which the function value should be computed. + + Returns: + the value of the function. + + """ + ... + @typing.overload + def value(self, t: _value_1__T) -> _value_1__T: + """ + Compute the value for the function. + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction.value` in + interface :class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction` + + Parameters: + x (T): the point for which the function value should be computed + + Returns: + the value + + + """ + ... class Expm1(org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction): + """ + public classExpm1 extends :class:`~org.hipparchus.analysis.function.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction` + + :code:`e :sup:`x` -1` function. + """ def __init__(self): ... _value_1__T = typing.TypeVar('_value_1__T', bound=org.hipparchus.analysis.differentiation.Derivative) # <T> @typing.overload - def value(self, double: float) -> float: ... - @typing.overload - def value(self, t: _value_1__T) -> _value_1__T: ... + def value(self, double: float) -> float: + """ + Compute the value of the function. + + Specified by: + :meth:`~org.hipparchus.analysis.UnivariateFunction.value` in + interface :class:`~org.hipparchus.analysis.UnivariateFunction` + + Parameters: + x (double): Point at which the function value should be computed. + + Returns: + the value of the function. + + """ + ... + @typing.overload + def value(self, t: _value_1__T) -> _value_1__T: + """ + Compute the value for the function. + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction.value` in + interface :class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction` + + Parameters: + x (T): the point for which the function value should be computed + + Returns: + the value + + + """ + ... class Floor(org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction): + """ + public classFloor extends :class:`~org.hipparchus.analysis.function.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction` + + :code:`floor` function. + """ def __init__(self): ... _value_1__T = typing.TypeVar('_value_1__T', bound=org.hipparchus.analysis.differentiation.Derivative) # <T> @typing.overload - def value(self, double: float) -> float: ... - @typing.overload - def value(self, t: _value_1__T) -> _value_1__T: ... + def value(self, double: float) -> float: + """ + Compute the value of the function. + + Specified by: + :meth:`~org.hipparchus.analysis.UnivariateFunction.value` in + interface :class:`~org.hipparchus.analysis.UnivariateFunction` + + Parameters: + x (double): Point at which the function value should be computed. + + Returns: + the value of the function. + + """ + ... + @typing.overload + def value(self, t: _value_1__T) -> _value_1__T: + """ + Compute the value for the function. + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction.value` in + interface :class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction` + + Parameters: + x (T): the point for which the function value should be computed + + Returns: + the value + + + """ + ... class Gaussian(org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction): + """ + public classGaussian extends :class:`~org.hipparchus.analysis.function.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction` + + ` Gaussian <http://en.wikipedia.org/wiki/Gaussian_function>` function. + """ @typing.overload def __init__(self): ... @typing.overload @@ -153,7 +783,41 @@ class Gaussian(org.hipparchus.analysis.differentiation.UnivariateDifferentiableF def __init__(self, double: float, double2: float, double3: float): ... _value_1__T = typing.TypeVar('_value_1__T', bound=org.hipparchus.analysis.differentiation.Derivative) # <T> @typing.overload - def value(self, double: float) -> float: ... + def value(self, double: float) -> float: + """ + Compute the value of the function. + + Specified by: + :meth:`~org.hipparchus.analysis.UnivariateFunction.value` in + interface :class:`~org.hipparchus.analysis.UnivariateFunction` + + Parameters: + x (double): Point at which the function value should be computed. + + Returns: + the value of the function. + + public <T extends :class:`~org.hipparchus.analysis.differentiation.Derivative`<T>> T value(T t) throws :class:`~org.hipparchus.exception.MathIllegalArgumentException` + + Compute the value for the function. + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction.value` in + interface :class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction` + + Parameters: + t (T): the point for which the function value should be computed + + Returns: + the value + + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if :code:`x` does not satisfy the function's constraints (argument out of bound, or unsupported derivative order for + example) + + + """ + ... @typing.overload def value(self, t: _value_1__T) -> _value_1__T: ... class Parametric(org.hipparchus.analysis.ParametricUnivariateFunction): @@ -162,10 +826,50 @@ class Gaussian(org.hipparchus.analysis.differentiation.UnivariateDifferentiableF def value(self, double: float, *double2: float) -> float: ... class HarmonicOscillator(org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction): + """ + public classHarmonicOscillator extends :class:`~org.hipparchus.analysis.function.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction` + + ` simple harmonic oscillator <http://en.wikipedia.org/wiki/Harmonic_oscillator>` function. + """ def __init__(self, double: float, double2: float, double3: float): ... _value_1__T = typing.TypeVar('_value_1__T', bound=org.hipparchus.analysis.differentiation.Derivative) # <T> @typing.overload - def value(self, double: float) -> float: ... + def value(self, double: float) -> float: + """ + Compute the value of the function. + + Specified by: + :meth:`~org.hipparchus.analysis.UnivariateFunction.value` in + interface :class:`~org.hipparchus.analysis.UnivariateFunction` + + Parameters: + x (double): Point at which the function value should be computed. + + Returns: + the value of the function. + + public <T extends :class:`~org.hipparchus.analysis.differentiation.Derivative`<T>> T value(T t) throws :class:`~org.hipparchus.exception.MathIllegalArgumentException` + + Compute the value for the function. + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction.value` in + interface :class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction` + + Parameters: + t (T): the point for which the function value should be computed + + Returns: + the value + + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if :code:`x` does not satisfy the function's constraints (argument out of bound, or unsupported derivative order for + example) + + + """ + ... @typing.overload def value(self, t: _value_1__T) -> _value_1__T: ... class Parametric(org.hipparchus.analysis.ParametricUnivariateFunction): @@ -174,58 +878,287 @@ class HarmonicOscillator(org.hipparchus.analysis.differentiation.UnivariateDiffe def value(self, double: float, *double2: float) -> float: ... class Identity(org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction): + """ + public classIdentity extends :class:`~org.hipparchus.analysis.function.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction` + + Identity function. + """ def __init__(self): ... _value_1__T = typing.TypeVar('_value_1__T', bound=org.hipparchus.analysis.differentiation.Derivative) # <T> @typing.overload - def value(self, double: float) -> float: ... - @typing.overload - def value(self, t: _value_1__T) -> _value_1__T: ... + def value(self, double: float) -> float: + """ + Compute the value of the function. + + Specified by: + :meth:`~org.hipparchus.analysis.UnivariateFunction.value` in + interface :class:`~org.hipparchus.analysis.UnivariateFunction` + + Parameters: + x (double): Point at which the function value should be computed. + + Returns: + the value of the function. + + """ + ... + @typing.overload + def value(self, t: _value_1__T) -> _value_1__T: + """ + Compute the value for the function. + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction.value` in + interface :class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction` + + Parameters: + t (T): the point for which the function value should be computed + + Returns: + the value + + + """ + ... class Inverse(org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction): + """ + public classInverse extends :class:`~org.hipparchus.analysis.function.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction` + + Inverse function. + """ def __init__(self): ... _value_1__T = typing.TypeVar('_value_1__T', bound=org.hipparchus.analysis.differentiation.Derivative) # <T> @typing.overload - def value(self, double: float) -> float: ... - @typing.overload - def value(self, t: _value_1__T) -> _value_1__T: ... + def value(self, double: float) -> float: + """ + Compute the value of the function. + + Specified by: + :meth:`~org.hipparchus.analysis.UnivariateFunction.value` in + interface :class:`~org.hipparchus.analysis.UnivariateFunction` + + Parameters: + x (double): Point at which the function value should be computed. + + Returns: + the value of the function. + + """ + ... + @typing.overload + def value(self, t: _value_1__T) -> _value_1__T: + """ + Compute the value for the function. + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction.value` in + interface :class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction` + + Parameters: + t (T): the point for which the function value should be computed + + Returns: + the value + + + """ + ... class Log(org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction): + """ + public classLog extends :class:`~org.hipparchus.analysis.function.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction` + + Natural logarithm function. + """ def __init__(self): ... _value_1__T = typing.TypeVar('_value_1__T', bound=org.hipparchus.analysis.differentiation.Derivative) # <T> @typing.overload - def value(self, double: float) -> float: ... - @typing.overload - def value(self, t: _value_1__T) -> _value_1__T: ... + def value(self, double: float) -> float: + """ + Compute the value of the function. + + Specified by: + :meth:`~org.hipparchus.analysis.UnivariateFunction.value` in + interface :class:`~org.hipparchus.analysis.UnivariateFunction` + + Parameters: + x (double): Point at which the function value should be computed. + + Returns: + the value of the function. + + """ + ... + @typing.overload + def value(self, t: _value_1__T) -> _value_1__T: + """ + Compute the value for the function. + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction.value` in + interface :class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction` + + Parameters: + x (T): the point for which the function value should be computed + + Returns: + the value + + + """ + ... class Log10(org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction): + """ + public classLog10 extends :class:`~org.hipparchus.analysis.function.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction` + + Base 10 logarithm function. + """ def __init__(self): ... _value_1__T = typing.TypeVar('_value_1__T', bound=org.hipparchus.analysis.differentiation.Derivative) # <T> @typing.overload - def value(self, double: float) -> float: ... - @typing.overload - def value(self, t: _value_1__T) -> _value_1__T: ... + def value(self, double: float) -> float: + """ + Compute the value of the function. + + Specified by: + :meth:`~org.hipparchus.analysis.UnivariateFunction.value` in + interface :class:`~org.hipparchus.analysis.UnivariateFunction` + + Parameters: + x (double): Point at which the function value should be computed. + + Returns: + the value of the function. + + """ + ... + @typing.overload + def value(self, t: _value_1__T) -> _value_1__T: + """ + Compute the value for the function. + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction.value` in + interface :class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction` + + Parameters: + x (T): the point for which the function value should be computed + + Returns: + the value + + + """ + ... class Log1p(org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction): + """ + public classLog1p extends :class:`~org.hipparchus.analysis.function.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction` + + :code:`log(1 + p)` function. + """ def __init__(self): ... _value_1__T = typing.TypeVar('_value_1__T', bound=org.hipparchus.analysis.differentiation.Derivative) # <T> @typing.overload - def value(self, double: float) -> float: ... - @typing.overload - def value(self, t: _value_1__T) -> _value_1__T: ... + def value(self, double: float) -> float: + """ + Compute the value of the function. + + Specified by: + :meth:`~org.hipparchus.analysis.UnivariateFunction.value` in + interface :class:`~org.hipparchus.analysis.UnivariateFunction` + + Parameters: + x (double): Point at which the function value should be computed. + + Returns: + the value of the function. + + """ + ... + @typing.overload + def value(self, t: _value_1__T) -> _value_1__T: + """ + Compute the value for the function. + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction.value` in + interface :class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction` + + Parameters: + x (T): the point for which the function value should be computed + + Returns: + the value + + + """ + ... class Logistic(org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction): + """ + public classLogistic extends :class:`~org.hipparchus.analysis.function.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction` + + ` Generalised logistic <http://en.wikipedia.org/wiki/Generalised_logistic_function>` function. + """ def __init__(self, double: float, double2: float, double3: float, double4: float, double5: float, double6: float): ... _value_1__T = typing.TypeVar('_value_1__T', bound=org.hipparchus.analysis.differentiation.Derivative) # <T> @typing.overload - def value(self, double: float) -> float: ... - @typing.overload - def value(self, t: _value_1__T) -> _value_1__T: ... + def value(self, double: float) -> float: + """ + Compute the value of the function. + + Specified by: + :meth:`~org.hipparchus.analysis.UnivariateFunction.value` in + interface :class:`~org.hipparchus.analysis.UnivariateFunction` + + Parameters: + x (double): Point at which the function value should be computed. + + Returns: + the value of the function. + + """ + ... + @typing.overload + def value(self, t: _value_1__T) -> _value_1__T: + """ + Compute the value for the function. + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction.value` in + interface :class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction` + + Parameters: + t (T): the point for which the function value should be computed + + Returns: + the value + + + """ + ... class Parametric(org.hipparchus.analysis.ParametricUnivariateFunction): def __init__(self): ... def gradient(self, double: float, *double2: float) -> typing.MutableSequence[float]: ... def value(self, double: float, *double2: float) -> float: ... class Logit(org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction): + """ + public classLogit extends :class:`~org.hipparchus.analysis.function.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction` + + ` Logit <http://en.wikipedia.org/wiki/Logit>` function. It is the inverse of the + :class:`~org.hipparchus.analysis.function.Sigmoid` function. + """ @typing.overload def __init__(self): ... @typing.overload @@ -241,53 +1174,298 @@ class Logit(org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunc def value(self, double: float, *double2: float) -> float: ... class Max(org.hipparchus.analysis.BivariateFunction): + """ + public classMax extends :class:`~org.hipparchus.analysis.function.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.analysis.BivariateFunction` + + Maximum function. + """ def __init__(self): ... - def value(self, double: float, double2: float) -> float: ... + def value(self, double: float, double2: float) -> float: + """ + Compute the value for the function. + + Specified by: + :meth:`~org.hipparchus.analysis.BivariateFunction.value` in + interface :class:`~org.hipparchus.analysis.BivariateFunction` + + Parameters: + x (double): Abscissa for which the function value should be computed. + y (double): Ordinate for which the function value should be computed. + + Returns: + the value. + + + """ + ... class Min(org.hipparchus.analysis.BivariateFunction): + """ + public classMin extends :class:`~org.hipparchus.analysis.function.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.analysis.BivariateFunction` + + Minimum function. + """ def __init__(self): ... - def value(self, double: float, double2: float) -> float: ... + def value(self, double: float, double2: float) -> float: + """ + Compute the value for the function. + + Specified by: + :meth:`~org.hipparchus.analysis.BivariateFunction.value` in + interface :class:`~org.hipparchus.analysis.BivariateFunction` + + Parameters: + x (double): Abscissa for which the function value should be computed. + y (double): Ordinate for which the function value should be computed. + + Returns: + the value. + + + """ + ... class Minus(org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction): + """ + public classMinus extends :class:`~org.hipparchus.analysis.function.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction` + + Minus function. + """ def __init__(self): ... _value_1__T = typing.TypeVar('_value_1__T', bound=org.hipparchus.analysis.differentiation.Derivative) # <T> @typing.overload - def value(self, double: float) -> float: ... - @typing.overload - def value(self, t: _value_1__T) -> _value_1__T: ... + def value(self, double: float) -> float: + """ + Compute the value of the function. + + Specified by: + :meth:`~org.hipparchus.analysis.UnivariateFunction.value` in + interface :class:`~org.hipparchus.analysis.UnivariateFunction` + + Parameters: + x (double): Point at which the function value should be computed. + + Returns: + the value of the function. + + """ + ... + @typing.overload + def value(self, t: _value_1__T) -> _value_1__T: + """ + Compute the value for the function. + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction.value` in + interface :class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction` + + Parameters: + t (T): the point for which the function value should be computed + + Returns: + the value + + + """ + ... class Multiply(org.hipparchus.analysis.BivariateFunction): + """ + public classMultiply extends :class:`~org.hipparchus.analysis.function.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.analysis.BivariateFunction` + + Multiply the two operands. + """ def __init__(self): ... - def value(self, double: float, double2: float) -> float: ... + def value(self, double: float, double2: float) -> float: + """ + Compute the value for the function. + + Specified by: + :meth:`~org.hipparchus.analysis.BivariateFunction.value` in + interface :class:`~org.hipparchus.analysis.BivariateFunction` + + Parameters: + x (double): Abscissa for which the function value should be computed. + y (double): Ordinate for which the function value should be computed. + + Returns: + the value. + + + """ + ... class Pow(org.hipparchus.analysis.BivariateFunction): + """ + public classPow extends :class:`~org.hipparchus.analysis.function.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.analysis.BivariateFunction` + + Power function. + """ def __init__(self): ... - def value(self, double: float, double2: float) -> float: ... + def value(self, double: float, double2: float) -> float: + """ + Compute the value for the function. + + Specified by: + :meth:`~org.hipparchus.analysis.BivariateFunction.value` in + interface :class:`~org.hipparchus.analysis.BivariateFunction` + + Parameters: + x (double): Abscissa for which the function value should be computed. + y (double): Ordinate for which the function value should be computed. + + Returns: + the value. + + + """ + ... class Power(org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction): + """ + public classPower extends :class:`~org.hipparchus.analysis.function.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction` + + Power function. + """ def __init__(self, double: float): ... _value_1__T = typing.TypeVar('_value_1__T', bound=org.hipparchus.analysis.differentiation.Derivative) # <T> @typing.overload - def value(self, double: float) -> float: ... - @typing.overload - def value(self, t: _value_1__T) -> _value_1__T: ... + def value(self, double: float) -> float: + """ + Compute the value of the function. + + Specified by: + :meth:`~org.hipparchus.analysis.UnivariateFunction.value` in + interface :class:`~org.hipparchus.analysis.UnivariateFunction` + + Parameters: + x (double): Point at which the function value should be computed. + + Returns: + the value of the function. + + """ + ... + @typing.overload + def value(self, t: _value_1__T) -> _value_1__T: + """ + Compute the value for the function. + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction.value` in + interface :class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction` + + Parameters: + t (T): the point for which the function value should be computed + + Returns: + the value + + + """ + ... class Rint(org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction): + """ + public classRint extends :class:`~org.hipparchus.analysis.function.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction` + + :code:`rint` function. + """ def __init__(self): ... _value_1__T = typing.TypeVar('_value_1__T', bound=org.hipparchus.analysis.differentiation.Derivative) # <T> @typing.overload - def value(self, double: float) -> float: ... - @typing.overload - def value(self, t: _value_1__T) -> _value_1__T: ... + def value(self, double: float) -> float: + """ + Compute the value of the function. + + Specified by: + :meth:`~org.hipparchus.analysis.UnivariateFunction.value` in + interface :class:`~org.hipparchus.analysis.UnivariateFunction` + + Parameters: + x (double): Point at which the function value should be computed. + + Returns: + the value of the function. + + """ + ... + @typing.overload + def value(self, t: _value_1__T) -> _value_1__T: + """ + Compute the value for the function. + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction.value` in + interface :class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction` + + Parameters: + x (T): the point for which the function value should be computed + + Returns: + the value + + + """ + ... class Sigmoid(org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction): + """ + public classSigmoid extends :class:`~org.hipparchus.analysis.function.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction` + + ` Sigmoid <http://en.wikipedia.org/wiki/Sigmoid_function>` function. It is the inverse of the + :class:`~org.hipparchus.analysis.function.Logit` function. A more flexible version, the generalised logistic, is + implemented by the :class:`~org.hipparchus.analysis.function.Logistic` class. + """ @typing.overload def __init__(self): ... @typing.overload def __init__(self, double: float, double2: float): ... _value_1__T = typing.TypeVar('_value_1__T', bound=org.hipparchus.analysis.differentiation.Derivative) # <T> @typing.overload - def value(self, double: float) -> float: ... + def value(self, double: float) -> float: + """ + Compute the value of the function. + + Specified by: + :meth:`~org.hipparchus.analysis.UnivariateFunction.value` in + interface :class:`~org.hipparchus.analysis.UnivariateFunction` + + Parameters: + x (double): Point at which the function value should be computed. + + Returns: + the value of the function. + + public <T extends :class:`~org.hipparchus.analysis.differentiation.Derivative`<T>> T value(T t) throws :class:`~org.hipparchus.exception.MathIllegalArgumentException` + + Compute the value for the function. + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction.value` in + interface :class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction` + + Parameters: + t (T): the point for which the function value should be computed + + Returns: + the value + + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if :code:`x` does not satisfy the function's constraints (argument out of bound, or unsupported derivative order for + example) + + + """ + ... @typing.overload def value(self, t: _value_1__T) -> _value_1__T: ... class Parametric(org.hipparchus.analysis.ParametricUnivariateFunction): @@ -296,67 +1474,364 @@ class Sigmoid(org.hipparchus.analysis.differentiation.UnivariateDifferentiableFu def value(self, double: float, *double2: float) -> float: ... class Sin(org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction): + """ + public classSin extends :class:`~org.hipparchus.analysis.function.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction` + + Sine function. + """ def __init__(self): ... _value_1__T = typing.TypeVar('_value_1__T', bound=org.hipparchus.analysis.differentiation.Derivative) # <T> @typing.overload - def value(self, double: float) -> float: ... - @typing.overload - def value(self, t: _value_1__T) -> _value_1__T: ... + def value(self, double: float) -> float: + """ + Compute the value of the function. + + Specified by: + :meth:`~org.hipparchus.analysis.UnivariateFunction.value` in + interface :class:`~org.hipparchus.analysis.UnivariateFunction` + + Parameters: + x (double): Point at which the function value should be computed. + + Returns: + the value of the function. + + """ + ... + @typing.overload + def value(self, t: _value_1__T) -> _value_1__T: + """ + Compute the value for the function. + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction.value` in + interface :class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction` + + Parameters: + x (T): the point for which the function value should be computed + + Returns: + the value + + + """ + ... class Sinc(org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction): + """ + public classSinc extends :class:`~org.hipparchus.analysis.function.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction` + + `Sinc <http://en.wikipedia.org/wiki/Sinc_function>` function, defined by + + .. code-block: java + + sinc(x) = 1 if x = 0, + sin(x) / x otherwise. + """ @typing.overload def __init__(self): ... @typing.overload def __init__(self, boolean: bool): ... _value_1__T = typing.TypeVar('_value_1__T', bound=org.hipparchus.analysis.differentiation.Derivative) # <T> @typing.overload - def value(self, double: float) -> float: ... + def value(self, double: float) -> float: + """ + Compute the value of the function. + + Specified by: + :meth:`~org.hipparchus.analysis.UnivariateFunction.value` in + interface :class:`~org.hipparchus.analysis.UnivariateFunction` + + Parameters: + x (double): Point at which the function value should be computed. + + Returns: + the value of the function. + + public <T extends :class:`~org.hipparchus.analysis.differentiation.Derivative`<T>> T value(T t) throws :class:`~org.hipparchus.exception.MathIllegalArgumentException` + + Compute the value for the function. + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction.value` in + interface :class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction` + + Parameters: + t (T): the point for which the function value should be computed + + Returns: + the value + + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if :code:`x` does not satisfy the function's constraints (argument out of bound, or unsupported derivative order for + example) + + + """ + ... @typing.overload def value(self, t: _value_1__T) -> _value_1__T: ... class Sinh(org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction): + """ + public classSinh extends :class:`~org.hipparchus.analysis.function.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction` + + Hyperbolic sine function. + """ def __init__(self): ... _value_1__T = typing.TypeVar('_value_1__T', bound=org.hipparchus.analysis.differentiation.Derivative) # <T> @typing.overload - def value(self, double: float) -> float: ... - @typing.overload - def value(self, t: _value_1__T) -> _value_1__T: ... + def value(self, double: float) -> float: + """ + Compute the value of the function. + + Specified by: + :meth:`~org.hipparchus.analysis.UnivariateFunction.value` in + interface :class:`~org.hipparchus.analysis.UnivariateFunction` + + Parameters: + x (double): Point at which the function value should be computed. + + Returns: + the value of the function. + + """ + ... + @typing.overload + def value(self, t: _value_1__T) -> _value_1__T: + """ + Compute the value for the function. + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction.value` in + interface :class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction` + + Parameters: + x (T): the point for which the function value should be computed + + Returns: + the value + + + """ + ... class Sqrt(org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction): + """ + public classSqrt extends :class:`~org.hipparchus.analysis.function.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction` + + Square-root function. + """ def __init__(self): ... _value_1__T = typing.TypeVar('_value_1__T', bound=org.hipparchus.analysis.differentiation.Derivative) # <T> @typing.overload - def value(self, double: float) -> float: ... - @typing.overload - def value(self, t: _value_1__T) -> _value_1__T: ... + def value(self, double: float) -> float: + """ + Compute the value of the function. + + Specified by: + :meth:`~org.hipparchus.analysis.UnivariateFunction.value` in + interface :class:`~org.hipparchus.analysis.UnivariateFunction` + + Parameters: + x (double): Point at which the function value should be computed. + + Returns: + the value of the function. + + """ + ... + @typing.overload + def value(self, t: _value_1__T) -> _value_1__T: + """ + Compute the value for the function. + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction.value` in + interface :class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction` + + Parameters: + x (T): the point for which the function value should be computed + + Returns: + the value + + + """ + ... class StepFunction(org.hipparchus.analysis.UnivariateFunction): + """ + public classStepFunction extends :class:`~org.hipparchus.analysis.function.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.analysis.UnivariateFunction` + + ` Step function <http://en.wikipedia.org/wiki/Step_function>`. + """ def __init__(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray]): ... - def value(self, double: float) -> float: ... + def value(self, double: float) -> float: + """ + Compute the value of the function. + + Specified by: + :meth:`~org.hipparchus.analysis.UnivariateFunction.value` in + interface :class:`~org.hipparchus.analysis.UnivariateFunction` + + Parameters: + x (double): Point at which the function value should be computed. + + Returns: + the value of the function. + + + """ + ... class Subtract(org.hipparchus.analysis.BivariateFunction): + """ + public classSubtract extends :class:`~org.hipparchus.analysis.function.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.analysis.BivariateFunction` + + Subtract the second operand from the first. + """ def __init__(self): ... - def value(self, double: float, double2: float) -> float: ... + def value(self, double: float, double2: float) -> float: + """ + Compute the value for the function. + + Specified by: + :meth:`~org.hipparchus.analysis.BivariateFunction.value` in + interface :class:`~org.hipparchus.analysis.BivariateFunction` + + Parameters: + x (double): Abscissa for which the function value should be computed. + y (double): Ordinate for which the function value should be computed. + + Returns: + the value. + + + """ + ... class Tan(org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction): + """ + public classTan extends :class:`~org.hipparchus.analysis.function.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction` + + Tangent function. + """ def __init__(self): ... _value_1__T = typing.TypeVar('_value_1__T', bound=org.hipparchus.analysis.differentiation.Derivative) # <T> @typing.overload - def value(self, double: float) -> float: ... - @typing.overload - def value(self, t: _value_1__T) -> _value_1__T: ... + def value(self, double: float) -> float: + """ + Compute the value of the function. + + Specified by: + :meth:`~org.hipparchus.analysis.UnivariateFunction.value` in + interface :class:`~org.hipparchus.analysis.UnivariateFunction` + + Parameters: + x (double): Point at which the function value should be computed. + + Returns: + the value of the function. + + """ + ... + @typing.overload + def value(self, t: _value_1__T) -> _value_1__T: + """ + Compute the value for the function. + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction.value` in + interface :class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction` + + Parameters: + x (T): the point for which the function value should be computed + + Returns: + the value + + + """ + ... class Tanh(org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction): + """ + public classTanh extends :class:`~org.hipparchus.analysis.function.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction` + + Hyperbolic tangent function. + """ def __init__(self): ... _value_1__T = typing.TypeVar('_value_1__T', bound=org.hipparchus.analysis.differentiation.Derivative) # <T> @typing.overload - def value(self, double: float) -> float: ... - @typing.overload - def value(self, t: _value_1__T) -> _value_1__T: ... + def value(self, double: float) -> float: + """ + Compute the value of the function. + + Specified by: + :meth:`~org.hipparchus.analysis.UnivariateFunction.value` in + interface :class:`~org.hipparchus.analysis.UnivariateFunction` + + Parameters: + x (double): Point at which the function value should be computed. + + Returns: + the value of the function. + + """ + ... + @typing.overload + def value(self, t: _value_1__T) -> _value_1__T: + """ + Compute the value for the function. + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction.value` in + interface :class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction` + + Parameters: + x (T): the point for which the function value should be computed + + Returns: + the value + + + """ + ... class Ulp(org.hipparchus.analysis.UnivariateFunction): + """ + public classUlp extends :class:`~org.hipparchus.analysis.function.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.analysis.UnivariateFunction` + + :code:`ulp` function. + """ def __init__(self): ... - def value(self, double: float) -> float: ... + def value(self, double: float) -> float: + """ + Compute the value of the function. + + Specified by: + :meth:`~org.hipparchus.analysis.UnivariateFunction.value` in + interface :class:`~org.hipparchus.analysis.UnivariateFunction` + + Parameters: + x (double): Point at which the function value should be computed. + + Returns: + the value of the function. + + + """ + ... class __module_protocol__(Protocol): diff --git a/org-stubs/hipparchus/analysis/integration/__init__.pyi b/org-stubs/hipparchus/analysis/integration/__init__.pyi index e061d60..41e521f 100644 --- a/org-stubs/hipparchus/analysis/integration/__init__.pyi +++ b/org-stubs/hipparchus/analysis/integration/__init__.pyi @@ -14,54 +14,465 @@ import typing _FieldUnivariateIntegrator__T = typing.TypeVar('_FieldUnivariateIntegrator__T', bound=org.hipparchus.CalculusFieldElement) # <T> class FieldUnivariateIntegrator(typing.Generic[_FieldUnivariateIntegrator__T]): - def getAbsoluteAccuracy(self) -> float: ... - def getEvaluations(self) -> int: ... - def getIterations(self) -> int: ... - def getMaximalIterationCount(self) -> int: ... - def getMinimalIterationCount(self) -> int: ... - def getRelativeAccuracy(self) -> float: ... + """ + public interfaceFieldUnivariateIntegrator<T extends :class:`~org.hipparchus.CalculusFieldElement`<T>> + + Interface for univariate real integration algorithms. + + Since: + 2.0 + """ + def getAbsoluteAccuracy(self) -> float: + """ + Get the absolute accuracy. + + Returns: + the accuracy + + + """ + ... + def getEvaluations(self) -> int: + """ + Get the number of function evaluations of the last run of the integrator. + + Returns: + number of function evaluations + + + """ + ... + def getIterations(self) -> int: + """ + Get the number of iterations of the last run of the integrator. + + Returns: + number of iterations + + + """ + ... + def getMaximalIterationCount(self) -> int: + """ + Get the upper limit for the number of iterations. + + Returns: + the actual upper limit + + + """ + ... + def getMinimalIterationCount(self) -> int: + """ + Get the min limit for the number of iterations. + + Returns: + the actual min limit + + + """ + ... + def getRelativeAccuracy(self) -> float: + """ + Get the relative accuracy. + + Returns: + the accuracy + + + """ + ... def integrate(self, int: int, calculusFieldUnivariateFunction: typing.Union[org.hipparchus.analysis.CalculusFieldUnivariateFunction[_FieldUnivariateIntegrator__T], typing.Callable[[_FieldUnivariateIntegrator__T], _FieldUnivariateIntegrator__T]], t: _FieldUnivariateIntegrator__T, t2: _FieldUnivariateIntegrator__T) -> _FieldUnivariateIntegrator__T: ... class UnivariateIntegrator: - def getAbsoluteAccuracy(self) -> float: ... - def getEvaluations(self) -> int: ... - def getIterations(self) -> int: ... - def getMaximalIterationCount(self) -> int: ... - def getMinimalIterationCount(self) -> int: ... - def getRelativeAccuracy(self) -> float: ... + """ + public interfaceUnivariateIntegrator + + Interface for univariate real integration algorithms. + """ + def getAbsoluteAccuracy(self) -> float: + """ + Get the absolute accuracy. + + Returns: + the accuracy + + + """ + ... + def getEvaluations(self) -> int: + """ + Get the number of function evaluations of the last run of the integrator. + + Returns: + number of function evaluations + + + """ + ... + def getIterations(self) -> int: + """ + Get the number of iterations of the last run of the integrator. + + Returns: + number of iterations + + + """ + ... + def getMaximalIterationCount(self) -> int: + """ + Get the upper limit for the number of iterations. + + Returns: + the actual upper limit + + + """ + ... + def getMinimalIterationCount(self) -> int: + """ + Get the min limit for the number of iterations. + + Returns: + the actual min limit + + + """ + ... + def getRelativeAccuracy(self) -> float: + """ + Get the relative accuracy. + + Returns: + the accuracy + + + """ + ... def integrate(self, int: int, univariateFunction: typing.Union[org.hipparchus.analysis.UnivariateFunction, typing.Callable], double: float, double2: float) -> float: ... _BaseAbstractFieldUnivariateIntegrator__T = typing.TypeVar('_BaseAbstractFieldUnivariateIntegrator__T', bound=org.hipparchus.CalculusFieldElement) # <T> class BaseAbstractFieldUnivariateIntegrator(FieldUnivariateIntegrator[_BaseAbstractFieldUnivariateIntegrator__T], typing.Generic[_BaseAbstractFieldUnivariateIntegrator__T]): + """ + public abstract classBaseAbstractFieldUnivariateIntegrator<T extends :class:`~org.hipparchus.CalculusFieldElement`<T>> extends :class:`~org.hipparchus.analysis.integration.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.analysis.integration.FieldUnivariateIntegrator`<T> + + Provide a default implementation for several generic functions. + + Since: + 2.0 + """ DEFAULT_ABSOLUTE_ACCURACY: typing.ClassVar[float] = ... + """ + public static final double DEFAULT_ABSOLUTE_ACCURACY + + Default absolute accuracy. + + Also see: + + - :meth:`~constant` + + + + """ DEFAULT_RELATIVE_ACCURACY: typing.ClassVar[float] = ... + """ + public static final double DEFAULT_RELATIVE_ACCURACY + + Default relative accuracy. + + Also see: + + - :meth:`~constant` + + + + """ DEFAULT_MIN_ITERATIONS_COUNT: typing.ClassVar[int] = ... + """ + public static final int DEFAULT_MIN_ITERATIONS_COUNT + + Default minimal iteration count. + + Also see: + + - :meth:`~constant` + + + + """ DEFAULT_MAX_ITERATIONS_COUNT: typing.ClassVar[int] = ... - def getAbsoluteAccuracy(self) -> float: ... - def getEvaluations(self) -> int: ... + """ + public static final int DEFAULT_MAX_ITERATIONS_COUNT + + Default maximal iteration count. + + Also see: + + - :meth:`~constant` + + + + """ + def getAbsoluteAccuracy(self) -> float: + """ + Get the absolute accuracy. + + Specified by: + :meth:`~org.hipparchus.analysis.integration.FieldUnivariateIntegrator.getAbsoluteAccuracy` in + interface :class:`~org.hipparchus.analysis.integration.FieldUnivariateIntegrator` + + Returns: + the accuracy + + + """ + ... + def getEvaluations(self) -> int: + """ + Get the number of function evaluations of the last run of the integrator. + + Specified by: + :meth:`~org.hipparchus.analysis.integration.FieldUnivariateIntegrator.getEvaluations` in + interface :class:`~org.hipparchus.analysis.integration.FieldUnivariateIntegrator` + + Returns: + number of function evaluations + + + """ + ... def getField(self) -> org.hipparchus.Field[_BaseAbstractFieldUnivariateIntegrator__T]: ... - def getIterations(self) -> int: ... - def getMaximalIterationCount(self) -> int: ... - def getMinimalIterationCount(self) -> int: ... - def getRelativeAccuracy(self) -> float: ... + def getIterations(self) -> int: + """ + Get the number of iterations of the last run of the integrator. + + Specified by: + :meth:`~org.hipparchus.analysis.integration.FieldUnivariateIntegrator.getIterations` in + interface :class:`~org.hipparchus.analysis.integration.FieldUnivariateIntegrator` + + Returns: + number of iterations + + + """ + ... + def getMaximalIterationCount(self) -> int: + """ + Get the upper limit for the number of iterations. + + Specified by: + :meth:`~org.hipparchus.analysis.integration.FieldUnivariateIntegrator.getMaximalIterationCount` in + interface :class:`~org.hipparchus.analysis.integration.FieldUnivariateIntegrator` + + Returns: + the actual upper limit + + + """ + ... + def getMinimalIterationCount(self) -> int: + """ + Get the min limit for the number of iterations. + + Specified by: + :meth:`~org.hipparchus.analysis.integration.FieldUnivariateIntegrator.getMinimalIterationCount` in + interface :class:`~org.hipparchus.analysis.integration.FieldUnivariateIntegrator` + + Returns: + the actual min limit + + + """ + ... + def getRelativeAccuracy(self) -> float: + """ + Get the relative accuracy. + + Specified by: + :meth:`~org.hipparchus.analysis.integration.FieldUnivariateIntegrator.getRelativeAccuracy` in + interface :class:`~org.hipparchus.analysis.integration.FieldUnivariateIntegrator` + + Returns: + the accuracy + + + """ + ... def integrate(self, int: int, calculusFieldUnivariateFunction: typing.Union[org.hipparchus.analysis.CalculusFieldUnivariateFunction[_BaseAbstractFieldUnivariateIntegrator__T], typing.Callable[[_BaseAbstractFieldUnivariateIntegrator__T], _BaseAbstractFieldUnivariateIntegrator__T]], t: _BaseAbstractFieldUnivariateIntegrator__T, t2: _BaseAbstractFieldUnivariateIntegrator__T) -> _BaseAbstractFieldUnivariateIntegrator__T: ... class BaseAbstractUnivariateIntegrator(UnivariateIntegrator): + """ + public abstract classBaseAbstractUnivariateIntegrator extends :class:`~org.hipparchus.analysis.integration.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.analysis.integration.UnivariateIntegrator` + + Provide a default implementation for several generic functions. + """ DEFAULT_ABSOLUTE_ACCURACY: typing.ClassVar[float] = ... + """ + public static final double DEFAULT_ABSOLUTE_ACCURACY + + Default absolute accuracy. + + Also see: + + - :meth:`~constant` + + + + """ DEFAULT_RELATIVE_ACCURACY: typing.ClassVar[float] = ... + """ + public static final double DEFAULT_RELATIVE_ACCURACY + + Default relative accuracy. + + Also see: + + - :meth:`~constant` + + + + """ DEFAULT_MIN_ITERATIONS_COUNT: typing.ClassVar[int] = ... + """ + public static final int DEFAULT_MIN_ITERATIONS_COUNT + + Default minimal iteration count. + + Also see: + + - :meth:`~constant` + + + + """ DEFAULT_MAX_ITERATIONS_COUNT: typing.ClassVar[int] = ... - def getAbsoluteAccuracy(self) -> float: ... - def getEvaluations(self) -> int: ... - def getIterations(self) -> int: ... - def getMaximalIterationCount(self) -> int: ... - def getMinimalIterationCount(self) -> int: ... - def getRelativeAccuracy(self) -> float: ... + """ + public static final int DEFAULT_MAX_ITERATIONS_COUNT + + Default maximal iteration count. + + Also see: + + - :meth:`~constant` + + + + """ + def getAbsoluteAccuracy(self) -> float: + """ + Get the absolute accuracy. + + Specified by: + :meth:`~org.hipparchus.analysis.integration.UnivariateIntegrator.getAbsoluteAccuracy` in + interface :class:`~org.hipparchus.analysis.integration.UnivariateIntegrator` + + Returns: + the accuracy + + + """ + ... + def getEvaluations(self) -> int: + """ + Get the number of function evaluations of the last run of the integrator. + + Specified by: + :meth:`~org.hipparchus.analysis.integration.UnivariateIntegrator.getEvaluations` in + interface :class:`~org.hipparchus.analysis.integration.UnivariateIntegrator` + + Returns: + number of function evaluations + + + """ + ... + def getIterations(self) -> int: + """ + Get the number of iterations of the last run of the integrator. + + Specified by: + :meth:`~org.hipparchus.analysis.integration.UnivariateIntegrator.getIterations` in + interface :class:`~org.hipparchus.analysis.integration.UnivariateIntegrator` + + Returns: + number of iterations + + + """ + ... + def getMaximalIterationCount(self) -> int: + """ + Get the upper limit for the number of iterations. + + Specified by: + :meth:`~org.hipparchus.analysis.integration.UnivariateIntegrator.getMaximalIterationCount` in + interface :class:`~org.hipparchus.analysis.integration.UnivariateIntegrator` + + Returns: + the actual upper limit + + + """ + ... + def getMinimalIterationCount(self) -> int: + """ + Get the min limit for the number of iterations. + + Specified by: + :meth:`~org.hipparchus.analysis.integration.UnivariateIntegrator.getMinimalIterationCount` in + interface :class:`~org.hipparchus.analysis.integration.UnivariateIntegrator` + + Returns: + the actual min limit + + + """ + ... + def getRelativeAccuracy(self) -> float: + """ + Get the relative accuracy. + + Specified by: + :meth:`~org.hipparchus.analysis.integration.UnivariateIntegrator.getRelativeAccuracy` in + interface :class:`~org.hipparchus.analysis.integration.UnivariateIntegrator` + + Returns: + the accuracy + + + """ + ... def integrate(self, int: int, univariateFunction: typing.Union[org.hipparchus.analysis.UnivariateFunction, typing.Callable], double: float, double2: float) -> float: ... _FieldMidPointIntegrator__T = typing.TypeVar('_FieldMidPointIntegrator__T', bound=org.hipparchus.CalculusFieldElement) # <T> class FieldMidPointIntegrator(BaseAbstractFieldUnivariateIntegrator[_FieldMidPointIntegrator__T], typing.Generic[_FieldMidPointIntegrator__T]): + """ + public classFieldMidPointIntegrator<T extends :class:`~org.hipparchus.CalculusFieldElement`<T>> extends :class:`~org.hipparchus.analysis.integration.BaseAbstractFieldUnivariateIntegrator`<T> + + Implements the ` Midpoint Rule <http://en.wikipedia.org/wiki/Midpoint_method>` for integration of real univariate + functions. For reference, see **Numerical Mathematics**, ISBN 0387989595, chapter 9.2. + + The function should be integrable. + + Since: + 2.0 + """ MIDPOINT_MAX_ITERATIONS_COUNT: typing.ClassVar[int] = ... + """ + public static final int MIDPOINT_MAX_ITERATIONS_COUNT + + Maximum number of iterations for midpoint. + + Also see: + + - :meth:`~constant` + + + + """ @typing.overload def __init__(self, field: org.hipparchus.Field[_FieldMidPointIntegrator__T]): ... @typing.overload @@ -71,7 +482,31 @@ class FieldMidPointIntegrator(BaseAbstractFieldUnivariateIntegrator[_FieldMidPoi _FieldRombergIntegrator__T = typing.TypeVar('_FieldRombergIntegrator__T', bound=org.hipparchus.CalculusFieldElement) # <T> class FieldRombergIntegrator(BaseAbstractFieldUnivariateIntegrator[_FieldRombergIntegrator__T], typing.Generic[_FieldRombergIntegrator__T]): + """ + public classFieldRombergIntegrator<T extends :class:`~org.hipparchus.CalculusFieldElement`<T>> extends :class:`~org.hipparchus.analysis.integration.BaseAbstractFieldUnivariateIntegrator`<T> + + Implements the ` Romberg Algorithm <http://mathworld.wolfram.com/RombergIntegration.html>` for integration of real + univariate functions. For reference, see **Introduction to Numerical Analysis**, ISBN 038795452X, chapter 3. + + Romberg integration employs k successive refinements of the trapezoid rule to remove error terms less than order + O(N^(-2k)). Simpson's rule is a special case of k = 2. + + Since: + 2.0 + """ ROMBERG_MAX_ITERATIONS_COUNT: typing.ClassVar[int] = ... + """ + public static final int ROMBERG_MAX_ITERATIONS_COUNT + + Maximal number of iterations for Romberg. + + Also see: + + - :meth:`~constant` + + + + """ @typing.overload def __init__(self, field: org.hipparchus.Field[_FieldRombergIntegrator__T]): ... @typing.overload @@ -81,7 +516,30 @@ class FieldRombergIntegrator(BaseAbstractFieldUnivariateIntegrator[_FieldRomberg _FieldSimpsonIntegrator__T = typing.TypeVar('_FieldSimpsonIntegrator__T', bound=org.hipparchus.CalculusFieldElement) # <T> class FieldSimpsonIntegrator(BaseAbstractFieldUnivariateIntegrator[_FieldSimpsonIntegrator__T], typing.Generic[_FieldSimpsonIntegrator__T]): + """ + public classFieldSimpsonIntegrator<T extends :class:`~org.hipparchus.CalculusFieldElement`<T>> extends :class:`~org.hipparchus.analysis.integration.BaseAbstractFieldUnivariateIntegrator`<T> + + Implements ` Simpson's Rule <http://mathworld.wolfram.com/SimpsonsRule.html>` for integration of real univariate + functions. For reference, see **Introduction to Numerical Analysis**, ISBN 038795452X, chapter 3. + + This implementation employs the basic trapezoid rule to calculate Simpson's rule. + + Since: + 2.0 + """ SIMPSON_MAX_ITERATIONS_COUNT: typing.ClassVar[int] = ... + """ + public static final int SIMPSON_MAX_ITERATIONS_COUNT + + Maximal number of iterations for Simpson. + + Also see: + + - :meth:`~constant` + + + + """ @typing.overload def __init__(self, field: org.hipparchus.Field[_FieldSimpsonIntegrator__T]): ... @typing.overload @@ -91,7 +549,30 @@ class FieldSimpsonIntegrator(BaseAbstractFieldUnivariateIntegrator[_FieldSimpson _FieldTrapezoidIntegrator__T = typing.TypeVar('_FieldTrapezoidIntegrator__T', bound=org.hipparchus.CalculusFieldElement) # <T> class FieldTrapezoidIntegrator(BaseAbstractFieldUnivariateIntegrator[_FieldTrapezoidIntegrator__T], typing.Generic[_FieldTrapezoidIntegrator__T]): + """ + public classFieldTrapezoidIntegrator<T extends :class:`~org.hipparchus.CalculusFieldElement`<T>> extends :class:`~org.hipparchus.analysis.integration.BaseAbstractFieldUnivariateIntegrator`<T> + + Implements the ` Trapezoid Rule <http://mathworld.wolfram.com/TrapezoidalRule.html>` for integration of real univariate + functions. For reference, see **Introduction to Numerical Analysis**, ISBN 038795452X, chapter 3. + + The function should be integrable. + + Since: + 2.0 + """ TRAPEZOID_MAX_ITERATIONS_COUNT: typing.ClassVar[int] = ... + """ + public static final int TRAPEZOID_MAX_ITERATIONS_COUNT + + Maximum number of iterations for trapezoid. + + Also see: + + - :meth:`~constant` + + + + """ @typing.overload def __init__(self, field: org.hipparchus.Field[_FieldTrapezoidIntegrator__T]): ... @typing.overload @@ -101,6 +582,20 @@ class FieldTrapezoidIntegrator(BaseAbstractFieldUnivariateIntegrator[_FieldTrape _IterativeLegendreFieldGaussIntegrator__T = typing.TypeVar('_IterativeLegendreFieldGaussIntegrator__T', bound=org.hipparchus.CalculusFieldElement) # <T> class IterativeLegendreFieldGaussIntegrator(BaseAbstractFieldUnivariateIntegrator[_IterativeLegendreFieldGaussIntegrator__T], typing.Generic[_IterativeLegendreFieldGaussIntegrator__T]): + """ + public classIterativeLegendreFieldGaussIntegrator<T extends :class:`~org.hipparchus.CalculusFieldElement`<T>> extends :class:`~org.hipparchus.analysis.integration.BaseAbstractFieldUnivariateIntegrator`<T> + + This algorithm divides the integration interval into equally-sized sub-interval and on each of them performs a ` + Legendre-Gauss <http://mathworld.wolfram.com/Legendre-GaussQuadrature.html>` quadrature. Because of its *non-adaptive* + nature, this algorithm can converge to a wrong value for the integral (for example, if the function is significantly + different from zero toward the ends of the integration interval). In particular, a change of variables aimed at + estimating integrals over infinite intervals as proposed ` here + <http://en.wikipedia.org/w/index.php?title=Numerical_integration#Integrals_over_infinite_intervals>` should be avoided + when using this class. + + Since: + 2.0 + """ @typing.overload def __init__(self, field: org.hipparchus.Field[_IterativeLegendreFieldGaussIntegrator__T], int: int, double: float, double2: float): ... @typing.overload @@ -109,6 +604,17 @@ class IterativeLegendreFieldGaussIntegrator(BaseAbstractFieldUnivariateIntegrato def __init__(self, field: org.hipparchus.Field[_IterativeLegendreFieldGaussIntegrator__T], int: int, int2: int, int3: int): ... class IterativeLegendreGaussIntegrator(BaseAbstractUnivariateIntegrator): + """ + public classIterativeLegendreGaussIntegrator extends :class:`~org.hipparchus.analysis.integration.BaseAbstractUnivariateIntegrator` + + This algorithm divides the integration interval into equally-sized sub-interval and on each of them performs a ` + Legendre-Gauss <http://mathworld.wolfram.com/Legendre-GaussQuadrature.html>` quadrature. Because of its *non-adaptive* + nature, this algorithm can converge to a wrong value for the integral (for example, if the function is significantly + different from zero toward the ends of the integration interval). In particular, a change of variables aimed at + estimating integrals over infinite intervals as proposed ` here + <http://en.wikipedia.org/w/index.php?title=Numerical_integration#Integrals_over_infinite_intervals>` should be avoided + when using this class. + """ @typing.overload def __init__(self, int: int, double: float, double2: float): ... @typing.overload @@ -117,7 +623,27 @@ class IterativeLegendreGaussIntegrator(BaseAbstractUnivariateIntegrator): def __init__(self, int: int, int2: int, int3: int): ... class MidPointIntegrator(BaseAbstractUnivariateIntegrator): + """ + public classMidPointIntegrator extends :class:`~org.hipparchus.analysis.integration.BaseAbstractUnivariateIntegrator` + + Implements the ` Midpoint Rule <http://en.wikipedia.org/wiki/Midpoint_method>` for integration of real univariate + functions. For reference, see **Numerical Mathematics**, ISBN 0387989595, chapter 9.2. + + The function should be integrable. + """ MIDPOINT_MAX_ITERATIONS_COUNT: typing.ClassVar[int] = ... + """ + public static final int MIDPOINT_MAX_ITERATIONS_COUNT + + Maximum number of iterations for midpoint. + + Also see: + + - :meth:`~constant` + + + + """ @typing.overload def __init__(self): ... @typing.overload @@ -126,7 +652,28 @@ class MidPointIntegrator(BaseAbstractUnivariateIntegrator): def __init__(self, int: int, int2: int): ... class RombergIntegrator(BaseAbstractUnivariateIntegrator): + """ + public classRombergIntegrator extends :class:`~org.hipparchus.analysis.integration.BaseAbstractUnivariateIntegrator` + + Implements the ` Romberg Algorithm <http://mathworld.wolfram.com/RombergIntegration.html>` for integration of real + univariate functions. For reference, see **Introduction to Numerical Analysis**, ISBN 038795452X, chapter 3. + + Romberg integration employs k successive refinements of the trapezoid rule to remove error terms less than order + O(N^(-2k)). Simpson's rule is a special case of k = 2. + """ ROMBERG_MAX_ITERATIONS_COUNT: typing.ClassVar[int] = ... + """ + public static final int ROMBERG_MAX_ITERATIONS_COUNT + + Maximal number of iterations for Romberg. + + Also see: + + - :meth:`~constant` + + + + """ @typing.overload def __init__(self): ... @typing.overload @@ -135,7 +682,27 @@ class RombergIntegrator(BaseAbstractUnivariateIntegrator): def __init__(self, int: int, int2: int): ... class SimpsonIntegrator(BaseAbstractUnivariateIntegrator): + """ + public classSimpsonIntegrator extends :class:`~org.hipparchus.analysis.integration.BaseAbstractUnivariateIntegrator` + + Implements ` Simpson's Rule <http://mathworld.wolfram.com/SimpsonsRule.html>` for integration of real univariate + functions. For reference, see **Introduction to Numerical Analysis**, ISBN 038795452X, chapter 3. + + This implementation employs the basic trapezoid rule to calculate Simpson's rule. + """ SIMPSON_MAX_ITERATIONS_COUNT: typing.ClassVar[int] = ... + """ + public static final int SIMPSON_MAX_ITERATIONS_COUNT + + Maximal number of iterations for Simpson. + + Also see: + + - :meth:`~constant` + + + + """ @typing.overload def __init__(self): ... @typing.overload @@ -144,7 +711,27 @@ class SimpsonIntegrator(BaseAbstractUnivariateIntegrator): def __init__(self, int: int, int2: int): ... class TrapezoidIntegrator(BaseAbstractUnivariateIntegrator): + """ + public classTrapezoidIntegrator extends :class:`~org.hipparchus.analysis.integration.BaseAbstractUnivariateIntegrator` + + Implements the ` Trapezoid Rule <http://mathworld.wolfram.com/TrapezoidalRule.html>` for integration of real univariate + functions. For reference, see **Introduction to Numerical Analysis**, ISBN 038795452X, chapter 3. + + The function should be integrable. + """ TRAPEZOID_MAX_ITERATIONS_COUNT: typing.ClassVar[int] = ... + """ + public static final int TRAPEZOID_MAX_ITERATIONS_COUNT + + Maximum number of iterations for trapezoid. + + Also see: + + - :meth:`~constant` + + + + """ @typing.overload def __init__(self): ... @typing.overload diff --git a/org-stubs/hipparchus/analysis/integration/gauss/__init__.pyi b/org-stubs/hipparchus/analysis/integration/gauss/__init__.pyi index 0bdafd6..2ba3349 100644 --- a/org-stubs/hipparchus/analysis/integration/gauss/__init__.pyi +++ b/org-stubs/hipparchus/analysis/integration/gauss/__init__.pyi @@ -15,17 +15,69 @@ import typing _FieldGaussIntegrator__T = typing.TypeVar('_FieldGaussIntegrator__T', bound=org.hipparchus.CalculusFieldElement) # <T> class FieldGaussIntegrator(typing.Generic[_FieldGaussIntegrator__T]): + """ + public classFieldGaussIntegrator<T extends :class:`~org.hipparchus.CalculusFieldElement`<T>> extends :class:`~org.hipparchus.analysis.integration.gauss.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Class that implements the Gaussian rule for + :meth:`~org.hipparchus.analysis.integration.gauss.FieldGaussIntegrator.integrate` a weighted function. + + Since: + 2.0 + """ @typing.overload def __init__(self, tArray: typing.Union[typing.List[_FieldGaussIntegrator__T], jpype.JArray], tArray2: typing.Union[typing.List[_FieldGaussIntegrator__T], jpype.JArray]): ... @typing.overload def __init__(self, pair: org.hipparchus.util.Pair[typing.Union[typing.List[_FieldGaussIntegrator__T], jpype.JArray], typing.Union[typing.List[_FieldGaussIntegrator__T], jpype.JArray]]): ... - def getNumberOfPoints(self) -> int: ... - def getPoint(self, int: int) -> _FieldGaussIntegrator__T: ... - def getWeight(self, int: int) -> _FieldGaussIntegrator__T: ... + def getNumberOfPoints(self) -> int: + """ + Get order of the integration rule. + + Returns: + the order of the integration rule (the number of integration points). + + + """ + ... + def getPoint(self, int: int) -> _FieldGaussIntegrator__T: + """ + Gets the integration point at the given index. The index must be in the valid range but no check is performed. + + Parameters: + index (int): index of the integration point + + Returns: + the integration point. + + + """ + ... + def getWeight(self, int: int) -> _FieldGaussIntegrator__T: + """ + Gets the weight of the integration point at the given index. The index must be in the valid range but no check is + performed. + + Parameters: + index (int): index of the integration point + + Returns: + the weight. + + + """ + ... def integrate(self, calculusFieldUnivariateFunction: typing.Union[org.hipparchus.analysis.CalculusFieldUnivariateFunction[_FieldGaussIntegrator__T], typing.Callable[[_FieldGaussIntegrator__T], _FieldGaussIntegrator__T]]) -> _FieldGaussIntegrator__T: ... _FieldGaussIntegratorFactory__T = typing.TypeVar('_FieldGaussIntegratorFactory__T', bound=org.hipparchus.CalculusFieldElement) # <T> class FieldGaussIntegratorFactory(typing.Generic[_FieldGaussIntegratorFactory__T]): + """ + public classFieldGaussIntegratorFactory<T extends :class:`~org.hipparchus.CalculusFieldElement`<T>> extends :class:`~org.hipparchus.analysis.integration.gauss.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Class that provides different ways to compute the nodes and weights to be used by the + :class:`~org.hipparchus.analysis.integration.gauss.GaussIntegrator`. + + Since: + 2.0 + """ def __init__(self, field: org.hipparchus.Field[_FieldGaussIntegratorFactory__T]): ... def hermite(self, int: int) -> 'SymmetricFieldGaussIntegrator'[_FieldGaussIntegratorFactory__T]: ... def laguerre(self, int: int) -> FieldGaussIntegrator[_FieldGaussIntegratorFactory__T]: ... @@ -36,28 +88,170 @@ class FieldGaussIntegratorFactory(typing.Generic[_FieldGaussIntegratorFactory__T _FieldRuleFactory__T = typing.TypeVar('_FieldRuleFactory__T', bound=org.hipparchus.FieldElement) # <T> class FieldRuleFactory(typing.Generic[_FieldRuleFactory__T]): + """ + public interfaceFieldRuleFactory<T extends :class:`~org.hipparchus.FieldElement`<T>> + + Interface for rules that determines the integration nodes and their weights. + + Since: + 2.0 + """ def getRule(self, int: int) -> org.hipparchus.util.Pair[typing.MutableSequence[_FieldRuleFactory__T], typing.MutableSequence[_FieldRuleFactory__T]]: ... class GaussIntegrator: + """ + public classGaussIntegrator extends :class:`~org.hipparchus.analysis.integration.gauss.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Class that implements the Gaussian rule for :meth:`~org.hipparchus.analysis.integration.gauss.GaussIntegrator.integrate` + a weighted function. + """ @typing.overload def __init__(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray]): ... @typing.overload def __init__(self, pair: org.hipparchus.util.Pair[typing.Union[typing.List[float], jpype.JArray], typing.Union[typing.List[float], jpype.JArray]]): ... - def getNumberOfPoints(self) -> int: ... - def getPoint(self, int: int) -> float: ... - def getWeight(self, int: int) -> float: ... - def integrate(self, univariateFunction: typing.Union[org.hipparchus.analysis.UnivariateFunction, typing.Callable]) -> float: ... + def getNumberOfPoints(self) -> int: + """ + Get the order of the integration rule. + + Returns: + the order of the integration rule (the number of integration points). + + + """ + ... + def getPoint(self, int: int) -> float: + """ + Gets the integration point at the given index. The index must be in the valid range but no check is performed. + + Parameters: + index (int): index of the integration point + + Returns: + the integration point. + + + """ + ... + def getWeight(self, int: int) -> float: + """ + Gets the weight of the integration point at the given index. The index must be in the valid range but no check is + performed. + + Parameters: + index (int): index of the integration point + + Returns: + the weight. + + + """ + ... + def integrate(self, univariateFunction: typing.Union[org.hipparchus.analysis.UnivariateFunction, typing.Callable]) -> float: + """ + Returns an estimate of the integral of :code:`f(x) * w(x)`, where :code:`w` is a weight function that depends on the + actual flavor of the Gauss integration scheme. The algorithm uses the points and associated weights, as passed to the + :meth:`~org.hipparchus.analysis.integration.gauss.GaussIntegrator.%3Cinit%3E`. + + Parameters: + f (:class:`~org.hipparchus.analysis.UnivariateFunction`): Function to integrate. + + Returns: + the integral of the weighted function. + + + """ + ... class GaussIntegratorFactory: + """ + public classGaussIntegratorFactory extends :class:`~org.hipparchus.analysis.integration.gauss.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Class that provides different ways to compute the nodes and weights to be used by the + :class:`~org.hipparchus.analysis.integration.gauss.GaussIntegrator`. + """ DEFAULT_DECIMAL_DIGITS: typing.ClassVar[int] = ... + """ + public static final int DEFAULT_DECIMAL_DIGITS + + Number of digits for Legendre high precision. + + Also see: + + - :meth:`~constant` + + + + """ @typing.overload def __init__(self): ... @typing.overload def __init__(self, int: int): ... - def hermite(self, int: int) -> 'SymmetricGaussIntegrator': ... - def laguerre(self, int: int) -> GaussIntegrator: ... + def hermite(self, int: int) -> 'SymmetricGaussIntegrator': + """ + Creates a Gauss-Hermite integrator of the given order. The call to the + :meth:`~org.hipparchus.analysis.integration.gauss.SymmetricGaussIntegrator.integrate` method will perform a weighted + integration on the interval \([-\infty, +\infty]\): the computed value is the improper integral of \(e^{-x^2}f(x)\) + where \(f(x)\) is the function passed to the + :meth:`~org.hipparchus.analysis.integration.gauss.SymmetricGaussIntegrator.integrate` method. + + Parameters: + numberOfPoints (int): Order of the integration rule. + + Returns: + a Gauss-Hermite integrator. + + + """ + ... + def laguerre(self, int: int) -> GaussIntegrator: + """ + Creates a Gauss-Laguerre integrator of the given order. The call to the + :meth:`~org.hipparchus.analysis.integration.gauss.GaussIntegrator.integrate` method will perform an integration on the + interval \([0, +\infty)\): the computed value is the improper integral of \(e^{-x} f(x)\) where \(f(x)\) is the function + passed to the :meth:`~org.hipparchus.analysis.integration.gauss.SymmetricGaussIntegrator.integrate` method. + + Parameters: + numberOfPoints (int): Order of the integration rule. + + Returns: + a Gauss-Legendre integrator. + + + """ + ... @typing.overload - def legendre(self, int: int) -> GaussIntegrator: ... + def legendre(self, int: int) -> GaussIntegrator: + """ + Creates a Gauss-Legendre integrator of the given order. The call to the + :meth:`~org.hipparchus.analysis.integration.gauss.GaussIntegrator.integrate` method will perform an integration on the + natural interval :code:`[-1 , 1]`. + + Parameters: + numberOfPoints (int): Order of the integration rule. + + Returns: + a Gauss-Legendre integrator. + + public :class:`~org.hipparchus.analysis.integration.gauss.GaussIntegrator` legendre(int numberOfPoints, double lowerBound, double upperBound) throws :class:`~org.hipparchus.exception.MathIllegalArgumentException` + + Creates a Gauss-Legendre integrator of the given order. The call to the + :meth:`~org.hipparchus.analysis.integration.gauss.GaussIntegrator.integrate` method will perform an integration on the + given interval. + + Parameters: + numberOfPoints (int): Order of the integration rule. + lowerBound (double): Lower bound of the integration interval. + upperBound (double): Upper bound of the integration interval. + + Returns: + a Gauss-Legendre integrator. + + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if number of points is not positive + + + """ + ... @typing.overload def legendre(self, int: int, double: float, double2: float) -> GaussIntegrator: ... @typing.overload @@ -66,20 +260,57 @@ class GaussIntegratorFactory: def legendreHighPrecision(self, int: int, double: float, double2: float) -> GaussIntegrator: ... class RuleFactory: + """ + public interfaceRuleFactory + + Interface for rules that determines the integration nodes and their weights. + + Since: + 2.0 + """ def getRule(self, int: int) -> org.hipparchus.util.Pair[typing.MutableSequence[float], typing.MutableSequence[float]]: ... class AbstractRuleFactory(RuleFactory): + """ + public abstract classAbstractRuleFactory extends :class:`~org.hipparchus.analysis.integration.gauss.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.analysis.integration.gauss.RuleFactory` + + Base class for rules that determines the integration nodes and their weights. Subclasses must implement the + :meth:`~org.hipparchus.analysis.integration.gauss.AbstractRuleFactory.computeRule` method. + + Since: + 2.0 + """ def __init__(self): ... def getRule(self, int: int) -> org.hipparchus.util.Pair[typing.MutableSequence[float], typing.MutableSequence[float]]: ... _FieldAbstractRuleFactory__T = typing.TypeVar('_FieldAbstractRuleFactory__T', bound=org.hipparchus.CalculusFieldElement) # <T> class FieldAbstractRuleFactory(FieldRuleFactory[_FieldAbstractRuleFactory__T], typing.Generic[_FieldAbstractRuleFactory__T]): + """ + public abstract classFieldAbstractRuleFactory<T extends :class:`~org.hipparchus.CalculusFieldElement`<T>> extends :class:`~org.hipparchus.analysis.integration.gauss.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.analysis.integration.gauss.FieldRuleFactory`<T> + + Base class for rules that determines the integration nodes and their weights. Subclasses must implement the + :meth:`~org.hipparchus.analysis.integration.gauss.FieldAbstractRuleFactory.computeRule` method. + + Since: + 2.0 + """ def __init__(self, field: org.hipparchus.Field[_FieldAbstractRuleFactory__T]): ... def getField(self) -> org.hipparchus.Field[_FieldAbstractRuleFactory__T]: ... def getRule(self, int: int) -> org.hipparchus.util.Pair[typing.MutableSequence[_FieldAbstractRuleFactory__T], typing.MutableSequence[_FieldAbstractRuleFactory__T]]: ... _SymmetricFieldGaussIntegrator__T = typing.TypeVar('_SymmetricFieldGaussIntegrator__T', bound=org.hipparchus.CalculusFieldElement) # <T> class SymmetricFieldGaussIntegrator(FieldGaussIntegrator[_SymmetricFieldGaussIntegrator__T], typing.Generic[_SymmetricFieldGaussIntegrator__T]): + """ + public classSymmetricFieldGaussIntegrator<T extends :class:`~org.hipparchus.CalculusFieldElement`<T>> extends :class:`~org.hipparchus.analysis.integration.gauss.FieldGaussIntegrator`<T> + + This class's implements :meth:`~org.hipparchus.analysis.integration.gauss.SymmetricFieldGaussIntegrator.integrate` + method assuming that the integral is symmetric about 0. This allows to reduce numerical errors. + + Since: + 2.0 + """ @typing.overload def __init__(self, tArray: typing.Union[typing.List[_SymmetricFieldGaussIntegrator__T], jpype.JArray], tArray2: typing.Union[typing.List[_SymmetricFieldGaussIntegrator__T], jpype.JArray]): ... @typing.overload @@ -87,37 +318,141 @@ class SymmetricFieldGaussIntegrator(FieldGaussIntegrator[_SymmetricFieldGaussInt def integrate(self, calculusFieldUnivariateFunction: typing.Union[org.hipparchus.analysis.CalculusFieldUnivariateFunction[_SymmetricFieldGaussIntegrator__T], typing.Callable[[_SymmetricFieldGaussIntegrator__T], _SymmetricFieldGaussIntegrator__T]]) -> _SymmetricFieldGaussIntegrator__T: ... class SymmetricGaussIntegrator(GaussIntegrator): + """ + public classSymmetricGaussIntegrator extends :class:`~org.hipparchus.analysis.integration.gauss.GaussIntegrator` + + This class's implements :meth:`~org.hipparchus.analysis.integration.gauss.SymmetricGaussIntegrator.integrate` method + assuming that the integral is symmetric about 0. This allows to reduce numerical errors. + """ @typing.overload def __init__(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray]): ... @typing.overload def __init__(self, pair: org.hipparchus.util.Pair[typing.Union[typing.List[float], jpype.JArray], typing.Union[typing.List[float], jpype.JArray]]): ... - def integrate(self, univariateFunction: typing.Union[org.hipparchus.analysis.UnivariateFunction, typing.Callable]) -> float: ... + def integrate(self, univariateFunction: typing.Union[org.hipparchus.analysis.UnivariateFunction, typing.Callable]) -> float: + """ + Returns an estimate of the integral of :code:`f(x) * w(x)`, where :code:`w` is a weight function that depends on the + actual flavor of the Gauss integration scheme. The algorithm uses the points and associated weights, as passed to the + :meth:`~org.hipparchus.analysis.integration.gauss.GaussIntegrator.%3Cinit%3E`. + + Overrides: + :meth:`~org.hipparchus.analysis.integration.gauss.GaussIntegrator.integrate` in + class :class:`~org.hipparchus.analysis.integration.gauss.GaussIntegrator` + + Parameters: + f (:class:`~org.hipparchus.analysis.UnivariateFunction`): Function to integrate. + + Returns: + the integral of the weighted function. + + + """ + ... _ConvertingRuleFactory__T = typing.TypeVar('_ConvertingRuleFactory__T', bound=org.hipparchus.FieldElement) # <T> class ConvertingRuleFactory(AbstractRuleFactory, typing.Generic[_ConvertingRuleFactory__T]): + """ + public classConvertingRuleFactory<T extends :class:`~org.hipparchus.FieldElement`<T>> extends :class:`~org.hipparchus.analysis.integration.gauss.AbstractRuleFactory` + + Factory converting :class:`~org.hipparchus.CalculusFieldElement` + :class:`~org.hipparchus.analysis.integration.gauss.FieldRuleFactory` into + :class:`~org.hipparchus.analysis.integration.gauss.RuleFactory`. + + Since: + 2.0 + """ def __init__(self, fieldRuleFactory: typing.Union[FieldRuleFactory[_ConvertingRuleFactory__T], typing.Callable[[int], org.hipparchus.util.Pair[typing.MutableSequence[org.hipparchus.FieldElement], typing.MutableSequence[org.hipparchus.FieldElement]]]]): ... _FieldHermiteRuleFactory__T = typing.TypeVar('_FieldHermiteRuleFactory__T', bound=org.hipparchus.CalculusFieldElement) # <T> class FieldHermiteRuleFactory(FieldAbstractRuleFactory[_FieldHermiteRuleFactory__T], typing.Generic[_FieldHermiteRuleFactory__T]): + """ + public classFieldHermiteRuleFactory<T extends :class:`~org.hipparchus.CalculusFieldElement`<T>> extends :class:`~org.hipparchus.analysis.integration.gauss.FieldAbstractRuleFactory`<T> + + Factory that creates a ` Gauss-type quadrature rule using Hermite polynomials + <http://en.wikipedia.org/wiki/Gauss-Hermite_quadrature>` of the first kind. Such a quadrature rule allows the + calculation of improper integrals of a function + + \(f(x) e^{-x^2}\) + + Recurrence relation and weights computation follow ` Abramowitz and Stegun, 1964 + <http://en.wikipedia.org/wiki/Abramowitz_and_Stegun>`. + + The coefficients of the standard Hermite polynomials grow very rapidly. In order to avoid overflows, each Hermite + polynomial is normalized with respect to the underlying scalar product. + + Since: + 2.0 + """ def __init__(self, field: org.hipparchus.Field[_FieldHermiteRuleFactory__T]): ... _FieldLaguerreRuleFactory__T = typing.TypeVar('_FieldLaguerreRuleFactory__T', bound=org.hipparchus.CalculusFieldElement) # <T> class FieldLaguerreRuleFactory(FieldAbstractRuleFactory[_FieldLaguerreRuleFactory__T], typing.Generic[_FieldLaguerreRuleFactory__T]): + """ + public classFieldLaguerreRuleFactory<T extends :class:`~org.hipparchus.CalculusFieldElement`<T>> extends :class:`~org.hipparchus.analysis.integration.gauss.FieldAbstractRuleFactory`<T> + + Factory that creates Gauss-type quadrature rule using Laguerre polynomials. + + Since: + 2.0 + + Also see: + + - `Gauss-Laguerre quadrature (Wikipedia) <http://en.wikipedia.org/wiki/Gauss%E2%80%93Laguerre_quadrature>` + """ def __init__(self, field: org.hipparchus.Field[_FieldLaguerreRuleFactory__T]): ... def computeRule(self, int: int) -> org.hipparchus.util.Pair[typing.MutableSequence[_FieldLaguerreRuleFactory__T], typing.MutableSequence[_FieldLaguerreRuleFactory__T]]: ... _FieldLegendreRuleFactory__T = typing.TypeVar('_FieldLegendreRuleFactory__T', bound=org.hipparchus.CalculusFieldElement) # <T> class FieldLegendreRuleFactory(FieldAbstractRuleFactory[_FieldLegendreRuleFactory__T], typing.Generic[_FieldLegendreRuleFactory__T]): + """ + public classFieldLegendreRuleFactory<T extends :class:`~org.hipparchus.CalculusFieldElement`<T>> extends :class:`~org.hipparchus.analysis.integration.gauss.FieldAbstractRuleFactory`<T> + + Factory that creates Gauss-type quadrature rule using Legendre polynomials. In this implementation, the lower and upper + bounds of the natural interval of integration are -1 and 1, respectively. The Legendre polynomials are evaluated using + the recurrence relation presented in ` Abramowitz and Stegun, 1964 + <http://en.wikipedia.org/wiki/Abramowitz_and_Stegun>`. + + Since: + 2.0 + """ def __init__(self, field: org.hipparchus.Field[_FieldLegendreRuleFactory__T]): ... def computeRule(self, int: int) -> org.hipparchus.util.Pair[typing.MutableSequence[_FieldLegendreRuleFactory__T], typing.MutableSequence[_FieldLegendreRuleFactory__T]]: ... class HermiteRuleFactory(AbstractRuleFactory): + """ + public classHermiteRuleFactory extends :class:`~org.hipparchus.analysis.integration.gauss.AbstractRuleFactory` + + Factory that creates a ` Gauss-type quadrature rule using Hermite polynomials + <http://en.wikipedia.org/wiki/Gauss-Hermite_quadrature>` of the first kind. Such a quadrature rule allows the + calculation of improper integrals of a function + + \(f(x) e^{-x^2}\) + + Recurrence relation and weights computation follow ` Abramowitz and Stegun, 1964 + <http://en.wikipedia.org/wiki/Abramowitz_and_Stegun>`. + """ def __init__(self): ... class LaguerreRuleFactory(AbstractRuleFactory): + """ + public classLaguerreRuleFactory extends :class:`~org.hipparchus.analysis.integration.gauss.AbstractRuleFactory` + + Factory that creates Gauss-type quadrature rule using Laguerre polynomials. + + Also see: + + - `Gauss-Laguerre quadrature (Wikipedia) <http://en.wikipedia.org/wiki/Gauss%E2%80%93Laguerre_quadrature>` + """ def __init__(self): ... class LegendreRuleFactory(AbstractRuleFactory): + """ + public classLegendreRuleFactory extends :class:`~org.hipparchus.analysis.integration.gauss.AbstractRuleFactory` + + Factory that creates Gauss-type quadrature rule using Legendre polynomials. In this implementation, the lower and upper + bounds of the natural interval of integration are -1 and 1, respectively. The Legendre polynomials are evaluated using + the recurrence relation presented in ` Abramowitz and Stegun, 1964 + <http://en.wikipedia.org/wiki/Abramowitz_and_Stegun>`. + """ def __init__(self): ... diff --git a/org-stubs/hipparchus/analysis/interpolation/__init__.pyi b/org-stubs/hipparchus/analysis/interpolation/__init__.pyi index c6df20c..dd90282 100644 --- a/org-stubs/hipparchus/analysis/interpolation/__init__.pyi +++ b/org-stubs/hipparchus/analysis/interpolation/__init__.pyi @@ -17,44 +17,288 @@ import typing class BicubicInterpolatingFunction(org.hipparchus.analysis.BivariateFunction): + """ + public classBicubicInterpolatingFunction extends :class:`~org.hipparchus.analysis.interpolation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.analysis.BivariateFunction` + + Function that implements the ` bicubic spline interpolation <http://en.wikipedia.org/wiki/Bicubic_interpolation>`. + """ def __init__(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray], doubleArray3: typing.Union[typing.List[typing.MutableSequence[float]], jpype.JArray], doubleArray4: typing.Union[typing.List[typing.MutableSequence[float]], jpype.JArray], doubleArray5: typing.Union[typing.List[typing.MutableSequence[float]], jpype.JArray], doubleArray6: typing.Union[typing.List[typing.MutableSequence[float]], jpype.JArray]): ... - def isValidPoint(self, double: float, double2: float) -> bool: ... + def isValidPoint(self, double: float, double2: float) -> bool: + """ + Indicates whether a point is within the interpolation range. + + Parameters: + x (double): First coordinate. + y (double): Second coordinate. + + Returns: + :code:`true` if (x, y) is a valid point. + + + """ + ... def value(self, double: float, double2: float) -> float: ... class BilinearInterpolatingFunction(org.hipparchus.analysis.BivariateFunction, org.hipparchus.analysis.FieldBivariateFunction, java.io.Serializable): + """ + public classBilinearInterpolatingFunction extends :class:`~org.hipparchus.analysis.interpolation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.analysis.BivariateFunction`, :class:`~org.hipparchus.analysis.FieldBivariateFunction`, :class:`~org.hipparchus.analysis.interpolation.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + Interpolate grid data using bi-linear interpolation. + + This interpolator is thread-safe. + + Since: + 1.4 + + Also see: + + - :meth:`~serialized` + """ def __init__(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray], doubleArray3: typing.Union[typing.List[typing.MutableSequence[float]], jpype.JArray]): ... - def getXInf(self) -> float: ... - def getXSup(self) -> float: ... - def getYInf(self) -> float: ... - def getYSup(self) -> float: ... + def getXInf(self) -> float: + """ + Get the lowest grid x coordinate. + + Returns: + lowest grid x coordinate + + + """ + ... + def getXSup(self) -> float: + """ + Get the highest grid x coordinate. + + Returns: + highest grid x coordinate + + + """ + ... + def getYInf(self) -> float: + """ + Get the lowest grid y coordinate. + + Returns: + lowest grid y coordinate + + + """ + ... + def getYSup(self) -> float: + """ + Get the highest grid y coordinate. + + Returns: + highest grid y coordinate + + + """ + ... _value_1__T = typing.TypeVar('_value_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload - def value(self, double: float, double2: float) -> float: ... + def value(self, double: float, double2: float) -> float: + """ + Compute the value for the function. + + Specified by: + :meth:`~org.hipparchus.analysis.BivariateFunction.value` in + interface :class:`~org.hipparchus.analysis.BivariateFunction` + + Parameters: + x (double): Abscissa for which the function value should be computed. + y (double): Ordinate for which the function value should be computed. + + Returns: + the value. + + """ + ... @typing.overload - def value(self, t: _value_1__T, t2: _value_1__T) -> _value_1__T: ... + def value(self, t: _value_1__T, t2: _value_1__T) -> _value_1__T: + """ + Compute the value for the function. + + Specified by: + :meth:`~org.hipparchus.analysis.FieldBivariateFunction.value` in + interface :class:`~org.hipparchus.analysis.FieldBivariateFunction` + + Parameters: + x (T): Abscissa for which the function value should be computed. + y (T): Ordinate for which the function value should be computed. + + Returns: + the value. + + Since: + 1.5 + + + """ + ... class BivariateGridInterpolator: + """ + public interfaceBivariateGridInterpolator + + Interface representing a bivariate real interpolating function where the sample points must be specified on a regular + grid. + """ def interpolate(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray], doubleArray3: typing.Union[typing.List[typing.MutableSequence[float]], jpype.JArray]) -> org.hipparchus.analysis.BivariateFunction: ... _FieldHermiteInterpolator__T = typing.TypeVar('_FieldHermiteInterpolator__T', bound=org.hipparchus.FieldElement) # <T> class FieldHermiteInterpolator(typing.Generic[_FieldHermiteInterpolator__T]): + """ + public classFieldHermiteInterpolator<T extends :class:`~org.hipparchus.FieldElement`<T>> extends :class:`~org.hipparchus.analysis.interpolation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Polynomial interpolator using both sample values and sample derivatives. + + The interpolation polynomials match all sample points, including both values and provided derivatives. There is one + polynomial for each component of the values vector. All polynomials have the same degree. The degree of the polynomials + depends on the number of points and number of derivatives at each point. For example the interpolation polynomials for n + sample points without any derivatives all have degree n-1. The interpolation polynomials for n sample points with the + two extreme points having value and first derivative and the remaining points having value only all have degree n+1. The + interpolation polynomial for n sample points with value, first and second derivative for all points all have degree + 3n-1. + """ def __init__(self): ... def addSamplePoint(self, t: _FieldHermiteInterpolator__T, *tArray: typing.Union[typing.List[_FieldHermiteInterpolator__T], jpype.JArray]) -> None: ... def derivatives(self, t: _FieldHermiteInterpolator__T, int: int) -> typing.MutableSequence[typing.MutableSequence[_FieldHermiteInterpolator__T]]: ... def value(self, t: _FieldHermiteInterpolator__T) -> typing.MutableSequence[_FieldHermiteInterpolator__T]: ... class FieldUnivariateInterpolator: + """ + public interfaceFieldUnivariateInterpolator + + Interface representing a univariate field interpolating function. + + Since: + 1.5 + """ _interpolate__T = typing.TypeVar('_interpolate__T', bound=org.hipparchus.CalculusFieldElement) # <T> def interpolate(self, tArray: typing.Union[typing.List[_interpolate__T], jpype.JArray], tArray2: typing.Union[typing.List[_interpolate__T], jpype.JArray]) -> org.hipparchus.analysis.CalculusFieldUnivariateFunction[_interpolate__T]: ... class GridAxis(java.io.Serializable): + """ + public classGridAxis extends :class:`~org.hipparchus.analysis.interpolation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.analysis.interpolation.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + Helper for finding interpolation nodes along one axis of grid data. + + This class is intended to be used for interpolating inside grids. It works on any sorted data without duplication and + size at least :code:`n` where :code:`n` is the number of points required for interpolation (i.e. 2 for linear + interpolation, 3 for quadratic...) + + The method uses linear interpolation to select the nodes indices. It should be O(1) for sufficiently regular data, + therefore much faster than bisection. It also features caching, which improves speed when interpolating several points + in raw in the close locations, i.e. when successive calls have a high probability to return the same interpolation + nodes. This occurs for example when scanning with small steps a loose grid. The method also works on non-regular grids, + but may be slower in this case. + + This class is thread-safe. + + Since: + 1.4 + + Also see: + + - :meth:`~serialized` + """ def __init__(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int): ... - def getN(self) -> int: ... - def interpolationIndex(self, double: float) -> int: ... - def node(self, int: int) -> float: ... - def size(self) -> int: ... + def getN(self) -> int: + """ + Get the number of points required for interpolation. + + Returns: + number of points required for interpolation + + + """ + ... + def interpolationIndex(self, double: float) -> int: + """ + Get the index of the first interpolation node for some coordinate along the grid. + + The index return is the one for the lowest interpolation node suitable for :code:`t`. This means that if :code:`i` is + returned the nodes to use for interpolation at coordinate :code:`t` are at indices :code:`i`, :code:`i+1`, ..., + :code:`i+n-1`, where :code:`n` is the number of points required for interpolation passed at construction. + + The index is selected in order to have the subset of nodes from :code:`i` to :code:`i+n-1` as balanced as possible + around :code:`t`: + + - if :code:`t` is inside the grid and sufficiently far from the endpoints + + - if :code:`n` is even, the returned nodes will be perfectly balanced: there will be :code:`n/2` nodes smaller than + :code:`t` and :code:`n/2` nodes larger than :code:`t` + - if :code:`n` is odd, the returned nodes will be slightly unbalanced by one point: there will be :code:`(n+1)/2` nodes + smaller than :code:`t` and :code:`(n-1)/2` nodes larger than :code:`t` + + - if :code:`t` is inside the grid and close to endpoints, the returned nodes will be unbalanced: there will be less nodes + on the endpoints side and more nodes on the interior side + - if :code:`t` is outside of the grid, the returned nodes will completely off balance: all nodes will be on the same side + with respect to :code:`t` + + + It is *not* an error to call this method with :code:`t` outside of the grid, it simply implies that the interpolation + will become an extrapolation and accuracy will decrease as :code:`t` goes farther from the grid points. This is intended + so interpolation does not fail near the end of the grid. + + Parameters: + t (double): coordinate of the point to interpolate + + Returns: + index :code:`i` such :meth:`~org.hipparchus.analysis.interpolation.GridAxis.node`, + :meth:`~org.hipparchus.analysis.interpolation.GridAxis.node`, ... + :meth:`~org.hipparchus.analysis.interpolation.GridAxis.node` can be used for interpolating a value at coordinate + :code:`t` + + Since: + 1.4 + + + """ + ... + def node(self, int: int) -> float: + """ + Get the interpolation node at specified index. + + Parameters: + index (int): node index + + Returns: + coordinate of the node at specified index + + + """ + ... + def size(self) -> int: + """ + Get the number of points of the grid. + + Returns: + number of points of the grid + + + """ + ... class HermiteInterpolator(org.hipparchus.analysis.differentiation.UnivariateDifferentiableVectorFunction): + """ + public classHermiteInterpolator extends :class:`~org.hipparchus.analysis.interpolation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableVectorFunction` + + Polynomial interpolator using both sample values and sample derivatives. + + The interpolation polynomials match all sample points, including both values and provided derivatives. There is one + polynomial for each component of the values vector. All polynomials have the same degree. The degree of the polynomials + depends on the number of points and number of derivatives at each point. For example the interpolation polynomials for n + sample points without any derivatives all have degree n-1. The interpolation polynomials for n sample points with the + two extreme points having value and first derivative and the remaining points having value only all have degree n+1. The + interpolation polynomial for n sample points with value, first and second derivative for all points all have degree + 3n-1. + """ def __init__(self): ... def addSamplePoint(self, double: float, *doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> None: ... def derivatives(self, double: float, int: int) -> typing.MutableSequence[typing.MutableSequence[float]]: ... @@ -66,18 +310,99 @@ class HermiteInterpolator(org.hipparchus.analysis.differentiation.UnivariateDiff def value(self, t: _value_1__T) -> typing.MutableSequence[_value_1__T]: ... class InterpolatingMicrosphere: + """ + public classInterpolatingMicrosphere extends :class:`~org.hipparchus.analysis.interpolation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Utility class for the :class:`~org.hipparchus.analysis.interpolation.MicrosphereProjectionInterpolator` algorithm. + """ def __init__(self, int: int, int2: int, double: float, double2: float, double3: float, unitSphereRandomVectorGenerator: org.hipparchus.random.UnitSphereRandomVectorGenerator): ... - def copy(self) -> 'InterpolatingMicrosphere': ... - def getDimension(self) -> int: ... - def getSize(self) -> int: ... - def value(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[typing.MutableSequence[float]], jpype.JArray], doubleArray3: typing.Union[typing.List[float], jpype.JArray], double4: float, double5: float) -> float: ... + def copy(self) -> 'InterpolatingMicrosphere': + """ + Perform a copy. + + Returns: + a copy of this instance. + + + """ + ... + def getDimension(self) -> int: + """ + Get the space dimensionality. + + Returns: + the number of space dimensions. + + + """ + ... + def getSize(self) -> int: + """ + Get the size of the sphere. + + Returns: + the number of surface elements of the microspshere. + + + """ + ... + def value(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[typing.MutableSequence[float]], jpype.JArray], doubleArray3: typing.Union[typing.List[float], jpype.JArray], double4: float, double5: float) -> float: + """ + Estimate the value at the requested location. This microsphere is placed at the given :code:`point`, contribution of the + given :code:`samplePoints` to each sphere facet is computed (illumination) and the interpolation is performed + (integration of the illumination). + + Parameters: + point (double[]): Interpolation point. + samplePoints (double[][]): Sampling data points. + sampleValues (double[]): Sampling data values at the corresponding :code:`samplePoints`. + exponent (double): Exponent used in the power law that computes the weights (distance dimming factor) of the sample data. + noInterpolationTolerance (double): When the distance between the :code:`point` and one of the :code:`samplePoints` is less than this value, no + interpolation will be performed, and the value of the sample will just be returned. + + Returns: + the estimated value at the given :code:`point`. + + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if :code:`exponent < 0`. + + + """ + ... class MultivariateInterpolator: + """ + public interfaceMultivariateInterpolator + + Interface representing a univariate real interpolating function. + """ def interpolate(self, doubleArray: typing.Union[typing.List[typing.MutableSequence[float]], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray]) -> org.hipparchus.analysis.MultivariateFunction: ... class PiecewiseBicubicSplineInterpolatingFunction(org.hipparchus.analysis.BivariateFunction, org.hipparchus.analysis.FieldBivariateFunction): + """ + public classPiecewiseBicubicSplineInterpolatingFunction extends :class:`~org.hipparchus.analysis.interpolation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.analysis.BivariateFunction`, :class:`~org.hipparchus.analysis.FieldBivariateFunction` + + Function that implements the `bicubic spline <http://www.paulinternet.nl/?page=bicubic>` interpolation. This + implementation currently uses :class:`~org.hipparchus.analysis.interpolation.AkimaSplineInterpolator` as the underlying + one-dimensional interpolator, which requires 5 sample points; insufficient data will raise an exception when the + :meth:`~org.hipparchus.analysis.interpolation.PiecewiseBicubicSplineInterpolatingFunction.value` method is called. + """ def __init__(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray], doubleArray3: typing.Union[typing.List[typing.MutableSequence[float]], jpype.JArray]): ... - def isValidPoint(self, double: float, double2: float) -> bool: ... + def isValidPoint(self, double: float, double2: float) -> bool: + """ + Indicates whether a point is within the interpolation range. + + Parameters: + x (double): First coordinate. + y (double): Second coordinate. + + Returns: + :code:`true` if (x, y) is a valid point. + + + """ + ... _value_1__T = typing.TypeVar('_value_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload def value(self, double: float, double2: float) -> float: ... @@ -85,17 +410,72 @@ class PiecewiseBicubicSplineInterpolatingFunction(org.hipparchus.analysis.Bivari def value(self, t: _value_1__T, t2: _value_1__T) -> _value_1__T: ... class TricubicInterpolatingFunction(org.hipparchus.analysis.TrivariateFunction): + """ + public classTricubicInterpolatingFunction extends :class:`~org.hipparchus.analysis.interpolation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.analysis.TrivariateFunction` + + Function that implements the ` tricubic spline interpolation <http://en.wikipedia.org/wiki/Tricubic_interpolation>`, as + proposed in + Tricubic interpolation in three dimensions + + + F. Lekien and J. Marsden + + + *Int. J. Numer. Meth. Eng* 2005; **63**:455-471 + """ def __init__(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray], doubleArray3: typing.Union[typing.List[float], jpype.JArray], doubleArray4: typing.Union[typing.List[typing.MutableSequence[typing.MutableSequence[float]]], jpype.JArray], doubleArray5: typing.Union[typing.List[typing.MutableSequence[typing.MutableSequence[float]]], jpype.JArray], doubleArray6: typing.Union[typing.List[typing.MutableSequence[typing.MutableSequence[float]]], jpype.JArray], doubleArray7: typing.Union[typing.List[typing.MutableSequence[typing.MutableSequence[float]]], jpype.JArray], doubleArray8: typing.Union[typing.List[typing.MutableSequence[typing.MutableSequence[float]]], jpype.JArray], doubleArray9: typing.Union[typing.List[typing.MutableSequence[typing.MutableSequence[float]]], jpype.JArray], doubleArray10: typing.Union[typing.List[typing.MutableSequence[typing.MutableSequence[float]]], jpype.JArray], doubleArray11: typing.Union[typing.List[typing.MutableSequence[typing.MutableSequence[float]]], jpype.JArray]): ... - def isValidPoint(self, double: float, double2: float, double3: float) -> bool: ... + def isValidPoint(self, double: float, double2: float, double3: float) -> bool: + """ + Indicates whether a point is within the interpolation range. + + Parameters: + x (double): First coordinate. + y (double): Second coordinate. + z (double): Third coordinate. + + Returns: + :code:`true` if (x, y, z) is a valid point. + + + """ + ... def value(self, double: float, double2: float, double3: float) -> float: ... class TrivariateGridInterpolator: + """ + public interfaceTrivariateGridInterpolator + + Interface representing a trivariate real interpolating function where the sample points must be specified on a regular + grid. + """ def interpolate(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray], doubleArray3: typing.Union[typing.List[float], jpype.JArray], doubleArray4: typing.Union[typing.List[typing.MutableSequence[typing.MutableSequence[float]]], jpype.JArray]) -> org.hipparchus.analysis.TrivariateFunction: ... class UnivariateInterpolator: + """ + public interfaceUnivariateInterpolator + + Interface representing a univariate real interpolating function. + """ def interpolate(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray]) -> org.hipparchus.analysis.UnivariateFunction: ... class AkimaSplineInterpolator(UnivariateInterpolator, FieldUnivariateInterpolator): + """ + public classAkimaSplineInterpolator extends :class:`~org.hipparchus.analysis.interpolation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.analysis.interpolation.UnivariateInterpolator`, :class:`~org.hipparchus.analysis.interpolation.FieldUnivariateInterpolator` + + Computes a cubic spline interpolation for the data set using the Akima algorithm, as originally formulated by Hiroshi + Akima in his 1970 paper `A New Method of Interpolation and Smooth Curve Fitting Based on Local Procedures. + <http://doi.acm.org/10.1145/321607.321609>` J. ACM 17, 4 (October 1970), 589-602. DOI=10.1145/321607.321609 + + This implementation is based on the Akima implementation in the CubicSpline class in the Math.NET Numerics library. The + method referenced is CubicSpline.InterpolateAkimaSorted + + The :meth:`~org.hipparchus.analysis.interpolation.AkimaSplineInterpolator.interpolate` method returns a + :class:`~org.hipparchus.analysis.polynomials.PolynomialSplineFunction` consisting of n cubic polynomials, defined over + the subintervals determined by the x values, :code:`x[0] < x[i] ... < x[n]`. The Akima algorithm requires that :code:`n + >= 5`. + """ @typing.overload def __init__(self): ... @typing.overload @@ -107,22 +487,85 @@ class AkimaSplineInterpolator(UnivariateInterpolator, FieldUnivariateInterpolato def interpolate(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray]) -> org.hipparchus.analysis.polynomials.PolynomialSplineFunction: ... class BicubicInterpolator(BivariateGridInterpolator): + """ + public classBicubicInterpolator extends :class:`~org.hipparchus.analysis.interpolation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.analysis.interpolation.BivariateGridInterpolator` + + Generates a :class:`~org.hipparchus.analysis.interpolation.BicubicInterpolatingFunction`. + + Caveat: Because the interpolation scheme requires that derivatives be specified at the sample points, those are + approximated with finite differences (using the 2-points symmetric formulae). Since their values are undefined at the + borders of the provided interpolation ranges, the interpolated values will be wrong at the edges of the patch. The + :code:`interpolate` method will return a function that overrides + :meth:`~org.hipparchus.analysis.interpolation.BicubicInterpolatingFunction.isValidPoint` to indicate points where the + interpolation will be inaccurate. + """ def __init__(self): ... def interpolate(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray], doubleArray3: typing.Union[typing.List[typing.MutableSequence[float]], jpype.JArray]) -> BicubicInterpolatingFunction: ... class BilinearInterpolator(BivariateGridInterpolator): + """ + public classBilinearInterpolator extends :class:`~org.hipparchus.analysis.interpolation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.analysis.interpolation.BivariateGridInterpolator` + + Interpolate grid data using bi-linear interpolation. + + Since: + 1.4 + """ def __init__(self): ... def interpolate(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray], doubleArray3: typing.Union[typing.List[typing.MutableSequence[float]], jpype.JArray]) -> BilinearInterpolatingFunction: ... class DividedDifferenceInterpolator(UnivariateInterpolator, java.io.Serializable): + """ + public classDividedDifferenceInterpolator extends :class:`~org.hipparchus.analysis.interpolation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.analysis.interpolation.UnivariateInterpolator`, :class:`~org.hipparchus.analysis.interpolation.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + Implements the ` Divided Difference Algorithm + <http://mathworld.wolfram.com/NewtonsDividedDifferenceInterpolationFormula.html>` for interpolation of real univariate + functions. For reference, see **Introduction to Numerical Analysis**, ISBN 038795452X, chapter 2. + + The actual code of Neville's evaluation is in PolynomialFunctionLagrangeForm, this class provides an easy-to-use + interface to it. + + Also see: + + - :meth:`~serialized` + """ def __init__(self): ... def interpolate(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray]) -> org.hipparchus.analysis.polynomials.PolynomialFunctionNewtonForm: ... class InterpolatingMicrosphere2D(InterpolatingMicrosphere): + """ + public classInterpolatingMicrosphere2D extends :class:`~org.hipparchus.analysis.interpolation.InterpolatingMicrosphere` + + Utility class for the :class:`~org.hipparchus.analysis.interpolation.MicrosphereProjectionInterpolator` algorithm. For + 2D interpolation, this class constructs the microsphere as a series of evenly spaced facets (rather than generating + random normals as in the base implementation). + """ def __init__(self, int: int, double: float, double2: float, double3: float): ... - def copy(self) -> 'InterpolatingMicrosphere2D': ... + def copy(self) -> 'InterpolatingMicrosphere2D': + """ + Perform a copy. + + Overrides: + :meth:`~org.hipparchus.analysis.interpolation.InterpolatingMicrosphere.copy` in + class :class:`~org.hipparchus.analysis.interpolation.InterpolatingMicrosphere` + + Returns: + a copy of this instance. + + + """ + ... class LinearInterpolator(UnivariateInterpolator, FieldUnivariateInterpolator): + """ + public classLinearInterpolator extends :class:`~org.hipparchus.analysis.interpolation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.analysis.interpolation.UnivariateInterpolator`, :class:`~org.hipparchus.analysis.interpolation.FieldUnivariateInterpolator` + + Implements a linear function for interpolation of real univariate functions. + """ def __init__(self): ... _interpolate_0__T = typing.TypeVar('_interpolate_0__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload @@ -131,9 +574,62 @@ class LinearInterpolator(UnivariateInterpolator, FieldUnivariateInterpolator): def interpolate(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray]) -> org.hipparchus.analysis.polynomials.PolynomialSplineFunction: ... class LoessInterpolator(UnivariateInterpolator, java.io.Serializable): + """ + public classLoessInterpolator extends :class:`~org.hipparchus.analysis.interpolation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.analysis.interpolation.UnivariateInterpolator`, :class:`~org.hipparchus.analysis.interpolation.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + Implements the ` Local Regression Algorithm <http://en.wikipedia.org/wiki/Local_regression>` (also Loess, Lowess) for + interpolation of real univariate functions. + + For reference, see ` William S. Cleveland - Robust Locally Weighted Regression and Smoothing Scatterplots + <http://amstat.tandfonline.com/doi/abs/10.1080/01621459.1979.10481038>` + + This class implements both the loess method and serves as an interpolation adapter to it, allowing one to build a spline + on the obtained loess fit. + + Also see: + + - :meth:`~serialized` + """ DEFAULT_BANDWIDTH: typing.ClassVar[float] = ... + """ + public static final double DEFAULT_BANDWIDTH + + Default value of the bandwidth parameter. + + Also see: + + - :meth:`~constant` + + + + """ DEFAULT_ROBUSTNESS_ITERS: typing.ClassVar[int] = ... + """ + public static final int DEFAULT_ROBUSTNESS_ITERS + + Default value of the number of robustness iterations. + + Also see: + + - :meth:`~constant` + + + + """ DEFAULT_ACCURACY: typing.ClassVar[float] = ... + """ + public static final double DEFAULT_ACCURACY + + Default value for accuracy. + + Also see: + + - :meth:`~constant` + + + + """ @typing.overload def __init__(self): ... @typing.overload @@ -147,6 +643,13 @@ class LoessInterpolator(UnivariateInterpolator, java.io.Serializable): def smooth(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray], doubleArray3: typing.Union[typing.List[float], jpype.JArray]) -> typing.MutableSequence[float]: ... class MicrosphereProjectionInterpolator(MultivariateInterpolator): + """ + public classMicrosphereProjectionInterpolator extends :class:`~org.hipparchus.analysis.interpolation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.analysis.interpolation.MultivariateInterpolator` + + Interpolator that implements the algorithm described in *William Dudziak*'s `MS thesis + <http://www.dudziak.com/microsphere.pdf>`. + """ @typing.overload def __init__(self, int: int, int2: int, double: float, double2: float, double3: float, double4: float, boolean: bool, double5: float): ... @typing.overload @@ -154,10 +657,30 @@ class MicrosphereProjectionInterpolator(MultivariateInterpolator): def interpolate(self, doubleArray: typing.Union[typing.List[typing.MutableSequence[float]], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray]) -> org.hipparchus.analysis.MultivariateFunction: ... class NevilleInterpolator(UnivariateInterpolator, java.io.Serializable): + """ + public classNevilleInterpolator extends :class:`~org.hipparchus.analysis.interpolation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.analysis.interpolation.UnivariateInterpolator`, :class:`~org.hipparchus.analysis.interpolation.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + Implements the ` Neville's Algorithm <http://mathworld.wolfram.com/NevillesAlgorithm.html>` for interpolation of real + univariate functions. For reference, see **Introduction to Numerical Analysis**, ISBN 038795452X, chapter 2. + + The actual code of Neville's algorithm is in PolynomialFunctionLagrangeForm, this class provides an easy-to-use + interface to it. + + Also see: + + - :meth:`~serialized` + """ def __init__(self): ... def interpolate(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray]) -> org.hipparchus.analysis.polynomials.PolynomialFunctionLagrangeForm: ... class PiecewiseBicubicSplineInterpolator(BivariateGridInterpolator): + """ + public classPiecewiseBicubicSplineInterpolator extends :class:`~org.hipparchus.analysis.interpolation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.analysis.interpolation.BivariateGridInterpolator` + + Generates a piecewise-bicubic interpolating function. + """ def __init__(self): ... def interpolate(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray], doubleArray3: typing.Union[typing.List[typing.MutableSequence[float]], jpype.JArray]) -> PiecewiseBicubicSplineInterpolatingFunction: ... @@ -170,11 +693,38 @@ class SplineInterpolator(UnivariateInterpolator, FieldUnivariateInterpolator): def interpolate(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray]) -> org.hipparchus.analysis.polynomials.PolynomialSplineFunction: ... class TricubicInterpolator(TrivariateGridInterpolator): + """ + public classTricubicInterpolator extends :class:`~org.hipparchus.analysis.interpolation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.analysis.interpolation.TrivariateGridInterpolator` + + Generates a tricubic interpolating function. + """ def __init__(self): ... def interpolate(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray], doubleArray3: typing.Union[typing.List[float], jpype.JArray], doubleArray4: typing.Union[typing.List[typing.MutableSequence[typing.MutableSequence[float]]], jpype.JArray]) -> TricubicInterpolatingFunction: ... class UnivariatePeriodicInterpolator(UnivariateInterpolator): + """ + public classUnivariatePeriodicInterpolator extends :class:`~org.hipparchus.analysis.interpolation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.analysis.interpolation.UnivariateInterpolator` + + Adapter for classes implementing the :class:`~org.hipparchus.analysis.interpolation.UnivariateInterpolator` interface. + The data to be interpolated is assumed to be periodic. Thus values that are outside of the range can be passed to the + interpolation function: They will be wrapped into the initial range before being passed to the class that actually + computes the interpolation. + """ DEFAULT_EXTEND: typing.ClassVar[int] = ... + """ + public static final int DEFAULT_EXTEND + + Default number of extension points of the samples array. + + Also see: + + - :meth:`~constant` + + + + """ @typing.overload def __init__(self, univariateInterpolator: typing.Union[UnivariateInterpolator, typing.Callable], double: float): ... @typing.overload diff --git a/org-stubs/hipparchus/analysis/polynomials/__init__.pyi b/org-stubs/hipparchus/analysis/polynomials/__init__.pyi index 90a6999..568b8ce 100644 --- a/org-stubs/hipparchus/analysis/polynomials/__init__.pyi +++ b/org-stubs/hipparchus/analysis/polynomials/__init__.pyi @@ -17,14 +17,77 @@ import typing _FieldPolynomialFunction__T = typing.TypeVar('_FieldPolynomialFunction__T', bound=org.hipparchus.CalculusFieldElement) # <T> class FieldPolynomialFunction(org.hipparchus.analysis.CalculusFieldUnivariateFunction[_FieldPolynomialFunction__T], typing.Generic[_FieldPolynomialFunction__T]): + """ + public classFieldPolynomialFunction<T extends :class:`~org.hipparchus.CalculusFieldElement`<T>> extends :class:`~org.hipparchus.analysis.polynomials.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.analysis.CalculusFieldUnivariateFunction`<T> + + Immutable representation of a real polynomial function with real coefficients. + + `Horner's Method <http://mathworld.wolfram.com/HornersMethod.html>` is used to evaluate the function. + + Since: + 1.5 + """ def __init__(self, tArray: typing.Union[typing.List[_FieldPolynomialFunction__T], jpype.JArray]): ... def add(self, fieldPolynomialFunction: 'FieldPolynomialFunction'[_FieldPolynomialFunction__T]) -> 'FieldPolynomialFunction'[_FieldPolynomialFunction__T]: ... def antiDerivative(self) -> 'FieldPolynomialFunction'[_FieldPolynomialFunction__T]: ... - def degree(self) -> int: ... - def getCoefficients(self) -> typing.MutableSequence[_FieldPolynomialFunction__T]: ... + def degree(self) -> int: + """ + Returns the degree of the polynomial. + + Returns: + the degree of the polynomial. + + + """ + ... + def getCoefficients(self) -> typing.MutableSequence[_FieldPolynomialFunction__T]: + """ + Returns a copy of the coefficients array. + + Changes made to the returned copy will not affect the coefficients of the polynomial. + + Returns: + a fresh copy of the coefficients array. + + + """ + ... def getField(self) -> org.hipparchus.Field[_FieldPolynomialFunction__T]: ... @typing.overload - def integrate(self, double: float, double2: float) -> _FieldPolynomialFunction__T: ... + def integrate(self, double: float, double2: float) -> _FieldPolynomialFunction__T: + """ + Returns the definite integral of this polymomial over the given interval. + + [lower, upper] must describe a finite interval (neither can be infinite and lower must be less than or equal to upper). + + Parameters: + lower (double): lower bound for the integration + upper (double): upper bound for the integration + + Returns: + the integral of this polymomial over the given interval + + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if the bounds do not describe a finite interval + + Returns the definite integral of this polymomial over the given interval. + + [lower, upper] must describe a finite interval (neither can be infinite and lower must be less than or equal to upper). + + Parameters: + lower (:class:`~org.hipparchus.analysis.polynomials.FieldPolynomialFunction`): lower bound for the integration + upper (:class:`~org.hipparchus.analysis.polynomials.FieldPolynomialFunction`): upper bound for the integration + + Returns: + the integral of this polymomial over the given interval + + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if the bounds do not describe a finite interval + + + """ + ... @typing.overload def integrate(self, t: _FieldPolynomialFunction__T, t2: _FieldPolynomialFunction__T) -> _FieldPolynomialFunction__T: ... def multiply(self, fieldPolynomialFunction: 'FieldPolynomialFunction'[_FieldPolynomialFunction__T]) -> 'FieldPolynomialFunction'[_FieldPolynomialFunction__T]: ... @@ -32,47 +95,434 @@ class FieldPolynomialFunction(org.hipparchus.analysis.CalculusFieldUnivariateFun def polynomialDerivative(self) -> 'FieldPolynomialFunction'[_FieldPolynomialFunction__T]: ... def subtract(self, fieldPolynomialFunction: 'FieldPolynomialFunction'[_FieldPolynomialFunction__T]) -> 'FieldPolynomialFunction'[_FieldPolynomialFunction__T]: ... @typing.overload - def value(self, double: float) -> _FieldPolynomialFunction__T: ... + def value(self, double: float) -> _FieldPolynomialFunction__T: + """ + Compute the value of the function for the given argument. + + The value returned is + + :code:`coefficients[n] * x^n + ... + coefficients[1] * x + coefficients[0]` + + Parameters: + x (double): Argument for which the function value should be computed. + + Returns: + the value of the polynomial at the given point. + + Also see: + + - :meth:`~org.hipparchus.analysis.UnivariateFunction.value` + + + Compute the value of the function for the given argument. + + The value returned is + + :code:`coefficients[n] * x^n + ... + coefficients[1] * x + coefficients[0]` + + Specified by: + :meth:`~org.hipparchus.analysis.CalculusFieldUnivariateFunction.value` in + interface :class:`~org.hipparchus.analysis.CalculusFieldUnivariateFunction` + + Parameters: + x (:class:`~org.hipparchus.analysis.polynomials.FieldPolynomialFunction`): Argument for which the function value should be computed. + + Returns: + the value of the polynomial at the given point. + + Also see: + + - :meth:`~org.hipparchus.analysis.UnivariateFunction.value` + + + + """ + ... @typing.overload def value(self, t: _FieldPolynomialFunction__T) -> _FieldPolynomialFunction__T: ... _FieldPolynomialSplineFunction__T = typing.TypeVar('_FieldPolynomialSplineFunction__T', bound=org.hipparchus.CalculusFieldElement) # <T> class FieldPolynomialSplineFunction(org.hipparchus.analysis.CalculusFieldUnivariateFunction[_FieldPolynomialSplineFunction__T], typing.Generic[_FieldPolynomialSplineFunction__T]): + """ + public classFieldPolynomialSplineFunction<T extends :class:`~org.hipparchus.CalculusFieldElement`<T>> extends :class:`~org.hipparchus.analysis.polynomials.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.analysis.CalculusFieldUnivariateFunction`<T> + + Represents a polynomial spline function. + + A **polynomial spline function** consists of a set of *interpolating polynomials* and an ascending array of domain *knot + points*, determining the intervals over which the spline function is defined by the constituent polynomials. The + polynomials are assumed to have been computed to match the values of another function at the knot points. The value + consistency constraints are not currently enforced by :code:`PolynomialSplineFunction` itself, but are assumed to hold + among the polynomials and knot points passed to the constructor. + + N.B.: The polynomials in the :code:`polynomials` property must be centered on the knot points to compute the spline + function values. See below. + + The domain of the polynomial spline function is :code:`[smallest knot, largest knot]`. Attempts to evaluate the function + at values outside of this range generate IllegalArgumentExceptions. + + The value of the polynomial spline function for an argument :code:`x` is computed as follows: + + 1. The knot array is searched to find the segment to which :code:`x` belongs. If :code:`x` is less than the smallest knot + point or greater than the largest one, an :code:`IllegalArgumentException` is thrown. + 2. Let :code:`j` be the index of the largest knot point that is less than or equal to :code:`x`. The value returned is + :code:`polynomials[j](x - knot[j])` + + + Since: + 1.5 + """ def __init__(self, tArray: typing.Union[typing.List[_FieldPolynomialSplineFunction__T], jpype.JArray], fieldPolynomialFunctionArray: typing.Union[typing.List[FieldPolynomialFunction[_FieldPolynomialSplineFunction__T]], jpype.JArray]): ... def getField(self) -> org.hipparchus.Field[_FieldPolynomialSplineFunction__T]: ... - def getKnots(self) -> typing.MutableSequence[_FieldPolynomialSplineFunction__T]: ... - def getN(self) -> int: ... + def getKnots(self) -> typing.MutableSequence[_FieldPolynomialSplineFunction__T]: + """ + Get an array copy of the knot points. It returns a fresh copy of the array. Changes made to the copy will not affect the + knots property. + + Returns: + the knot points. + + + """ + ... + def getN(self) -> int: + """ + Get the number of spline segments. It is also the number of polynomials and the number of knot points - 1. + + Returns: + the number of spline segments. + + + """ + ... def getPolynomials(self) -> typing.MutableSequence[FieldPolynomialFunction[_FieldPolynomialSplineFunction__T]]: ... - def isValidPoint(self, t: _FieldPolynomialSplineFunction__T) -> bool: ... + def isValidPoint(self, t: _FieldPolynomialSplineFunction__T) -> bool: + """ + Indicates whether a point is within the interpolation range. + + Parameters: + x (:class:`~org.hipparchus.analysis.polynomials.FieldPolynomialSplineFunction`): Point. + + Returns: + :code:`true` if :code:`x` is a valid point. + + + """ + ... def polynomialSplineDerivative(self) -> 'FieldPolynomialSplineFunction'[_FieldPolynomialSplineFunction__T]: ... @typing.overload - def value(self, double: float) -> _FieldPolynomialSplineFunction__T: ... + def value(self, double: float) -> _FieldPolynomialSplineFunction__T: + """ + Compute the value for the function. See :class:`~org.hipparchus.analysis.polynomials.FieldPolynomialSplineFunction` for + details on the algorithm for computing the value of the function. + + Parameters: + v (double): Point for which the function value should be computed. + + Returns: + the value. + + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if :code:`v` is outside of the domain of the spline function (smaller than the smallest knot point or larger than the + largest knot point). + + Compute the value for the function. See :class:`~org.hipparchus.analysis.polynomials.FieldPolynomialSplineFunction` for + details on the algorithm for computing the value of the function. + + Specified by: + :meth:`~org.hipparchus.analysis.CalculusFieldUnivariateFunction.value` in + interface :class:`~org.hipparchus.analysis.CalculusFieldUnivariateFunction` + + Parameters: + v (:class:`~org.hipparchus.analysis.polynomials.FieldPolynomialSplineFunction`): Point for which the function value should be computed. + + Returns: + the value. + + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if :code:`v` is outside of the domain of the spline function (smaller than the smallest knot point or larger than the + largest knot point). + + + """ + ... @typing.overload def value(self, t: _FieldPolynomialSplineFunction__T) -> _FieldPolynomialSplineFunction__T: ... class JacobiKey: + """ + public classJacobiKey extends :class:`~org.hipparchus.analysis.polynomials.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Class for handling Jacobi polynomials keys. + + Since: + 3.1 + """ def __init__(self, int: int, int2: int): ... - def equals(self, object: typing.Any) -> bool: ... - def hashCode(self) -> int: ... + def equals(self, object: typing.Any) -> bool: + """ + Check if the instance represent the same key as another instance. + + Overrides: + :meth:`~org.hipparchus.analysis.polynomials.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.equals` in + class :class:`~org.hipparchus.analysis.polynomials.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Parameters: + key (:class:`~org.hipparchus.analysis.polynomials.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object`): other key + + Returns: + true if the instance and the other key refer to the same polynomial + + + """ + ... + def hashCode(self) -> int: + """ + Get hash code. + + Overrides: + :meth:`~org.hipparchus.analysis.polynomials.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.hashCode` in + class :class:`~org.hipparchus.analysis.polynomials.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Returns: + hash code + + + """ + ... class PolynomialFunction(org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction, org.hipparchus.analysis.FieldUnivariateFunction, java.io.Serializable): + """ + public classPolynomialFunction extends :class:`~org.hipparchus.analysis.polynomials.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction`, :class:`~org.hipparchus.analysis.FieldUnivariateFunction`, :class:`~org.hipparchus.analysis.polynomials.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + Immutable representation of a real polynomial function with real coefficients. + + `Horner's Method <http://mathworld.wolfram.com/HornersMethod.html>` is used to evaluate the function. + + Also see: + + - :meth:`~serialized` + """ def __init__(self, *double: float): ... - def add(self, polynomialFunction: 'PolynomialFunction') -> 'PolynomialFunction': ... - def antiDerivative(self) -> 'PolynomialFunction': ... - def degree(self) -> int: ... - def equals(self, object: typing.Any) -> bool: ... - def getCoefficients(self) -> typing.MutableSequence[float]: ... - def hashCode(self) -> int: ... - def integrate(self, double: float, double2: float) -> float: ... - def multiply(self, polynomialFunction: 'PolynomialFunction') -> 'PolynomialFunction': ... - def negate(self) -> 'PolynomialFunction': ... - def polynomialDerivative(self) -> 'PolynomialFunction': ... - def subtract(self, polynomialFunction: 'PolynomialFunction') -> 'PolynomialFunction': ... - def toString(self) -> str: ... + def add(self, polynomialFunction: 'PolynomialFunction') -> 'PolynomialFunction': + """ + Add a polynomial to the instance. + + Parameters: + p (:class:`~org.hipparchus.analysis.polynomials.PolynomialFunction`): Polynomial to add. + + Returns: + a new polynomial which is the sum of the instance and :code:`p`. + + + """ + ... + def antiDerivative(self) -> 'PolynomialFunction': + """ + Returns an anti-derivative of this polynomial, with 0 constant term. + + Returns: + a polynomial whose derivative has the same coefficients as this polynomial + + + """ + ... + def degree(self) -> int: + """ + Returns the degree of the polynomial. + + Returns: + the degree of the polynomial. + + + """ + ... + def equals(self, object: typing.Any) -> bool: + """ + + Overrides: + :meth:`~org.hipparchus.analysis.polynomials.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.equals` in + class :class:`~org.hipparchus.analysis.polynomials.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + + """ + ... + def getCoefficients(self) -> typing.MutableSequence[float]: + """ + Returns a copy of the coefficients array. + + Changes made to the returned copy will not affect the coefficients of the polynomial. + + Returns: + a fresh copy of the coefficients array. + + + """ + ... + def hashCode(self) -> int: + """ + + Overrides: + :meth:`~org.hipparchus.analysis.polynomials.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.hashCode` in + class :class:`~org.hipparchus.analysis.polynomials.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + + """ + ... + def integrate(self, double: float, double2: float) -> float: + """ + Returns the definite integral of this polymomial over the given interval. + + [lower, upper] must describe a finite interval (neither can be infinite and lower must be less than or equal to upper). + + Parameters: + lower (double): lower bound for the integration + upper (double): upper bound for the integration + + Returns: + the integral of this polymomial over the given interval + + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if the bounds do not describe a finite interval + + + """ + ... + def multiply(self, polynomialFunction: 'PolynomialFunction') -> 'PolynomialFunction': + """ + Multiply the instance by a polynomial. + + Parameters: + p (:class:`~org.hipparchus.analysis.polynomials.PolynomialFunction`): Polynomial to multiply by. + + Returns: + a new polynomial equal to this times :code:`p` + + + """ + ... + def negate(self) -> 'PolynomialFunction': + """ + Negate the instance. + + Returns: + a new polynomial with all coefficients negated + + + """ + ... + def polynomialDerivative(self) -> 'PolynomialFunction': + """ + Returns the derivative as a :class:`~org.hipparchus.analysis.polynomials.PolynomialFunction`. + + Returns: + the derivative polynomial. + + + """ + ... + def subtract(self, polynomialFunction: 'PolynomialFunction') -> 'PolynomialFunction': + """ + Subtract a polynomial from the instance. + + Parameters: + p (:class:`~org.hipparchus.analysis.polynomials.PolynomialFunction`): Polynomial to subtract. + + Returns: + a new polynomial which is the instance minus :code:`p`. + + + """ + ... + def toString(self) -> str: + """ + Returns a string representation of the polynomial. + + The representation is user oriented. Terms are displayed lowest degrees first. The multiplications signs, coefficients + equals to one and null terms are not displayed (except if the polynomial is 0, in which case the 0 constant term is + displayed). Addition of terms with negative coefficients are replaced by subtraction of terms with positive coefficients + except for the first displayed term (i.e. we display :code:`-3` for a constant negative polynomial, but :code:`1 - 3 x + + x^2` if the negative coefficient is not the first one displayed). + + Overrides: + :meth:`~org.hipparchus.analysis.polynomials.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.toString` in + class :class:`~org.hipparchus.analysis.polynomials.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Returns: + a string representation of the polynomial. + + + """ + ... _value_1__T = typing.TypeVar('_value_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> _value_2__T = typing.TypeVar('_value_2__T', bound=org.hipparchus.analysis.differentiation.Derivative) # <T> @typing.overload - def value(self, double: float) -> float: ... + def value(self, double: float) -> float: + """ + Compute the value of the function for the given argument. + + The value returned is + + :code:`coefficients[n] * x^n + ... + coefficients[1] * x + coefficients[0]` + + Specified by: + :meth:`~org.hipparchus.analysis.UnivariateFunction.value` in + interface :class:`~org.hipparchus.analysis.UnivariateFunction` + + Parameters: + x (double): Argument for which the function value should be computed. + + Returns: + the value of the polynomial at the given point. + + Also see: + + - :meth:`~org.hipparchus.analysis.UnivariateFunction.value` + + + public <T extends :class:`~org.hipparchus.analysis.differentiation.Derivative`<T>> T value(T t) throws :class:`~org.hipparchus.exception.MathIllegalArgumentException`, :class:`~org.hipparchus.exception.NullArgumentException` + + Compute the value for the function. + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction.value` in + interface :class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction` + + Parameters: + t (T): the point for which the function value should be computed + + Returns: + the value + + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if :code:`coefficients` is empty. + :class:`~org.hipparchus.exception.NullArgumentException`: if :code:`coefficients` is :code:`null`. + + public <T extends :class:`~org.hipparchus.CalculusFieldElement`<T>> T value(T t) throws :class:`~org.hipparchus.exception.MathIllegalArgumentException`, :class:`~org.hipparchus.exception.NullArgumentException` + + Compute the value of the function. + + Specified by: + :meth:`~org.hipparchus.analysis.FieldUnivariateFunction.value` in + interface :class:`~org.hipparchus.analysis.FieldUnivariateFunction` + + Parameters: + t (T): Point at which the function value should be computed. + + Returns: + the value of the function. + + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if :code:`coefficients` is empty. + :class:`~org.hipparchus.exception.NullArgumentException`: if :code:`coefficients` is :code:`null`. + + Since: + 1.3 + + + """ + ... @typing.overload def value(self, t: _value_1__T) -> _value_1__T: ... @typing.overload @@ -83,101 +533,627 @@ class PolynomialFunction(org.hipparchus.analysis.differentiation.UnivariateDiffe def value(self, double: float, *double2: float) -> float: ... class PolynomialFunctionLagrangeForm(org.hipparchus.analysis.UnivariateFunction): + """ + public classPolynomialFunctionLagrangeForm extends :class:`~org.hipparchus.analysis.polynomials.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.analysis.UnivariateFunction` + + Implements the representation of a real polynomial function in ` Lagrange Form + <http://mathworld.wolfram.com/LagrangeInterpolatingPolynomial.html>`. For reference, see **Introduction to Numerical + Analysis**, ISBN 038795452X, chapter 2. + + The approximated function should be smooth enough for Lagrange polynomial to work well. Otherwise, consider using + splines instead. + """ def __init__(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray]): ... - def degree(self) -> int: ... + def degree(self) -> int: + """ + Returns the degree of the polynomial. + + Returns: + the degree of the polynomial + + + """ + ... @staticmethod def evaluate(doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray], double3: float) -> float: ... - def getCoefficients(self) -> typing.MutableSequence[float]: ... - def getInterpolatingPoints(self) -> typing.MutableSequence[float]: ... - def getInterpolatingValues(self) -> typing.MutableSequence[float]: ... - def value(self, double: float) -> float: ... + def getCoefficients(self) -> typing.MutableSequence[float]: + """ + Returns a copy of the coefficients array. + + Changes made to the returned copy will not affect the polynomial. + + Note that coefficients computation can be ill-conditioned. Use with caution and only when it is necessary. + + Returns: + a fresh copy of the coefficients array + + + """ + ... + def getInterpolatingPoints(self) -> typing.MutableSequence[float]: + """ + Returns a copy of the interpolating points array. + + Changes made to the returned copy will not affect the polynomial. + + Returns: + a fresh copy of the interpolating points array + + + """ + ... + def getInterpolatingValues(self) -> typing.MutableSequence[float]: + """ + Returns a copy of the interpolating values array. + + Changes made to the returned copy will not affect the polynomial. + + Returns: + a fresh copy of the interpolating values array + + + """ + ... + def value(self, double: float) -> float: + """ + Calculate the function value at the given point. + + Specified by: + :meth:`~org.hipparchus.analysis.UnivariateFunction.value` in + interface :class:`~org.hipparchus.analysis.UnivariateFunction` + + Parameters: + z (double): Point at which the function value is to be computed. + + Returns: + the function value. + + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if :code:`x` and :code:`y` have different lengths. + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if :code:`x` is not sorted in strictly increasing order. + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if the size of :code:`x` is less than 2. + + + """ + ... @staticmethod def verifyInterpolationArray(doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray], boolean: bool) -> bool: ... class PolynomialFunctionNewtonForm(org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction, org.hipparchus.analysis.FieldUnivariateFunction): + """ + public classPolynomialFunctionNewtonForm extends :class:`~org.hipparchus.analysis.polynomials.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction`, :class:`~org.hipparchus.analysis.FieldUnivariateFunction` + + Implements the representation of a real polynomial function in Newton Form. For reference, see **Elementary Numerical + Analysis**, ISBN 0070124477, chapter 2. + + The formula of polynomial in Newton form is p(x) = a[0] + a[1](x-c[0]) + a[2](x-c[0])(x-c[1]) + ... + + a[n](x-c[0])(x-c[1])...(x-c[n-1]) Note that the length of a[] is one more than the length of c[] + """ def __init__(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray]): ... - def degree(self) -> int: ... + def degree(self) -> int: + """ + Returns the degree of the polynomial. + + Returns: + the degree of the polynomial + + + """ + ... @staticmethod def evaluate(doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray], double3: float) -> float: ... - def getCenters(self) -> typing.MutableSequence[float]: ... - def getCoefficients(self) -> typing.MutableSequence[float]: ... - def getNewtonCoefficients(self) -> typing.MutableSequence[float]: ... + def getCenters(self) -> typing.MutableSequence[float]: + """ + Returns a copy of the centers array. + + Changes made to the returned copy will not affect the polynomial. + + Returns: + a fresh copy of the centers array. + + + """ + ... + def getCoefficients(self) -> typing.MutableSequence[float]: + """ + Returns a copy of the coefficients array. + + Changes made to the returned copy will not affect the polynomial. + + Returns: + a fresh copy of the coefficients array. + + + """ + ... + def getNewtonCoefficients(self) -> typing.MutableSequence[float]: + """ + Returns a copy of coefficients in Newton form formula. + + Changes made to the returned copy will not affect the polynomial. + + Returns: + a fresh copy of coefficients in Newton form formula + + + """ + ... _value_1__T = typing.TypeVar('_value_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> _value_2__T = typing.TypeVar('_value_2__T', bound=org.hipparchus.analysis.differentiation.Derivative) # <T> @typing.overload - def value(self, double: float) -> float: ... + def value(self, double: float) -> float: + """ + Calculate the function value at the given point. + + Specified by: + :meth:`~org.hipparchus.analysis.UnivariateFunction.value` in + interface :class:`~org.hipparchus.analysis.UnivariateFunction` + + Parameters: + z (double): Point at which the function value is to be computed. + + Returns: + the function value. + + """ + ... @typing.overload - def value(self, t: _value_1__T) -> _value_1__T: ... + def value(self, t: _value_1__T) -> _value_1__T: + """ + Compute the value for the function. + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction.value` in + interface :class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction` + + Parameters: + t (T): the point for which the function value should be computed + + Returns: + the value + + Compute the value of the function. + + Specified by: + :meth:`~org.hipparchus.analysis.FieldUnivariateFunction.value` in + interface :class:`~org.hipparchus.analysis.FieldUnivariateFunction` + + Parameters: + t (T): Point at which the function value should be computed. + + Returns: + the value of the function. + + + """ + ... @typing.overload def value(self, t: _value_2__T) -> _value_2__T: ... class PolynomialSplineFunction(org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction, org.hipparchus.analysis.FieldUnivariateFunction): + """ + public classPolynomialSplineFunction extends :class:`~org.hipparchus.analysis.polynomials.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction`, :class:`~org.hipparchus.analysis.FieldUnivariateFunction` + + Represents a polynomial spline function. + + A **polynomial spline function** consists of a set of *interpolating polynomials* and an ascending array of domain *knot + points*, determining the intervals over which the spline function is defined by the constituent polynomials. The + polynomials are assumed to have been computed to match the values of another function at the knot points. The value + consistency constraints are not currently enforced by :code:`PolynomialSplineFunction` itself, but are assumed to hold + among the polynomials and knot points passed to the constructor. + + N.B.: The polynomials in the :code:`polynomials` property must be centered on the knot points to compute the spline + function values. See below. + + The domain of the polynomial spline function is :code:`[smallest knot, largest knot]`. Attempts to evaluate the function + at values outside of this range generate IllegalArgumentExceptions. + + The value of the polynomial spline function for an argument :code:`x` is computed as follows: + + 1. The knot array is searched to find the segment to which :code:`x` belongs. If :code:`x` is less than the smallest knot + point or greater than the largest one, an :code:`IllegalArgumentException` is thrown. + 2. Let :code:`j` be the index of the largest knot point that is less than or equal to :code:`x`. The value returned is + :code:`polynomials[j](x - knot[j])` + """ def __init__(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], polynomialFunctionArray: typing.Union[typing.List[PolynomialFunction], jpype.JArray]): ... - def getKnots(self) -> typing.MutableSequence[float]: ... - def getN(self) -> int: ... - def getPolynomials(self) -> typing.MutableSequence[PolynomialFunction]: ... - def isValidPoint(self, double: float) -> bool: ... - def polynomialSplineDerivative(self) -> 'PolynomialSplineFunction': ... + def getKnots(self) -> typing.MutableSequence[float]: + """ + Get an array copy of the knot points. It returns a fresh copy of the array. Changes made to the copy will not affect the + knots property. + + Returns: + the knot points. + + + """ + ... + def getN(self) -> int: + """ + Get the number of spline segments. It is also the number of polynomials and the number of knot points - 1. + + Returns: + the number of spline segments. + + + """ + ... + def getPolynomials(self) -> typing.MutableSequence[PolynomialFunction]: + """ + Get a copy of the interpolating polynomials array. It returns a fresh copy of the array. Changes made to the copy will + not affect the polynomials property. + + Returns: + the interpolating polynomials. + + + """ + ... + def isValidPoint(self, double: float) -> bool: + """ + Indicates whether a point is within the interpolation range. + + Parameters: + x (double): Point. + + Returns: + :code:`true` if :code:`x` is a valid point. + + + """ + ... + def polynomialSplineDerivative(self) -> 'PolynomialSplineFunction': + """ + Get the derivative of the polynomial spline function. + + Returns: + the derivative function. + + + """ + ... _value_1__T = typing.TypeVar('_value_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> _value_2__T = typing.TypeVar('_value_2__T', bound=org.hipparchus.analysis.differentiation.Derivative) # <T> @typing.overload - def value(self, double: float) -> float: ... + def value(self, double: float) -> float: + """ + Compute the value for the function. See :class:`~org.hipparchus.analysis.polynomials.PolynomialSplineFunction` for + details on the algorithm for computing the value of the function. + + Specified by: + :meth:`~org.hipparchus.analysis.UnivariateFunction.value` in + interface :class:`~org.hipparchus.analysis.UnivariateFunction` + + Parameters: + v (double): Point for which the function value should be computed. + + Returns: + the value. + + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if :code:`v` is outside of the domain of the spline function (smaller than the smallest knot point or larger than the + largest knot point). + + """ + ... @typing.overload - def value(self, t: _value_1__T) -> _value_1__T: ... + def value(self, t: _value_1__T) -> _value_1__T: + """ + Compute the value for the function. + + Specified by: + :meth:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction.value` in + interface :class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction` + + Parameters: + t (T): the point for which the function value should be computed + + Returns: + the value + + Compute the value of the function. + + Specified by: + :meth:`~org.hipparchus.analysis.FieldUnivariateFunction.value` in + interface :class:`~org.hipparchus.analysis.FieldUnivariateFunction` + + Parameters: + t (T): Point at which the function value should be computed. + + Returns: + the value of the function. + + + """ + ... @typing.overload def value(self, t: _value_2__T) -> _value_2__T: ... class PolynomialsUtils: + """ + public classPolynomialsUtils extends :class:`~org.hipparchus.analysis.polynomials.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + A collection of static methods that operate on or return polynomials. + """ @staticmethod - def createChebyshevPolynomial(int: int) -> PolynomialFunction: ... + def createChebyshevPolynomial(int: int) -> PolynomialFunction: + """ + Create a Chebyshev polynomial of the first kind. + + :class:`~org.hipparchus.analysis.polynomials.https:.en.wikipedia.org.wiki.Chebyshev_polynomials` are orthogonal + polynomials. They can be defined by the following recurrence relations: + + \( T_0(x) = 1 \\ T_1(x) = x \\ T_{k+1}(x) = 2x T_k(x) - T_{k-1}(x) \) + + Parameters: + degree (int): degree of the polynomial + + Returns: + Chebyshev polynomial of specified degree + + + """ + ... @staticmethod - def createHermitePolynomial(int: int) -> PolynomialFunction: ... + def createHermitePolynomial(int: int) -> PolynomialFunction: + """ + Create a Hermite polynomial. + + `Hermite polynomials <http://mathworld.wolfram.com/HermitePolynomial.html>` are orthogonal polynomials. They can be + defined by the following recurrence relations: + + \( H_0(x) = 1 \\ H_1(x) = 2x \\ H_{k+1}(x) = 2x H_k(X) - 2k H_{k-1}(x) \) + + Parameters: + degree (int): degree of the polynomial + + Returns: + Hermite polynomial of specified degree + + + """ + ... @staticmethod - def createJacobiPolynomial(int: int, int2: int, int3: int) -> PolynomialFunction: ... + def createJacobiPolynomial(int: int, int2: int, int3: int) -> PolynomialFunction: + """ + Create a Jacobi polynomial. + + `Jacobi polynomials <http://mathworld.wolfram.com/JacobiPolynomial.html>` are orthogonal polynomials. They can be + defined by the following recurrence relations: + + \( P_0^{vw}(x) = 1 \\ P_{-1}^{vw}(x) = 0 \\ 2k(k + v + w)(2k + v + w - 2) P_k^{vw}(x) = \\ (2k + v + w - 1)[(2k + v + + w)(2k + v + w - 2) x + v^2 - w^2] P_{k-1}^{vw}(x) \\ - 2(k + v - 1)(k + w - 1)(2k + v + w) P_{k-2}^{vw}(x) \) + + Parameters: + degree (int): degree of the polynomial + v (int): first exponent + w (int): second exponent + + Returns: + Jacobi polynomial of specified degree + + + """ + ... @staticmethod - def createLaguerrePolynomial(int: int) -> PolynomialFunction: ... + def createLaguerrePolynomial(int: int) -> PolynomialFunction: + """ + Create a Laguerre polynomial. + + `Laguerre polynomials <http://mathworld.wolfram.com/LaguerrePolynomial.html>` are orthogonal polynomials. They can be + defined by the following recurrence relations: + + \( L_0(x) = 1 \\ L_1(x) = 1 - x \\ (k+1) L_{k+1}(x) = (2k + 1 - x) L_k(x) - k L_{k-1}(x) \) + + Parameters: + degree (int): degree of the polynomial + + Returns: + Laguerre polynomial of specified degree + + + """ + ... @staticmethod - def createLegendrePolynomial(int: int) -> PolynomialFunction: ... + def createLegendrePolynomial(int: int) -> PolynomialFunction: + """ + Create a Legendre polynomial. + + `Legendre polynomials <http://mathworld.wolfram.com/LegendrePolynomial.html>` are orthogonal polynomials. They can be + defined by the following recurrence relations: + + \( P_0(x) = 1 \\ P_1(x) = x \\ (k+1) P_{k+1}(x) = (2k+1) x P_k(x) - k P_{k-1}(x) \) + + Parameters: + degree (int): degree of the polynomial + + Returns: + Legendre polynomial of specified degree + + + """ + ... @staticmethod - def shift(doubleArray: typing.Union[typing.List[float], jpype.JArray], double2: float) -> typing.MutableSequence[float]: ... + def shift(doubleArray: typing.Union[typing.List[float], jpype.JArray], double2: float) -> typing.MutableSequence[float]: + """ + Compute the coefficients of the polynomial \(P_s(x)\) whose values at point :code:`x` will be the same as the those from + the original polynomial \(P(x)\) when computed at :code:`x + shift`. + + More precisely, let \(\Delta = \) :code:`shift` and let \(P_s(x) = P(x + \Delta)\). The returned array consists of the + coefficients of \(P_s\). So if \(a_0, ..., a_{n-1}\) are the coefficients of \(P\), then the returned array \(b_0, ..., + b_{n-1}\) satisfies the identity \(\sum_{i=0}^{n-1} b_i x^i = \sum_{i=0}^{n-1} a_i (x + \Delta)^i\) for all \(x\). + + Parameters: + coefficients (double[]): Coefficients of the original polynomial. + shift (double): Shift value. + + Returns: + the coefficients \(b_i\) of the shifted polynomial. + + + """ + ... _SmoothStepFactory__FieldSmoothStepFunction__T = typing.TypeVar('_SmoothStepFactory__FieldSmoothStepFunction__T', bound=org.hipparchus.CalculusFieldElement) # <T> class SmoothStepFactory: + """ + public classSmoothStepFactory extends :class:`~org.hipparchus.analysis.polynomials.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Smoothstep function factory. + + It allows for quick creation of common and generic smoothstep functions as defined + :class:`~org.hipparchus.analysis.polynomials.https:.en.wikipedia.org.wiki.Smoothstep`. + """ @staticmethod def checkBetweenZeroAndOneIncluded(double: float) -> None: ... _getClamp_0__T = typing.TypeVar('_getClamp_0__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload @staticmethod - def getClamp(field: org.hipparchus.Field[_getClamp_0__T]) -> 'SmoothStepFactory.FieldSmoothStepFunction'[_getClamp_0__T]: ... + def getClamp(field: org.hipparchus.Field[_getClamp_0__T]) -> 'SmoothStepFactory.FieldSmoothStepFunction'[_getClamp_0__T]: + """ + Get the :class:`~org.hipparchus.analysis.polynomials.SmoothStepFactory.SmoothStepFunction`. + + Parameters: + field (:class:`~org.hipparchus.Field`<T> field): field of the element + + Returns: + clamping smoothstep function + + + """ + ... @typing.overload @staticmethod - def getClamp() -> 'SmoothStepFactory.SmoothStepFunction': ... + def getClamp() -> 'SmoothStepFactory.SmoothStepFunction': + """ + Get the :class:`~org.hipparchus.analysis.polynomials.SmoothStepFactory.SmoothStepFunction`. + + Returns: + clamping smoothstep function + + """ + ... _getCubic_0__T = typing.TypeVar('_getCubic_0__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload @staticmethod - def getCubic(field: org.hipparchus.Field[_getCubic_0__T]) -> 'SmoothStepFactory.FieldSmoothStepFunction'[_getCubic_0__T]: ... + def getCubic(field: org.hipparchus.Field[_getCubic_0__T]) -> 'SmoothStepFactory.FieldSmoothStepFunction'[_getCubic_0__T]: + """ + Get the :class:`~org.hipparchus.analysis.polynomials.SmoothStepFactory.SmoothStepFunction`. + + Parameters: + field (:class:`~org.hipparchus.Field`<T> field): field of the element + + Returns: + cubic smoothstep function + + + """ + ... @typing.overload @staticmethod - def getCubic() -> 'SmoothStepFactory.SmoothStepFunction': ... + def getCubic() -> 'SmoothStepFactory.SmoothStepFunction': + """ + Get the :class:`~org.hipparchus.analysis.polynomials.SmoothStepFactory.SmoothStepFunction`. + + Returns: + cubic smoothstep function + + """ + ... _getFieldGeneralOrder__T = typing.TypeVar('_getFieldGeneralOrder__T', bound=org.hipparchus.CalculusFieldElement) # <T> @staticmethod - def getFieldGeneralOrder(field: org.hipparchus.Field[_getFieldGeneralOrder__T], int: int) -> 'SmoothStepFactory.FieldSmoothStepFunction'[_getFieldGeneralOrder__T]: ... + def getFieldGeneralOrder(field: org.hipparchus.Field[_getFieldGeneralOrder__T], int: int) -> 'SmoothStepFactory.FieldSmoothStepFunction'[_getFieldGeneralOrder__T]: + """ + Create a :class:`~org.hipparchus.analysis.polynomials.SmoothStepFactory.SmoothStepFunction` of order **2N + 1**. + + It uses the general smoothstep equation presented + :class:`~org.hipparchus.analysis.polynomials.https:.en.wikipedia.org.wiki.Smoothstep` : $S_{N}(x) = \sum_{n=0}^{N} + \begin{pmatrix} -N-1 \\ n \end{pmatrix} \begin{pmatrix} 2N+1 \\ N-n \end{pmatrix} x^{N+n+1}$ + + Parameters: + field (:class:`~org.hipparchus.Field`<T> field): field of the element + N (int): determines the order of the output smoothstep function (=2N + 1) + + Returns: + smoothstep function of order **2N + 1** + + + """ + ... @staticmethod - def getGeneralOrder(int: int) -> 'SmoothStepFactory.SmoothStepFunction': ... + def getGeneralOrder(int: int) -> 'SmoothStepFactory.SmoothStepFunction': + """ + Create a :class:`~org.hipparchus.analysis.polynomials.SmoothStepFactory.SmoothStepFunction` of order **2N + 1**. + + It uses the general smoothstep equation presented + :class:`~org.hipparchus.analysis.polynomials.https:.en.wikipedia.org.wiki.Smoothstep` : $S_{N}(x) = \sum_{n=0}^{N} + \begin{pmatrix} -N-1 \\ n \end{pmatrix} \begin{pmatrix} 2N+1 \\ N-n \end{pmatrix} x^{N+n+1}$ + + Parameters: + N (int): determines the order of the output smoothstep function (=2N + 1) + + Returns: + smoothstep function of order **2N + 1** + + + """ + ... _getQuadratic_0__T = typing.TypeVar('_getQuadratic_0__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload @staticmethod - def getQuadratic(field: org.hipparchus.Field[_getQuadratic_0__T]) -> 'SmoothStepFactory.FieldSmoothStepFunction'[_getQuadratic_0__T]: ... + def getQuadratic(field: org.hipparchus.Field[_getQuadratic_0__T]) -> 'SmoothStepFactory.FieldSmoothStepFunction'[_getQuadratic_0__T]: + """ + Get the :class:`~org.hipparchus.analysis.polynomials.SmoothStepFactory.SmoothStepFunction`. + + Parameters: + field (:class:`~org.hipparchus.Field`<T> field): field of the element + + Returns: + clamping smoothstep function + + + """ + ... @typing.overload @staticmethod - def getQuadratic() -> 'SmoothStepFactory.SmoothStepFunction': ... + def getQuadratic() -> 'SmoothStepFactory.SmoothStepFunction': + """ + Get the :class:`~org.hipparchus.analysis.polynomials.SmoothStepFactory.SmoothStepFunction`. + + Returns: + clamping smoothstep function + + """ + ... _getQuintic_0__T = typing.TypeVar('_getQuintic_0__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload @staticmethod - def getQuintic(field: org.hipparchus.Field[_getQuintic_0__T]) -> 'SmoothStepFactory.FieldSmoothStepFunction'[_getQuintic_0__T]: ... + def getQuintic(field: org.hipparchus.Field[_getQuintic_0__T]) -> 'SmoothStepFactory.FieldSmoothStepFunction'[_getQuintic_0__T]: + """ + Get the :class:`~org.hipparchus.analysis.polynomials.SmoothStepFactory.SmoothStepFunction`. + + Parameters: + field (:class:`~org.hipparchus.Field`<T> field): field of the element + + Returns: + quintic smoothstep function + + + """ + ... @typing.overload @staticmethod - def getQuintic() -> 'SmoothStepFactory.SmoothStepFunction': ... + def getQuintic() -> 'SmoothStepFactory.SmoothStepFunction': + """ + Get the :class:`~org.hipparchus.analysis.polynomials.SmoothStepFactory.SmoothStepFunction`. + + Returns: + quintic smoothstep function + + """ + ... class FieldSmoothStepFunction(FieldPolynomialFunction[_SmoothStepFactory__FieldSmoothStepFunction__T], typing.Generic[_SmoothStepFactory__FieldSmoothStepFunction__T]): @typing.overload def value(self, double: float) -> _SmoothStepFactory__FieldSmoothStepFunction__T: ... diff --git a/org-stubs/hipparchus/analysis/solvers/__init__.pyi b/org-stubs/hipparchus/analysis/solvers/__init__.pyi index a56fef1..957bc02 100644 --- a/org-stubs/hipparchus/analysis/solvers/__init__.pyi +++ b/org-stubs/hipparchus/analysis/solvers/__init__.pyi @@ -17,6 +17,22 @@ import typing class AllowedSolution(java.lang.Enum['AllowedSolution']): + """ + public enumAllowedSolution extends :class:`~org.hipparchus.analysis.solvers.https:.docs.oracle.com.javase.8.docs.api.java.lang.Enum`<:class:`~org.hipparchus.analysis.solvers.AllowedSolution`> + + The kinds of solutions that a :class:`~org.hipparchus.analysis.solvers.BracketedUnivariateSolver` may accept as + solutions. This basically controls whether or not under-approximations and over-approximations are allowed. + + If all solutions are accepted (:meth:`~org.hipparchus.analysis.solvers.AllowedSolution.ANY_SIDE`), then the solution + that the root-finding algorithm returns for a given root may be equal to the actual root, but it may also be an + approximation that is slightly smaller or slightly larger than the actual root. Root-finding algorithms generally only + guarantee that the returned solution is within the requested tolerances. In certain cases however, it may be necessary + to guarantee that a solution is returned that lies on a specific side the solution. + + Also see: + + - :class:`~org.hipparchus.analysis.solvers.BracketedUnivariateSolver` + """ ANY_SIDE: typing.ClassVar['AllowedSolution'] = ... LEFT_SIDE: typing.ClassVar['AllowedSolution'] = ... RIGHT_SIDE: typing.ClassVar['AllowedSolution'] = ... @@ -28,18 +44,120 @@ class AllowedSolution(java.lang.Enum['AllowedSolution']): def valueOf(class_: typing.Type[_valueOf_0__T], string: str) -> _valueOf_0__T: ... @typing.overload @staticmethod - def valueOf(string: str) -> 'AllowedSolution': ... + def valueOf(string: str) -> 'AllowedSolution': + """ + Returns the enum constant of this type with the specified name. The string must match *exactly* an identifier used to + declare an enum constant in this type. (Extraneous whitespace characters are not permitted.) + + Parameters: + name (:class:`~org.hipparchus.analysis.solvers.https:.docs.oracle.com.javase.8.docs.api.java.lang.String`): the name of the enum constant to be returned. + + Returns: + the enum constant with the specified name + + Raises: + :class:`~org.hipparchus.analysis.solvers.https:.docs.oracle.com.javase.8.docs.api.java.lang.IllegalArgumentException`: if this enum type has no constant with the specified name + :class:`~org.hipparchus.analysis.solvers.https:.docs.oracle.com.javase.8.docs.api.java.lang.NullPointerException`: if the argument is null + + + """ + ... @staticmethod - def values() -> typing.MutableSequence['AllowedSolution']: ... + def values() -> typing.MutableSequence['AllowedSolution']: + """ + Returns an array containing the constants of this enum type, in the order they are declared. + + Returns: + an array containing the constants of this enum type, in the order they are declared + + + """ + ... _BaseUnivariateSolver__F = typing.TypeVar('_BaseUnivariateSolver__F', bound=org.hipparchus.analysis.UnivariateFunction) # <F> class BaseUnivariateSolver(typing.Generic[_BaseUnivariateSolver__F]): - def getAbsoluteAccuracy(self) -> float: ... - def getEvaluations(self) -> int: ... - def getFunctionValueAccuracy(self) -> float: ... - def getRelativeAccuracy(self) -> float: ... - @typing.overload - def solve(self, int: int, f: _BaseUnivariateSolver__F, double: float) -> float: ... + """ + public interfaceBaseUnivariateSolver<F extends :class:`~org.hipparchus.analysis.UnivariateFunction`> + + Interface for (univariate real) rootfinding algorithms. Implementations will search for only one zero in the given + interval. This class is not intended for use outside of the Hipparchus library, regular user should rely on more + specific interfaces like :class:`~org.hipparchus.analysis.solvers.UnivariateSolver`, + :class:`~org.hipparchus.analysis.solvers.PolynomialSolver` or + :class:`~org.hipparchus.analysis.solvers.UnivariateDifferentiableSolver`. + + Also see: + + - :class:`~org.hipparchus.analysis.solvers.UnivariateSolver` + - :class:`~org.hipparchus.analysis.solvers.PolynomialSolver` + - :class:`~org.hipparchus.analysis.solvers.UnivariateDifferentiableSolver` + """ + def getAbsoluteAccuracy(self) -> float: + """ + Get the absolute accuracy of the solver. Solutions returned by the solver should be accurate to this tolerance, i.e., if + ε is the absolute accuracy of the solver and :code:`v` is a value returned by one of the :code:`solve` methods, then a + root of the function should exist somewhere in the interval (:code:`v` - ε, :code:`v` + ε). + + Returns: + the absolute accuracy. + + + """ + ... + def getEvaluations(self) -> int: + """ + Get the number of evaluations of the objective function. The number of evaluations corresponds to the last call to the + :code:`optimize` method. It is 0 if the method has not been called yet. + + Returns: + the number of evaluations of the objective function. + + + """ + ... + def getFunctionValueAccuracy(self) -> float: + """ + Get the function value accuracy of the solver. If :code:`v` is a value returned by the solver for a function :code:`f`, + then by contract, :code:`|f(v)|` should be less than or equal to the function value accuracy configured for the solver. + + Returns: + the function value accuracy. + + + """ + ... + def getRelativeAccuracy(self) -> float: + """ + Get the relative accuracy of the solver. The contract for relative accuracy is the same as + :meth:`~org.hipparchus.analysis.solvers.BaseUnivariateSolver.getAbsoluteAccuracy`, but using relative, rather than + absolute error. If Ï is the relative accuracy configured for a solver and :code:`v` is a value returned, then a root of + the function should exist somewhere in the interval (:code:`v` - Ï :code:`v`, :code:`v` + Ï :code:`v`). + + Returns: + the relative accuracy. + + + """ + ... + @typing.overload + def solve(self, int: int, f: _BaseUnivariateSolver__F, double: float) -> float: + """ + Solve for a zero in the vicinity of :code:`startValue`. + + Parameters: + f (int): Function to solve. + startValue (:class:`~org.hipparchus.analysis.solvers.BaseUnivariateSolver`): Start value to use. + maxEval (double): Maximum number of evaluations. + + Returns: + a value where the function is zero. + + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if the arguments do not satisfy the requirements specified by the solver. + :class:`~org.hipparchus.exception.MathIllegalStateException`: if the allowed number of evaluations is exceeded. + + + """ + ... @typing.overload def solve(self, int: int, f: _BaseUnivariateSolver__F, double: float, double2: float) -> float: ... @typing.overload @@ -48,11 +166,84 @@ class BaseUnivariateSolver(typing.Generic[_BaseUnivariateSolver__F]): _BracketedRealFieldUnivariateSolver__Interval__T = typing.TypeVar('_BracketedRealFieldUnivariateSolver__Interval__T', bound=org.hipparchus.CalculusFieldElement) # <T> _BracketedRealFieldUnivariateSolver__T = typing.TypeVar('_BracketedRealFieldUnivariateSolver__T', bound=org.hipparchus.CalculusFieldElement) # <T> class BracketedRealFieldUnivariateSolver(typing.Generic[_BracketedRealFieldUnivariateSolver__T]): - def getAbsoluteAccuracy(self) -> _BracketedRealFieldUnivariateSolver__T: ... - def getEvaluations(self) -> int: ... - def getFunctionValueAccuracy(self) -> _BracketedRealFieldUnivariateSolver__T: ... - def getMaxEvaluations(self) -> int: ... - def getRelativeAccuracy(self) -> _BracketedRealFieldUnivariateSolver__T: ... + """ + public interfaceBracketedRealFieldUnivariateSolver<T extends :class:`~org.hipparchus.CalculusFieldElement`<T>> + + Interface for :class:`~org.hipparchus.analysis.solvers.UnivariateSolver` that maintain a bracketed solution. There are + several advantages to having such root-finding algorithms: + + - The bracketed solution guarantees that the root is kept within the interval. As such, these algorithms generally also + guarantee convergence. + - The bracketed solution means that we have the opportunity to only return roots that are greater than or equal to the + actual root, or are less than or equal to the actual root. That is, we can control whether under-approximations and + over-approximations are :class:`~org.hipparchus.analysis.solvers.AllowedSolution`. Other root-finding algorithms can + usually only guarantee that the solution (the root that was found) is around the actual root. + + + For backwards compatibility, all root-finding algorithms must have + :meth:`~org.hipparchus.analysis.solvers.AllowedSolution.ANY_SIDE` as default for the allowed solutions. + + Also see: + + - :class:`~org.hipparchus.analysis.solvers.AllowedSolution` + """ + def getAbsoluteAccuracy(self) -> _BracketedRealFieldUnivariateSolver__T: + """ + Get the absolute accuracy of the solver. Solutions returned by the solver should be accurate to this tolerance, i.e., if + ε is the absolute accuracy of the solver and :code:`v` is a value returned by one of the :code:`solve` methods, then a + root of the function should exist somewhere in the interval (:code:`v` - ε, :code:`v` + ε). + + Returns: + the absolute accuracy. + + + """ + ... + def getEvaluations(self) -> int: + """ + Get the number of evaluations of the objective function. The number of evaluations corresponds to the last call to the + :code:`optimize` method. It is 0 if the method has not been called yet. + + Returns: + the number of evaluations of the objective function. + + + """ + ... + def getFunctionValueAccuracy(self) -> _BracketedRealFieldUnivariateSolver__T: + """ + Get the function value accuracy of the solver. If :code:`v` is a value returned by the solver for a function :code:`f`, + then by contract, :code:`|f(v)|` should be less than or equal to the function value accuracy configured for the solver. + + Returns: + the function value accuracy. + + + """ + ... + def getMaxEvaluations(self) -> int: + """ + Get the maximum number of function evaluations. + + Returns: + the maximum number of function evaluations. + + + """ + ... + def getRelativeAccuracy(self) -> _BracketedRealFieldUnivariateSolver__T: + """ + Get the relative accuracy of the solver. The contract for relative accuracy is the same as + :meth:`~org.hipparchus.analysis.solvers.BracketedRealFieldUnivariateSolver.getAbsoluteAccuracy`, but using relative, + rather than absolute error. If Ï is the relative accuracy configured for a solver and :code:`v` is a value returned, + then a root of the function should exist somewhere in the interval (:code:`v` - Ï :code:`v`, :code:`v` + Ï :code:`v`). + + Returns: + the relative accuracy. + + + """ + ... @typing.overload def solve(self, int: int, calculusFieldUnivariateFunction: typing.Union[org.hipparchus.analysis.CalculusFieldUnivariateFunction[_BracketedRealFieldUnivariateSolver__T], typing.Callable[[_BracketedRealFieldUnivariateSolver__T], _BracketedRealFieldUnivariateSolver__T]], t: _BracketedRealFieldUnivariateSolver__T, t2: _BracketedRealFieldUnivariateSolver__T, t3: _BracketedRealFieldUnivariateSolver__T, allowedSolution: AllowedSolution) -> _BracketedRealFieldUnivariateSolver__T: ... @typing.overload @@ -70,6 +261,11 @@ class BracketedRealFieldUnivariateSolver(typing.Generic[_BracketedRealFieldUniva def getSide(self, allowedSolution: AllowedSolution) -> _BracketedRealFieldUnivariateSolver__Interval__T: ... class UnivariateSolverUtils: + """ + public classUnivariateSolverUtils extends :class:`~org.hipparchus.analysis.solvers.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Utility routines for :class:`~org.hipparchus.analysis.solvers.UnivariateSolver` objects. + """ _bracket_3__T = typing.TypeVar('_bracket_3__T', bound=org.hipparchus.CalculusFieldElement) # <T> _bracket_4__T = typing.TypeVar('_bracket_4__T', bound=org.hipparchus.CalculusFieldElement) # <T> _bracket_5__T = typing.TypeVar('_bracket_5__T', bound=org.hipparchus.CalculusFieldElement) # <T> @@ -96,9 +292,36 @@ class UnivariateSolverUtils: @staticmethod def isBracketing(univariateFunction: typing.Union[org.hipparchus.analysis.UnivariateFunction, typing.Callable], double: float, double2: float) -> bool: ... @staticmethod - def isSequence(double: float, double2: float, double3: float) -> bool: ... + def isSequence(double: float, double2: float, double3: float) -> bool: + """ + Check whether the arguments form a (strictly) increasing sequence. + + Parameters: + start (double): First number. + mid (double): Second number. + end (double): Third number. + + Returns: + :code:`true` if the arguments form an increasing sequence. + + + """ + ... @staticmethod - def midpoint(double: float, double2: float) -> float: ... + def midpoint(double: float, double2: float) -> float: + """ + Compute the midpoint of two values. + + Parameters: + a (double): first value. + b (double): second value. + + Returns: + the midpoint. + + + """ + ... @typing.overload @staticmethod def solve(univariateFunction: typing.Union[org.hipparchus.analysis.UnivariateFunction, typing.Callable], double: float, double2: float) -> float: ... @@ -114,15 +337,149 @@ class UnivariateSolverUtils: _BaseAbstractUnivariateSolver__F = typing.TypeVar('_BaseAbstractUnivariateSolver__F', bound=org.hipparchus.analysis.UnivariateFunction) # <F> class BaseAbstractUnivariateSolver(BaseUnivariateSolver[_BaseAbstractUnivariateSolver__F], typing.Generic[_BaseAbstractUnivariateSolver__F]): - def getAbsoluteAccuracy(self) -> float: ... - def getEvaluations(self) -> int: ... - def getFunctionValueAccuracy(self) -> float: ... - def getMax(self) -> float: ... - def getMin(self) -> float: ... - def getRelativeAccuracy(self) -> float: ... - def getStartValue(self) -> float: ... - @typing.overload - def solve(self, int: int, f: _BaseAbstractUnivariateSolver__F, double: float) -> float: ... + """ + public abstract classBaseAbstractUnivariateSolver<F extends :class:`~org.hipparchus.analysis.UnivariateFunction`> extends :class:`~org.hipparchus.analysis.solvers.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.analysis.solvers.BaseUnivariateSolver`<F> + + Provide a default implementation for several functions useful to generic solvers. The default values for relative and + function tolerances are 1e-14 and 1e-15, respectively. It is however highly recommended to not rely on the default, but + rather carefully consider values that match user's expectations, as well as the specifics of each implementation. + """ + def getAbsoluteAccuracy(self) -> float: + """ + Get the absolute accuracy of the solver. Solutions returned by the solver should be accurate to this tolerance, i.e., if + ε is the absolute accuracy of the solver and :code:`v` is a value returned by one of the :code:`solve` methods, then a + root of the function should exist somewhere in the interval (:code:`v` - ε, :code:`v` + ε). + + Specified by: + :meth:`~org.hipparchus.analysis.solvers.BaseUnivariateSolver.getAbsoluteAccuracy` in + interface :class:`~org.hipparchus.analysis.solvers.BaseUnivariateSolver` + + Returns: + the absolute accuracy. + + + """ + ... + def getEvaluations(self) -> int: + """ + Get the number of evaluations of the objective function. The number of evaluations corresponds to the last call to the + :code:`optimize` method. It is 0 if the method has not been called yet. + + Specified by: + :meth:`~org.hipparchus.analysis.solvers.BaseUnivariateSolver.getEvaluations` in + interface :class:`~org.hipparchus.analysis.solvers.BaseUnivariateSolver` + + Returns: + the number of evaluations of the objective function. + + + """ + ... + def getFunctionValueAccuracy(self) -> float: + """ + Get the function value accuracy of the solver. If :code:`v` is a value returned by the solver for a function :code:`f`, + then by contract, :code:`|f(v)|` should be less than or equal to the function value accuracy configured for the solver. + + Specified by: + :meth:`~org.hipparchus.analysis.solvers.BaseUnivariateSolver.getFunctionValueAccuracy` in + interface :class:`~org.hipparchus.analysis.solvers.BaseUnivariateSolver` + + Returns: + the function value accuracy. + + + """ + ... + def getMax(self) -> float: + """ + Get higher end of the search interval. + + Returns: + the higher end of the search interval + + + """ + ... + def getMin(self) -> float: + """ + Get lower end of the search interval. + + Returns: + the lower end of the search interval + + + """ + ... + def getRelativeAccuracy(self) -> float: + """ + Get the relative accuracy of the solver. The contract for relative accuracy is the same as + :meth:`~org.hipparchus.analysis.solvers.BaseUnivariateSolver.getAbsoluteAccuracy`, but using relative, rather than + absolute error. If Ï is the relative accuracy configured for a solver and :code:`v` is a value returned, then a root of + the function should exist somewhere in the interval (:code:`v` - Ï :code:`v`, :code:`v` + Ï :code:`v`). + + Specified by: + :meth:`~org.hipparchus.analysis.solvers.BaseUnivariateSolver.getRelativeAccuracy` in + interface :class:`~org.hipparchus.analysis.solvers.BaseUnivariateSolver` + + Returns: + the relative accuracy. + + + """ + ... + def getStartValue(self) -> float: + """ + Get initial guess. + + Returns: + the initial guess + + + """ + ... + @typing.overload + def solve(self, int: int, f: _BaseAbstractUnivariateSolver__F, double: float) -> float: + """ + Solve for a zero root in the given interval. A solver may require that the interval brackets a single zero root. Solvers + that do require bracketing should be able to handle the case where one of the endpoints is itself a root. + + Specified by: + :meth:`~org.hipparchus.analysis.solvers.BaseUnivariateSolver.solve` in + interface :class:`~org.hipparchus.analysis.solvers.BaseUnivariateSolver` + + Parameters: + maxEval (int): Maximum number of evaluations. + f (:class:`~org.hipparchus.analysis.solvers.BaseAbstractUnivariateSolver`): Function to solve. + min (double): Lower bound for the interval. + max (double): Upper bound for the interval. + + Returns: + a value where the function is zero. + + public double solve(int maxEval, :class:`~org.hipparchus.analysis.solvers.BaseAbstractUnivariateSolver` f, double startValue) throws :class:`~org.hipparchus.exception.MathIllegalArgumentException`, :class:`~org.hipparchus.exception.MathIllegalStateException` + + Solve for a zero in the vicinity of :code:`startValue`. + + Specified by: + :meth:`~org.hipparchus.analysis.solvers.BaseUnivariateSolver.solve` in + interface :class:`~org.hipparchus.analysis.solvers.BaseUnivariateSolver` + + Parameters: + maxEval (int): Maximum number of evaluations. + f (:class:`~org.hipparchus.analysis.solvers.BaseAbstractUnivariateSolver`): Function to solve. + startValue (double): Start value to use. + + Returns: + a value where the function is zero. + + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if the arguments do not satisfy the requirements specified by the solver. + :class:`~org.hipparchus.exception.MathIllegalStateException`: if the allowed number of evaluations is exceeded. + + + """ + ... @typing.overload def solve(self, int: int, f: _BaseAbstractUnivariateSolver__F, double: float, double2: float) -> float: ... @typing.overload @@ -130,8 +487,69 @@ class BaseAbstractUnivariateSolver(BaseUnivariateSolver[_BaseAbstractUnivariateS _BracketedUnivariateSolver__F = typing.TypeVar('_BracketedUnivariateSolver__F', bound=org.hipparchus.analysis.UnivariateFunction) # <F> class BracketedUnivariateSolver(BaseUnivariateSolver[_BracketedUnivariateSolver__F], typing.Generic[_BracketedUnivariateSolver__F]): - @typing.overload - def solve(self, int: int, f: _BracketedUnivariateSolver__F, double: float) -> float: ... + """ + public interfaceBracketedUnivariateSolver<F extends :class:`~org.hipparchus.analysis.UnivariateFunction`>extends :class:`~org.hipparchus.analysis.solvers.BaseUnivariateSolver`<F> + + Interface for :class:`~org.hipparchus.analysis.solvers.UnivariateSolver` that maintain a bracketed solution. There are + several advantages to having such root-finding algorithms: + + - The bracketed solution guarantees that the root is kept within the interval. As such, these algorithms generally also + guarantee convergence. + - The bracketed solution means that we have the opportunity to only return roots that are greater than or equal to the + actual root, or are less than or equal to the actual root. That is, we can control whether under-approximations and + over-approximations are :class:`~org.hipparchus.analysis.solvers.AllowedSolution`. Other root-finding algorithms can + usually only guarantee that the solution (the root that was found) is around the actual root. + + + For backwards compatibility, all root-finding algorithms must have + :meth:`~org.hipparchus.analysis.solvers.AllowedSolution.ANY_SIDE` as default for the allowed solutions. + + Also see: + + - :class:`~org.hipparchus.analysis.solvers.AllowedSolution` + """ + @typing.overload + def solve(self, int: int, f: _BracketedUnivariateSolver__F, double: float) -> float: + """ + Solve for a zero in the given interval. A solver may require that the interval brackets a single zero root. Solvers that + do require bracketing should be able to handle the case where one of the endpoints is itself a root. + + Parameters: + maxEval (int): Maximum number of evaluations. + f (:class:`~org.hipparchus.analysis.solvers.BracketedUnivariateSolver`): Function to solve. + min (double): Lower bound for the interval. + max (double): Upper bound for the interval. + allowedSolution (:class:`~org.hipparchus.analysis.solvers.AllowedSolution`): The kind of solutions that the root-finding algorithm may accept as solutions. + + Returns: + A value where the function is zero. + + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if the arguments do not satisfy the requirements specified by the solver. + :class:`~org.hipparchus.exception.MathIllegalStateException`: if the allowed number of evaluations is exceeded. + + Solve for a zero in the given interval, start at :code:`startValue`. A solver may require that the interval brackets a + single zero root. Solvers that do require bracketing should be able to handle the case where one of the endpoints is + itself a root. + + Parameters: + maxEval (int): Maximum number of evaluations. + f (:class:`~org.hipparchus.analysis.solvers.BracketedUnivariateSolver`): Function to solve. + min (double): Lower bound for the interval. + max (double): Upper bound for the interval. + startValue (double): Start value to use. + allowedSolution (:class:`~org.hipparchus.analysis.solvers.AllowedSolution`): The kind of solutions that the root-finding algorithm may accept as solutions. + + Returns: + A value where the function is zero. + + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if the arguments do not satisfy the requirements specified by the solver. + :class:`~org.hipparchus.exception.MathIllegalStateException`: if the allowed number of evaluations is exceeded. + + + """ + ... @typing.overload def solve(self, int: int, f: _BracketedUnivariateSolver__F, double: float, double2: float) -> float: ... @typing.overload @@ -154,13 +572,103 @@ class BracketedUnivariateSolver(BaseUnivariateSolver[_BracketedUnivariateSolver_ _FieldBracketingNthOrderBrentSolver__T = typing.TypeVar('_FieldBracketingNthOrderBrentSolver__T', bound=org.hipparchus.CalculusFieldElement) # <T> class FieldBracketingNthOrderBrentSolver(BracketedRealFieldUnivariateSolver[_FieldBracketingNthOrderBrentSolver__T], typing.Generic[_FieldBracketingNthOrderBrentSolver__T]): + """ + public classFieldBracketingNthOrderBrentSolver<T extends :class:`~org.hipparchus.CalculusFieldElement`<T>> extends :class:`~org.hipparchus.analysis.solvers.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.analysis.solvers.BracketedRealFieldUnivariateSolver`<T> + + This class implements a modification of the ` Brent algorithm <http://mathworld.wolfram.com/BrentsMethod.html>`. + + The changes with respect to the original Brent algorithm are: + + - the returned value is chosen in the current interval according to user specified + :class:`~org.hipparchus.analysis.solvers.AllowedSolution` + - the maximal order for the invert polynomial root search is user-specified instead of being invert quadratic only + + + The given interval must bracket the root. + """ def __init__(self, t: _FieldBracketingNthOrderBrentSolver__T, t2: _FieldBracketingNthOrderBrentSolver__T, t3: _FieldBracketingNthOrderBrentSolver__T, int: int): ... - def getAbsoluteAccuracy(self) -> _FieldBracketingNthOrderBrentSolver__T: ... - def getEvaluations(self) -> int: ... - def getFunctionValueAccuracy(self) -> _FieldBracketingNthOrderBrentSolver__T: ... - def getMaxEvaluations(self) -> int: ... - def getMaximalOrder(self) -> int: ... - def getRelativeAccuracy(self) -> _FieldBracketingNthOrderBrentSolver__T: ... + def getAbsoluteAccuracy(self) -> _FieldBracketingNthOrderBrentSolver__T: + """ + Get the absolute accuracy. + + Specified by: + :meth:`~org.hipparchus.analysis.solvers.BracketedRealFieldUnivariateSolver.getAbsoluteAccuracy` in + interface :class:`~org.hipparchus.analysis.solvers.BracketedRealFieldUnivariateSolver` + + Returns: + absolute accuracy + + + """ + ... + def getEvaluations(self) -> int: + """ + Get the number of evaluations of the objective function. The number of evaluations corresponds to the last call to the + :code:`optimize` method. It is 0 if the method has not been called yet. + + Specified by: + :meth:`~org.hipparchus.analysis.solvers.BracketedRealFieldUnivariateSolver.getEvaluations` in + interface :class:`~org.hipparchus.analysis.solvers.BracketedRealFieldUnivariateSolver` + + Returns: + the number of evaluations of the objective function. + + + """ + ... + def getFunctionValueAccuracy(self) -> _FieldBracketingNthOrderBrentSolver__T: + """ + Get the function accuracy. + + Specified by: + :meth:`~org.hipparchus.analysis.solvers.BracketedRealFieldUnivariateSolver.getFunctionValueAccuracy` in + interface :class:`~org.hipparchus.analysis.solvers.BracketedRealFieldUnivariateSolver` + + Returns: + function accuracy + + + """ + ... + def getMaxEvaluations(self) -> int: + """ + Get the maximal number of function evaluations. + + Specified by: + :meth:`~org.hipparchus.analysis.solvers.BracketedRealFieldUnivariateSolver.getMaxEvaluations` in + interface :class:`~org.hipparchus.analysis.solvers.BracketedRealFieldUnivariateSolver` + + Returns: + the maximal number of function evaluations. + + + """ + ... + def getMaximalOrder(self) -> int: + """ + Get the maximal order. + + Returns: + maximal order + + + """ + ... + def getRelativeAccuracy(self) -> _FieldBracketingNthOrderBrentSolver__T: + """ + Get the relative accuracy. + + Specified by: + :meth:`~org.hipparchus.analysis.solvers.BracketedRealFieldUnivariateSolver.getRelativeAccuracy` in + interface :class:`~org.hipparchus.analysis.solvers.BracketedRealFieldUnivariateSolver` + + Returns: + relative accuracy + + + """ + ... @typing.overload def solve(self, int: int, calculusFieldUnivariateFunction: typing.Union[org.hipparchus.analysis.CalculusFieldUnivariateFunction[_FieldBracketingNthOrderBrentSolver__T], typing.Callable[[_FieldBracketingNthOrderBrentSolver__T], _FieldBracketingNthOrderBrentSolver__T]], t: _FieldBracketingNthOrderBrentSolver__T, t2: _FieldBracketingNthOrderBrentSolver__T, t3: _FieldBracketingNthOrderBrentSolver__T, allowedSolution: AllowedSolution) -> _FieldBracketingNthOrderBrentSolver__T: ... @typing.overload @@ -170,21 +678,143 @@ class FieldBracketingNthOrderBrentSolver(BracketedRealFieldUnivariateSolver[_Fie @typing.overload def solveInterval(self, int: int, calculusFieldUnivariateFunction: typing.Union[org.hipparchus.analysis.CalculusFieldUnivariateFunction[_FieldBracketingNthOrderBrentSolver__T], typing.Callable[[_FieldBracketingNthOrderBrentSolver__T], _FieldBracketingNthOrderBrentSolver__T]], t: _FieldBracketingNthOrderBrentSolver__T, t2: _FieldBracketingNthOrderBrentSolver__T, t3: _FieldBracketingNthOrderBrentSolver__T) -> BracketedRealFieldUnivariateSolver.Interval[_FieldBracketingNthOrderBrentSolver__T]: ... -class PolynomialSolver(BaseUnivariateSolver[org.hipparchus.analysis.polynomials.PolynomialFunction]): ... +class PolynomialSolver(BaseUnivariateSolver[org.hipparchus.analysis.polynomials.PolynomialFunction]): + """ + public interfacePolynomialSolverextends :class:`~org.hipparchus.analysis.solvers.BaseUnivariateSolver`<:class:`~org.hipparchus.analysis.polynomials.PolynomialFunction`> + + Interface for (polynomial) root-finding algorithms. Implementations will search for only one zero in the given interval. + """ + ... -class UnivariateDifferentiableSolver(BaseUnivariateSolver[org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction]): ... +class UnivariateDifferentiableSolver(BaseUnivariateSolver[org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction]): + """ + public interfaceUnivariateDifferentiableSolverextends :class:`~org.hipparchus.analysis.solvers.BaseUnivariateSolver`<:class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction`> + + Interface for (univariate real) rootfinding algorithms. Implementations will search for only one zero in the given + interval. + """ + ... -class UnivariateSolver(BaseUnivariateSolver[org.hipparchus.analysis.UnivariateFunction]): ... +class UnivariateSolver(BaseUnivariateSolver[org.hipparchus.analysis.UnivariateFunction]): + """ + public interfaceUnivariateSolverextends :class:`~org.hipparchus.analysis.solvers.BaseUnivariateSolver`<:class:`~org.hipparchus.analysis.UnivariateFunction`> + + Interface for (univariate real) root-finding algorithms. Implementations will search for only one zero in the given + interval. + """ + ... -class AbstractPolynomialSolver(BaseAbstractUnivariateSolver[org.hipparchus.analysis.polynomials.PolynomialFunction], PolynomialSolver): ... +class AbstractPolynomialSolver(BaseAbstractUnivariateSolver[org.hipparchus.analysis.polynomials.PolynomialFunction], PolynomialSolver): + """ + public abstract classAbstractPolynomialSolver extends :class:`~org.hipparchus.analysis.solvers.BaseAbstractUnivariateSolver`<:class:`~org.hipparchus.analysis.polynomials.PolynomialFunction`> + implements :class:`~org.hipparchus.analysis.solvers.PolynomialSolver` + + Base class for solvers. + """ + ... -class AbstractUnivariateDifferentiableSolver(BaseAbstractUnivariateSolver[org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction], UnivariateDifferentiableSolver): ... +class AbstractUnivariateDifferentiableSolver(BaseAbstractUnivariateSolver[org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction], UnivariateDifferentiableSolver): + """ + public abstract classAbstractUnivariateDifferentiableSolver extends :class:`~org.hipparchus.analysis.solvers.BaseAbstractUnivariateSolver`<:class:`~org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction`> + implements :class:`~org.hipparchus.analysis.solvers.UnivariateDifferentiableSolver` + + Provide a default implementation for several functions useful to generic solvers. + """ + ... -class AbstractUnivariateSolver(BaseAbstractUnivariateSolver[org.hipparchus.analysis.UnivariateFunction], UnivariateSolver): ... +class AbstractUnivariateSolver(BaseAbstractUnivariateSolver[org.hipparchus.analysis.UnivariateFunction], UnivariateSolver): + """ + public abstract classAbstractUnivariateSolver extends :class:`~org.hipparchus.analysis.solvers.BaseAbstractUnivariateSolver`<:class:`~org.hipparchus.analysis.UnivariateFunction`> + implements :class:`~org.hipparchus.analysis.solvers.UnivariateSolver` + + Base class for solvers. + """ + ... class BaseSecantSolver(AbstractUnivariateSolver, BracketedUnivariateSolver[org.hipparchus.analysis.UnivariateFunction]): - @typing.overload - def solve(self, int: int, f: org.hipparchus.analysis.UnivariateFunction, double: float) -> float: ... + """ + public abstract classBaseSecantSolver extends :class:`~org.hipparchus.analysis.solvers.AbstractUnivariateSolver` + implements :class:`~org.hipparchus.analysis.solvers.BracketedUnivariateSolver`<:class:`~org.hipparchus.analysis.UnivariateFunction`> + + Base class for all bracketing *Secant*-based methods for root-finding (approximating a zero of a univariate real + function). + + Implementation of the :class:`~org.hipparchus.analysis.solvers.RegulaFalsiSolver` and + :class:`~org.hipparchus.analysis.solvers.IllinoisSolver` methods is based on the following article: M. Dowell and P. + Jarratt, *A modified regula falsi method for computing the root of an equation*, BIT Numerical Mathematics, volume 11, + number 2, pages 168-174, Springer, 1971. + + Implementation of the :class:`~org.hipparchus.analysis.solvers.PegasusSolver` method is based on the following article: + M. Dowell and P. Jarratt, *The "Pegasus" method for computing the root of an equation*, BIT Numerical Mathematics, + volume 12, number 4, pages 503-508, Springer, 1972. + + The :class:`~org.hipparchus.analysis.solvers.SecantSolver` method is *not* a bracketing method, so it is not implemented + here. It has a separate implementation. + """ + @typing.overload + def solve(self, int: int, f: org.hipparchus.analysis.UnivariateFunction, double: float) -> float: + """ + Solve for a zero in the given interval. A solver may require that the interval brackets a single zero root. Solvers that + do require bracketing should be able to handle the case where one of the endpoints is itself a root. + + Specified by: + :meth:`~org.hipparchus.analysis.solvers.BracketedUnivariateSolver.solve` in + interface :class:`~org.hipparchus.analysis.solvers.BracketedUnivariateSolver` + + Parameters: + maxEval (int): Maximum number of evaluations. + f (:class:`~org.hipparchus.analysis.UnivariateFunction`): Function to solve. + min (double): Lower bound for the interval. + max (double): Upper bound for the interval. + allowedSolution (:class:`~org.hipparchus.analysis.solvers.AllowedSolution`): The kind of solutions that the root-finding algorithm may accept as solutions. + + Returns: + A value where the function is zero. + + Solve for a zero in the given interval, start at :code:`startValue`. A solver may require that the interval brackets a + single zero root. Solvers that do require bracketing should be able to handle the case where one of the endpoints is + itself a root. + + Specified by: + :meth:`~org.hipparchus.analysis.solvers.BracketedUnivariateSolver.solve` in + interface :class:`~org.hipparchus.analysis.solvers.BracketedUnivariateSolver` + + Parameters: + maxEval (int): Maximum number of evaluations. + f (:class:`~org.hipparchus.analysis.UnivariateFunction`): Function to solve. + min (double): Lower bound for the interval. + max (double): Upper bound for the interval. + startValue (double): Start value to use. + allowedSolution (:class:`~org.hipparchus.analysis.solvers.AllowedSolution`): The kind of solutions that the root-finding algorithm may accept as solutions. + + Returns: + A value where the function is zero. + + Solve for a zero in the given interval, start at :code:`startValue`. A solver may require that the interval brackets a + single zero root. Solvers that do require bracketing should be able to handle the case where one of the endpoints is + itself a root. + + Specified by: + :meth:`~org.hipparchus.analysis.solvers.BaseUnivariateSolver.solve` in + interface :class:`~org.hipparchus.analysis.solvers.BaseUnivariateSolver` + + Overrides: + :meth:`~org.hipparchus.analysis.solvers.BaseAbstractUnivariateSolver.solve` in + class :class:`~org.hipparchus.analysis.solvers.BaseAbstractUnivariateSolver` + + Parameters: + maxEval (int): Maximum number of evaluations. + f (:class:`~org.hipparchus.analysis.UnivariateFunction`): Function to solve. + min (double): Lower bound for the interval. + max (double): Upper bound for the interval. + startValue (double): Start value to use. + + Returns: + a value where the function is zero. + + + """ + ... @typing.overload def solve(self, int: int, f: org.hipparchus.analysis.UnivariateFunction, double: float, double2: float) -> float: ... @typing.overload @@ -199,6 +829,14 @@ class BaseSecantSolver(AbstractUnivariateSolver, BracketedUnivariateSolver[org.h def solveInterval(self, int: int, univariateFunction: typing.Union[org.hipparchus.analysis.UnivariateFunction, typing.Callable], double: float, double2: float, double3: float) -> BracketedUnivariateSolver.Interval: ... class BisectionSolver(AbstractUnivariateSolver): + """ + public classBisectionSolver extends :class:`~org.hipparchus.analysis.solvers.AbstractUnivariateSolver` + + Implements the ` bisection algorithm <http://mathworld.wolfram.com/Bisection.html>` for finding zeros of univariate real + functions. + + The function should be continuous but not necessarily smooth. + """ @typing.overload def __init__(self): ... @typing.overload @@ -207,6 +845,21 @@ class BisectionSolver(AbstractUnivariateSolver): def __init__(self, double: float, double2: float): ... class BracketingNthOrderBrentSolver(AbstractUnivariateSolver, BracketedUnivariateSolver[org.hipparchus.analysis.UnivariateFunction]): + """ + public classBracketingNthOrderBrentSolver extends :class:`~org.hipparchus.analysis.solvers.AbstractUnivariateSolver` + implements :class:`~org.hipparchus.analysis.solvers.BracketedUnivariateSolver`<:class:`~org.hipparchus.analysis.UnivariateFunction`> + + This class implements a modification of the ` Brent algorithm <http://mathworld.wolfram.com/BrentsMethod.html>`. + + The changes with respect to the original Brent algorithm are: + + - the returned value is chosen in the current interval according to user specified + :class:`~org.hipparchus.analysis.solvers.AllowedSolution`, + - the maximal order for the invert polynomial root search is user-specified instead of being invert quadratic only + + + The given interval must bracket the root. + """ @typing.overload def __init__(self): ... @typing.overload @@ -215,7 +868,16 @@ class BracketingNthOrderBrentSolver(AbstractUnivariateSolver, BracketedUnivariat def __init__(self, double: float, double2: float, int: int): ... @typing.overload def __init__(self, double: float, int: int): ... - def getMaximalOrder(self) -> int: ... + def getMaximalOrder(self) -> int: + """ + Get the maximal order. + + Returns: + maximal order + + + """ + ... @typing.overload def solve(self, int: int, f: org.hipparchus.analysis.UnivariateFunction, double: float) -> float: ... @typing.overload @@ -232,6 +894,23 @@ class BracketingNthOrderBrentSolver(AbstractUnivariateSolver, BracketedUnivariat def solveInterval(self, int: int, univariateFunction: typing.Union[org.hipparchus.analysis.UnivariateFunction, typing.Callable], double: float, double2: float, double3: float) -> BracketedUnivariateSolver.Interval: ... class BrentSolver(AbstractUnivariateSolver): + """ + public classBrentSolver extends :class:`~org.hipparchus.analysis.solvers.AbstractUnivariateSolver` + + This class implements the ` Brent algorithm <http://mathworld.wolfram.com/BrentsMethod.html>` for finding zeros of real + univariate functions. The function should be continuous but not necessarily smooth. The :code:`solve` method returns a + zero :code:`x` of the function :code:`f` in the given interval :code:`[a, b]` to within a tolerance :code:`2 eps abs(x) + + t` where :code:`eps` is the relative accuracy and :code:`t` is the absolute accuracy. + + The given interval must bracket the root. + + The reference implementation is given in chapter 4 of + **Algorithms for Minimization Without Derivatives**, *Richard P. Brent*, Dover, 2002 + + Also see: + + - :class:`~org.hipparchus.analysis.solvers.BaseAbstractUnivariateSolver` + """ @typing.overload def __init__(self): ... @typing.overload @@ -242,6 +921,15 @@ class BrentSolver(AbstractUnivariateSolver): def __init__(self, double: float, double2: float, double3: float): ... class LaguerreSolver(AbstractPolynomialSolver): + """ + public classLaguerreSolver extends :class:`~org.hipparchus.analysis.solvers.AbstractPolynomialSolver` + + Implements the ` Laguerre's Method <http://mathworld.wolfram.com/LaguerresMethod.html>` for root finding of real + coefficient polynomials. For reference, see + **A First Course in Numerical Analysis**, ISBN 048641454X, chapter 8. + Laguerre's method is global in the sense that it can start with any initial approximation and be able to solve all roots + from that point. The algorithm requires a bracketing condition. + """ @typing.overload def __init__(self): ... @typing.overload @@ -258,6 +946,29 @@ class LaguerreSolver(AbstractPolynomialSolver): def solveComplex(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], double2: float) -> org.hipparchus.complex.Complex: ... class MullerSolver(AbstractUnivariateSolver): + """ + public classMullerSolver extends :class:`~org.hipparchus.analysis.solvers.AbstractUnivariateSolver` + + This class implements the ` Muller's Method <http://mathworld.wolfram.com/MullersMethod.html>` for root finding of real + univariate functions. For reference, see **Elementary Numerical Analysis**, ISBN 0070124477, chapter 3. + + Muller's method applies to both real and complex functions, but here we restrict ourselves to real functions. This class + differs from :class:`~org.hipparchus.analysis.solvers.MullerSolver` in the way it avoids complex operations. + + Muller's original method would have function evaluation at complex point. Since our f(x) is real, we have to find ways + to avoid that. Bracketing condition is one way to go: by requiring bracketing in every iteration, the newly computed + approximation is guaranteed to be real. + + Normally Muller's method converges quadratically in the vicinity of a zero, however it may be very slow in regions far + away from zeros. For example, f(x) = exp(x) - 1, min = -50, max = 100. In such case we use bisection as a safety backup + if it performs very poorly. + + The formulas here use divided differences directly. + + Also see: + + - :class:`~org.hipparchus.analysis.solvers.MullerSolver2` + """ @typing.overload def __init__(self): ... @typing.overload @@ -266,6 +977,28 @@ class MullerSolver(AbstractUnivariateSolver): def __init__(self, double: float, double2: float): ... class MullerSolver2(AbstractUnivariateSolver): + """ + public classMullerSolver2 extends :class:`~org.hipparchus.analysis.solvers.AbstractUnivariateSolver` + + This class implements the ` Muller's Method <http://mathworld.wolfram.com/MullersMethod.html>` for root finding of real + univariate functions. For reference, see **Elementary Numerical Analysis**, ISBN 0070124477, chapter 3. + + Muller's method applies to both real and complex functions, but here we restrict ourselves to real functions. This class + differs from :class:`~org.hipparchus.analysis.solvers.MullerSolver` in the way it avoids complex operations. + + Except for the initial [min, max], it does not require bracketing condition, e.g. f(x0), f(x1), f(x2) can have the same + sign. If a complex number arises in the computation, we simply use its modulus as a real approximation. + + Because the interval may not be bracketing, the bisection alternative is not applicable here. However in practice our + treatment usually works well, especially near real zeroes where the imaginary part of the complex approximation is often + negligible. + + The formulas here do not use divided differences directly. + + Also see: + + - :class:`~org.hipparchus.analysis.solvers.MullerSolver` + """ @typing.overload def __init__(self): ... @typing.overload @@ -274,6 +1007,12 @@ class MullerSolver2(AbstractUnivariateSolver): def __init__(self, double: float, double2: float): ... class NewtonRaphsonSolver(AbstractUnivariateDifferentiableSolver): + """ + public classNewtonRaphsonSolver extends :class:`~org.hipparchus.analysis.solvers.AbstractUnivariateDifferentiableSolver` + + Implements ` Newton's Method <http://mathworld.wolfram.com/NewtonsMethod.html>` for finding zeros of real univariate + differentiable functions. + """ @typing.overload def __init__(self): ... @typing.overload @@ -286,6 +1025,15 @@ class NewtonRaphsonSolver(AbstractUnivariateDifferentiableSolver): def solve(self, int: int, univariateDifferentiableFunction: org.hipparchus.analysis.differentiation.UnivariateDifferentiableFunction, double: float, double2: float) -> float: ... class RiddersSolver(AbstractUnivariateSolver): + """ + public classRiddersSolver extends :class:`~org.hipparchus.analysis.solvers.AbstractUnivariateSolver` + + Implements the ` Ridders' Method <http://mathworld.wolfram.com/RiddersMethod.html>` for root finding of real univariate + functions. For reference, see C. Ridders, *A new algorithm for computing a single root of a real continuous function*, + IEEE Transactions on Circuits and Systems, 26 (1979), 979 - 980. + + The function should be continuous but not necessarily smooth. + """ @typing.overload def __init__(self): ... @typing.overload @@ -294,6 +1042,20 @@ class RiddersSolver(AbstractUnivariateSolver): def __init__(self, double: float, double2: float): ... class SecantSolver(AbstractUnivariateSolver): + """ + public classSecantSolver extends :class:`~org.hipparchus.analysis.solvers.AbstractUnivariateSolver` + + Implements the *Secant* method for root-finding (approximating a zero of a univariate real function). The solution that + is maintained is not bracketed, and as such convergence is not guaranteed. + + Implementation based on the following article: M. Dowell and P. Jarratt, *A modified regula falsi method for computing + the root of an equation*, BIT Numerical Mathematics, volume 11, number 2, pages 168-174, Springer, 1971. + + Note that since release 3.0 this class implements the actual *Secant* algorithm, and not a modified one. As such, the + 3.0 version is not backwards compatible with previous versions. To use an algorithm similar to the pre-3.0 releases, use + the :class:`~org.hipparchus.analysis.solvers.IllinoisSolver` algorithm or the + :class:`~org.hipparchus.analysis.solvers.PegasusSolver` algorithm. + """ @typing.overload def __init__(self): ... @typing.overload @@ -302,6 +1064,22 @@ class SecantSolver(AbstractUnivariateSolver): def __init__(self, double: float, double2: float): ... class IllinoisSolver(BaseSecantSolver): + """ + public classIllinoisSolver extends :class:`~org.hipparchus.analysis.solvers.BaseSecantSolver` + + Implements the *Illinois* method for root-finding (approximating a zero of a univariate real function). It is a modified + :class:`~org.hipparchus.analysis.solvers.RegulaFalsiSolver` method. + + Like the *Regula Falsi* method, convergence is guaranteed by maintaining a bracketed solution. The *Illinois* method + however, should converge much faster than the original *Regula Falsi* method. Furthermore, this implementation of the + *Illinois* method should not suffer from the same implementation issues as the *Regula Falsi* method, which may fail to + convergence in certain cases. + + The *Illinois* method assumes that the function is continuous, but not necessarily smooth. + + Implementation based on the following article: M. Dowell and P. Jarratt, *A modified regula falsi method for computing + the root of an equation*, BIT Numerical Mathematics, volume 11, number 2, pages 168-174, Springer, 1971. + """ @typing.overload def __init__(self): ... @typing.overload @@ -312,6 +1090,23 @@ class IllinoisSolver(BaseSecantSolver): def __init__(self, double: float, double2: float, double3: float): ... class PegasusSolver(BaseSecantSolver): + """ + public classPegasusSolver extends :class:`~org.hipparchus.analysis.solvers.BaseSecantSolver` + + Implements the *Pegasus* method for root-finding (approximating a zero of a univariate real function). It is a modified + :class:`~org.hipparchus.analysis.solvers.RegulaFalsiSolver` method. + + Like the *Regula Falsi* method, convergence is guaranteed by maintaining a bracketed solution. The *Pegasus* method + however, should converge much faster than the original *Regula Falsi* method. Furthermore, this implementation of the + *Pegasus* method should not suffer from the same implementation issues as the *Regula Falsi* method, which may fail to + convergence in certain cases. Also, the *Pegasus* method should converge faster than the + :class:`~org.hipparchus.analysis.solvers.IllinoisSolver` method, another *Regula Falsi*-based method. + + The *Pegasus* method assumes that the function is continuous, but not necessarily smooth. + + Implementation based on the following article: M. Dowell and P. Jarratt, *The "Pegasus" method for computing the root of + an equation*, BIT Numerical Mathematics, volume 12, number 4, pages 503-508, Springer, 1972. + """ @typing.overload def __init__(self): ... @typing.overload @@ -322,6 +1117,31 @@ class PegasusSolver(BaseSecantSolver): def __init__(self, double: float, double2: float, double3: float): ... class RegulaFalsiSolver(BaseSecantSolver): + """ + public classRegulaFalsiSolver extends :class:`~org.hipparchus.analysis.solvers.BaseSecantSolver` + + Implements the *Regula Falsi* or *False position* method for root-finding (approximating a zero of a univariate real + function). It is a modified :class:`~org.hipparchus.analysis.solvers.SecantSolver` method. + + The *Regula Falsi* method is included for completeness, for testing purposes, for educational purposes, for comparison + to other algorithms, etc. It is however **not** intended to be used for actual problems, as one of the bounds often + remains fixed, resulting in very slow convergence. Instead, one of the well-known modified *Regula Falsi* algorithms can + be used (:class:`~org.hipparchus.analysis.solvers.IllinoisSolver` or + :class:`~org.hipparchus.analysis.solvers.PegasusSolver`). These two algorithms solve the fundamental issues of the + original *Regula Falsi* algorithm, and greatly out-performs it for most, if not all, (practical) functions. + + Unlike the *Secant* method, the *Regula Falsi* guarantees convergence, by maintaining a bracketed solution. Note + however, that due to the finite/limited precision of Java's + :class:`~org.hipparchus.analysis.solvers.https:.docs.oracle.com.javase.8.docs.api.java.lang.Double` type, which is used + in this implementation, the algorithm may get stuck in a situation where it no longer makes any progress. Such cases are + detected and result in a :code:`MathIllegalStateException` exception being thrown. In other words, the algorithm + theoretically guarantees convergence, but the implementation does not. + + The *Regula Falsi* method assumes that the function is continuous, but not necessarily smooth. + + Implementation based on the following article: M. Dowell and P. Jarratt, *A modified regula falsi method for computing + the root of an equation*, BIT Numerical Mathematics, volume 11, number 2, pages 168-174, Springer, 1971. + """ @typing.overload def __init__(self): ... @typing.overload diff --git a/org-stubs/hipparchus/complex/__init__.pyi b/org-stubs/hipparchus/complex/__init__.pyi index 259cfb1..77fc9c5 100644 --- a/org-stubs/hipparchus/complex/__init__.pyi +++ b/org-stubs/hipparchus/complex/__init__.pyi @@ -19,46 +19,546 @@ import typing class Complex(org.hipparchus.CalculusFieldElement['Complex'], java.lang.Comparable['Complex'], java.io.Serializable): + """ + public classComplex extends :class:`~org.hipparchus.complex.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.CalculusFieldElement`<:class:`~org.hipparchus.complex.Complex`>, :class:`~org.hipparchus.complex.https:.docs.oracle.com.javase.8.docs.api.java.lang.Comparable`<:class:`~org.hipparchus.complex.Complex`>, :class:`~org.hipparchus.complex.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + Representation of a Complex number, i.e. a number which has both a real and imaginary part. + + Implementations of arithmetic operations handle :code:`NaN` and infinite values according to the rules for + :class:`~org.hipparchus.complex.https:.docs.oracle.com.javase.8.docs.api.java.lang.Double`, i.e. + :meth:`~org.hipparchus.complex.Complex.equals` is an equivalence relation for all instances that have a :code:`NaN` in + either real or imaginary part, e.g. the following are considered equal: + + - :code:`1 + NaNi` + - :code:`NaN + i` + - :code:`NaN + NaNi` + + + Note that this contradicts the IEEE-754 standard for floating point numbers (according to which the test :code:`x == x` + must fail if :code:`x` is :code:`NaN`). The method :meth:`~org.hipparchus.util.Precision.equals` in + :class:`~org.hipparchus.util.Precision` conforms with IEEE-754 while this class conforms with the standard behavior for + Java object types. + + Also see: + + - :meth:`~serialized` + """ I: typing.ClassVar['Complex'] = ... + """ + public static final :class:`~org.hipparchus.complex.Complex` I + + The square root of -1. A number representing "0.0 + 1.0i". + + """ MINUS_I: typing.ClassVar['Complex'] = ... + """ + public static final :class:`~org.hipparchus.complex.Complex` MINUS_I + + The square root of -1. A number representing "0.0 - 1.0i". + + Since: + 1.7 + + + """ NaN: typing.ClassVar['Complex'] = ... + """ + public static final :class:`~org.hipparchus.complex.Complex` NaN + + A complex number representing "NaN + NaNi". + + """ INF: typing.ClassVar['Complex'] = ... + """ + public static final :class:`~org.hipparchus.complex.Complex` INF + + A complex number representing "+INF + INFi" + + """ ONE: typing.ClassVar['Complex'] = ... + """ + public static final :class:`~org.hipparchus.complex.Complex` ONE + + A complex number representing "1.0 + 0.0i". + + """ MINUS_ONE: typing.ClassVar['Complex'] = ... + """ + public static final :class:`~org.hipparchus.complex.Complex` MINUS_ONE + + A complex number representing "-1.0 + 0.0i". + + Since: + 1.7 + + + """ ZERO: typing.ClassVar['Complex'] = ... + """ + public static final :class:`~org.hipparchus.complex.Complex` ZERO + + A complex number representing "0.0 + 0.0i". + + """ PI: typing.ClassVar['Complex'] = ... + """ + public static final :class:`~org.hipparchus.complex.Complex` PI + + A complex number representing "Ï€ + 0.0i". + + """ @typing.overload def __init__(self, double: float): ... @typing.overload def __init__(self, double: float, double2: float): ... - def abs(self) -> 'Complex': ... - def acos(self) -> 'Complex': ... - def acosh(self) -> 'Complex': ... - @typing.overload - def add(self, double: float) -> 'Complex': ... + def abs(self) -> 'Complex': + """ + Return the absolute value of this complex number. Returns :code:`NaN` if either real or imaginary part is :code:`NaN` + and :code:`Double.POSITIVE_INFINITY` if neither part is :code:`NaN`, but at least one part is infinite. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.abs` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + the norm. + + Since: + 2.0 + + + """ + ... + def acos(self) -> 'Complex': + """ + Compute the ` inverse cosine <http://mathworld.wolfram.com/InverseCosine.html>` of this complex number. Implements the + formula: + + :code:`acos(z) = -i (log(z + i (sqrt(1 - z<sup>2</sup>))))` + Returns :meth:`~org.hipparchus.complex.Complex.NaN` if either real or imaginary part of the input argument is + :code:`NaN` or infinite. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.acos` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + the inverse cosine of this complex number. + + + """ + ... + def acosh(self) -> 'Complex': + """ + Inverse hyperbolic cosine operation. + + Branch cuts are on the real axis, below +1. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.acosh` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + acosh(this) + + Since: + 1.7 + + + """ + ... + @typing.overload + def add(self, double: float) -> 'Complex': + """ + Returns a :code:`Complex` whose value is :code:`(this + addend)`, with :code:`addend` interpreted as a real number. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.add` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + addend (double): Value to be added to this :code:`Complex`. + + Returns: + :code:`this + addend`. + + Also see: + + - :meth:`~org.hipparchus.complex.Complex.add` + + + + """ + ... @typing.overload def add(self, complex: 'Complex') -> 'Complex': ... - def asin(self) -> 'Complex': ... - def asinh(self) -> 'Complex': ... - def atan(self) -> 'Complex': ... - def atan2(self, complex: 'Complex') -> 'Complex': ... - def atanh(self) -> 'Complex': ... - def cbrt(self) -> 'Complex': ... - def ceil(self) -> 'Complex': ... - def compareTo(self, complex: 'Complex') -> int: ... - def conjugate(self) -> 'Complex': ... - @typing.overload - def copySign(self, double: float) -> 'Complex': ... + def asin(self) -> 'Complex': + """ + Compute the ` inverse sine <http://mathworld.wolfram.com/InverseSine.html>` of this complex number. Implements the + formula: + + :code:`asin(z) = -i (log(sqrt(1 - z<sup>2</sup>) + iz))` + + Returns :meth:`~org.hipparchus.complex.Complex.NaN` if either real or imaginary part of the input argument is + :code:`NaN` or infinite. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.asin` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + the inverse sine of this complex number. + + + """ + ... + def asinh(self) -> 'Complex': + """ + Inverse hyperbolic sine operation. + + Branch cuts are on the imaginary axis, above +i and below -i. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.asinh` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + asin(this) + + Since: + 1.7 + + + """ + ... + def atan(self) -> 'Complex': + """ + Compute the ` inverse tangent <http://mathworld.wolfram.com/InverseTangent.html>` of this complex number. Implements the + formula: + + :code:`atan(z) = (i/2) log((1 - iz)/(1 + iz))` + + Returns :meth:`~org.hipparchus.complex.Complex.NaN` if either real or imaginary part of the input argument is + :code:`NaN` or infinite. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.atan` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + the inverse tangent of this complex number + + + """ + ... + def atan2(self, complex: 'Complex') -> 'Complex': + """ + Two arguments arc tangent operation. + + Beware of the order or arguments! As this is based on a two-arguments functions, in order to be consistent with + arguments order, the instance is the *first* argument and the single provided argument is the *second* argument. In + order to be consistent with programming languages :code:`atan2`, this method computes :code:`atan2(this, x)`, i.e. the + instance represents the :code:`y` argument and the :code:`x` argument is the one passed as a single argument. This may + seem confusing especially for users of Wolfram alpha, as this site is *not* consistent with programming languages + :code:`atan2` two-arguments arc tangent and puts :code:`x` as its first argument. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.atan2` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + x (:class:`~org.hipparchus.complex.Complex`): second argument of the arc tangent + + Returns: + Since: + 1.7 + + + """ + ... + def atanh(self) -> 'Complex': + """ + Inverse hyperbolic tangent operation. + + Branch cuts are on the real axis, above +1 and below -1. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.atanh` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + atanh(this) + + Since: + 1.7 + + + """ + ... + def cbrt(self) -> 'Complex': + """ + Cubic root. + + This implementation compute the principal cube root by using a branch cut along real negative axis. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.cbrt` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + cubic root of the instance + + Since: + 1.7 + + + """ + ... + def ceil(self) -> 'Complex': + """ + Get the smallest whole number larger than instance. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.ceil` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + ceil(this) + + Since: + 1.7 + + + """ + ... + def compareTo(self, complex: 'Complex') -> int: + """ + + Comparison us performed using real ordering as the primary sort order and imaginary ordering as the secondary sort + order. + + Specified by: + :meth:`~org.hipparchus.complex.https:.docs.oracle.com.javase.8.docs.api.java.lang.Comparable.compareTo` in + interface :class:`~org.hipparchus.complex.https:.docs.oracle.com.javase.8.docs.api.java.lang.Comparable` + + Since: + 3.0 + + + """ + ... + def conjugate(self) -> 'Complex': + """ + Returns the conjugate of this complex number. The conjugate of :code:`a + bi` is :code:`a - bi`. + + :meth:`~org.hipparchus.complex.Complex.NaN` is returned if either the real or imaginary part of this Complex number + equals :code:`Double.NaN`. + + If the imaginary part is infinite, and the real part is not :code:`NaN`, the returned value has infinite imaginary part + of the opposite sign, e.g. the conjugate of :code:`1 + POSITIVE_INFINITY i` is :code:`1 - NEGATIVE_INFINITY i`. + + Returns: + the conjugate of this Complex object. + + + """ + ... + @typing.overload + def copySign(self, double: float) -> 'Complex': + """ + Returns the instance with the sign of the argument. A NaN :code:`sign` argument is treated as positive. + + The signs of real and imaginary parts are copied independently. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.copySign` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + z (:class:`~org.hipparchus.complex.Complex`): the sign for the returned value + + Returns: + the instance with the same sign as the :code:`sign` argument + + Since: + 1.7 + + Returns the instance with the sign of the argument. A NaN :code:`sign` argument is treated as positive. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.copySign` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + r (double): the sign for the returned value + + Returns: + the instance with the same sign as the :code:`sign` argument + + Since: + 1.7 + + + """ + ... @typing.overload def copySign(self, complex: 'Complex') -> 'Complex': ... - def cos(self) -> 'Complex': ... - def cosh(self) -> 'Complex': ... - @typing.overload - def divide(self, double: float) -> 'Complex': ... + def cos(self) -> 'Complex': + """ + Compute the ` cosine <http://mathworld.wolfram.com/Cosine.html>` of this complex number. Implements the formula: + + :code:`cos(a + bi) = cos(a)cosh(b) - sin(a)sinh(b)i` + + where the (real) functions on the right-hand side are :meth:`~org.hipparchus.util.FastMath.sin`, + :meth:`~org.hipparchus.util.FastMath.cos`, :meth:`~org.hipparchus.util.FastMath.cosh` and + :meth:`~org.hipparchus.util.FastMath.sinh`. + + Returns :meth:`~org.hipparchus.complex.Complex.NaN` if either real or imaginary part of the input argument is + :code:`NaN`. + + Infinite values in real or imaginary parts of the input may result in infinite or NaN values returned in parts of the + result. + + .. code-block: java + + Examples: + + cos(1 ± INFINITY i) = 1 ∓ INFINITY i + cos(±INFINITY + i) = NaN + NaN i + cos(±INFINITY ± INFINITY i) = NaN + NaN i + + + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.cos` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + the cosine of this complex number. + + + """ + ... + def cosh(self) -> 'Complex': + """ + Compute the ` hyperbolic cosine <http://mathworld.wolfram.com/HyperbolicCosine.html>` of this complex number. Implements + the formula: + + .. code-block: java + + + cosh(a + bi) = cosh(a)cos(b) + sinh(a)sin(b)i + + + where the (real) functions on the right-hand side are :meth:`~org.hipparchus.util.FastMath.sin`, + :meth:`~org.hipparchus.util.FastMath.cos`, :meth:`~org.hipparchus.util.FastMath.cosh` and + :meth:`~org.hipparchus.util.FastMath.sinh`. + + Returns :meth:`~org.hipparchus.complex.Complex.NaN` if either real or imaginary part of the input argument is + :code:`NaN`. + Infinite values in real or imaginary parts of the input may result in infinite or NaN values returned in parts of the + result. + + .. code-block: java + + Examples: + + cosh(1 ± INFINITY i) = NaN + NaN i + cosh(±INFINITY + i) = INFINITY ± INFINITY i + cosh(±INFINITY ± INFINITY i) = NaN + NaN i + + + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.cosh` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + the hyperbolic cosine of this complex number. + + + """ + ... + @typing.overload + def divide(self, double: float) -> 'Complex': + """ + Returns a :code:`Complex` whose value is :code:`(this / divisor)`, with :code:`divisor` interpreted as a real number. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.divide` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + divisor (double): Value by which this :code:`Complex` is to be divided. + + Returns: + :code:`this / divisor`. + + Also see: + + - :meth:`~org.hipparchus.complex.Complex.divide` + + + + """ + ... @typing.overload def divide(self, complex: 'Complex') -> 'Complex': ... @typing.overload - def equals(self, object: typing.Any) -> bool: ... + def equals(self, object: typing.Any) -> bool: + """ + Test for equality with another object. If both the real and imaginary parts of two complex numbers are exactly the same, + and neither is :code:`Double.NaN`, the two Complex objects are considered to be equal. The behavior is the same as for + JDK's :meth:`~org.hipparchus.complex.https:.docs.oracle.com.javase.8.docs.api.java.lang.Double.equals`: + + - All :code:`NaN` values are considered to be equal, i.e, if either (or both) real and imaginary parts of the complex + number are equal to :code:`Double.NaN`, the complex number is equal to :code:`NaN`. + - Instances constructed with different representations of zero (i.e. either "0" or "-0") are *not* considered to be equal. + + + Overrides: + :meth:`~org.hipparchus.complex.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.equals` in + class :class:`~org.hipparchus.complex.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Parameters: + other (:class:`~org.hipparchus.complex.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object`): Object to test for equality with this instance. + + Returns: + :code:`true` if the objects are equal, :code:`false` if object is :code:`null`, not an instance of :code:`Complex`, or + not equal to this instance. + + Test for the floating-point equality between Complex objects. It returns :code:`true` if both arguments are equal or + within the range of allowed error (inclusive). + + Parameters: + x (:class:`~org.hipparchus.complex.Complex`): First value (cannot be :code:`null`). + y (:class:`~org.hipparchus.complex.Complex`): Second value (cannot be :code:`null`). + maxUlps (int): :code:`(maxUlps - 1)` is the number of floating point values between the real (resp. imaginary) parts of :code:`x` and + :code:`y`. + + Returns: + :code:`true` if there are fewer than :code:`maxUlps` floating point values between the real (resp. imaginary) parts of + :code:`x` and :code:`y`. + + Also see: + + - :meth:`~org.hipparchus.util.Precision.equals` + + + Returns :code:`true` iff the values are equal as defined by :meth:`~org.hipparchus.complex.Complex.equals`. + + Parameters: + x (:class:`~org.hipparchus.complex.Complex`): First value (cannot be :code:`null`). + y (:class:`~org.hipparchus.complex.Complex`): Second value (cannot be :code:`null`). + + Returns: + :code:`true` if the values are equal. + + Returns :code:`true` if, both for the real part and for the imaginary part, there is no double value strictly between + the arguments or the difference between them is within the range of allowed error (inclusive). Returns :code:`false` if + either of the arguments is NaN. + + Parameters: + x (:class:`~org.hipparchus.complex.Complex`): First value (cannot be :code:`null`). + y (:class:`~org.hipparchus.complex.Complex`): Second value (cannot be :code:`null`). + eps (double): Amount of allowed absolute error. + + Returns: + :code:`true` if the values are two adjacent floating point numbers or they are within range of each other. + + Also see: + + - :meth:`~org.hipparchus.util.Precision.equals` + + + + """ + ... @typing.overload @staticmethod def equals(complex: 'Complex', complex2: 'Complex') -> bool: ... @@ -69,26 +569,469 @@ class Complex(org.hipparchus.CalculusFieldElement['Complex'], java.lang.Comparab @staticmethod def equals(complex: 'Complex', complex2: 'Complex', int: int) -> bool: ... @staticmethod - def equalsWithRelativeTolerance(complex: 'Complex', complex2: 'Complex', double: float) -> bool: ... - def exp(self) -> 'Complex': ... - def expm1(self) -> 'Complex': ... - def floor(self) -> 'Complex': ... - def getArgument(self) -> float: ... - def getField(self) -> 'ComplexField': ... - def getImaginary(self) -> float: ... - def getImaginaryPart(self) -> float: ... - def getPi(self) -> 'Complex': ... - def getReal(self) -> float: ... - def getRealPart(self) -> float: ... - def hashCode(self) -> int: ... - def hypot(self, complex: 'Complex') -> 'Complex': ... - def isInfinite(self) -> bool: ... - def isMathematicalInteger(self) -> bool: ... - def isNaN(self) -> bool: ... - def isReal(self) -> bool: ... - def isZero(self) -> bool: ... - @typing.overload - def linearCombination(self, double: float, complex: 'Complex', double2: float, complex2: 'Complex') -> 'Complex': ... + def equalsWithRelativeTolerance(complex: 'Complex', complex2: 'Complex', double: float) -> bool: + """ + Returns :code:`true` if, both for the real part and for the imaginary part, there is no double value strictly between + the arguments or the relative difference between them is smaller or equal to the given tolerance. Returns :code:`false` + if either of the arguments is NaN. + + Parameters: + x (:class:`~org.hipparchus.complex.Complex`): First value (cannot be :code:`null`). + y (:class:`~org.hipparchus.complex.Complex`): Second value (cannot be :code:`null`). + eps (double): Amount of allowed relative error. + + Returns: + :code:`true` if the values are two adjacent floating point numbers or they are within range of each other. + + Also see: + + - :meth:`~org.hipparchus.util.Precision.equalsWithRelativeTolerance` + + + + """ + ... + def exp(self) -> 'Complex': + """ + Compute the ` exponential function <http://mathworld.wolfram.com/ExponentialFunction.html>` of this complex number. + Implements the formula: + + .. code-block: java + + + exp(a + bi) = exp(a)cos(b) + exp(a)sin(b)i + + + where the (real) functions on the right-hand side are :meth:`~org.hipparchus.util.FastMath.exp` p}, + :meth:`~org.hipparchus.util.FastMath.cos`, and :meth:`~org.hipparchus.util.FastMath.sin`. + + Returns :meth:`~org.hipparchus.complex.Complex.NaN` if either real or imaginary part of the input argument is + :code:`NaN`. + Infinite values in real or imaginary parts of the input may result in infinite or NaN values returned in parts of the + result. + + .. code-block: java + + Examples: + + exp(1 ± INFINITY i) = NaN + NaN i + exp(INFINITY + i) = INFINITY + INFINITY i + exp(-INFINITY + i) = 0 + 0i + exp(±INFINITY ± INFINITY i) = NaN + NaN i + + + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.exp` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + :code:`*e* :sup:`this``. + + + """ + ... + def expm1(self) -> 'Complex': + """ + Exponential minus 1. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.expm1` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + exponential minus one of the instance + + Since: + 1.7 + + + """ + ... + def floor(self) -> 'Complex': + """ + Get the largest whole number smaller than instance. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.floor` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + floor(this) + + Since: + 1.7 + + + """ + ... + def getArgument(self) -> float: + """ + Compute the argument of this complex number. The argument is the angle phi between the positive real axis and the point + representing this number in the complex plane. The value returned is between -PI (not inclusive) and PI (inclusive), + with negative values returned for numbers with negative imaginary parts. + + If either real or imaginary part (or both) is NaN, NaN is returned. Infinite parts are handled as :code:`Math.atan2` + handles them, essentially treating finite parts as zero in the presence of an infinite coordinate and returning a + multiple of pi/4 depending on the signs of the infinite parts. See the javadoc for :code:`Math.atan2` for full details. + + Returns: + the argument of :code:`this`. + + + """ + ... + def getField(self) -> 'ComplexField': + """ + Get the :class:`~org.hipparchus.Field` to which the instance belongs. + + Specified by: + :meth:`~org.hipparchus.FieldElement.getField` in interface :class:`~org.hipparchus.FieldElement` + + Returns: + :class:`~org.hipparchus.Field` to which the instance belongs + + + """ + ... + def getImaginary(self) -> float: + """ + Access the imaginary part. + + Returns: + the imaginary part. + + + """ + ... + def getImaginaryPart(self) -> float: + """ + Access the imaginary part. + + Returns: + the imaginary part. + + Since: + 2.0 + + + """ + ... + def getPi(self) -> 'Complex': + """ + Get the Archimedes constant Ï€. + + Archimedes constant is the ratio of a circle's circumference to its diameter. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.getPi` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + Archimedes constant Ï€ + + + """ + ... + def getReal(self) -> float: + """ + Access the real part. + + Specified by: + :meth:`~org.hipparchus.FieldElement.getReal` in interface :class:`~org.hipparchus.FieldElement` + + Returns: + the real part. + + + """ + ... + def getRealPart(self) -> float: + """ + Access the real part. + + Returns: + the real part. + + Since: + 2.0 + + + """ + ... + def hashCode(self) -> int: + """ + Get a hashCode for the complex number. Any :code:`Double.NaN` value in real or imaginary part produces the same hash + code :code:`7`. + + Overrides: + :meth:`~org.hipparchus.complex.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.hashCode` in + class :class:`~org.hipparchus.complex.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Returns: + a hash code value for this object. + + + """ + ... + def hypot(self, complex: 'Complex') -> 'Complex': + """ + Returns the hypotenuse of a triangle with sides :code:`this` and :code:`y` - sqrt(*this* :sup:`2` +*y* :sup:`2` ) + avoiding intermediate overflow or underflow. + + - If either argument is infinite, then the result is positive infinity. + - else, if either argument is NaN then the result is NaN. + + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.hypot` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + y (:class:`~org.hipparchus.complex.Complex`): a value + + Returns: + sqrt(*this* :sup:`2` +*y* :sup:`2` ) + + Since: + 1.7 + + + """ + ... + def isInfinite(self) -> bool: + """ + Checks whether either the real or imaginary part of this complex number takes an infinite value (either + :code:`Double.POSITIVE_INFINITY` or :code:`Double.NEGATIVE_INFINITY`) and neither part is :code:`NaN`. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.isInfinite` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + true if one or both parts of this complex number are infinite and neither part is :code:`NaN`. + + + """ + ... + def isMathematicalInteger(self) -> bool: + """ + Check whether the instance is an integer (i.e. imaginary part is zero and real part has no fractional part). + + Returns: + true if imaginary part is zero and real part has no fractional part + + Since: + 1.7 + + + """ + ... + def isNaN(self) -> bool: + """ + Checks whether either or both parts of this complex number is :code:`NaN`. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.isNaN` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + true if either or both parts of this complex number is :code:`NaN`; false otherwise. + + + """ + ... + def isReal(self) -> bool: + """ + Check whether the instance is real (i.e. imaginary part is zero). + + Returns: + true if imaginary part is zero + + Since: + 1.7 + + + """ + ... + def isZero(self) -> bool: + """ + Check if an element is semantically equal to zero. + + The default implementation simply calls :code:`equals(getField().getZero())`. However, this may need to be overridden in + some cases as due to compatibility with :code:`hashCode()` some classes implements :code:`equals(Object)` in such a way + that -0.0 and +0.0 are different, which may be a problem. It prevents for example identifying a diagonal element is zero + and should be avoided when doing partial pivoting in LU decomposition. + + This implementation considers +0.0 and -0.0 to be equal for both real and imaginary components. + + Specified by: + :meth:`~org.hipparchus.FieldElement.isZero` in interface :class:`~org.hipparchus.FieldElement` + + Returns: + true if the element is semantically equal to zero + + Since: + 1.8 + + + """ + ... + @typing.overload + def linearCombination(self, double: float, complex: 'Complex', double2: float, complex2: 'Complex') -> 'Complex': + """ + Compute a linear combination. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` in + interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + a1 (:class:`~org.hipparchus.complex.Complex`): first factor of the first term + b1 (:class:`~org.hipparchus.complex.Complex`): second factor of the first term + a2 (:class:`~org.hipparchus.complex.Complex`): first factor of the second term + b2 (:class:`~org.hipparchus.complex.Complex`): second factor of the second term + + Returns: + a :sub:`1` ×b :sub:`1` + a :sub:`2` ×b :sub:`2` + + Since: + 1.7 + + Also see: + + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + + + Compute a linear combination. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` in + interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + a1 (double): first factor of the first term + b1 (:class:`~org.hipparchus.complex.Complex`): second factor of the first term + a2 (double): first factor of the second term + b2 (:class:`~org.hipparchus.complex.Complex`): second factor of the second term + + Returns: + a :sub:`1` ×b :sub:`1` + a :sub:`2` ×b :sub:`2` + + Since: + 1.7 + + Also see: + + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + + + Compute a linear combination. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` in + interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + a1 (:class:`~org.hipparchus.complex.Complex`): first factor of the first term + b1 (:class:`~org.hipparchus.complex.Complex`): second factor of the first term + a2 (:class:`~org.hipparchus.complex.Complex`): first factor of the second term + b2 (:class:`~org.hipparchus.complex.Complex`): second factor of the second term + a3 (:class:`~org.hipparchus.complex.Complex`): first factor of the third term + b3 (:class:`~org.hipparchus.complex.Complex`): second factor of the third term + + Returns: + a :sub:`1` ×b :sub:`1` + a :sub:`2` ×b :sub:`2` + a :sub:`3` ×b :sub:`3` + + Since: + 1.7 + + Also see: + + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + + + Compute a linear combination. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` in + interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + a1 (double): first factor of the first term + b1 (:class:`~org.hipparchus.complex.Complex`): second factor of the first term + a2 (double): first factor of the second term + b2 (:class:`~org.hipparchus.complex.Complex`): second factor of the second term + a3 (double): first factor of the third term + b3 (:class:`~org.hipparchus.complex.Complex`): second factor of the third term + + Returns: + a :sub:`1` ×b :sub:`1` + a :sub:`2` ×b :sub:`2` + a :sub:`3` ×b :sub:`3` + + Since: + 1.7 + + Also see: + + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + + + Compute a linear combination. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` in + interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + a1 (:class:`~org.hipparchus.complex.Complex`): first factor of the first term + b1 (:class:`~org.hipparchus.complex.Complex`): second factor of the first term + a2 (:class:`~org.hipparchus.complex.Complex`): first factor of the second term + b2 (:class:`~org.hipparchus.complex.Complex`): second factor of the second term + a3 (:class:`~org.hipparchus.complex.Complex`): first factor of the third term + b3 (:class:`~org.hipparchus.complex.Complex`): second factor of the third term + a4 (:class:`~org.hipparchus.complex.Complex`): first factor of the fourth term + b4 (:class:`~org.hipparchus.complex.Complex`): second factor of the fourth term + + Returns: + a :sub:`1` ×b :sub:`1` + a :sub:`2` ×b :sub:`2` + a :sub:`3` ×b :sub:`3` + a :sub:`4` ×b :sub:`4` + + Since: + 1.7 + + Also see: + + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + + + Compute a linear combination. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` in + interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + a1 (double): first factor of the first term + b1 (:class:`~org.hipparchus.complex.Complex`): second factor of the first term + a2 (double): first factor of the second term + b2 (:class:`~org.hipparchus.complex.Complex`): second factor of the second term + a3 (double): first factor of the third term + b3 (:class:`~org.hipparchus.complex.Complex`): second factor of the third term + a4 (double): first factor of the fourth term + b4 (:class:`~org.hipparchus.complex.Complex`): second factor of the fourth term + + Returns: + a :sub:`1` ×b :sub:`1` + a :sub:`2` ×b :sub:`2` + a :sub:`3` ×b :sub:`3` + a :sub:`4` ×b :sub:`4` + + Since: + 1.7 + + Also see: + + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + + + + """ + ... @typing.overload def linearCombination(self, double: float, complex: 'Complex', double2: float, complex2: 'Complex', double3: float, complex3: 'Complex') -> 'Complex': ... @typing.overload @@ -103,74 +1046,818 @@ class Complex(org.hipparchus.CalculusFieldElement['Complex'], java.lang.Comparab def linearCombination(self, complex: 'Complex', complex2: 'Complex', complex3: 'Complex', complex4: 'Complex', complex5: 'Complex', complex6: 'Complex', complex7: 'Complex', complex8: 'Complex') -> 'Complex': ... @typing.overload def linearCombination(self, complexArray: typing.Union[typing.List['Complex'], jpype.JArray], complexArray2: typing.Union[typing.List['Complex'], jpype.JArray]) -> 'Complex': ... - def log(self) -> 'Complex': ... - def log10(self) -> 'Complex': ... - def log1p(self) -> 'Complex': ... - @typing.overload - def multiply(self, double: float) -> 'Complex': ... + def log(self) -> 'Complex': + """ + Compute the ` natural logarithm <http://mathworld.wolfram.com/NaturalLogarithm.html>` of this complex number. Implements + the formula: + + .. code-block: java + + + log(a + bi) = ln(|a + bi|) + arg(a + bi)i + + + where ln on the right hand side is :meth:`~org.hipparchus.util.FastMath.log`, :code:`|a + bi|` is the modulus, + :meth:`~org.hipparchus.complex.Complex.abs`, and :code:`arg(a + bi) =`:meth:`~org.hipparchus.util.FastMath.atan2`(b, a). + + Returns :meth:`~org.hipparchus.complex.Complex.NaN` if either real or imaginary part of the input argument is + :code:`NaN`. + Infinite (or critical) values in real or imaginary parts of the input may result in infinite or NaN values returned in + parts of the result. + + .. code-block: java + + Examples: + + log(1 ± INFINITY i) = INFINITY ± (Ï€/2)i + log(INFINITY + i) = INFINITY + 0i + log(-INFINITY + i) = INFINITY + Ï€i + log(INFINITY ± INFINITY i) = INFINITY ± (Ï€/4)i + log(-INFINITY ± INFINITY i) = INFINITY ± (3Ï€/4)i + log(0 + 0i) = -INFINITY + 0i + + + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.log` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + the value :code:`ln this`, the natural logarithm of :code:`this`. + + + """ + ... + def log10(self) -> 'Complex': + """ + Base 10 logarithm. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.log10` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + base 10 logarithm of the instance + + Since: + 1.7 + + + """ + ... + def log1p(self) -> 'Complex': + """ + Shifted natural logarithm. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.log1p` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + logarithm of one plus the instance + + Since: + 1.7 + + + """ + ... + @typing.overload + def multiply(self, double: float) -> 'Complex': + """ + Returns a :code:`Complex` whose value is :code:`this * factor`, with :code:`factor` interpreted as a integer number. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.multiply` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Specified by: + :meth:`~org.hipparchus.FieldElement.multiply` in interface :class:`~org.hipparchus.FieldElement` + + Parameters: + factor (int): value to be multiplied by this :code:`Complex`. + + Returns: + :code:`this * factor`. + + Also see: + + - :meth:`~org.hipparchus.complex.Complex.multiply` + + + Returns a :code:`Complex` whose value is :code:`this * factor`, with :code:`factor` interpreted as a real number. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.multiply` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + factor (double): value to be multiplied by this :code:`Complex`. + + Returns: + :code:`this * factor`. + + Also see: + + - :meth:`~org.hipparchus.complex.Complex.multiply` + + + + """ + ... @typing.overload def multiply(self, int: int) -> 'Complex': ... @typing.overload def multiply(self, complex: 'Complex') -> 'Complex': ... - def multiplyMinusI(self) -> 'Complex': ... - def multiplyPlusI(self) -> 'Complex': ... - def negate(self) -> 'Complex': ... - def newInstance(self, double: float) -> 'Complex': ... - def norm(self) -> float: ... + def multiplyMinusI(self) -> 'Complex': + """ + Compute this *- -i. + + Returns: + this * i + + Since: + 2.0 + + + """ + ... + def multiplyPlusI(self) -> 'Complex': + """ + Compute this * i. + + Returns: + this * i + + Since: + 2.0 + + + """ + ... + def negate(self) -> 'Complex': + """ + Returns a :code:`Complex` whose value is :code:`(-this)`. Returns :code:`NaN` if either real or imaginary part of this + Complex number is :code:`Double.NaN`. + + Specified by: + :meth:`~org.hipparchus.FieldElement.negate` in interface :class:`~org.hipparchus.FieldElement` + + Returns: + :code:`-this`. + + + """ + ... + def newInstance(self, double: float) -> 'Complex': + """ + Create an instance corresponding to a constant real value. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.newInstance` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + realPart (double): constant real value + + Returns: + instance corresponding to a constant real value + + + """ + ... + def norm(self) -> float: + """ + norm. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.norm` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + norm(this) + + + """ + ... def nthRoot(self, int: int) -> java.util.List['Complex']: ... @typing.overload - def pow(self, double: float) -> 'Complex': ... + def pow(self, double: float) -> 'Complex': + """ + Returns of value of this complex number raised to the power of :code:`x`. + + If :code:`x` has an integer value, returns :meth:`~org.hipparchus.complex.Complex.pow`, if :code:`this` is real and + :meth:`~org.hipparchus.util.FastMath.pow` with the corresponding real arguments would return a finite number (neither + NaN nor infinite), then returns the same value converted to :code:`Complex`, with the same special cases. In all other + cases real cases, implements y :sup:`x` = exp(x·log(y)). + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.pow` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + x (double): exponent to which this :code:`Complex` is to be raised. + + Returns: + :code:`this :sup:`x``. + + Integer power operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.pow` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + n (int): power to apply + + Returns: + this :sup:`n` + + Since: + 1.7 + + + """ + ... @typing.overload def pow(self, int: int) -> 'Complex': ... @typing.overload def pow(self, complex: 'Complex') -> 'Complex': ... - def reciprocal(self) -> 'Complex': ... - @typing.overload - def remainder(self, double: float) -> 'Complex': ... + def reciprocal(self) -> 'Complex': + """ + Returns the multiplicative inverse of :code:`this` element. + + Specified by: + :meth:`~org.hipparchus.FieldElement.reciprocal` in interface :class:`~org.hipparchus.FieldElement` + + Returns: + the inverse of :code:`this`. + + + """ + ... + @typing.overload + def remainder(self, double: float) -> 'Complex': + """ + IEEE remainder operator. + + for complex numbers, the integer n corresponding to :code:`this.subtract(remainder(a)).divide(a)` is a + :class:`~org.hipparchus.complex.https:.en.wikipedia.org.wiki.Gaussian_integer`. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.remainder` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + a (double): right hand side parameter of the operator + + Returns: + this - n × a where n is the closest integer to this/a + + Since: + 1.7 + + IEEE remainder operator. + + for complex numbers, the integer n corresponding to :code:`this.subtract(remainder(a)).divide(a)` is a + :class:`~org.hipparchus.complex.https:.en.wikipedia.org.wiki.Gaussian_integer`. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.remainder` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + a (:class:`~org.hipparchus.complex.Complex`): right hand side parameter of the operator + + Returns: + this - n × a where n is the closest integer to this/a + + Since: + 1.7 + + + """ + ... @typing.overload def remainder(self, complex: 'Complex') -> 'Complex': ... - def rint(self) -> 'Complex': ... - def rootN(self, int: int) -> 'Complex': ... - def scalb(self, int: int) -> 'Complex': ... - def sign(self) -> 'Complex': ... - def sin(self) -> 'Complex': ... + def rint(self) -> 'Complex': + """ + Get the whole number that is the nearest to the instance, or the even one if x is exactly half way between two integers. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.rint` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + a double number r such that r is an integer r - 0.5 ≤ this ≤ r + 0.5 + + Since: + 1.7 + + + """ + ... + def rootN(self, int: int) -> 'Complex': + """ + N :sup:`th` root. + + This implementation compute the principal n :sup:`th` root by using a branch cut along real negative axis. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.rootN` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + n (int): order of the root + + Returns: + n :sup:`th` root of the instance + + Since: + 1.7 + + + """ + ... + def scalb(self, int: int) -> 'Complex': + """ + Multiply the instance by a power of 2. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.scalb` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + n (int): power of 2 + + Returns: + this × 2 :sup:`n` + + Since: + 1.7 + + + """ + ... + def sign(self) -> 'Complex': + """ + Compute the sign of the instance. The sign is -1 for negative numbers, +1 for positive numbers and 0 otherwise, for + Complex number, it is extended on the unit circle (equivalent to z/|z|, with special handling for 0 and NaN) + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.sign` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + -1.0, -0.0, +0.0, +1.0 or NaN depending on sign of a + + Since: + 2.0 + + + """ + ... + def sin(self) -> 'Complex': + """ + Compute the ` sine <http://mathworld.wolfram.com/Sine.html>` of this complex number. Implements the formula: + + .. code-block: java + + + sin(a + bi) = sin(a)cosh(b) + cos(a)sinh(b)i + + + where the (real) functions on the right-hand side are :meth:`~org.hipparchus.util.FastMath.sin`, + :meth:`~org.hipparchus.util.FastMath.cos`, :meth:`~org.hipparchus.util.FastMath.cosh` and + :meth:`~org.hipparchus.util.FastMath.sinh`. + + Returns :meth:`~org.hipparchus.complex.Complex.NaN` if either real or imaginary part of the input argument is + :code:`NaN`. + + Infinite values in real or imaginary parts of the input may result in infinite or :code:`NaN` values returned in parts + of the result. + + .. code-block: java + + Examples: + + sin(1 ± INFINITY i) = 1 ± INFINITY i + sin(±INFINITY + i) = NaN + NaN i + sin(±INFINITY ± INFINITY i) = NaN + NaN i + + + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.sin` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + the sine of this complex number. + + + """ + ... def sinCos(self) -> org.hipparchus.util.FieldSinCos['Complex']: ... - def sinh(self) -> 'Complex': ... + def sinh(self) -> 'Complex': + """ + Compute the ` hyperbolic sine <http://mathworld.wolfram.com/HyperbolicSine.html>` of this complex number. Implements the + formula: + + .. code-block: java + + + sinh(a + bi) = sinh(a)cos(b)) + cosh(a)sin(b)i + + + where the (real) functions on the right-hand side are :meth:`~org.hipparchus.util.FastMath.sin`, + :meth:`~org.hipparchus.util.FastMath.cos`, :meth:`~org.hipparchus.util.FastMath.cosh` and + :meth:`~org.hipparchus.util.FastMath.sinh`. + + Returns :meth:`~org.hipparchus.complex.Complex.NaN` if either real or imaginary part of the input argument is + :code:`NaN`. + + Infinite values in real or imaginary parts of the input may result in infinite or NaN values returned in parts of the + result. + + .. code-block: java + + Examples: + + sinh(1 ± INFINITY i) = NaN + NaN i + sinh(±INFINITY + i) = ± INFINITY + INFINITY i + sinh(±INFINITY ± INFINITY i) = NaN + NaN i + + + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.sinh` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + the hyperbolic sine of :code:`this`. + + + """ + ... def sinhCosh(self) -> org.hipparchus.util.FieldSinhCosh['Complex']: ... - def sqrt(self) -> 'Complex': ... - def sqrt1z(self) -> 'Complex': ... - def square(self) -> 'Complex': ... - @typing.overload - def subtract(self, double: float) -> 'Complex': ... + def sqrt(self) -> 'Complex': + """ + Compute the ` square root <http://mathworld.wolfram.com/SquareRoot.html>` of this complex number. Implements the + following algorithm to compute :code:`sqrt(a + bi)`: + + 1. Let :code:`t = sqrt((|a| + |a + bi|) / 2)` + 2. + .. code-block: java + + if a ≥ 0 return :code:`t + (b/2t)i` + else return :code:`|b|/2t + sign(b)t i` + + where + + - :code:`|a| =`:meth:`~org.hipparchus.util.FastMath.abs` + - :code:`|a + bi| =`:meth:`~org.hipparchus.util.FastMath.hypot` + - :code:`sign(b) =`:meth:`~org.hipparchus.util.FastMath.copySign` + + The real part is therefore always nonnegative. + + Returns :meth:`~org.hipparchus.complex.Complex.NaN` if either real or imaginary part of the input argument is + :code:`NaN`. + + Infinite values in real or imaginary parts of the input may result in infinite or NaN values returned in parts of the + result. + + .. code-block: java + + Examples: + + sqrt(1 ± ∞ i) = ∞ + NaN i + sqrt(∞ + i) = ∞ + 0i + sqrt(-∞ + i) = 0 + ∞ i + sqrt(∞ ± ∞ i) = ∞ + NaN i + sqrt(-∞ ± ∞ i) = NaN ± ∞ i + + + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.sqrt` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + the square root of :code:`this` with nonnegative real part. + + + """ + ... + def sqrt1z(self) -> 'Complex': + """ + Compute the ` square root <http://mathworld.wolfram.com/SquareRoot.html>` of :code:`1 - this :sup:`2`` for this complex + number. Computes the result directly as :code:`sqrt(ONE.subtract(z.square()))`. + + Returns :meth:`~org.hipparchus.complex.Complex.NaN` if either real or imaginary part of the input argument is + :code:`NaN`. + Infinite values in real or imaginary parts of the input may result in infinite or NaN values returned in parts of the + result. + + Returns: + the square root of :code:`1 - this :sup:`2``. + + + """ + ... + def square(self) -> 'Complex': + """ + Compute this × this. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.square` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + a new element representing this × this + + + """ + ... + @typing.overload + def subtract(self, double: float) -> 'Complex': + """ + Returns a :code:`Complex` whose value is :code:`(this - subtrahend)`. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.subtract` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + subtrahend (double): value to be subtracted from this :code:`Complex`. + + Returns: + :code:`this - subtrahend`. + + Also see: + + - :meth:`~org.hipparchus.complex.Complex.subtract` + + + + """ + ... @typing.overload def subtract(self, complex: 'Complex') -> 'Complex': ... - def tan(self) -> 'Complex': ... - def tanh(self) -> 'Complex': ... - def toDegrees(self) -> 'Complex': ... - def toRadians(self) -> 'Complex': ... - def toString(self) -> str: ... - def ulp(self) -> 'Complex': ... + def tan(self) -> 'Complex': + """ + Compute the ` tangent <http://mathworld.wolfram.com/Tangent.html>` of this complex number. Implements the formula: + + .. code-block: java + + + tan(a + bi) = sin(2a)/(cos(2a)+cosh(2b)) + [sinh(2b)/(cos(2a)+cosh(2b))]i + + + where the (real) functions on the right-hand side are :meth:`~org.hipparchus.util.FastMath.sin`, + :meth:`~org.hipparchus.util.FastMath.cos`, :meth:`~org.hipparchus.util.FastMath.cosh` and + :meth:`~org.hipparchus.util.FastMath.sinh`. + + Returns :meth:`~org.hipparchus.complex.Complex.NaN` if either real or imaginary part of the input argument is + :code:`NaN`. + Infinite (or critical) values in real or imaginary parts of the input may result in infinite or NaN values returned in + parts of the result. + + .. code-block: java + + Examples: + + tan(a ± INFINITY i) = 0 ± i + tan(±INFINITY + bi) = NaN + NaN i + tan(±INFINITY ± INFINITY i) = NaN + NaN i + tan(±π/2 + 0 i) = ±INFINITY + NaN i + + + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.tan` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + the tangent of :code:`this`. + + + """ + ... + def tanh(self) -> 'Complex': + """ + Compute the ` hyperbolic tangent <http://mathworld.wolfram.com/HyperbolicTangent.html>` of this complex number. + Implements the formula: + + .. code-block: java + + + tan(a + bi) = sinh(2a)/(cosh(2a)+cos(2b)) + [sin(2b)/(cosh(2a)+cos(2b))]i + + + where the (real) functions on the right-hand side are :meth:`~org.hipparchus.util.FastMath.sin`, + :meth:`~org.hipparchus.util.FastMath.cos`, :meth:`~org.hipparchus.util.FastMath.cosh` and + :meth:`~org.hipparchus.util.FastMath.sinh`. + + Returns :meth:`~org.hipparchus.complex.Complex.NaN` if either real or imaginary part of the input argument is + :code:`NaN`. + Infinite values in real or imaginary parts of the input may result in infinite or NaN values returned in parts of the + result. + + .. code-block: java + + Examples: + + tanh(a ± INFINITY i) = NaN + NaN i + tanh(±INFINITY + bi) = ±1 + 0 i + tanh(±INFINITY ± INFINITY i) = NaN + NaN i + tanh(0 + (Ï€/2)i) = NaN + INFINITY i + + + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.tanh` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + the hyperbolic tangent of :code:`this`. + + + """ + ... + def toDegrees(self) -> 'Complex': + """ + Convert radians to degrees, with error of less than 0.5 ULP + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.toDegrees` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + instance converted into degrees + + + """ + ... + def toRadians(self) -> 'Complex': + """ + Convert degrees to radians, with error of less than 0.5 ULP + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.toRadians` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + instance converted into radians + + + """ + ... + def toString(self) -> str: + """ + + Overrides: + :meth:`~org.hipparchus.complex.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.toString` in + class :class:`~org.hipparchus.complex.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + + """ + ... + def ulp(self) -> 'Complex': + """ + Compute least significant bit (Unit in Last Position) for a number. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.ulp` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + ulp(this) + + + """ + ... @typing.overload @staticmethod - def valueOf(double: float) -> 'Complex': ... + def valueOf(double: float) -> 'Complex': + """ + Create a complex number given the real and imaginary parts. + + Parameters: + realPart (double): Real part. + imaginaryPart (double): Imaginary part. + + Returns: + a Complex instance. + + Create a complex number given only the real part. + + Parameters: + realPart (double): Real part. + + Returns: + a Complex instance. + + + """ + ... @typing.overload @staticmethod def valueOf(double: float, double2: float) -> 'Complex': ... class ComplexComparator(java.util.Comparator[Complex], java.io.Serializable): + """ + public classComplexComparator extends :class:`~org.hipparchus.complex.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.complex.https:.docs.oracle.com.javase.8.docs.api.java.util.Comparator`<:class:`~org.hipparchus.complex.Complex`>, :class:`~org.hipparchus.complex.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + Comparator for Complex Numbers. + + Also see: + + - :meth:`~serialized` + """ def __init__(self): ... - def compare(self, complex: Complex, complex2: Complex) -> int: ... + def compare(self, complex: Complex, complex2: Complex) -> int: + """ + Compare two complex numbers, using real ordering as the primary sort order and imaginary ordering as the secondary sort + order. + + Specified by: + :meth:`~org.hipparchus.complex.https:.docs.oracle.com.javase.8.docs.api.java.util.Comparator.compare` in + interface :class:`~org.hipparchus.complex.https:.docs.oracle.com.javase.8.docs.api.java.util.Comparator` + + Parameters: + o1 (:class:`~org.hipparchus.complex.Complex`): first complex number + o2 (:class:`~org.hipparchus.complex.Complex`): second complex number + + Returns: + a negative value if o1 real part is less than o2 real part or if real parts are equal and o1 imaginary part is less than + o2 imaginary part + + + """ + ... class ComplexField(org.hipparchus.Field[Complex], java.io.Serializable): - def equals(self, object: typing.Any) -> bool: ... + """ + public classComplexField extends :class:`~org.hipparchus.complex.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.Field`<:class:`~org.hipparchus.complex.Complex`>, :class:`~org.hipparchus.complex.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + Representation of the complex numbers field. + + This class is a singleton. + + Also see: + + - :class:`~org.hipparchus.complex.Complex` + - :meth:`~serialized` + """ + def equals(self, object: typing.Any) -> bool: + """ + + Overrides: + :meth:`~org.hipparchus.complex.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.equals` in + class :class:`~org.hipparchus.complex.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + + """ + ... @staticmethod - def getInstance() -> 'ComplexField': ... - def getOne(self) -> Complex: ... + def getInstance() -> 'ComplexField': + """ + Get the unique instance. + + Returns: + the unique instance + + + """ + ... + def getOne(self) -> Complex: + """ + Get the multiplicative identity of the field. + + The multiplicative identity is the element e :sub:`1` of the field such that for all elements a of the field, the + equalities a × e :sub:`1` = e :sub:`1` × a = a hold. + + Specified by: + :meth:`~org.hipparchus.Field.getOne` in interface :class:`~org.hipparchus.Field` + + Returns: + multiplicative identity of the field + + + """ + ... def getRuntimeClass(self) -> typing.Type[Complex]: ... - def getZero(self) -> Complex: ... - def hashCode(self) -> int: ... + def getZero(self) -> Complex: + """ + Get the additive identity of the field. + + The additive identity is the element e :sub:`0` of the field such that for all elements a of the field, the equalities a + + e :sub:`0` = e :sub:`0` + a = a hold. + + Specified by: + :meth:`~org.hipparchus.Field.getZero` in interface :class:`~org.hipparchus.Field` + + Returns: + additive identity of the field + + + """ + ... + def hashCode(self) -> int: + """ + + Overrides: + :meth:`~org.hipparchus.complex.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.hashCode` in + class :class:`~org.hipparchus.complex.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + + """ + ... class ComplexFormat: + """ + public classComplexFormat extends :class:`~org.hipparchus.complex.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Formats a Complex number in cartesian format "Re(c) + Im(c)i". 'i' can be replaced with 'j' (or anything else), and the + number format for both real and imaginary parts can be configured. + """ @typing.overload def __init__(self): ... @typing.overload @@ -184,7 +1871,61 @@ class ComplexFormat: @typing.overload def __init__(self, numberFormat: java.text.NumberFormat, numberFormat2: java.text.NumberFormat): ... @typing.overload - def format(self, double: float) -> str: ... + def format(self, double: float) -> str: + """ + This method calls :meth:`~org.hipparchus.complex.ComplexFormat.format`. + + Parameters: + c (:class:`~org.hipparchus.complex.Complex`): Complex object to format. + + Returns: + A formatted number in the form "Re(c) + Im(c)i". + + This method calls :meth:`~org.hipparchus.complex.ComplexFormat.format`. + + Parameters: + c (:class:`~org.hipparchus.complex.https:.docs.oracle.com.javase.8.docs.api.java.lang.Double`): Double object to format. + + Returns: + A formatted number. + + Formats a :class:`~org.hipparchus.complex.Complex` object to produce a string. + + Parameters: + complex (:class:`~org.hipparchus.complex.Complex`): the object to format. + toAppendTo (:class:`~org.hipparchus.complex.https:.docs.oracle.com.javase.8.docs.api.java.lang.StringBuffer`): where the text is to be appended + pos (:class:`~org.hipparchus.complex.https:.docs.oracle.com.javase.8.docs.api.java.text.FieldPosition`): On input: an alignment field, if desired. On output: the offsets of the alignment field + + Returns: + the value passed in as toAppendTo. + + public :class:`~org.hipparchus.complex.https:.docs.oracle.com.javase.8.docs.api.java.lang.StringBuffer` format(:class:`~org.hipparchus.complex.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` obj, :class:`~org.hipparchus.complex.https:.docs.oracle.com.javase.8.docs.api.java.lang.StringBuffer` toAppendTo, :class:`~org.hipparchus.complex.https:.docs.oracle.com.javase.8.docs.api.java.text.FieldPosition` pos) throws :class:`~org.hipparchus.exception.MathIllegalArgumentException` + + Formats a object to produce a string. :code:`obj` must be either a :class:`~org.hipparchus.complex.Complex` object or a + :class:`~org.hipparchus.complex.https:.docs.oracle.com.javase.8.docs.api.java.lang.Number` object. Any other type of + object will result in an + :class:`~org.hipparchus.complex.https:.docs.oracle.com.javase.8.docs.api.java.lang.IllegalArgumentException` being + thrown. + + Parameters: + obj (:class:`~org.hipparchus.complex.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object`): the object to format. + toAppendTo (:class:`~org.hipparchus.complex.https:.docs.oracle.com.javase.8.docs.api.java.lang.StringBuffer`): where the text is to be appended + pos (:class:`~org.hipparchus.complex.https:.docs.oracle.com.javase.8.docs.api.java.text.FieldPosition`): On input: an alignment field, if desired. On output: the offsets of the alignment field + + Returns: + the value passed in as toAppendTo. + + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: is :code:`obj` is not a valid type. + + Also see: + + - :meth:`~org.hipparchus.complex.https:.docs.oracle.com.javase.8.docs.api.java.text.Format.format` + + + + """ + ... @typing.overload def format(self, complex: Complex) -> str: ... @typing.overload @@ -192,25 +1933,129 @@ class ComplexFormat: @typing.overload def format(self, complex: Complex, stringBuffer: java.lang.StringBuffer, fieldPosition: java.text.FieldPosition) -> java.lang.StringBuffer: ... @staticmethod - def getAvailableLocales() -> typing.MutableSequence[java.util.Locale]: ... + def getAvailableLocales() -> typing.MutableSequence[java.util.Locale]: + """ + Get the set of locales for which complex formats are available. + + This is the same set as the + :class:`~org.hipparchus.complex.https:.docs.oracle.com.javase.8.docs.api.java.text.NumberFormat` set. + + Returns: + available complex format locales. + + + """ + ... @typing.overload @staticmethod - def getComplexFormat() -> 'ComplexFormat': ... + def getComplexFormat() -> 'ComplexFormat': + """ + Returns the default complex format for the current locale. + + Returns: + the default complex format. + + Since: + 1.4 + + """ + ... @typing.overload @staticmethod def getComplexFormat(string: str, locale: java.util.Locale) -> 'ComplexFormat': ... @typing.overload @staticmethod - def getComplexFormat(locale: java.util.Locale) -> 'ComplexFormat': ... - def getImaginaryCharacter(self) -> str: ... - def getImaginaryFormat(self) -> java.text.NumberFormat: ... - def getRealFormat(self) -> java.text.NumberFormat: ... - @typing.overload - def parse(self, string: str) -> Complex: ... + def getComplexFormat(locale: java.util.Locale) -> 'ComplexFormat': + """ + Returns the default complex format for the given locale. + + Parameters: + locale (:class:`~org.hipparchus.complex.https:.docs.oracle.com.javase.8.docs.api.java.util.Locale`): the specific locale used by the format. + + Returns: + the complex format specific to the given locale. + + Since: + 1.4 + + public static :class:`~org.hipparchus.complex.ComplexFormat` getComplexFormat(:class:`~org.hipparchus.complex.https:.docs.oracle.com.javase.8.docs.api.java.lang.String` imaginaryCharacter, :class:`~org.hipparchus.complex.https:.docs.oracle.com.javase.8.docs.api.java.util.Locale` locale) throws :class:`~org.hipparchus.exception.MathIllegalArgumentException`, :class:`~org.hipparchus.exception.NullArgumentException` + + Returns the default complex format for the given locale. + + Parameters: + locale (:class:`~org.hipparchus.complex.https:.docs.oracle.com.javase.8.docs.api.java.lang.String`): the specific locale used by the format. + imaginaryCharacter (:class:`~org.hipparchus.complex.https:.docs.oracle.com.javase.8.docs.api.java.util.Locale`): Imaginary character. + + Returns: + the complex format specific to the given locale. + + Raises: + :class:`~org.hipparchus.exception.NullArgumentException`: if :code:`imaginaryCharacter` is :code:`null`. + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if :code:`imaginaryCharacter` is an empty string. + + Since: + 1.4 + + + """ + ... + def getImaginaryCharacter(self) -> str: + """ + Access the imaginaryCharacter. + + Returns: + the imaginaryCharacter. + + + """ + ... + def getImaginaryFormat(self) -> java.text.NumberFormat: + """ + Access the imaginaryFormat. + + Returns: + the imaginaryFormat. + + + """ + ... + def getRealFormat(self) -> java.text.NumberFormat: + """ + Access the realFormat. + + Returns: + the realFormat. + + + """ + ... + @typing.overload + def parse(self, string: str) -> Complex: + """ + Parses a string to produce a :class:`~org.hipparchus.complex.Complex` object. + + Parameters: + source (:class:`~org.hipparchus.complex.https:.docs.oracle.com.javase.8.docs.api.java.lang.String`): the string to parse + pos (:class:`~org.hipparchus.complex.https:.docs.oracle.com.javase.8.docs.api.java.text.ParsePosition`): input/ouput parsing parameter. + + Returns: + the parsed :class:`~org.hipparchus.complex.Complex` object. + + + """ + ... @typing.overload def parse(self, string: str, parsePosition: java.text.ParsePosition) -> Complex: ... class ComplexUnivariateIntegrator: + """ + public classComplexUnivariateIntegrator extends :class:`~org.hipparchus.complex.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Wrapper to perform univariate complex integration using an underlying real integration algorithms. + + Since: + 2.0 + """ def __init__(self, univariateIntegrator: org.hipparchus.analysis.integration.UnivariateIntegrator): ... @typing.overload def integrate(self, int: int, calculusFieldUnivariateFunction: typing.Union[org.hipparchus.analysis.CalculusFieldUnivariateFunction[Complex], typing.Callable[[Complex], Complex]], complex: Complex, complex2: Complex) -> Complex: ... @@ -218,8 +2063,25 @@ class ComplexUnivariateIntegrator: def integrate(self, int: int, calculusFieldUnivariateFunction: typing.Union[org.hipparchus.analysis.CalculusFieldUnivariateFunction[Complex], typing.Callable[[Complex], Complex]], complex: Complex, *complex2: Complex) -> Complex: ... class ComplexUtils: + """ + public classComplexUtils extends :class:`~org.hipparchus.complex.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Static implementations of common :class:`~org.hipparchus.complex.Complex` utilities functions. + """ @staticmethod - def convertToComplex(doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> typing.MutableSequence[Complex]: ... + def convertToComplex(doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> typing.MutableSequence[Complex]: + """ + Convert an array of primitive doubles to an array of :code:`Complex` objects. + + Parameters: + real (double[]): Array of numbers to be converted to their :code:`Complex` equivalent. + + Returns: + an array of :code:`Complex` objects. + + + """ + ... _polar2Complex_1__T = typing.TypeVar('_polar2Complex_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload @staticmethod @@ -230,6 +2092,30 @@ class ComplexUtils: _FieldComplex__T = typing.TypeVar('_FieldComplex__T', bound=org.hipparchus.CalculusFieldElement) # <T> class FieldComplex(org.hipparchus.CalculusFieldElement['FieldComplex'[_FieldComplex__T]], typing.Generic[_FieldComplex__T]): + """ + public classFieldComplex<T extends :class:`~org.hipparchus.CalculusFieldElement`<T>> extends :class:`~org.hipparchus.complex.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.CalculusFieldElement`<:class:`~org.hipparchus.complex.FieldComplex`<T>> + + Representation of a Complex number, i.e. a number which has both a real and imaginary part. + + Implementations of arithmetic operations handle :code:`NaN` and infinite values according to the rules for + :class:`~org.hipparchus.complex.https:.docs.oracle.com.javase.8.docs.api.java.lang.Double`, i.e. + :meth:`~org.hipparchus.complex.FieldComplex.equals` is an equivalence relation for all instances that have a :code:`NaN` + in either real or imaginary part, e.g. the following are considered equal: + + - :code:`1 + NaNi` + - :code:`NaN + i` + - :code:`NaN + NaNi` + + + Note that this contradicts the IEEE-754 standard for floating point numbers (according to which the test :code:`x == x` + must fail if :code:`x` is :code:`NaN`). The method :meth:`~org.hipparchus.util.Precision.equals` in + :class:`~org.hipparchus.util.Precision` conforms with IEEE-754 while this class conforms with the standard behavior for + Java object types. + + Since: + 2.0 + """ @typing.overload def __init__(self, t: _FieldComplex__T): ... @typing.overload @@ -267,63 +2153,396 @@ class FieldComplex(org.hipparchus.CalculusFieldElement['FieldComplex'[_FieldComp _equals_2__T = typing.TypeVar('_equals_2__T', bound=org.hipparchus.CalculusFieldElement) # <T> _equals_3__T = typing.TypeVar('_equals_3__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload - def equals(self, object: typing.Any) -> bool: ... + def equals(self, object: typing.Any) -> bool: + """ + Test for equality with another object. If both the real and imaginary parts of two complex numbers are exactly the same, + and neither is :code:`Double.NaN`, the two Complex objects are considered to be equal. The behavior is the same as for + JDK's :meth:`~org.hipparchus.complex.https:.docs.oracle.com.javase.8.docs.api.java.lang.Double.equals`: + + - All :code:`NaN` values are considered to be equal, i.e, if either (or both) real and imaginary parts of the complex + number are equal to :code:`Double.NaN`, the complex number is equal to :code:`NaN`. + - Instances constructed with different representations of zero (i.e. either "0" or "-0") are *not* considered to be equal. + + + Overrides: + :meth:`~org.hipparchus.complex.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.equals` in + class :class:`~org.hipparchus.complex.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Parameters: + other (:class:`~org.hipparchus.complex.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object`): Object to test for equality with this instance. + + Returns: + :code:`true` if the objects are equal, :code:`false` if object is :code:`null`, not an instance of :code:`Complex`, or + not equal to this instance. + + """ + ... @typing.overload @staticmethod - def equals(fieldComplex: 'FieldComplex'[_equals_1__T], fieldComplex2: 'FieldComplex'[_equals_1__T]) -> bool: ... + def equals(fieldComplex: 'FieldComplex'[_equals_1__T], fieldComplex2: 'FieldComplex'[_equals_1__T]) -> bool: + """ + Returns :code:`true` iff the values are equal as defined by :meth:`~org.hipparchus.complex.FieldComplex.equals`. + + Parameters: + x (:class:`~org.hipparchus.complex.FieldComplex`<T> x): First value (cannot be :code:`null`). + y (:class:`~org.hipparchus.complex.FieldComplex`<T> y): Second value (cannot be :code:`null`). + + Returns: + :code:`true` if the values are equal. + + """ + ... @typing.overload @staticmethod - def equals(fieldComplex: 'FieldComplex'[_equals_2__T], fieldComplex2: 'FieldComplex'[_equals_2__T], double: float) -> bool: ... + def equals(fieldComplex: 'FieldComplex'[_equals_2__T], fieldComplex2: 'FieldComplex'[_equals_2__T], double: float) -> bool: + """ + Test for the floating-point equality between Complex objects. It returns :code:`true` if both arguments are equal or + within the range of allowed error (inclusive). + + Parameters: + x (:class:`~org.hipparchus.complex.FieldComplex`<T> x): First value (cannot be :code:`null`). + y (:class:`~org.hipparchus.complex.FieldComplex`<T> y): Second value (cannot be :code:`null`). + maxUlps (int): :code:`(maxUlps - 1)` is the number of floating point values between the real (resp. imaginary) parts of :code:`x` and + :code:`y`. + + Returns: + :code:`true` if there are fewer than :code:`maxUlps` floating point values between the real (resp. imaginary) parts of + :code:`x` and :code:`y`. + + Also see: + + - :meth:`~org.hipparchus.util.Precision.equals` + + + Returns :code:`true` if, both for the real part and for the imaginary part, there is no T value strictly between the + arguments or the difference between them is within the range of allowed error (inclusive). Returns :code:`false` if + either of the arguments is NaN. + + Parameters: + x (:class:`~org.hipparchus.complex.FieldComplex`<T> x): First value (cannot be :code:`null`). + y (:class:`~org.hipparchus.complex.FieldComplex`<T> y): Second value (cannot be :code:`null`). + eps (double): Amount of allowed absolute error. + + Returns: + :code:`true` if the values are two adjacent floating point numbers or they are within range of each other. + + Also see: + + - :meth:`~org.hipparchus.util.Precision.equals` + + + + """ + ... @typing.overload @staticmethod def equals(fieldComplex: 'FieldComplex'[_equals_3__T], fieldComplex2: 'FieldComplex'[_equals_3__T], int: int) -> bool: ... _equalsWithRelativeTolerance__T = typing.TypeVar('_equalsWithRelativeTolerance__T', bound=org.hipparchus.CalculusFieldElement) # <T> @staticmethod - def equalsWithRelativeTolerance(fieldComplex: 'FieldComplex'[_equalsWithRelativeTolerance__T], fieldComplex2: 'FieldComplex'[_equalsWithRelativeTolerance__T], double: float) -> bool: ... + def equalsWithRelativeTolerance(fieldComplex: 'FieldComplex'[_equalsWithRelativeTolerance__T], fieldComplex2: 'FieldComplex'[_equalsWithRelativeTolerance__T], double: float) -> bool: + """ + Returns :code:`true` if, both for the real part and for the imaginary part, there is no T value strictly between the + arguments or the relative difference between them is smaller or equal to the given tolerance. Returns :code:`false` if + either of the arguments is NaN. + + Parameters: + x (:class:`~org.hipparchus.complex.FieldComplex`<T> x): First value (cannot be :code:`null`). + y (:class:`~org.hipparchus.complex.FieldComplex`<T> y): Second value (cannot be :code:`null`). + eps (double): Amount of allowed relative error. + + Returns: + :code:`true` if the values are two adjacent floating point numbers or they are within range of each other. + + Also see: + + - :meth:`~org.hipparchus.util.Precision.equalsWithRelativeTolerance` + + + + """ + ... def exp(self) -> 'FieldComplex'[_FieldComplex__T]: ... def expm1(self) -> 'FieldComplex'[_FieldComplex__T]: ... def floor(self) -> 'FieldComplex'[_FieldComplex__T]: ... - def getArgument(self) -> _FieldComplex__T: ... + def getArgument(self) -> _FieldComplex__T: + """ + Compute the argument of this complex number. The argument is the angle phi between the positive real axis and the point + representing this number in the complex plane. The value returned is between -PI (not inclusive) and PI (inclusive), + with negative values returned for numbers with negative imaginary parts. + + If either real or imaginary part (or both) is NaN, NaN is returned. Infinite parts are handled as :code:`Math.atan2` + handles them, essentially treating finite parts as zero in the presence of an infinite coordinate and returning a + multiple of pi/4 depending on the signs of the infinite parts. See the javadoc for :code:`Math.atan2` for full details. + + Returns: + the argument of :code:`this`. + + + """ + ... def getField(self) -> 'FieldComplexField'[_FieldComplex__T]: ... _getI__T = typing.TypeVar('_getI__T', bound=org.hipparchus.CalculusFieldElement) # <T> @staticmethod - def getI(field: org.hipparchus.Field[_getI__T]) -> 'FieldComplex'[_getI__T]: ... - def getImaginary(self) -> _FieldComplex__T: ... - def getImaginaryPart(self) -> _FieldComplex__T: ... + def getI(field: org.hipparchus.Field[_getI__T]) -> 'FieldComplex'[_getI__T]: + """ + Get the square root of -1. + + Parameters: + field (:class:`~org.hipparchus.Field`<T> field): field the complex components belong to + + Returns: + number representing "0.0 + 1.0i" + + + """ + ... + def getImaginary(self) -> _FieldComplex__T: + """ + Access the imaginary part. + + Returns: + the imaginary part. + + + """ + ... + def getImaginaryPart(self) -> _FieldComplex__T: + """ + Access the imaginary part. + + Returns: + the imaginary part. + + + """ + ... _getInf__T = typing.TypeVar('_getInf__T', bound=org.hipparchus.CalculusFieldElement) # <T> @staticmethod - def getInf(field: org.hipparchus.Field[_getInf__T]) -> 'FieldComplex'[_getInf__T]: ... + def getInf(field: org.hipparchus.Field[_getInf__T]) -> 'FieldComplex'[_getInf__T]: + """ + Get a complex number representing "+INF + INFi". + + Parameters: + field (:class:`~org.hipparchus.Field`<T> field): field the complex components belong to + + Returns: + complex number representing "+INF + INFi" + + + """ + ... _getMinusI__T = typing.TypeVar('_getMinusI__T', bound=org.hipparchus.CalculusFieldElement) # <T> @staticmethod - def getMinusI(field: org.hipparchus.Field[_getMinusI__T]) -> 'FieldComplex'[_getMinusI__T]: ... + def getMinusI(field: org.hipparchus.Field[_getMinusI__T]) -> 'FieldComplex'[_getMinusI__T]: + """ + Get the square root of -1. + + Parameters: + field (:class:`~org.hipparchus.Field`<T> field): field the complex components belong to + + Returns: + number representing "0.0 _ 1.0i" + + + """ + ... _getMinusOne__T = typing.TypeVar('_getMinusOne__T', bound=org.hipparchus.CalculusFieldElement) # <T> @staticmethod - def getMinusOne(field: org.hipparchus.Field[_getMinusOne__T]) -> 'FieldComplex'[_getMinusOne__T]: ... + def getMinusOne(field: org.hipparchus.Field[_getMinusOne__T]) -> 'FieldComplex'[_getMinusOne__T]: + """ + Get a complex number representing "-1.0 + 0.0i". + + Parameters: + field (:class:`~org.hipparchus.Field`<T> field): field the complex components belong to + + Returns: + complex number representing "-1.0 + 0.0i" + + + """ + ... _getNaN__T = typing.TypeVar('_getNaN__T', bound=org.hipparchus.CalculusFieldElement) # <T> @staticmethod - def getNaN(field: org.hipparchus.Field[_getNaN__T]) -> 'FieldComplex'[_getNaN__T]: ... + def getNaN(field: org.hipparchus.Field[_getNaN__T]) -> 'FieldComplex'[_getNaN__T]: + """ + Get a complex number representing "NaN + NaNi". + + Parameters: + field (:class:`~org.hipparchus.Field`<T> field): field the complex components belong to + + Returns: + complex number representing "NaN + NaNi" + + + """ + ... _getOne__T = typing.TypeVar('_getOne__T', bound=org.hipparchus.CalculusFieldElement) # <T> @staticmethod - def getOne(field: org.hipparchus.Field[_getOne__T]) -> 'FieldComplex'[_getOne__T]: ... + def getOne(field: org.hipparchus.Field[_getOne__T]) -> 'FieldComplex'[_getOne__T]: + """ + Get a complex number representing "1.0 + 0.0i". + + Parameters: + field (:class:`~org.hipparchus.Field`<T> field): field the complex components belong to + + Returns: + complex number representing "1.0 + 0.0i" + + + """ + ... def getPartsField(self) -> org.hipparchus.Field[_FieldComplex__T]: ... _getPi_1__T = typing.TypeVar('_getPi_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload def getPi(self) -> 'FieldComplex'[_FieldComplex__T]: ... @typing.overload @staticmethod - def getPi(field: org.hipparchus.Field[_getPi_1__T]) -> 'FieldComplex'[_getPi_1__T]: ... - def getReal(self) -> float: ... - def getRealPart(self) -> _FieldComplex__T: ... + def getPi(field: org.hipparchus.Field[_getPi_1__T]) -> 'FieldComplex'[_getPi_1__T]: + """ + Get a complex number representing "Ï€ + 0.0i". + + Parameters: + field (:class:`~org.hipparchus.Field`<T> field): field the complex components belong to + + Returns: + complex number representing "Ï€ + 0.0i + + public :class:`~org.hipparchus.complex.FieldComplex`<:class:`~org.hipparchus.complex.FieldComplex`> getPi() + + Get the Archimedes constant Ï€. + + Archimedes constant is the ratio of a circle's circumference to its diameter. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.getPi` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + Archimedes constant Ï€ + + + """ + ... + def getReal(self) -> float: + """ + Access the real part. + + Specified by: + :meth:`~org.hipparchus.FieldElement.getReal` in interface :class:`~org.hipparchus.FieldElement` + + Returns: + the real part. + + + """ + ... + def getRealPart(self) -> _FieldComplex__T: + """ + Access the real part. + + Returns: + the real part. + + + """ + ... _getZero__T = typing.TypeVar('_getZero__T', bound=org.hipparchus.CalculusFieldElement) # <T> @staticmethod - def getZero(field: org.hipparchus.Field[_getZero__T]) -> 'FieldComplex'[_getZero__T]: ... - def hashCode(self) -> int: ... + def getZero(field: org.hipparchus.Field[_getZero__T]) -> 'FieldComplex'[_getZero__T]: + """ + Get a complex number representing "0.0 + 0.0i". + + Parameters: + field (:class:`~org.hipparchus.Field`<T> field): field the complex components belong to + + Returns: + complex number representing "0.0 + 0.0i + + + """ + ... + def hashCode(self) -> int: + """ + Get a hashCode for the complex number. Any :code:`Double.NaN` value in real or imaginary part produces the same hash + code :code:`7`. + + Overrides: + :meth:`~org.hipparchus.complex.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.hashCode` in + class :class:`~org.hipparchus.complex.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Returns: + a hash code value for this object. + + + """ + ... def hypot(self, fieldComplex: 'FieldComplex'[_FieldComplex__T]) -> 'FieldComplex'[_FieldComplex__T]: ... - def isInfinite(self) -> bool: ... - def isMathematicalInteger(self) -> bool: ... - def isNaN(self) -> bool: ... - def isReal(self) -> bool: ... - def isZero(self) -> bool: ... + def isInfinite(self) -> bool: + """ + Checks whether either the real or imaginary part of this complex number takes an infinite value (either + :code:`Double.POSITIVE_INFINITY` or :code:`Double.NEGATIVE_INFINITY`) and neither part is :code:`NaN`. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.isInfinite` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + true if one or both parts of this complex number are infinite and neither part is :code:`NaN`. + + + """ + ... + def isMathematicalInteger(self) -> bool: + """ + Check whether the instance is an integer (i.e. imaginary part is zero and real part has no fractional part). + + Returns: + true if imaginary part is zero and real part has no fractional part + + + """ + ... + def isNaN(self) -> bool: + """ + Checks whether either or both parts of this complex number is :code:`NaN`. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.isNaN` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + true if either or both parts of this complex number is :code:`NaN`; false otherwise. + + + """ + ... + def isReal(self) -> bool: + """ + Check whether the instance is real (i.e. imaginary part is zero). + + Returns: + true if imaginary part is zero + + + """ + ... + def isZero(self) -> bool: + """ + Check if an element is semantically equal to zero. + + The default implementation simply calls :code:`equals(getField().getZero())`. However, this may need to be overridden in + some cases as due to compatibility with :code:`hashCode()` some classes implements :code:`equals(Object)` in such a way + that -0.0 and +0.0 are different, which may be a problem. It prevents for example identifying a diagonal element is zero + and should be avoided when doing partial pivoting in LU decomposition. + + This implementation considers +0.0 and -0.0 to be equal for both real and imaginary components. + + Specified by: + :meth:`~org.hipparchus.FieldElement.isZero` in interface :class:`~org.hipparchus.FieldElement` + + Returns: + true if the element is semantically equal to zero + + + """ + ... @typing.overload def linearCombination(self, double: float, fieldComplex: 'FieldComplex'[_FieldComplex__T], double2: float, fieldComplex2: 'FieldComplex'[_FieldComplex__T]) -> 'FieldComplex'[_FieldComplex__T]: ... @typing.overload @@ -390,30 +2609,111 @@ class FieldComplex(org.hipparchus.CalculusFieldElement['FieldComplex'[_FieldComp def tanh(self) -> 'FieldComplex'[_FieldComplex__T]: ... def toDegrees(self) -> 'FieldComplex'[_FieldComplex__T]: ... def toRadians(self) -> 'FieldComplex'[_FieldComplex__T]: ... - def toString(self) -> str: ... + def toString(self) -> str: + """ + + Overrides: + :meth:`~org.hipparchus.complex.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.toString` in + class :class:`~org.hipparchus.complex.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + + """ + ... def ulp(self) -> 'FieldComplex'[_FieldComplex__T]: ... _valueOf_0__T = typing.TypeVar('_valueOf_0__T', bound=org.hipparchus.CalculusFieldElement) # <T> _valueOf_1__T = typing.TypeVar('_valueOf_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload @staticmethod - def valueOf(t: _valueOf_0__T) -> 'FieldComplex'[_valueOf_0__T]: ... + def valueOf(t: _valueOf_0__T) -> 'FieldComplex'[_valueOf_0__T]: + """ + Create a complex number given the real and imaginary parts. + + Parameters: + realPart (T): Real part. + imaginaryPart (T): Imaginary part. + + Returns: + a Complex instance. + + Create a complex number given only the real part. + + Parameters: + realPart (T): Real part. + + Returns: + a Complex instance. + + + """ + ... @typing.overload @staticmethod def valueOf(t: _valueOf_1__T, t2: _valueOf_1__T) -> 'FieldComplex'[_valueOf_1__T]: ... _FieldComplexField__T = typing.TypeVar('_FieldComplexField__T', bound=org.hipparchus.CalculusFieldElement) # <T> class FieldComplexField(org.hipparchus.Field[FieldComplex[_FieldComplexField__T]], typing.Generic[_FieldComplexField__T]): - def equals(self, object: typing.Any) -> bool: ... + """ + public classFieldComplexField<T extends :class:`~org.hipparchus.CalculusFieldElement`<T>> extends :class:`~org.hipparchus.complex.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.Field`<:class:`~org.hipparchus.complex.FieldComplex`<T>> + + Representation of the complex numbers field. + + Since: + 2.0 + + Also see: + + - :class:`~org.hipparchus.complex.FieldComplex` + """ + def equals(self, object: typing.Any) -> bool: + """ + + Overrides: + :meth:`~org.hipparchus.complex.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.equals` in + class :class:`~org.hipparchus.complex.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + + """ + ... _getField__T = typing.TypeVar('_getField__T', bound=org.hipparchus.CalculusFieldElement) # <T> @staticmethod - def getField(field: org.hipparchus.Field[_getField__T]) -> 'FieldComplexField'[_getField__T]: ... + def getField(field: org.hipparchus.Field[_getField__T]) -> 'FieldComplexField'[_getField__T]: + """ + Get the field for complex numbers. + + Parameters: + partsField (:class:`~org.hipparchus.Field`<T> partsField): field for the real and imaginary parts + + Returns: + cached field + + + """ + ... def getOne(self) -> FieldComplex[_FieldComplexField__T]: ... def getRuntimeClass(self) -> typing.Type[FieldComplex[_FieldComplexField__T]]: ... def getZero(self) -> FieldComplex[_FieldComplexField__T]: ... - def hashCode(self) -> int: ... + def hashCode(self) -> int: + """ + + Overrides: + :meth:`~org.hipparchus.complex.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.hashCode` in + class :class:`~org.hipparchus.complex.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + + """ + ... _FieldComplexUnivariateIntegrator__T = typing.TypeVar('_FieldComplexUnivariateIntegrator__T', bound=org.hipparchus.CalculusFieldElement) # <T> class FieldComplexUnivariateIntegrator(typing.Generic[_FieldComplexUnivariateIntegrator__T]): + """ + public classFieldComplexUnivariateIntegrator<T extends :class:`~org.hipparchus.CalculusFieldElement`<T>> extends :class:`~org.hipparchus.complex.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Wrapper to perform univariate complex integration using an underlying real integration algorithms. + + Since: + 2.0 + """ def __init__(self, fieldUnivariateIntegrator: org.hipparchus.analysis.integration.FieldUnivariateIntegrator[_FieldComplexUnivariateIntegrator__T]): ... @typing.overload def integrate(self, int: int, calculusFieldUnivariateFunction: typing.Union[org.hipparchus.analysis.CalculusFieldUnivariateFunction[FieldComplex[_FieldComplexUnivariateIntegrator__T]], typing.Callable[[FieldComplex[_FieldComplexUnivariateIntegrator__T]], FieldComplex[_FieldComplexUnivariateIntegrator__T]]], fieldComplex: FieldComplex[_FieldComplexUnivariateIntegrator__T], fieldComplex2: FieldComplex[_FieldComplexUnivariateIntegrator__T]) -> FieldComplex[_FieldComplexUnivariateIntegrator__T]: ... @@ -421,11 +2721,53 @@ class FieldComplexUnivariateIntegrator(typing.Generic[_FieldComplexUnivariateInt def integrate(self, int: int, calculusFieldUnivariateFunction: typing.Union[org.hipparchus.analysis.CalculusFieldUnivariateFunction[FieldComplex[_FieldComplexUnivariateIntegrator__T]], typing.Callable[[FieldComplex[_FieldComplexUnivariateIntegrator__T]], FieldComplex[_FieldComplexUnivariateIntegrator__T]]], fieldComplex: FieldComplex[_FieldComplexUnivariateIntegrator__T], *fieldComplex2: FieldComplex[_FieldComplexUnivariateIntegrator__T]) -> FieldComplex[_FieldComplexUnivariateIntegrator__T]: ... class Quaternion(java.io.Serializable): + """ + public final classQuaternion extends :class:`~org.hipparchus.complex.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.complex.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + This class implements ` quaternions <http://mathworld.wolfram.com/Quaternion.html>` (Hamilton's hypercomplex numbers). + + Instance of this class are guaranteed to be immutable. + + Also see: + + - :meth:`~serialized` + """ IDENTITY: typing.ClassVar['Quaternion'] = ... + """ + public static final :class:`~org.hipparchus.complex.Quaternion` IDENTITY + + Identity quaternion. + + """ ZERO: typing.ClassVar['Quaternion'] = ... + """ + public static final :class:`~org.hipparchus.complex.Quaternion` ZERO + + Zero quaternion. + + """ I: typing.ClassVar['Quaternion'] = ... + """ + public static final :class:`~org.hipparchus.complex.Quaternion` I + + i + + """ J: typing.ClassVar['Quaternion'] = ... + """ + public static final :class:`~org.hipparchus.complex.Quaternion` J + + j + + """ K: typing.ClassVar['Quaternion'] = ... + """ + public static final :class:`~org.hipparchus.complex.Quaternion` K + + k + + """ @typing.overload def __init__(self, double: float, double2: float, double3: float, double4: float): ... @typing.overload @@ -433,52 +2775,343 @@ class Quaternion(java.io.Serializable): @typing.overload def __init__(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]): ... @typing.overload - def add(self, quaternion: 'Quaternion') -> 'Quaternion': ... + def add(self, quaternion: 'Quaternion') -> 'Quaternion': + """ + Computes the sum of two quaternions. + + Parameters: + q1 (:class:`~org.hipparchus.complex.Quaternion`): Quaternion. + q2 (:class:`~org.hipparchus.complex.Quaternion`): Quaternion. + + Returns: + the sum of :code:`q1` and :code:`q2`. + + Computes the sum of the instance and another quaternion. + + Parameters: + q (:class:`~org.hipparchus.complex.Quaternion`): Quaternion. + + Returns: + the sum of this instance and :code:`q` + + + """ + ... @typing.overload @staticmethod def add(quaternion: 'Quaternion', quaternion2: 'Quaternion') -> 'Quaternion': ... @typing.overload - def dotProduct(self, quaternion: 'Quaternion') -> float: ... + def dotProduct(self, quaternion: 'Quaternion') -> float: + """ + Computes the dot-product of two quaternions. + + Parameters: + q1 (:class:`~org.hipparchus.complex.Quaternion`): Quaternion. + q2 (:class:`~org.hipparchus.complex.Quaternion`): Quaternion. + + Returns: + the dot product of :code:`q1` and :code:`q2`. + + Computes the dot-product of the instance by a quaternion. + + Parameters: + q (:class:`~org.hipparchus.complex.Quaternion`): Quaternion. + + Returns: + the dot product of this instance and :code:`q`. + + + """ + ... @typing.overload @staticmethod def dotProduct(quaternion: 'Quaternion', quaternion2: 'Quaternion') -> float: ... @typing.overload - def equals(self, object: typing.Any) -> bool: ... + def equals(self, object: typing.Any) -> bool: + """ + + Overrides: + :meth:`~org.hipparchus.complex.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.equals` in + class :class:`~org.hipparchus.complex.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Checks whether this instance is equal to another quaternion within a given tolerance. + + Parameters: + q (:class:`~org.hipparchus.complex.Quaternion`): Quaternion with which to compare the current quaternion. + eps (double): Tolerance. + + Returns: + :code:`true` if the each of the components are equal within the allowed absolute error. + + + """ + ... @typing.overload def equals(self, quaternion: 'Quaternion', double: float) -> bool: ... - def getConjugate(self) -> 'Quaternion': ... - def getInverse(self) -> 'Quaternion': ... - def getNorm(self) -> float: ... - def getPositivePolarForm(self) -> 'Quaternion': ... - def getQ0(self) -> float: ... - def getQ1(self) -> float: ... - def getQ2(self) -> float: ... - def getQ3(self) -> float: ... - def getScalarPart(self) -> float: ... - def getVectorPart(self) -> typing.MutableSequence[float]: ... - def hashCode(self) -> int: ... - def isPureQuaternion(self, double: float) -> bool: ... - def isUnitQuaternion(self, double: float) -> bool: ... - @typing.overload - def multiply(self, double: float) -> 'Quaternion': ... + def getConjugate(self) -> 'Quaternion': + """ + Returns the conjugate quaternion of the instance. + + Returns: + the conjugate quaternion + + + """ + ... + def getInverse(self) -> 'Quaternion': + """ + Returns the inverse of this instance. The norm of the quaternion must not be zero. + + Returns: + the inverse. + + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if the norm (squared) of the quaternion is zero. + + + """ + ... + def getNorm(self) -> float: + """ + Computes the norm of the quaternion. + + Returns: + the norm. + + + """ + ... + def getPositivePolarForm(self) -> 'Quaternion': + """ + Returns the polar form of the quaternion. + + Returns: + the unit quaternion with positive scalar part. + + + """ + ... + def getQ0(self) -> float: + """ + Gets the first component of the quaternion (scalar part). + + Returns: + the scalar part. + + + """ + ... + def getQ1(self) -> float: + """ + Gets the second component of the quaternion (first component of the vector part). + + Returns: + the first component of the vector part. + + + """ + ... + def getQ2(self) -> float: + """ + Gets the third component of the quaternion (second component of the vector part). + + Returns: + the second component of the vector part. + + + """ + ... + def getQ3(self) -> float: + """ + Gets the fourth component of the quaternion (third component of the vector part). + + Returns: + the third component of the vector part. + + + """ + ... + def getScalarPart(self) -> float: + """ + Gets the scalar part of the quaternion. + + Returns: + the scalar part. + + Also see: + + - :meth:`~org.hipparchus.complex.Quaternion.getQ0` + + + + """ + ... + def getVectorPart(self) -> typing.MutableSequence[float]: + """ + Gets the three components of the vector part of the quaternion. + + Returns: + the vector part. + + Also see: + + - :meth:`~org.hipparchus.complex.Quaternion.getQ1` + - :meth:`~org.hipparchus.complex.Quaternion.getQ2` + - :meth:`~org.hipparchus.complex.Quaternion.getQ3` + + + + """ + ... + def hashCode(self) -> int: + """ + + Overrides: + :meth:`~org.hipparchus.complex.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.hashCode` in + class :class:`~org.hipparchus.complex.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + + """ + ... + def isPureQuaternion(self, double: float) -> bool: + """ + Checks whether the instance is a pure quaternion within a given tolerance. + + Parameters: + eps (double): Tolerance (absolute error). + + Returns: + :code:`true` if the scalar part of the quaternion is zero. + + + """ + ... + def isUnitQuaternion(self, double: float) -> bool: + """ + Checks whether the instance is a unit quaternion within a given tolerance. + + Parameters: + eps (double): Tolerance (absolute error). + + Returns: + :code:`true` if the norm is 1 within the given tolerance, :code:`false` otherwise + + + """ + ... + @typing.overload + def multiply(self, double: float) -> 'Quaternion': + """ + Returns the Hamilton product of two quaternions. + + Parameters: + q1 (:class:`~org.hipparchus.complex.Quaternion`): First quaternion. + q2 (:class:`~org.hipparchus.complex.Quaternion`): Second quaternion. + + Returns: + the product :code:`q1` and :code:`q2`, in that order. + + Returns the Hamilton product of the instance by a quaternion. + + Parameters: + q (:class:`~org.hipparchus.complex.Quaternion`): Quaternion. + + Returns: + the product of this instance with :code:`q`, in that order. + + Multiplies the instance by a scalar. + + Parameters: + alpha (double): Scalar factor. + + Returns: + a scaled quaternion. + + + """ + ... @typing.overload def multiply(self, quaternion: 'Quaternion') -> 'Quaternion': ... @typing.overload @staticmethod def multiply(quaternion: 'Quaternion', quaternion2: 'Quaternion') -> 'Quaternion': ... - def normalize(self) -> 'Quaternion': ... - @typing.overload - def subtract(self, quaternion: 'Quaternion') -> 'Quaternion': ... + def normalize(self) -> 'Quaternion': + """ + Computes the normalized quaternion (the versor of the instance). The norm of the quaternion must not be zero. + + Returns: + a normalized quaternion. + + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if the norm of the quaternion is zero. + + + """ + ... + @typing.overload + def subtract(self, quaternion: 'Quaternion') -> 'Quaternion': + """ + Subtracts two quaternions. + + Parameters: + q1 (:class:`~org.hipparchus.complex.Quaternion`): First Quaternion. + q2 (:class:`~org.hipparchus.complex.Quaternion`): Second quaternion. + + Returns: + the difference between :code:`q1` and :code:`q2`. + + Subtracts a quaternion from the instance. + + Parameters: + q (:class:`~org.hipparchus.complex.Quaternion`): Quaternion. + + Returns: + the difference between this instance and :code:`q`. + + + """ + ... @typing.overload @staticmethod def subtract(quaternion: 'Quaternion', quaternion2: 'Quaternion') -> 'Quaternion': ... - def toString(self) -> str: ... + def toString(self) -> str: + """ + + Overrides: + :meth:`~org.hipparchus.complex.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.toString` in + class :class:`~org.hipparchus.complex.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + + """ + ... class RootsOfUnity(java.io.Serializable): + """ + public classRootsOfUnity extends :class:`~org.hipparchus.complex.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.complex.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + A helper class for the computation and caching of the :code:`n`-th roots of unity. + + Also see: + + - :meth:`~serialized` + """ def __init__(self): ... def computeRoots(self, int: int) -> None: ... def getImaginary(self, int: int) -> float: ... - def getNumberOfRoots(self) -> int: ... + def getNumberOfRoots(self) -> int: + """ + Returns the number of roots of unity currently stored. + + If :meth:`~org.hipparchus.complex.RootsOfUnity.computeRoots` was called with :code:`n`, then this method returns + :code:`abs(n)`. If no roots of unity have been computed yet, this method returns 0. + + Returns: + the number of roots of unity currently stored + + + """ + ... def getReal(self, int: int) -> float: ... def isCounterClockWise(self) -> bool: ... diff --git a/org-stubs/hipparchus/dfp/__init__.pyi b/org-stubs/hipparchus/dfp/__init__.pyi index 52f436c..50caaf7 100644 --- a/org-stubs/hipparchus/dfp/__init__.pyi +++ b/org-stubs/hipparchus/dfp/__init__.pyi @@ -14,67 +14,847 @@ import typing class Dfp(org.hipparchus.CalculusFieldElement['Dfp']): + """ + public classDfp extends :class:`~org.hipparchus.dfp.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.CalculusFieldElement`<:class:`~org.hipparchus.dfp.Dfp`> + + Decimal floating point library for Java + + Another floating point class. This one is built using radix 10000 which is 10 :sup:`4` , so its almost decimal. + + The design goals here are: + + 1. Decimal math, or close to it + 2. Settable precision (but no mix between numbers using different settings) + 3. Portability. Code should be kept as portable as possible. + 4. Performance + 5. Accuracy - Results should always be +/- 1 ULP for basic algebraic operation + 6. Comply with IEEE 854-1987 as much as possible. (See IEEE 854-1987 notes below) + + + Trade offs: + + 1. Memory foot print. I'm using more memory than necessary to represent numbers to get better performance. + 2. Digits are bigger, so rounding is a greater loss. So, if you really need 12 decimal digits, better use 4 base 10000 + digits there can be one partially filled. + + + Numbers are represented in the following form: \[ n = \mathrm{sign} \times \mathrm{mant} \times + \mathrm{radix}^\mathrm{exp} \] where sign is ±1, mantissa represents a fractional number between zero and one. mant[0] + is the least significant digit. exp is in the range of -32767 to 32768 + + IEEE 854-1987 Notes and differences + + IEEE 854 requires the radix to be either 2 or 10. The radix here is 10000, so that requirement is not met, but it is + possible that a subclassed can be made to make it behave as a radix 10 number. It is my opinion that if it looks and + behaves as a radix 10 number then it is one and that requirement would be met. + + The radix of 10000 was chosen because it should be faster to operate on 4 decimal digits at once instead of one at a + time. Radix 10 behavior can be realized by adding an additional rounding step to ensure that the number of decimal + digits represented is constant. + + The IEEE standard specifically leaves out internal data encoding, so it is reasonable to conclude that such a subclass + of this radix 10000 system is merely an encoding of a radix 10 system. + + IEEE 854 also specifies the existence of "sub-normal" numbers. This class does not contain any such entities. The most + significant radix 10000 digit is always non-zero. Instead, we support "gradual underflow" by raising the underflow flag + for numbers less with exponent less than expMin, but don't flush to zero until the exponent reaches MIN_EXP-digits. Thus + the smallest number we can represent would be: 1E(-(MIN_EXP-digits-1)*4), eg, for digits=5, MIN_EXP=-32767, that would + be 1e-131092. + + IEEE 854 defines that the implied radix point lies just to the right of the most significant digit and to the left of + the remaining digits. This implementation puts the implied radix point to the left of all digits including the most + significant one. The most significant digit here is the one just to the right of the radix point. This is a fine detail + and is really only a matter of definition. Any side effects of this can be rendered invisible by a subclass. + + Also see: + + - :class:`~org.hipparchus.dfp.DfpField` + """ RADIX: typing.ClassVar[int] = ... + """ + public static final int RADIX + + The radix, or base of this system. Set to 10000 + + Also see: + + - :meth:`~constant` + + + + """ MIN_EXP: typing.ClassVar[int] = ... + """ + public static final int MIN_EXP + + The minimum exponent before underflow is signaled. Flush to zero occurs at minExp-DIGITS + + Also see: + + - :meth:`~constant` + + + + """ MAX_EXP: typing.ClassVar[int] = ... + """ + public static final int MAX_EXP + + The maximum exponent before overflow is signaled and results flushed to infinity + + Also see: + + - :meth:`~constant` + + + + """ ERR_SCALE: typing.ClassVar[int] = ... + """ + public static final int ERR_SCALE + + The amount under/overflows are scaled by before going to trap handler + + Also see: + + - :meth:`~constant` + + + + """ FINITE: typing.ClassVar[int] = ... + """ + public static final byte FINITE + + Indicator value for normal finite numbers. + + Also see: + + - :meth:`~constant` + + + + """ INFINITE: typing.ClassVar[int] = ... + """ + public static final byte INFINITE + + Indicator value for Infinity. + + Also see: + + - :meth:`~constant` + + + + """ SNAN: typing.ClassVar[int] = ... + """ + public static final byte SNAN + + Indicator value for signaling NaN. + + Also see: + + - :meth:`~constant` + + + + """ QNAN: typing.ClassVar[int] = ... + """ + public static final byte QNAN + + Indicator value for quiet NaN. + + Also see: + + - :meth:`~constant` + + + + """ def __init__(self, dfp: 'Dfp'): ... - def abs(self) -> 'Dfp': ... - def acos(self) -> 'Dfp': ... - def acosh(self) -> 'Dfp': ... + def abs(self) -> 'Dfp': + """ + absolute value. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.abs` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + abs(this) + + + """ + ... + def acos(self) -> 'Dfp': + """ + Arc cosine operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.acos` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + acos(this) + + + """ + ... + def acosh(self) -> 'Dfp': + """ + Inverse hyperbolic cosine operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.acosh` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + acosh(this) + + + """ + ... @typing.overload - def add(self, double: float) -> org.hipparchus.FieldElement: ... + def add(self, double: float) -> org.hipparchus.FieldElement: + """ + Add x to this. + + Specified by: + :meth:`~org.hipparchus.FieldElement.add` in interface :class:`~org.hipparchus.FieldElement` + + Parameters: + x (:class:`~org.hipparchus.dfp.Dfp`): number to add + + Returns: + sum of this and x + + + """ + ... @typing.overload def add(self, dfp: 'Dfp') -> 'Dfp': ... - def asin(self) -> 'Dfp': ... - def asinh(self) -> 'Dfp': ... - def atan(self) -> 'Dfp': ... - def atan2(self, dfp: 'Dfp') -> 'Dfp': ... - def atanh(self) -> 'Dfp': ... - def ceil(self) -> 'Dfp': ... - def classify(self) -> int: ... + def asin(self) -> 'Dfp': + """ + Arc sine operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.asin` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + asin(this) + + + """ + ... + def asinh(self) -> 'Dfp': + """ + Inverse hyperbolic sine operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.asinh` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + asin(this) + + + """ + ... + def atan(self) -> 'Dfp': + """ + Arc tangent operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.atan` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + atan(this) + + + """ + ... + def atan2(self, dfp: 'Dfp') -> 'Dfp': + """ + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if number of free parameters or orders are inconsistent + + + """ + ... + def atanh(self) -> 'Dfp': + """ + Inverse hyperbolic tangent operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.atanh` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + atanh(this) + + + """ + ... + def ceil(self) -> 'Dfp': + """ + Round to an integer using the round ceil mode. That is, round toward +Infinity + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.ceil` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + rounded value + + + """ + ... + def classify(self) -> int: + """ + Returns the type - one of FINITE, INFINITE, SNAN, QNAN. + + Returns: + type of the number + + + """ + ... @typing.overload - def copySign(self, double: float) -> 'Dfp': ... + def copySign(self, double: float) -> 'Dfp': + """ + Returns the instance with the sign of the argument. A NaN :code:`sign` argument is treated as positive. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.copySign` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + s (:class:`~org.hipparchus.dfp.Dfp`): the sign for the returned value + + Returns: + the instance with the same sign as the :code:`sign` argument + + Returns the instance with the sign of the argument. A NaN :code:`sign` argument is treated as positive. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.copySign` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + s (double): the sign for the returned value + + Returns: + the instance with the same sign as the :code:`sign` argument + + + """ + ... @typing.overload def copySign(self, dfp: 'Dfp') -> 'Dfp': ... @staticmethod - def copysign(dfp: 'Dfp', dfp2: 'Dfp') -> 'Dfp': ... - def cos(self) -> 'Dfp': ... - def cosh(self) -> 'Dfp': ... + def copysign(dfp: 'Dfp', dfp2: 'Dfp') -> 'Dfp': + """ + Creates an instance that is the same as x except that it has the sign of y. abs(x) = dfp.copysign(x, dfp.one) + + Parameters: + x (:class:`~org.hipparchus.dfp.Dfp`): number to get the value from + y (:class:`~org.hipparchus.dfp.Dfp`): number to get the sign from + + Returns: + a number with the value of x and the sign of y + + + """ + ... + def cos(self) -> 'Dfp': + """ + Cosine operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.cos` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + cos(this) + + + """ + ... + def cosh(self) -> 'Dfp': + """ + Hyperbolic cosine operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.cosh` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + cosh(this) + + + """ + ... @typing.overload - def divide(self, double: float) -> org.hipparchus.FieldElement: ... + def divide(self, double: float) -> org.hipparchus.FieldElement: + """ + Divide this by divisor. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.divide` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Specified by: + :meth:`~org.hipparchus.FieldElement.divide` in interface :class:`~org.hipparchus.FieldElement` + + Parameters: + divisor (:class:`~org.hipparchus.dfp.Dfp`): divisor + + Returns: + quotient of this by divisor + + Divide by a single digit less than radix. Special case, so there are speed advantages. 0 <= divisor < radix + + Parameters: + divisor (int): divisor + + Returns: + quotient of this by divisor + + + """ + ... @typing.overload def divide(self, int: int) -> 'Dfp': ... @typing.overload def divide(self, dfp: 'Dfp') -> 'Dfp': ... - def dotrap(self, int: int, string: str, dfp: 'Dfp', dfp2: 'Dfp') -> 'Dfp': ... - def equals(self, object: typing.Any) -> bool: ... - def exp(self) -> 'Dfp': ... - def expm1(self) -> 'Dfp': ... - def floor(self) -> 'Dfp': ... - def getExponent(self) -> int: ... - def getField(self) -> 'DfpField': ... - def getOne(self) -> 'Dfp': ... - def getPi(self) -> 'Dfp': ... - def getRadixDigits(self) -> int: ... - def getReal(self) -> float: ... - def getTwo(self) -> 'Dfp': ... - def getZero(self) -> 'Dfp': ... - def greaterThan(self, dfp: 'Dfp') -> bool: ... - def hashCode(self) -> int: ... - def hypot(self, dfp: 'Dfp') -> 'Dfp': ... - def intLog10(self) -> int: ... - def intValue(self) -> int: ... - def isInfinite(self) -> bool: ... - def isNaN(self) -> bool: ... - def isZero(self) -> bool: ... - def lessThan(self, dfp: 'Dfp') -> bool: ... - @typing.overload - def linearCombination(self, double: float, dfp: 'Dfp', double2: float, dfp2: 'Dfp') -> 'Dfp': ... + def dotrap(self, int: int, string: str, dfp: 'Dfp', dfp2: 'Dfp') -> 'Dfp': + """ + Raises a trap. This does not set the corresponding flag however. + + Parameters: + type (int): the trap type + what (:class:`~org.hipparchus.dfp.https:.docs.oracle.com.javase.8.docs.api.java.lang.String`): - name of routine trap occurred in + oper (:class:`~org.hipparchus.dfp.Dfp`): - input operator to function + result (:class:`~org.hipparchus.dfp.Dfp`): - the result computed prior to the trap + + Returns: + The suggested return value from the trap handler + + + """ + ... + def equals(self, object: typing.Any) -> bool: + """ + Check if instance is equal to x. + + Overrides: + :meth:`~org.hipparchus.dfp.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.equals` in + class :class:`~org.hipparchus.dfp.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Parameters: + other (:class:`~org.hipparchus.dfp.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object`): object to check instance against + + Returns: + true if instance is equal to x and neither are NaN, false otherwise + + + """ + ... + def exp(self) -> 'Dfp': + """ + Exponential. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.exp` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + exponential of the instance + + + """ + ... + def expm1(self) -> 'Dfp': + """ + Exponential minus 1. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.expm1` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + exponential minus one of the instance + + + """ + ... + def floor(self) -> 'Dfp': + """ + Round to an integer using the round floor mode. That is, round toward -Infinity + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.floor` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + rounded value + + + """ + ... + def getExponent(self) -> int: + """ + Return the exponent of the instance, removing the bias. + + For double numbers of the form 2 :sup:`x` , the unbiased exponent is exactly x. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.getExponent` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + exponent for the instance, without bias + + + """ + ... + def getField(self) -> 'DfpField': + """ + Get the :class:`~org.hipparchus.Field` (really a :class:`~org.hipparchus.dfp.DfpField`) to which the instance belongs. + + The field is linked to the number of digits and acts as a factory for :class:`~org.hipparchus.dfp.Dfp` instances. + + Specified by: + :meth:`~org.hipparchus.FieldElement.getField` in interface :class:`~org.hipparchus.FieldElement` + + Returns: + :class:`~org.hipparchus.Field` (really a :class:`~org.hipparchus.dfp.DfpField`) to which the instance belongs + + + """ + ... + def getOne(self) -> 'Dfp': + """ + Get the constant 1. + + Returns: + a Dfp with value one + + + """ + ... + def getPi(self) -> 'Dfp': + """ + Get the Archimedes constant Ï€. + + Archimedes constant is the ratio of a circle's circumference to its diameter. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.getPi` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + Archimedes constant Ï€ + + + """ + ... + def getRadixDigits(self) -> int: + """ + Get the number of radix digits of the instance. + + Returns: + number of radix digits + + + """ + ... + def getReal(self) -> float: + """ + Get the real value of the number. + + Specified by: + :meth:`~org.hipparchus.FieldElement.getReal` in interface :class:`~org.hipparchus.FieldElement` + + Returns: + real value + + + """ + ... + def getTwo(self) -> 'Dfp': + """ + Get the constant 2. + + Returns: + a Dfp with value two + + + """ + ... + def getZero(self) -> 'Dfp': + """ + Get the constant 0. + + Returns: + a Dfp with value zero + + + """ + ... + def greaterThan(self, dfp: 'Dfp') -> bool: + """ + Check if instance is greater than x. + + Parameters: + x (:class:`~org.hipparchus.dfp.Dfp`): number to check instance against + + Returns: + true if instance is greater than x and neither are NaN, false otherwise + + + """ + ... + def hashCode(self) -> int: + """ + Gets a hashCode for the instance. + + Overrides: + :meth:`~org.hipparchus.dfp.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.hashCode` in + class :class:`~org.hipparchus.dfp.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Returns: + a hash code value for this object + + + """ + ... + def hypot(self, dfp: 'Dfp') -> 'Dfp': + """ + Returns the hypotenuse of a triangle with sides :code:`this` and :code:`y` - sqrt(*this* :sup:`2` +*y* :sup:`2` ) + avoiding intermediate overflow or underflow. + + - If either argument is infinite, then the result is positive infinity. + - else, if either argument is NaN then the result is NaN. + + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.hypot` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + y (:class:`~org.hipparchus.dfp.Dfp`): a value + + Returns: + sqrt(*this* :sup:`2` +*y* :sup:`2` ) + + + """ + ... + def intLog10(self) -> int: + """ + Get the exponent of the greatest power of 10 that is less than or equal to abs(this). + + Returns: + integer base 10 logarithm + + + """ + ... + def intValue(self) -> int: + """ + Convert this to an integer. If greater than 2147483647, it returns 2147483647. If less than -2147483648 it returns + -2147483648. + + Returns: + converted number + + + """ + ... + def isInfinite(self) -> bool: + """ + Check if the instance is infinite. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.isInfinite` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + true if the instance is infinite + + + """ + ... + def isNaN(self) -> bool: + """ + Check if the instance is Not a Number. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.isNaN` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + true if the instance is Not a Number + + + """ + ... + def isZero(self) -> bool: + """ + Check if instance is equal to zero. + + Specified by: + :meth:`~org.hipparchus.FieldElement.isZero` in interface :class:`~org.hipparchus.FieldElement` + + Returns: + true if instance is equal to zero + + + """ + ... + def lessThan(self, dfp: 'Dfp') -> bool: + """ + Check if instance is less than x. + + Parameters: + x (:class:`~org.hipparchus.dfp.Dfp`): number to check instance against + + Returns: + true if instance is less than x and neither are NaN, false otherwise + + + """ + ... + @typing.overload + def linearCombination(self, double: float, dfp: 'Dfp', double2: float, dfp2: 'Dfp') -> 'Dfp': + """ + Compute a linear combination. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` in + interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + a1 (:class:`~org.hipparchus.dfp.Dfp`): first factor of the first term + b1 (:class:`~org.hipparchus.dfp.Dfp`): second factor of the first term + a2 (:class:`~org.hipparchus.dfp.Dfp`): first factor of the second term + b2 (:class:`~org.hipparchus.dfp.Dfp`): second factor of the second term + + Returns: + a :sub:`1` ×b :sub:`1` + a :sub:`2` ×b :sub:`2` + + Also see: + + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + + + Compute a linear combination. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` in + interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + a1 (double): first factor of the first term + b1 (:class:`~org.hipparchus.dfp.Dfp`): second factor of the first term + a2 (double): first factor of the second term + b2 (:class:`~org.hipparchus.dfp.Dfp`): second factor of the second term + + Returns: + a :sub:`1` ×b :sub:`1` + a :sub:`2` ×b :sub:`2` + + Also see: + + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + + + Compute a linear combination. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` in + interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + a1 (:class:`~org.hipparchus.dfp.Dfp`): first factor of the first term + b1 (:class:`~org.hipparchus.dfp.Dfp`): second factor of the first term + a2 (:class:`~org.hipparchus.dfp.Dfp`): first factor of the second term + b2 (:class:`~org.hipparchus.dfp.Dfp`): second factor of the second term + a3 (:class:`~org.hipparchus.dfp.Dfp`): first factor of the third term + b3 (:class:`~org.hipparchus.dfp.Dfp`): second factor of the third term + + Returns: + a :sub:`1` ×b :sub:`1` + a :sub:`2` ×b :sub:`2` + a :sub:`3` ×b :sub:`3` + + Also see: + + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + + + Compute a linear combination. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` in + interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + a1 (double): first factor of the first term + b1 (:class:`~org.hipparchus.dfp.Dfp`): second factor of the first term + a2 (double): first factor of the second term + b2 (:class:`~org.hipparchus.dfp.Dfp`): second factor of the second term + a3 (double): first factor of the third term + b3 (:class:`~org.hipparchus.dfp.Dfp`): second factor of the third term + + Returns: + a :sub:`1` ×b :sub:`1` + a :sub:`2` ×b :sub:`2` + a :sub:`3` ×b :sub:`3` + + Also see: + + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + + + Compute a linear combination. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` in + interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + a1 (:class:`~org.hipparchus.dfp.Dfp`): first factor of the first term + b1 (:class:`~org.hipparchus.dfp.Dfp`): second factor of the first term + a2 (:class:`~org.hipparchus.dfp.Dfp`): first factor of the second term + b2 (:class:`~org.hipparchus.dfp.Dfp`): second factor of the second term + a3 (:class:`~org.hipparchus.dfp.Dfp`): first factor of the third term + b3 (:class:`~org.hipparchus.dfp.Dfp`): second factor of the third term + a4 (:class:`~org.hipparchus.dfp.Dfp`): first factor of the fourth term + b4 (:class:`~org.hipparchus.dfp.Dfp`): second factor of the fourth term + + Returns: + a :sub:`1` ×b :sub:`1` + a :sub:`2` ×b :sub:`2` + a :sub:`3` ×b :sub:`3` + a :sub:`4` ×b :sub:`4` + + Also see: + + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + + + Compute a linear combination. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` in + interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + a1 (double): first factor of the first term + b1 (:class:`~org.hipparchus.dfp.Dfp`): second factor of the first term + a2 (double): first factor of the second term + b2 (:class:`~org.hipparchus.dfp.Dfp`): second factor of the second term + a3 (double): first factor of the third term + b3 (:class:`~org.hipparchus.dfp.Dfp`): second factor of the third term + a4 (double): first factor of the fourth term + b4 (:class:`~org.hipparchus.dfp.Dfp`): second factor of the fourth term + + Returns: + a :sub:`1` ×b :sub:`1` + a :sub:`2` ×b :sub:`2` + a :sub:`3` ×b :sub:`3` + a :sub:`4` ×b :sub:`4` + + Also see: + + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + + + + """ + ... @typing.overload def linearCombination(self, double: float, dfp: 'Dfp', double2: float, dfp2: 'Dfp', double3: float, dfp3: 'Dfp') -> 'Dfp': ... @typing.overload @@ -89,22 +869,212 @@ class Dfp(org.hipparchus.CalculusFieldElement['Dfp']): def linearCombination(self, dfp: 'Dfp', dfp2: 'Dfp', dfp3: 'Dfp', dfp4: 'Dfp', dfp5: 'Dfp', dfp6: 'Dfp', dfp7: 'Dfp', dfp8: 'Dfp') -> 'Dfp': ... @typing.overload def linearCombination(self, dfpArray: typing.Union[typing.List['Dfp'], jpype.JArray], dfpArray2: typing.Union[typing.List['Dfp'], jpype.JArray]) -> 'Dfp': ... - def log(self) -> 'Dfp': ... - def log10(self) -> 'Dfp': ... - def log10K(self) -> int: ... - def log1p(self) -> 'Dfp': ... + def log(self) -> 'Dfp': + """ + Natural logarithm. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.log` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + logarithm of the instance + + + """ + ... + def log10(self) -> 'Dfp': + """ + Base 10 logarithm. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.log10` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + base 10 logarithm of the instance + + + """ + ... + def log10K(self) -> int: + """ + Get the exponent of the greatest power of 10000 that is less than or equal to the absolute value of this. I.E. if this + is 10 :sup:`6` then log10K would return 1. + + Returns: + integer base 10000 logarithm + + + """ + ... + def log1p(self) -> 'Dfp': + """ + Shifted natural logarithm. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.log1p` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + logarithm of one plus the instance + + + """ + ... @typing.overload - def multiply(self, double: float) -> org.hipparchus.FieldElement: ... + def multiply(self, double: float) -> org.hipparchus.FieldElement: + """ + Multiply this by x. + + Specified by: + :meth:`~org.hipparchus.FieldElement.multiply` in interface :class:`~org.hipparchus.FieldElement` + + Parameters: + x (:class:`~org.hipparchus.dfp.Dfp`): multiplicand + + Returns: + product of this and x + + Multiply this by a single digit x. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.multiply` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Specified by: + :meth:`~org.hipparchus.FieldElement.multiply` in interface :class:`~org.hipparchus.FieldElement` + + Parameters: + x (int): multiplicand + + Returns: + product of this and x + + + """ + ... @typing.overload def multiply(self, int: int) -> 'Dfp': ... @typing.overload def multiply(self, dfp: 'Dfp') -> 'Dfp': ... - def negate(self) -> 'Dfp': ... - def negativeOrNull(self) -> bool: ... + def negate(self) -> 'Dfp': + """ + Returns a number that is this number with the sign bit reversed. + + Specified by: + :meth:`~org.hipparchus.FieldElement.negate` in interface :class:`~org.hipparchus.FieldElement` + + Returns: + the opposite of this + + + """ + ... + def negativeOrNull(self) -> bool: + """ + Check if instance is less than or equal to 0. + + Returns: + true if instance is not NaN and less than or equal to 0, false otherwise + + + """ + ... @typing.overload - def newInstance(self) -> 'Dfp': ... + def newInstance(self) -> 'Dfp': + """ + Create an instance with a value of 0. Use this internally in preference to constructors to facilitate subclasses + + Returns: + a new instance with a value of 0 + + """ + ... @typing.overload - def newInstance(self, byte: int) -> 'Dfp': ... + def newInstance(self, byte: int) -> 'Dfp': + """ + Create an instance from a byte value. + + Parameters: + x (byte): value to convert to an instance + + Returns: + a new instance with value x + + Create an instance from an int value. + + Parameters: + x (int): value to convert to an instance + + Returns: + a new instance with value x + + Create an instance from a long value. + + Parameters: + x (long): value to convert to an instance + + Returns: + a new instance with value x + + Create an instance corresponding to a constant real value. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.newInstance` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + x (double): constant real value + + Returns: + instance corresponding to a constant real value + + Create an instance by copying an existing one. Use this internally in preference to constructors to facilitate + subclasses. + + Parameters: + d (:class:`~org.hipparchus.dfp.Dfp`): instance to copy + + Returns: + a new instance with the same value as d + + Create an instance from a String representation. Use this internally in preference to constructors to facilitate + subclasses. + + Parameters: + s (:class:`~org.hipparchus.dfp.https:.docs.oracle.com.javase.8.docs.api.java.lang.String`): string representation of the instance + + Returns: + a new instance parsed from specified string + + Creates an instance with a non-finite value. + + Parameters: + sig (byte): sign of the Dfp to create + code (byte): code of the value, must be one of :meth:`~org.hipparchus.dfp.Dfp.INFINITE`, :meth:`~org.hipparchus.dfp.Dfp.SNAN`, + :meth:`~org.hipparchus.dfp.Dfp.QNAN` + + Returns: + a new instance with a non-finite value + + Creates an instance by converting the instance to a different field (i.e. different accuracy). + + If the target field as a greater number of digits, the extra least significant digits will be set to zero. + + Parameters: + targetField (:class:`~org.hipparchus.dfp.DfpField`): field to convert the instance to + rmode (:class:`~org.hipparchus.dfp.DfpField.RoundingMode`): rounding mode to use if target field as less digits than the instance, can be null otherwise + + Returns: + converted instance (or the instance itself if it already has the required number of digits) + + Since: + 1.7 + + Also see: + + - :meth:`~org.hipparchus.dfp.DfpField.getExtendedField` + + + + """ + ... @typing.overload def newInstance(self, byte: int, byte2: int) -> 'Dfp': ... @typing.overload @@ -119,88 +1089,903 @@ class Dfp(org.hipparchus.CalculusFieldElement['Dfp']): def newInstance(self, dfp: 'Dfp') -> 'Dfp': ... @typing.overload def newInstance(self, dfpField: 'DfpField', roundingMode: 'DfpField.RoundingMode') -> 'Dfp': ... - def nextAfter(self, dfp: 'Dfp') -> 'Dfp': ... - def positiveOrNull(self) -> bool: ... + def nextAfter(self, dfp: 'Dfp') -> 'Dfp': + """ + Returns the next number greater than this one in the direction of x. If this==x then simply returns this. + + Parameters: + x (:class:`~org.hipparchus.dfp.Dfp`): direction where to look at + + Returns: + closest number next to instance in the direction of x + + + """ + ... + def positiveOrNull(self) -> bool: + """ + Check if instance is greater than or equal to 0. + + Returns: + true if instance is not NaN and greater than or equal to 0, false otherwise + + + """ + ... @typing.overload - def pow(self, double: float) -> 'Dfp': ... + def pow(self, double: float) -> 'Dfp': + """ + Power operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.pow` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + p (double): power to apply + + Returns: + this :sup:`p` + + Integer power operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.pow` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + n (int): power to apply + + Returns: + this :sup:`n` + + Power operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.pow` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + e (:class:`~org.hipparchus.dfp.Dfp`): exponent + + Returns: + this :sup:`e` + + + """ + ... @typing.overload def pow(self, int: int) -> 'Dfp': ... @typing.overload def pow(self, dfp: 'Dfp') -> 'Dfp': ... - def power10(self, int: int) -> 'Dfp': ... - def power10K(self, int: int) -> 'Dfp': ... - def reciprocal(self) -> 'Dfp': ... + def power10(self, int: int) -> 'Dfp': + """ + Return the specified power of 10. + + Parameters: + e (int): desired power + + Returns: + 10 :sup:`e` + + + """ + ... + def power10K(self, int: int) -> 'Dfp': + """ + Get the specified power of 10000. + + Parameters: + e (int): desired power + + Returns: + 10000 :sup:`e` + + + """ + ... + def reciprocal(self) -> 'Dfp': + """ + Returns the multiplicative inverse of :code:`this` element. + + Specified by: + :meth:`~org.hipparchus.FieldElement.reciprocal` in interface :class:`~org.hipparchus.FieldElement` + + Returns: + the inverse of :code:`this`. + + + """ + ... @typing.overload - def remainder(self, double: float) -> 'Dfp': ... + def remainder(self, double: float) -> 'Dfp': + """ + Returns the IEEE remainder. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.remainder` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + d (:class:`~org.hipparchus.dfp.Dfp`): divisor + + Returns: + this less n × d, where n is the integer closest to this/d + + IEEE remainder operator. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.remainder` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + a (double): right hand side parameter of the operator + + Returns: + this - n × a where n is the closest integer to this/a + + + """ + ... @typing.overload def remainder(self, dfp: 'Dfp') -> 'Dfp': ... - def rint(self) -> 'Dfp': ... - def rootN(self, int: int) -> 'Dfp': ... - def scalb(self, int: int) -> 'Dfp': ... - def sign(self) -> 'Dfp': ... - def sin(self) -> 'Dfp': ... - def sinh(self) -> 'Dfp': ... + def rint(self) -> 'Dfp': + """ + Round to nearest integer using the round-half-even method. That is round to nearest integer unless both are equidistant. + In which case round to the even one. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.rint` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + rounded value + + + """ + ... + def rootN(self, int: int) -> 'Dfp': + """ + N :sup:`th` root. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.rootN` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + n (int): order of the root + + Returns: + n :sup:`th` root of the instance + + + """ + ... + def scalb(self, int: int) -> 'Dfp': + """ + Multiply the instance by a power of 2. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.scalb` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + n (int): power of 2 + + Returns: + this × 2 :sup:`n` + + + """ + ... + def sign(self) -> 'Dfp': + """ + Compute the sign of the instance. The sign is -1 for negative numbers, +1 for positive numbers and 0 otherwise, for + Complex number, it is extended on the unit circle (equivalent to z/|z|, with special handling for 0 and NaN) + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.sign` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + -1.0, -0.0, +0.0, +1.0 or NaN depending on sign of a + + + """ + ... + def sin(self) -> 'Dfp': + """ + Sine operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.sin` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + sin(this) + + + """ + ... + def sinh(self) -> 'Dfp': + """ + Hyperbolic sine operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.sinh` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + sinh(this) + + + """ + ... def sinhCosh(self) -> org.hipparchus.util.FieldSinhCosh['Dfp']: ... - def sqrt(self) -> 'Dfp': ... - def square(self) -> 'Dfp': ... - def strictlyNegative(self) -> bool: ... - def strictlyPositive(self) -> bool: ... + def sqrt(self) -> 'Dfp': + """ + Compute the square root. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.sqrt` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + square root of the instance + + + """ + ... + def square(self) -> 'Dfp': + """ + Compute this × this. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.square` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + a new element representing this × this + + + """ + ... + def strictlyNegative(self) -> bool: + """ + Check if instance is strictly less than 0. + + Returns: + true if instance is not NaN and less than or equal to 0, false otherwise + + + """ + ... + def strictlyPositive(self) -> bool: + """ + Check if instance is strictly greater than 0. + + Returns: + true if instance is not NaN and greater than or equal to 0, false otherwise + + + """ + ... @typing.overload - def subtract(self, double: float) -> org.hipparchus.FieldElement: ... + def subtract(self, double: float) -> org.hipparchus.FieldElement: + """ + Subtract x from this. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.subtract` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Specified by: + :meth:`~org.hipparchus.FieldElement.subtract` in interface :class:`~org.hipparchus.FieldElement` + + Parameters: + x (:class:`~org.hipparchus.dfp.Dfp`): number to subtract + + Returns: + difference of this and a + + + """ + ... @typing.overload def subtract(self, dfp: 'Dfp') -> 'Dfp': ... - def tan(self) -> 'Dfp': ... - def tanh(self) -> 'Dfp': ... - def toDegrees(self) -> 'Dfp': ... - def toDouble(self) -> float: ... - def toRadians(self) -> 'Dfp': ... - def toSplitDouble(self) -> typing.MutableSequence[float]: ... - def toString(self) -> str: ... - def ulp(self) -> 'Dfp': ... - def unequal(self, dfp: 'Dfp') -> bool: ... + def tan(self) -> 'Dfp': + """ + Tangent operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.tan` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + tan(this) + + + """ + ... + def tanh(self) -> 'Dfp': + """ + Hyperbolic tangent operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.tanh` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + tanh(this) + + + """ + ... + def toDegrees(self) -> 'Dfp': + """ + Convert radians to degrees, with error of less than 0.5 ULP + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.toDegrees` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + instance converted into degrees + + + """ + ... + def toDouble(self) -> float: + """ + Convert the instance into a double. + + Returns: + a double approximating the instance + + Also see: + + - :meth:`~org.hipparchus.dfp.Dfp.toSplitDouble` + + + + """ + ... + def toRadians(self) -> 'Dfp': + """ + Convert degrees to radians, with error of less than 0.5 ULP + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.toRadians` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + instance converted into radians + + + """ + ... + def toSplitDouble(self) -> typing.MutableSequence[float]: + """ + Convert the instance into a split double. + + Returns: + an array of two doubles which sum represent the instance + + Also see: + + - :meth:`~org.hipparchus.dfp.Dfp.toDouble` + + + + """ + ... + def toString(self) -> str: + """ + Get a string representation of the instance. + + Overrides: + :meth:`~org.hipparchus.dfp.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.toString` in + class :class:`~org.hipparchus.dfp.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Returns: + string representation of the instance + + + """ + ... + def ulp(self) -> 'Dfp': + """ + Compute least significant bit (Unit in Last Position) for a number. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.ulp` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + ulp(this) + + + """ + ... + def unequal(self, dfp: 'Dfp') -> bool: + """ + Check if instance is not equal to x. + + Parameters: + x (:class:`~org.hipparchus.dfp.Dfp`): number to check instance against + + Returns: + true if instance is not equal to x and neither are NaN, false otherwise + + + """ + ... class DfpField(org.hipparchus.Field[Dfp]): + """ + public classDfpField extends :class:`~org.hipparchus.dfp.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.Field`<:class:`~org.hipparchus.dfp.Dfp`> + + Field for Decimal floating point instances. + """ FLAG_INVALID: typing.ClassVar[int] = ... + """ + public static final int FLAG_INVALID + + IEEE 854-1987 flag for invalid operation. + + Also see: + + - :meth:`~constant` + + + + """ FLAG_DIV_ZERO: typing.ClassVar[int] = ... + """ + public static final int FLAG_DIV_ZERO + + IEEE 854-1987 flag for division by zero. + + Also see: + + - :meth:`~constant` + + + + """ FLAG_OVERFLOW: typing.ClassVar[int] = ... + """ + public static final int FLAG_OVERFLOW + + IEEE 854-1987 flag for overflow. + + Also see: + + - :meth:`~constant` + + + + """ FLAG_UNDERFLOW: typing.ClassVar[int] = ... + """ + public static final int FLAG_UNDERFLOW + + IEEE 854-1987 flag for underflow. + + Also see: + + - :meth:`~constant` + + + + """ FLAG_INEXACT: typing.ClassVar[int] = ... + """ + public static final int FLAG_INEXACT + + IEEE 854-1987 flag for inexact result. + + Also see: + + - :meth:`~constant` + + + + """ def __init__(self, int: int): ... - def clearIEEEFlags(self) -> None: ... + def clearIEEEFlags(self) -> None: + """ + Clears the IEEE 854 status flags. + + Also see: + + - :meth:`~org.hipparchus.dfp.DfpField.getIEEEFlags` + - :meth:`~org.hipparchus.dfp.DfpField.setIEEEFlags` + - :meth:`~org.hipparchus.dfp.DfpField.setIEEEFlagsBits` + - :meth:`~org.hipparchus.dfp.DfpField.FLAG_INVALID` + - :meth:`~org.hipparchus.dfp.DfpField.FLAG_DIV_ZERO` + - :meth:`~org.hipparchus.dfp.DfpField.FLAG_OVERFLOW` + - :meth:`~org.hipparchus.dfp.DfpField.FLAG_UNDERFLOW` + - :meth:`~org.hipparchus.dfp.DfpField.FLAG_INEXACT` + + + + """ + ... @staticmethod - def computeExp(dfp: Dfp, dfp2: Dfp) -> Dfp: ... + def computeExp(dfp: Dfp, dfp2: Dfp) -> Dfp: + """ + Compute exp(a). + + Parameters: + a (:class:`~org.hipparchus.dfp.Dfp`): number for which we want the exponential + one (:class:`~org.hipparchus.dfp.Dfp`): constant with value 1 at desired precision + + Returns: + exp(a) + + + """ + ... @staticmethod - def computeLn(dfp: Dfp, dfp2: Dfp, dfp3: Dfp) -> Dfp: ... - def equals(self, object: typing.Any) -> bool: ... - def getDegToRad(self) -> Dfp: ... - def getE(self) -> Dfp: ... - def getESplit(self) -> typing.MutableSequence[Dfp]: ... - def getExtendedField(self, int: int, boolean: bool) -> 'DfpField': ... - def getIEEEFlags(self) -> int: ... - def getLn10(self) -> Dfp: ... - def getLn2(self) -> Dfp: ... - def getLn2Split(self) -> typing.MutableSequence[Dfp]: ... - def getLn5(self) -> Dfp: ... - def getLn5Split(self) -> typing.MutableSequence[Dfp]: ... - def getOne(self) -> Dfp: ... - def getPi(self) -> Dfp: ... - def getPiSplit(self) -> typing.MutableSequence[Dfp]: ... - def getRadToDeg(self) -> Dfp: ... - def getRadixDigits(self) -> int: ... - def getRoundingMode(self) -> 'DfpField.RoundingMode': ... + def computeLn(dfp: Dfp, dfp2: Dfp, dfp3: Dfp) -> Dfp: + """ + Compute ln(a). Let f(x) = ln(x), We know that f'(x) = 1/x, thus from Taylor's theorem we have: ----- n+1 n f(x) = \ (-1) + (x - 1) / ---------------- for 1 <= n <= infinity ----- n or 2 3 4 (x-1) (x-1) (x-1) ln(x) = (x-1) - ----- + ------ - + ------ + ... 2 3 4 alternatively, 2 3 4 x x x ln(x+1) = x - - + - - - + ... 2 3 4 This series can be used to compute + ln(x), but it converges too slowly. If we substitute -x for x above, we get 2 3 4 x x x ln(1-x) = -x - - - - - - + ... 2 + 3 4 Note that all terms are now negative. Because the even powered ones absorbed the sign. Now, subtract the series + above from the previous one to get ln(x+1) - ln(1-x). Note the even terms cancel out leaving only the odd ones 3 5 7 2x + 2x 2x ln(x+1) - ln(x-1) = 2x + --- + --- + ---- + ... 3 5 7 By the property of logarithms that ln(a) - ln(b) = ln (a/b) + we have: 3 5 7 x+1 / x x x \ ln ----- = 2 * | x + ---- + ---- + ---- + ... | x-1 \ 3 5 7 / But now we want to find + ln(a), so we need to find the value of x such that a = (x+1)/(x-1). This is easily solved to find that x = (a-1)/(a+1). + + Parameters: + a (:class:`~org.hipparchus.dfp.Dfp`): number for which we want the exponential + one (:class:`~org.hipparchus.dfp.Dfp`): constant with value 1 at desired precision + two (:class:`~org.hipparchus.dfp.Dfp`): constant with value 2 at desired precision + + Returns: + ln(a) + + + """ + ... + def equals(self, object: typing.Any) -> bool: + """ + + Two fields are considered equals if they have the same number of radix digits and the same rounding mode. + + Overrides: + :meth:`~org.hipparchus.dfp.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.equals` in + class :class:`~org.hipparchus.dfp.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + + """ + ... + def getDegToRad(self) -> Dfp: + """ + Get the degrees to radians conversion factor. + + Returns: + a :class:`~org.hipparchus.dfp.Dfp` for degrees to radians conversion factor + + + """ + ... + def getE(self) -> Dfp: + """ + Get the constant e. + + Returns: + a :class:`~org.hipparchus.dfp.Dfp` with value e + + + """ + ... + def getESplit(self) -> typing.MutableSequence[Dfp]: + """ + Get the constant e split in two pieces. + + Returns: + a :class:`~org.hipparchus.dfp.Dfp` with value e split in two pieces + + + """ + ... + def getExtendedField(self, int: int, boolean: bool) -> 'DfpField': + """ + Get extended field for accuracy conversion. + + Parameters: + digitsFactor (int): multiplication factor for number of digits + computeConstants (boolean): if true, the transcendental constants for the given precision must be computed (setting this flag to false is RESERVED + for the internal recursive call) + + Returns: + field with extended precision + + Since: + 1.7 + + + """ + ... + def getIEEEFlags(self) -> int: + """ + Get the IEEE 854 status flags. + + Returns: + IEEE 854 status flags + + Also see: + + - :meth:`~org.hipparchus.dfp.DfpField.clearIEEEFlags` + - :meth:`~org.hipparchus.dfp.DfpField.setIEEEFlags` + - :meth:`~org.hipparchus.dfp.DfpField.setIEEEFlagsBits` + - :meth:`~org.hipparchus.dfp.DfpField.FLAG_INVALID` + - :meth:`~org.hipparchus.dfp.DfpField.FLAG_DIV_ZERO` + - :meth:`~org.hipparchus.dfp.DfpField.FLAG_OVERFLOW` + - :meth:`~org.hipparchus.dfp.DfpField.FLAG_UNDERFLOW` + - :meth:`~org.hipparchus.dfp.DfpField.FLAG_INEXACT` + + + + """ + ... + def getLn10(self) -> Dfp: + """ + Get the constant ln(10). + + Returns: + a :class:`~org.hipparchus.dfp.Dfp` with value ln(10) + + + """ + ... + def getLn2(self) -> Dfp: + """ + Get the constant ln(2). + + Returns: + a :class:`~org.hipparchus.dfp.Dfp` with value ln(2) + + + """ + ... + def getLn2Split(self) -> typing.MutableSequence[Dfp]: + """ + Get the constant ln(2) split in two pieces. + + Returns: + a :class:`~org.hipparchus.dfp.Dfp` with value ln(2) split in two pieces + + + """ + ... + def getLn5(self) -> Dfp: + """ + Get the constant ln(5). + + Returns: + a :class:`~org.hipparchus.dfp.Dfp` with value ln(5) + + + """ + ... + def getLn5Split(self) -> typing.MutableSequence[Dfp]: + """ + Get the constant ln(5) split in two pieces. + + Returns: + a :class:`~org.hipparchus.dfp.Dfp` with value ln(5) split in two pieces + + + """ + ... + def getOne(self) -> Dfp: + """ + Get the constant 1. + + Specified by: + :meth:`~org.hipparchus.Field.getOne` in interface :class:`~org.hipparchus.Field` + + Returns: + a :class:`~org.hipparchus.dfp.Dfp` with value 1 + + + """ + ... + def getPi(self) -> Dfp: + """ + Get the constant Ï€. + + Returns: + a :class:`~org.hipparchus.dfp.Dfp` with value Ï€ + + + """ + ... + def getPiSplit(self) -> typing.MutableSequence[Dfp]: + """ + Get the constant Ï€ split in two pieces. + + Returns: + a :class:`~org.hipparchus.dfp.Dfp` with value Ï€ split in two pieces + + + """ + ... + def getRadToDeg(self) -> Dfp: + """ + Get the radians to degrees conversion factor. + + Returns: + a :class:`~org.hipparchus.dfp.Dfp` for radians to degrees conversion factor + + + """ + ... + def getRadixDigits(self) -> int: + """ + Get the number of radix digits of the :class:`~org.hipparchus.dfp.Dfp` instances built by this factory. + + Returns: + number of radix digits + + + """ + ... + def getRoundingMode(self) -> 'DfpField.RoundingMode': + """ + Get the current rounding mode. + + Returns: + current rounding mode + + + """ + ... def getRuntimeClass(self) -> typing.Type[Dfp]: ... - def getSqr2(self) -> Dfp: ... - def getSqr2Reciprocal(self) -> Dfp: ... - def getSqr2Split(self) -> typing.MutableSequence[Dfp]: ... - def getSqr3(self) -> Dfp: ... - def getSqr3Reciprocal(self) -> Dfp: ... - def getTwo(self) -> Dfp: ... - def getZero(self) -> Dfp: ... - def hashCode(self) -> int: ... + def getSqr2(self) -> Dfp: + """ + Get the constant √2. + + Returns: + a :class:`~org.hipparchus.dfp.Dfp` with value √2 + + + """ + ... + def getSqr2Reciprocal(self) -> Dfp: + """ + Get the constant √2 / 2. + + Returns: + a :class:`~org.hipparchus.dfp.Dfp` with value √2 / 2 + + + """ + ... + def getSqr2Split(self) -> typing.MutableSequence[Dfp]: + """ + Get the constant √2 split in two pieces. + + Returns: + a :class:`~org.hipparchus.dfp.Dfp` with value √2 split in two pieces + + + """ + ... + def getSqr3(self) -> Dfp: + """ + Get the constant √3. + + Returns: + a :class:`~org.hipparchus.dfp.Dfp` with value √3 + + + """ + ... + def getSqr3Reciprocal(self) -> Dfp: + """ + Get the constant √3 / 3. + + Returns: + a :class:`~org.hipparchus.dfp.Dfp` with value √3 / 3 + + + """ + ... + def getTwo(self) -> Dfp: + """ + Get the constant 2. + + Returns: + a :class:`~org.hipparchus.dfp.Dfp` with value 2 + + + """ + ... + def getZero(self) -> Dfp: + """ + Get the constant 0. + + Specified by: + :meth:`~org.hipparchus.Field.getZero` in interface :class:`~org.hipparchus.Field` + + Returns: + a :class:`~org.hipparchus.dfp.Dfp` with value 0 + + + """ + ... + def hashCode(self) -> int: + """ + + Overrides: + :meth:`~org.hipparchus.dfp.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.hashCode` in + class :class:`~org.hipparchus.dfp.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + + """ + ... @typing.overload - def newDfp(self) -> Dfp: ... + def newDfp(self) -> Dfp: + """ + Makes a :class:`~org.hipparchus.dfp.Dfp` with a value of 0. + + Returns: + a new :class:`~org.hipparchus.dfp.Dfp` with a value of 0 + + """ + ... @typing.overload - def newDfp(self, byte: int) -> Dfp: ... + def newDfp(self, byte: int) -> Dfp: + """ + Create an instance from a byte value. + + Parameters: + x (byte): value to convert to an instance + + Returns: + a new :class:`~org.hipparchus.dfp.Dfp` with the same value as x + + Create an instance from an int value. + + Parameters: + x (int): value to convert to an instance + + Returns: + a new :class:`~org.hipparchus.dfp.Dfp` with the same value as x + + Create an instance from a long value. + + Parameters: + x (long): value to convert to an instance + + Returns: + a new :class:`~org.hipparchus.dfp.Dfp` with the same value as x + + Create an instance from a double value. + + Parameters: + x (double): value to convert to an instance + + Returns: + a new :class:`~org.hipparchus.dfp.Dfp` with the same value as x + + Copy constructor. + + Parameters: + d (:class:`~org.hipparchus.dfp.Dfp`): instance to copy + + Returns: + a new :class:`~org.hipparchus.dfp.Dfp` with the same value as d + + Create a :class:`~org.hipparchus.dfp.Dfp` given a String representation. + + Parameters: + s (:class:`~org.hipparchus.dfp.https:.docs.oracle.com.javase.8.docs.api.java.lang.String`): string representation of the instance + + Returns: + a new :class:`~org.hipparchus.dfp.Dfp` parsed from specified string + + Creates a :class:`~org.hipparchus.dfp.Dfp` with a non-finite value. + + Parameters: + sign (byte): sign of the Dfp to create + nans (byte): code of the value, must be one of :meth:`~org.hipparchus.dfp.Dfp.INFINITE`, :meth:`~org.hipparchus.dfp.Dfp.SNAN`, + :meth:`~org.hipparchus.dfp.Dfp.QNAN` + + Returns: + a new :class:`~org.hipparchus.dfp.Dfp` with a non-finite value + + + """ + ... @typing.overload def newDfp(self, byte: int, byte2: int) -> Dfp: ... @typing.overload @@ -213,9 +1998,64 @@ class DfpField(org.hipparchus.Field[Dfp]): def newDfp(self, long: int) -> Dfp: ... @typing.overload def newDfp(self, dfp: Dfp) -> Dfp: ... - def setIEEEFlags(self, int: int) -> None: ... - def setIEEEFlagsBits(self, int: int) -> None: ... - def setRoundingMode(self, roundingMode: 'DfpField.RoundingMode') -> None: ... + def setIEEEFlags(self, int: int) -> None: + """ + Sets the IEEE 854 status flags. + + Parameters: + flags (int): desired value for the flags + + Also see: + + - :meth:`~org.hipparchus.dfp.DfpField.getIEEEFlags` + - :meth:`~org.hipparchus.dfp.DfpField.clearIEEEFlags` + - :meth:`~org.hipparchus.dfp.DfpField.setIEEEFlagsBits` + - :meth:`~org.hipparchus.dfp.DfpField.FLAG_INVALID` + - :meth:`~org.hipparchus.dfp.DfpField.FLAG_DIV_ZERO` + - :meth:`~org.hipparchus.dfp.DfpField.FLAG_OVERFLOW` + - :meth:`~org.hipparchus.dfp.DfpField.FLAG_UNDERFLOW` + - :meth:`~org.hipparchus.dfp.DfpField.FLAG_INEXACT` + + + + """ + ... + def setIEEEFlagsBits(self, int: int) -> None: + """ + Sets some bits in the IEEE 854 status flags, without changing the already set bits. + + Calling this method is equivalent to call :code:`setIEEEFlags(getIEEEFlags() | bits)` + + Parameters: + bits (int): bits to set + + Also see: + + - :meth:`~org.hipparchus.dfp.DfpField.getIEEEFlags` + - :meth:`~org.hipparchus.dfp.DfpField.clearIEEEFlags` + - :meth:`~org.hipparchus.dfp.DfpField.setIEEEFlags` + - :meth:`~org.hipparchus.dfp.DfpField.FLAG_INVALID` + - :meth:`~org.hipparchus.dfp.DfpField.FLAG_DIV_ZERO` + - :meth:`~org.hipparchus.dfp.DfpField.FLAG_OVERFLOW` + - :meth:`~org.hipparchus.dfp.DfpField.FLAG_UNDERFLOW` + - :meth:`~org.hipparchus.dfp.DfpField.FLAG_INEXACT` + + + + """ + ... + def setRoundingMode(self, roundingMode: 'DfpField.RoundingMode') -> None: + """ + Set the rounding mode. If not set, the default value is + :meth:`~org.hipparchus.dfp.DfpField.RoundingMode.ROUND_HALF_EVEN`. + + Parameters: + mode (:class:`~org.hipparchus.dfp.DfpField.RoundingMode`): desired rounding mode Note that the rounding mode is common to all :class:`~org.hipparchus.dfp.Dfp` instances belonging + to the current :class:`~org.hipparchus.dfp.DfpField` in the system and will affect all future calculations. + + + """ + ... class RoundingMode(java.lang.Enum['DfpField.RoundingMode']): ROUND_DOWN: typing.ClassVar['DfpField.RoundingMode'] = ... ROUND_UP: typing.ClassVar['DfpField.RoundingMode'] = ... @@ -236,37 +2076,308 @@ class DfpField(org.hipparchus.Field[Dfp]): def values() -> typing.MutableSequence['DfpField.RoundingMode']: ... class DfpMath: + """ + public classDfpMath extends :class:`~org.hipparchus.dfp.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Mathematical routines for use with :class:`~org.hipparchus.dfp.Dfp`. The constants are defined in + :class:`~org.hipparchus.dfp.DfpField` + """ @staticmethod - def acos(dfp: Dfp) -> Dfp: ... + def acos(dfp: Dfp) -> Dfp: + """ + computes the arc-cosine of the argument. + + Parameters: + a (:class:`~org.hipparchus.dfp.Dfp`): number from which arc-cosine is desired + + Returns: + acos(a) + + + """ + ... @staticmethod - def asin(dfp: Dfp) -> Dfp: ... + def asin(dfp: Dfp) -> Dfp: + """ + computes the arc-sine of the argument. + + Parameters: + a (:class:`~org.hipparchus.dfp.Dfp`): number from which arc-sine is desired + + Returns: + asin(a) + + + """ + ... @staticmethod - def atan(dfp: Dfp) -> Dfp: ... + def atan(dfp: Dfp) -> Dfp: + """ + computes the arc tangent of the argument Uses the typical taylor series but may reduce arguments using the following + identity tan(x+y) = (tan(x) + tan(y)) / (1 - tan(x)*tan(y)) since tan(PI/8) = sqrt(2)-1, atan(x) = atan( (x - sqrt(2) + + 1) / (1+x*sqrt(2) - x) + PI/8.0 + + Parameters: + a (:class:`~org.hipparchus.dfp.Dfp`): number from which arc-tangent is desired + + Returns: + atan(a) + + + """ + ... @staticmethod - def cos(dfp: Dfp) -> Dfp: ... + def cos(dfp: Dfp) -> Dfp: + """ + computes the cosine of the argument. + + Parameters: + a (:class:`~org.hipparchus.dfp.Dfp`): number from which cosine is desired + + Returns: + cos(a) + + + """ + ... @staticmethod - def exp(dfp: Dfp) -> Dfp: ... + def exp(dfp: Dfp) -> Dfp: + """ + Computes e to the given power. a is broken into two parts, such that a = n+m where n is an integer. We use pow() to + compute e :sup:`n` and a Taylor series to compute e :sup:`m` . We return e* :sup:`n` × e :sup:`m` + + Parameters: + a (:class:`~org.hipparchus.dfp.Dfp`): power at which e should be raised + + Returns: + e :sup:`a` + + + """ + ... @staticmethod - def log(dfp: Dfp) -> Dfp: ... + def log(dfp: Dfp) -> Dfp: + """ + Returns the natural logarithm of a. a is first split into three parts such that a = (10000^h)(2^j)k. ln(a) is computed + by ln(a) = ln(5)*h + ln(2)*(h+j) + ln(k) k is in the range 2/3 < k < 4/3 and is passed on to a series expansion. + + Parameters: + a (:class:`~org.hipparchus.dfp.Dfp`): number from which logarithm is requested + + Returns: + log(a) + + + """ + ... @typing.overload @staticmethod - def pow(dfp: Dfp, int: int) -> Dfp: ... + def pow(dfp: Dfp, int: int) -> Dfp: + """ + Raises base to the power a by successive squaring. + + Parameters: + base (:class:`~org.hipparchus.dfp.Dfp`): number to raise + a (int): power + + Returns: + base :sup:`a` + + Computes x to the y power. + + Uses the following method: + + 1. Set u = rint(y), v = y-u + 2. Compute a = v * ln(x) + 3. Compute b = rint( a/ln(2) ) + 4. Compute c = a - b*ln(2) + 5. x :sup:`y` = x :sup:`u` * 2 :sup:`b` * e :sup:`c` + + if |y| > 1e8, then we compute by exp(y*ln(x)) + + Special Cases + + - if y is 0.0 or -0.0 then result is 1.0 + - if y is 1.0 then result is x + - if y is NaN then result is NaN + - if x is NaN and y is not zero then result is NaN + - if |x| > 1.0 and y is +Infinity then result is +Infinity + - if |x| < 1.0 and y is -Infinity then result is +Infinity + - if |x| > 1.0 and y is -Infinity then result is +0 + - if |x| < 1.0 and y is +Infinity then result is +0 + - if |x| = 1.0 and y is +/-Infinity then result is NaN + - if x = +0 and y > 0 then result is +0 + - if x = +Inf and y < 0 then result is +0 + - if x = +0 and y < 0 then result is +Inf + - if x = +Inf and y > 0 then result is +Inf + - if x = -0 and y > 0, finite, not odd integer then result is +0 + - if x = -0 and y < 0, finite, and odd integer then result is -Inf + - if x = -Inf and y > 0, finite, and odd integer then result is -Inf + - if x = -0 and y < 0, not finite odd integer then result is +Inf + - if x = -Inf and y > 0, not finite odd integer then result is +Inf + - if x < 0 and y > 0, finite, and odd integer then result is -(|x| :sup:`y` ) + - if x < 0 and y > 0, finite, and not integer then result is NaN + + + Parameters: + x (:class:`~org.hipparchus.dfp.Dfp`): base to be raised + y (:class:`~org.hipparchus.dfp.Dfp`): power to which base should be raised + + Returns: + x :sup:`y` + + + """ + ... @typing.overload @staticmethod def pow(dfp: Dfp, dfp2: Dfp) -> Dfp: ... @staticmethod - def sin(dfp: Dfp) -> Dfp: ... + def sin(dfp: Dfp) -> Dfp: + """ + computes the sine of the argument. + + Parameters: + a (:class:`~org.hipparchus.dfp.Dfp`): number from which sine is desired + + Returns: + sin(a) + + + """ + ... @staticmethod - def tan(dfp: Dfp) -> Dfp: ... + def tan(dfp: Dfp) -> Dfp: + """ + computes the tangent of the argument. + + Parameters: + a (:class:`~org.hipparchus.dfp.Dfp`): number from which tangent is desired + + Returns: + tan(a) + + + """ + ... class DfpDec(Dfp): + """ + public classDfpDec extends :class:`~org.hipparchus.dfp.Dfp` + + Subclass of :class:`~org.hipparchus.dfp.Dfp` which hides the radix-10000 artifacts of the superclass. This should give + outward appearances of being a decimal number with DIGITS*4-3 decimal digits. This class can be subclassed to appear to + be an arbitrary number of decimal digits less than DIGITS*4-3. + """ def __init__(self, dfp: Dfp): ... @typing.overload - def newInstance(self, dfpField: DfpField, roundingMode: DfpField.RoundingMode) -> Dfp: ... + def newInstance(self, dfpField: DfpField, roundingMode: DfpField.RoundingMode) -> Dfp: + """ + Creates an instance with a non-finite value. + + Overrides: + :meth:`~org.hipparchus.dfp.Dfp.newInstance` in class :class:`~org.hipparchus.dfp.Dfp` + + Parameters: + sign (byte): sign of the Dfp to create + nans (byte): code of the value, must be one of :meth:`~org.hipparchus.dfp.Dfp.INFINITE`, :meth:`~org.hipparchus.dfp.Dfp.SNAN`, + :meth:`~org.hipparchus.dfp.Dfp.QNAN` + + Returns: + a new instance with a non-finite value + + + """ + ... @typing.overload - def newInstance(self) -> Dfp: ... + def newInstance(self) -> Dfp: + """ + Create an instance with a value of 0. Use this internally in preference to constructors to facilitate subclasses + + Overrides: + :meth:`~org.hipparchus.dfp.Dfp.newInstance` in class :class:`~org.hipparchus.dfp.Dfp` + + Returns: + a new instance with a value of 0 + + """ + ... @typing.overload - def newInstance(self, byte: int) -> Dfp: ... + def newInstance(self, byte: int) -> Dfp: + """ + Create an instance from a byte value. + + Overrides: + :meth:`~org.hipparchus.dfp.Dfp.newInstance` in class :class:`~org.hipparchus.dfp.Dfp` + + Parameters: + x (byte): value to convert to an instance + + Returns: + a new instance with value x + + Create an instance from an int value. + + Overrides: + :meth:`~org.hipparchus.dfp.Dfp.newInstance` in class :class:`~org.hipparchus.dfp.Dfp` + + Parameters: + x (int): value to convert to an instance + + Returns: + a new instance with value x + + Create an instance from a long value. + + Overrides: + :meth:`~org.hipparchus.dfp.Dfp.newInstance` in class :class:`~org.hipparchus.dfp.Dfp` + + Parameters: + x (long): value to convert to an instance + + Returns: + a new instance with value x + + Create an instance corresponding to a constant real value. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.newInstance` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Overrides: + :meth:`~org.hipparchus.dfp.Dfp.newInstance` in class :class:`~org.hipparchus.dfp.Dfp` + + Parameters: + x (double): constant real value + + Returns: + instance corresponding to a constant real value + + Create an instance by copying an existing one. Use this internally in preference to constructors to facilitate + subclasses. + + Overrides: + :meth:`~org.hipparchus.dfp.Dfp.newInstance` in class :class:`~org.hipparchus.dfp.Dfp` + + Parameters: + d (:class:`~org.hipparchus.dfp.Dfp`): instance to copy + + Returns: + a new instance with the same value as d + + Create an instance from a String representation. Use this internally in preference to constructors to facilitate + subclasses. + + Overrides: + :meth:`~org.hipparchus.dfp.Dfp.newInstance` in class :class:`~org.hipparchus.dfp.Dfp` + + Parameters: + s (:class:`~org.hipparchus.dfp.https:.docs.oracle.com.javase.8.docs.api.java.lang.String`): string representation of the instance + + Returns: + a new instance parsed from specified string + + """ + ... @typing.overload def newInstance(self, byte: int, byte2: int) -> Dfp: ... @typing.overload @@ -279,7 +2390,22 @@ class DfpDec(Dfp): def newInstance(self, long: int) -> Dfp: ... @typing.overload def newInstance(self, dfp: Dfp) -> Dfp: ... - def nextAfter(self, dfp: Dfp) -> Dfp: ... + def nextAfter(self, dfp: Dfp) -> Dfp: + """ + Returns the next number greater than this one in the direction of x. If this==x then simply returns this. + + Overrides: + :meth:`~org.hipparchus.dfp.Dfp.nextAfter` in class :class:`~org.hipparchus.dfp.Dfp` + + Parameters: + x (:class:`~org.hipparchus.dfp.Dfp`): direction where to look at + + Returns: + closest number next to instance in the direction of x + + + """ + ... class __module_protocol__(Protocol): diff --git a/org-stubs/hipparchus/distribution/__init__.pyi b/org-stubs/hipparchus/distribution/__init__.pyi index 640ac82..75a6159 100644 --- a/org-stubs/hipparchus/distribution/__init__.pyi +++ b/org-stubs/hipparchus/distribution/__init__.pyi @@ -18,45 +18,390 @@ import typing _EnumeratedDistribution__T = typing.TypeVar('_EnumeratedDistribution__T') # <T> class EnumeratedDistribution(java.io.Serializable, typing.Generic[_EnumeratedDistribution__T]): + """ + public classEnumeratedDistribution<T> extends :class:`~org.hipparchus.distribution.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.distribution.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + A generic implementation of a ` discrete probability distribution (Wikipedia) + <http://en.wikipedia.org/wiki/Probability_distribution#Discrete_probability_distribution>` over a finite sample space, + based on an enumerated list of <value, probability> pairs. + + Input probabilities must all be non-negative, but zero values are allowed and their sum does not have to equal one. + Constructors will normalize input probabilities to make them sum to one. + + The list of <value, probability> pairs does not, strictly speaking, have to be a function and it can contain null + values. The pmf created by the constructor will combine probabilities of equal values and will treat null values as + equal. + + For example, if the list of pairs <"dog", 0.2>, <null, 0.1>, <"pig", 0.2>, <"dog", 0.1>, <null, 0.4> is provided to the + constructor, the resulting pmf will assign mass of 0.5 to null, 0.3 to "dog" and 0.2 to null. + + Also see: + + - :meth:`~serialized` + """ def __init__(self, list: java.util.List[org.hipparchus.util.Pair[_EnumeratedDistribution__T, float]]): ... @staticmethod - def checkAndNormalize(doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> typing.MutableSequence[float]: ... + def checkAndNormalize(doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> typing.MutableSequence[float]: + """ + Checks to make sure that weights is neither null nor empty and contains only non-negative, finite, non-NaN values and if + necessary normalizes it to sum to 1. + + Parameters: + weights (double[]): input array to be used as the basis for the values of a PMF + + Returns: + a possibly rescaled copy of the array that sums to 1 and contains only valid probability values + + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: of weights is null or empty or includes negative, NaN or infinite values or only 0's + + + """ + ... def getPmf(self) -> java.util.List[org.hipparchus.util.Pair[_EnumeratedDistribution__T, float]]: ... - def probability(self, t: _EnumeratedDistribution__T) -> float: ... + def probability(self, t: _EnumeratedDistribution__T) -> float: + """ + For a random variable :code:`X` whose values are distributed according to this distribution, this method returns + :code:`P(X = x)`. In other words, this method represents the probability mass function (PMF) for the distribution. + + Note that if :code:`x1` and :code:`x2` satisfy :code:`x1.equals(x2)`, or both are null, then :code:`probability(x1) = + probability(x2)`. + + Parameters: + x (:class:`~org.hipparchus.distribution.EnumeratedDistribution`): the point at which the PMF is evaluated + + Returns: + the value of the probability mass function at :code:`x` + + + """ + ... class IntegerDistribution: - def cumulativeProbability(self, int: int) -> float: ... - def getNumericalMean(self) -> float: ... - def getNumericalVariance(self) -> float: ... - def getSupportLowerBound(self) -> int: ... - def getSupportUpperBound(self) -> int: ... + """ + public interfaceIntegerDistribution + + Interface for discrete distributions. + """ + def cumulativeProbability(self, int: int) -> float: + """ + For a random variable :code:`X` whose values are distributed according to this distribution, this method returns + :code:`P(X <= x)`. In other words, this method represents the (cumulative) distribution function (CDF) for this + distribution. + + Parameters: + x (int): the point at which the CDF is evaluated + + Returns: + the probability that a random variable with this distribution takes a value less than or equal to :code:`x` + + + """ + ... + def getNumericalMean(self) -> float: + """ + Use this method to get the numerical value of the mean of this distribution. + + Returns: + the mean or :code:`Double.NaN` if it is not defined + + + """ + ... + def getNumericalVariance(self) -> float: + """ + Use this method to get the numerical value of the variance of this distribution. + + Returns: + the variance (possibly :code:`Double.POSITIVE_INFINITY` or :code:`Double.NaN` if it is not defined) + + + """ + ... + def getSupportLowerBound(self) -> int: + """ + Access the lower bound of the support. This method must return the same value as + :code:`inverseCumulativeProbability(0)`. In other words, this method must return + + :code:`inf {x in Z | P(X <= x) > 0}`. + + Returns: + lower bound of the support (:code:`Integer.MIN_VALUE` for negative infinity) + + + """ + ... + def getSupportUpperBound(self) -> int: + """ + Access the upper bound of the support. This method must return the same value as + :code:`inverseCumulativeProbability(1)`. In other words, this method must return + + :code:`inf {x in R | P(X <= x) = 1}`. + + Returns: + upper bound of the support (:code:`Integer.MAX_VALUE` for positive infinity) + + + """ + ... def inverseCumulativeProbability(self, double: float) -> int: ... - def isSupportConnected(self) -> bool: ... - def logProbability(self, int: int) -> float: ... + def isSupportConnected(self) -> bool: + """ + Use this method to get information about whether the support is connected, i.e. whether all integers between the lower + and upper bound of the support are included in the support. + + Returns: + whether the support is connected or not + + + """ + ... + def logProbability(self, int: int) -> float: + """ + For a random variable :code:`X` whose values are distributed according to this distribution, this method returns + :code:`log(P(X = x))`, where :code:`log` is the natural logarithm. In other words, this method represents the logarithm + of the probability mass function (PMF) for the distribution. Note that due to the floating point precision and + under/overflow issues, this method will for some distributions be more precise and faster than computing the logarithm + of :meth:`~org.hipparchus.distribution.IntegerDistribution.probability`. + + Parameters: + x (int): the point at which the PMF is evaluated + + Returns: + the logarithm of the value of the probability mass function at :code:`x` + + + """ + ... @typing.overload - def probability(self, int: int) -> float: ... + def probability(self, int: int) -> float: + """ + For a random variable :code:`X` whose values are distributed according to this distribution, this method returns + :code:`P(X = x)`. In other words, this method represents the probability mass function (PMF) for the distribution. + + Parameters: + x (int): the point at which the PMF is evaluated + + Returns: + the value of the probability mass function at :code:`x` + + double probability(int x0, int x1) throws :class:`~org.hipparchus.exception.MathIllegalArgumentException` + + For a random variable :code:`X` whose values are distributed according to this distribution, this method returns + :code:`P(x0 < X <= x1)`. + + Parameters: + x0 (int): the exclusive lower bound + x1 (int): the inclusive upper bound + + Returns: + the probability that a random variable with this distribution will take a value between :code:`x0` and :code:`x1`, + excluding the lower and including the upper endpoint + + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if :code:`x0 > x1` + + + """ + ... @typing.overload def probability(self, int: int, int2: int) -> float: ... class MultivariateRealDistribution: - def density(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> float: ... - def getDimension(self) -> int: ... - def reseedRandomGenerator(self, long: int) -> None: ... + """ + public interfaceMultivariateRealDistribution + + Base interface for multivariate continuous distributions. + + This is based largely on the RealDistribution interface, but cumulative distribution functions are not required because + they are often quite difficult to compute for multivariate distributions. + """ + def density(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> float: + """ + Returns the probability density function (PDF) of this distribution evaluated at the specified point :code:`x`. In + general, the PDF is the derivative of the cumulative distribution function. If the derivative does not exist at + :code:`x`, then an appropriate replacement should be returned, e.g. :code:`Double.POSITIVE_INFINITY`, + :code:`Double.NaN`, or the limit inferior or limit superior of the difference quotient. + + Parameters: + x (double[]): Point at which the PDF is evaluated. + + Returns: + the value of the probability density function at point :code:`x`. + + + """ + ... + def getDimension(self) -> int: + """ + Gets the number of random variables of the distribution. It is the size of the array returned by the + :meth:`~org.hipparchus.distribution.MultivariateRealDistribution.sample` method. + + Returns: + the number of variables. + + + """ + ... + def reseedRandomGenerator(self, long: int) -> None: + """ + Reseeds the random generator used to generate samples. + + Parameters: + seed (long): Seed with which to initialize the random number generator. + + + """ + ... @typing.overload - def sample(self) -> typing.MutableSequence[float]: ... + def sample(self) -> typing.MutableSequence[float]: + """ + Generates a random value vector sampled from this distribution. + + Returns: + a random value vector. + + double[][] sample(int sampleSize) throws :class:`~org.hipparchus.exception.MathIllegalArgumentException` + + Generates a list of a random value vectors from the distribution. + + Parameters: + sampleSize (int): the number of random vectors to generate. + + Returns: + an array representing the random samples. + + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if :code:`sampleSize` is not positive. + + Also see: + + - :meth:`~org.hipparchus.distribution.MultivariateRealDistribution.sample` + + + + """ + ... @typing.overload def sample(self, int: int) -> typing.MutableSequence[typing.MutableSequence[float]]: ... class RealDistribution: - def cumulativeProbability(self, double: float) -> float: ... - def density(self, double: float) -> float: ... - def getNumericalMean(self) -> float: ... - def getNumericalVariance(self) -> float: ... - def getSupportLowerBound(self) -> float: ... - def getSupportUpperBound(self) -> float: ... + """ + public interfaceRealDistribution + + Base interface for continuous distributions. + """ + def cumulativeProbability(self, double: float) -> float: + """ + For a random variable :code:`X` whose values are distributed according to this distribution, this method returns + :code:`P(X <= x)`. In other words, this method represents the (cumulative) distribution function (CDF) for this + distribution. + + Parameters: + x (double): the point at which the CDF is evaluated + + Returns: + the probability that a random variable with this distribution takes a value less than or equal to :code:`x` + + + """ + ... + def density(self, double: float) -> float: + """ + Returns the probability density function (PDF) of this distribution evaluated at the specified point :code:`x`. In + general, the PDF is the derivative of the :meth:`~org.hipparchus.distribution.RealDistribution.cumulativeProbability`. + If the derivative does not exist at :code:`x`, then an appropriate replacement should be returned, e.g. + :code:`Double.POSITIVE_INFINITY`, :code:`Double.NaN`, or the limit inferior or limit superior of the difference + quotient. + + Parameters: + x (double): the point at which the PDF is evaluated + + Returns: + the value of the probability density function at point :code:`x` + + + """ + ... + def getNumericalMean(self) -> float: + """ + Use this method to get the numerical value of the mean of this distribution. + + Returns: + the mean or :code:`Double.NaN` if it is not defined + + + """ + ... + def getNumericalVariance(self) -> float: + """ + Use this method to get the numerical value of the variance of this distribution. + + Returns: + the variance (possibly :code:`Double.POSITIVE_INFINITY` as for certain cases in + :class:`~org.hipparchus.distribution.continuous.TDistribution`) or :code:`Double.NaN` if it is not defined + + + """ + ... + def getSupportLowerBound(self) -> float: + """ + Access the lower bound of the support. This method must return the same value as + :code:`inverseCumulativeProbability(0)`. In other words, this method must return + + :code:`inf {x in R | P(X <= x) > 0}`. + + Returns: + lower bound of the support (might be :code:`Double.NEGATIVE_INFINITY`) + + + """ + ... + def getSupportUpperBound(self) -> float: + """ + Access the upper bound of the support. This method must return the same value as + :code:`inverseCumulativeProbability(1)`. In other words, this method must return + + :code:`inf {x in R | P(X <= x) = 1}`. + + Returns: + upper bound of the support (might be :code:`Double.POSITIVE_INFINITY`) + + + """ + ... def inverseCumulativeProbability(self, double: float) -> float: ... - def isSupportConnected(self) -> bool: ... - def logDensity(self, double: float) -> float: ... + def isSupportConnected(self) -> bool: + """ + Use this method to get information about whether the support is connected, i.e. whether all values between the lower and + upper bound of the support are included in the support. + + Returns: + whether the support is connected or not + + + """ + ... + def logDensity(self, double: float) -> float: + """ + Returns the natural logarithm of the probability density function (PDF) of this distribution evaluated at the specified + point :code:`x`. In general, the PDF is the derivative of the + :meth:`~org.hipparchus.distribution.RealDistribution.cumulativeProbability`. If the derivative does not exist at + :code:`x`, then an appropriate replacement should be returned, e.g. :code:`Double.POSITIVE_INFINITY`, + :code:`Double.NaN`, or the limit inferior or limit superior of the difference quotient. Note that due to the floating + point precision and under/overflow issues, this method will for some distributions be more precise and faster than + computing the logarithm of :meth:`~org.hipparchus.distribution.RealDistribution.density`. + + Parameters: + x (double): the point at which the PDF is evaluated + + Returns: + the logarithm of the value of the probability density function at point :code:`x` + + + """ + ... def probability(self, double: float, double2: float) -> float: ... diff --git a/org-stubs/hipparchus/distribution/continuous/__init__.pyi b/org-stubs/hipparchus/distribution/continuous/__init__.pyi index a7965c6..5efef40 100644 --- a/org-stubs/hipparchus/distribution/continuous/__init__.pyi +++ b/org-stubs/hipparchus/distribution/continuous/__init__.pyi @@ -15,309 +15,3011 @@ import typing class AbstractRealDistribution(org.hipparchus.distribution.RealDistribution, java.io.Serializable): + """ + public abstract classAbstractRealDistribution extends :class:`~org.hipparchus.distribution.continuous.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.distribution.RealDistribution`, :class:`~org.hipparchus.distribution.continuous.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + Base class for probability distributions on the reals. + + Default implementations are provided for some of the methods that do not vary from distribution to distribution. + + Also see: + + - :meth:`~serialized` + """ def inverseCumulativeProbability(self, double: float) -> float: ... - def logDensity(self, double: float) -> float: ... + def logDensity(self, double: float) -> float: + """ + Returns the natural logarithm of the probability density function (PDF) of this distribution evaluated at the specified + point :code:`x`. In general, the PDF is the derivative of the + :meth:`~org.hipparchus.distribution.RealDistribution.cumulativeProbability`. If the derivative does not exist at + :code:`x`, then an appropriate replacement should be returned, e.g. :code:`Double.POSITIVE_INFINITY`, + :code:`Double.NaN`, or the limit inferior or limit superior of the difference quotient. Note that due to the floating + point precision and under/overflow issues, this method will for some distributions be more precise and faster than + computing the logarithm of :meth:`~org.hipparchus.distribution.RealDistribution.density`. + + The default implementation simply computes the logarithm of :code:`density(x)`. + + Specified by: + :meth:`~org.hipparchus.distribution.RealDistribution.logDensity` in + interface :class:`~org.hipparchus.distribution.RealDistribution` + + Parameters: + x (double): the point at which the PDF is evaluated + + Returns: + the logarithm of the value of the probability density function at point :code:`x` + + + """ + ... def probability(self, double: float, double2: float) -> float: ... class BetaDistribution(AbstractRealDistribution): + """ + public classBetaDistribution extends :class:`~org.hipparchus.distribution.continuous.AbstractRealDistribution` + + Implements the Beta distribution. + + Also see: + + - `Beta distribution <http://en.wikipedia.org/wiki/Beta_distribution>` + - :meth:`~serialized` + """ @typing.overload def __init__(self, double: float, double2: float): ... @typing.overload def __init__(self, double: float, double2: float, double3: float): ... - def cumulativeProbability(self, double: float) -> float: ... - def density(self, double: float) -> float: ... - def getAlpha(self) -> float: ... - def getBeta(self) -> float: ... - def getNumericalMean(self) -> float: ... - def getNumericalVariance(self) -> float: ... - def getSupportLowerBound(self) -> float: ... - def getSupportUpperBound(self) -> float: ... - def isSupportConnected(self) -> bool: ... - def logDensity(self, double: float) -> float: ... + def cumulativeProbability(self, double: float) -> float: + """ + For a random variable :code:`X` whose values are distributed according to this distribution, this method returns + :code:`P(X <= x)`. In other words, this method represents the (cumulative) distribution function (CDF) for this + distribution. + + Parameters: + x (double): the point at which the CDF is evaluated + + Returns: + the probability that a random variable with this distribution takes a value less than or equal to :code:`x` + + + """ + ... + def density(self, double: float) -> float: + """ + Returns the probability density function (PDF) of this distribution evaluated at the specified point :code:`x`. In + general, the PDF is the derivative of the :meth:`~org.hipparchus.distribution.RealDistribution.cumulativeProbability`. + If the derivative does not exist at :code:`x`, then an appropriate replacement should be returned, e.g. + :code:`Double.POSITIVE_INFINITY`, :code:`Double.NaN`, or the limit inferior or limit superior of the difference + quotient. + + Parameters: + x (double): the point at which the PDF is evaluated + + Returns: + the value of the probability density function at point :code:`x` + + + """ + ... + def getAlpha(self) -> float: + """ + Access the first shape parameter, :code:`alpha`. + + Returns: + the first shape parameter. + + + """ + ... + def getBeta(self) -> float: + """ + Access the second shape parameter, :code:`beta`. + + Returns: + the second shape parameter. + + + """ + ... + def getNumericalMean(self) -> float: + """ + Use this method to get the numerical value of the mean of this distribution. For first shape parameter :code:`alpha` and + second shape parameter :code:`beta`, the mean is :code:`alpha / (alpha + beta)`. + + Returns: + the mean or :code:`Double.NaN` if it is not defined + + + """ + ... + def getNumericalVariance(self) -> float: + """ + Use this method to get the numerical value of the variance of this distribution. For first shape parameter :code:`alpha` + and second shape parameter :code:`beta`, the variance is :code:`(alpha * beta) / [(alpha + beta)^2 * (alpha + beta + + 1)]`. + + Returns: + the variance (possibly :code:`Double.POSITIVE_INFINITY` as for certain cases in + :class:`~org.hipparchus.distribution.continuous.TDistribution`) or :code:`Double.NaN` if it is not defined + + + """ + ... + def getSupportLowerBound(self) -> float: + """ + Access the lower bound of the support. This method must return the same value as + :code:`inverseCumulativeProbability(0)`. In other words, this method must return + + :code:`inf {x in R | P(X <= x) > 0}`. + The lower bound of the support is always 0 no matter the parameters. + + Returns: + lower bound of the support (always 0) + + + """ + ... + def getSupportUpperBound(self) -> float: + """ + Access the upper bound of the support. This method must return the same value as + :code:`inverseCumulativeProbability(1)`. In other words, this method must return + + :code:`inf {x in R | P(X <= x) = 1}`. + The upper bound of the support is always 1 no matter the parameters. + + Returns: + upper bound of the support (always 1) + + + """ + ... + def isSupportConnected(self) -> bool: + """ + Use this method to get information about whether the support is connected, i.e. whether all values between the lower and + upper bound of the support are included in the support. The support of this distribution is connected. + + Returns: + :code:`true` + + + """ + ... + def logDensity(self, double: float) -> float: + """ + Returns the natural logarithm of the probability density function (PDF) of this distribution evaluated at the specified + point :code:`x`. In general, the PDF is the derivative of the + :meth:`~org.hipparchus.distribution.RealDistribution.cumulativeProbability`. If the derivative does not exist at + :code:`x`, then an appropriate replacement should be returned, e.g. :code:`Double.POSITIVE_INFINITY`, + :code:`Double.NaN`, or the limit inferior or limit superior of the difference quotient. Note that due to the floating + point precision and under/overflow issues, this method will for some distributions be more precise and faster than + computing the logarithm of :meth:`~org.hipparchus.distribution.RealDistribution.density`. + + The default implementation simply computes the logarithm of :code:`density(x)`. + + Specified by: + :meth:`~org.hipparchus.distribution.RealDistribution.logDensity` in + interface :class:`~org.hipparchus.distribution.RealDistribution` + + Overrides: + :meth:`~org.hipparchus.distribution.continuous.AbstractRealDistribution.logDensity` in + class :class:`~org.hipparchus.distribution.continuous.AbstractRealDistribution` + + Parameters: + x (double): the point at which the PDF is evaluated + + Returns: + the logarithm of the value of the probability density function at point :code:`x` + + + """ + ... class CauchyDistribution(AbstractRealDistribution): + """ + public classCauchyDistribution extends :class:`~org.hipparchus.distribution.continuous.AbstractRealDistribution` + + Implementation of the Cauchy distribution. + + Also see: + + - `Cauchy distribution (Wikipedia) <http://en.wikipedia.org/wiki/Cauchy_distribution>` + - `Cauchy Distribution (MathWorld) <http://mathworld.wolfram.com/CauchyDistribution.html>` + - :meth:`~serialized` + """ @typing.overload def __init__(self): ... @typing.overload def __init__(self, double: float, double2: float): ... - def cumulativeProbability(self, double: float) -> float: ... - def density(self, double: float) -> float: ... - def getMedian(self) -> float: ... - def getNumericalMean(self) -> float: ... - def getNumericalVariance(self) -> float: ... - def getScale(self) -> float: ... - def getSupportLowerBound(self) -> float: ... - def getSupportUpperBound(self) -> float: ... + def cumulativeProbability(self, double: float) -> float: + """ + For a random variable :code:`X` whose values are distributed according to this distribution, this method returns + :code:`P(X <= x)`. In other words, this method represents the (cumulative) distribution function (CDF) for this + distribution. + + Parameters: + x (double): the point at which the CDF is evaluated + + Returns: + the probability that a random variable with this distribution takes a value less than or equal to :code:`x` + + + """ + ... + def density(self, double: float) -> float: + """ + Returns the probability density function (PDF) of this distribution evaluated at the specified point :code:`x`. In + general, the PDF is the derivative of the :meth:`~org.hipparchus.distribution.RealDistribution.cumulativeProbability`. + If the derivative does not exist at :code:`x`, then an appropriate replacement should be returned, e.g. + :code:`Double.POSITIVE_INFINITY`, :code:`Double.NaN`, or the limit inferior or limit superior of the difference + quotient. + + Parameters: + x (double): the point at which the PDF is evaluated + + Returns: + the value of the probability density function at point :code:`x` + + + """ + ... + def getMedian(self) -> float: + """ + Access the median. + + Returns: + the median for this distribution. + + + """ + ... + def getNumericalMean(self) -> float: + """ + Use this method to get the numerical value of the mean of this distribution. The mean is always undefined no matter the + parameters. + + Returns: + mean (always Double.NaN) + + + """ + ... + def getNumericalVariance(self) -> float: + """ + Use this method to get the numerical value of the variance of this distribution. The variance is always undefined no + matter the parameters. + + Returns: + variance (always Double.NaN) + + + """ + ... + def getScale(self) -> float: + """ + Access the scale parameter. + + Returns: + the scale parameter for this distribution. + + + """ + ... + def getSupportLowerBound(self) -> float: + """ + Access the lower bound of the support. This method must return the same value as + :code:`inverseCumulativeProbability(0)`. In other words, this method must return + + :code:`inf {x in R | P(X <= x) > 0}`. + The lower bound of the support is always negative infinity no matter the parameters. + + Returns: + lower bound of the support (always Double.NEGATIVE_INFINITY) + + + """ + ... + def getSupportUpperBound(self) -> float: + """ + Access the upper bound of the support. This method must return the same value as + :code:`inverseCumulativeProbability(1)`. In other words, this method must return + + :code:`inf {x in R | P(X <= x) = 1}`. + The upper bound of the support is always positive infinity no matter the parameters. + + Returns: + upper bound of the support (always Double.POSITIVE_INFINITY) + + + """ + ... def inverseCumulativeProbability(self, double: float) -> float: ... - def isSupportConnected(self) -> bool: ... + def isSupportConnected(self) -> bool: + """ + Use this method to get information about whether the support is connected, i.e. whether all values between the lower and + upper bound of the support are included in the support. The support of this distribution is connected. + + Returns: + :code:`true` + + + """ + ... class ChiSquaredDistribution(AbstractRealDistribution): + """ + public classChiSquaredDistribution extends :class:`~org.hipparchus.distribution.continuous.AbstractRealDistribution` + + Implementation of the chi-squared distribution. + + Also see: + + - `Chi-squared distribution (Wikipedia) <http://en.wikipedia.org/wiki/Chi-squared_distribution>` + - `Chi-squared Distribution (MathWorld) <http://mathworld.wolfram.com/Chi-SquaredDistribution.html>` + - :meth:`~serialized` + """ @typing.overload def __init__(self, double: float): ... @typing.overload def __init__(self, double: float, double2: float): ... - def cumulativeProbability(self, double: float) -> float: ... - def density(self, double: float) -> float: ... - def getDegreesOfFreedom(self) -> float: ... - def getNumericalMean(self) -> float: ... - def getNumericalVariance(self) -> float: ... - def getSupportLowerBound(self) -> float: ... - def getSupportUpperBound(self) -> float: ... - def isSupportConnected(self) -> bool: ... - def logDensity(self, double: float) -> float: ... + def cumulativeProbability(self, double: float) -> float: + """ + For a random variable :code:`X` whose values are distributed according to this distribution, this method returns + :code:`P(X <= x)`. In other words, this method represents the (cumulative) distribution function (CDF) for this + distribution. + + Parameters: + x (double): the point at which the CDF is evaluated + + Returns: + the probability that a random variable with this distribution takes a value less than or equal to :code:`x` + + + """ + ... + def density(self, double: float) -> float: + """ + Returns the probability density function (PDF) of this distribution evaluated at the specified point :code:`x`. In + general, the PDF is the derivative of the :meth:`~org.hipparchus.distribution.RealDistribution.cumulativeProbability`. + If the derivative does not exist at :code:`x`, then an appropriate replacement should be returned, e.g. + :code:`Double.POSITIVE_INFINITY`, :code:`Double.NaN`, or the limit inferior or limit superior of the difference + quotient. + + Parameters: + x (double): the point at which the PDF is evaluated + + Returns: + the value of the probability density function at point :code:`x` + + + """ + ... + def getDegreesOfFreedom(self) -> float: + """ + Access the number of degrees of freedom. + + Returns: + the degrees of freedom. + + + """ + ... + def getNumericalMean(self) -> float: + """ + Use this method to get the numerical value of the mean of this distribution. For :code:`k` degrees of freedom, the mean + is :code:`k`. + + Returns: + the mean or :code:`Double.NaN` if it is not defined + + + """ + ... + def getNumericalVariance(self) -> float: + """ + Use this method to get the numerical value of the variance of this distribution. + + Returns: + :code:`2 * k`, where :code:`k` is the number of degrees of freedom. + + + """ + ... + def getSupportLowerBound(self) -> float: + """ + Access the lower bound of the support. This method must return the same value as + :code:`inverseCumulativeProbability(0)`. In other words, this method must return + + :code:`inf {x in R | P(X <= x) > 0}`. + The lower bound of the support is always 0 no matter the degrees of freedom. + + Returns: + zero. + + + """ + ... + def getSupportUpperBound(self) -> float: + """ + Access the upper bound of the support. This method must return the same value as + :code:`inverseCumulativeProbability(1)`. In other words, this method must return + + :code:`inf {x in R | P(X <= x) = 1}`. + The upper bound of the support is always positive infinity no matter the degrees of freedom. + + Returns: + :code:`Double.POSITIVE_INFINITY`. + + + """ + ... + def isSupportConnected(self) -> bool: + """ + Use this method to get information about whether the support is connected, i.e. whether all values between the lower and + upper bound of the support are included in the support. The support of this distribution is connected. + + Returns: + :code:`true` + + + """ + ... + def logDensity(self, double: float) -> float: + """ + Returns the natural logarithm of the probability density function (PDF) of this distribution evaluated at the specified + point :code:`x`. In general, the PDF is the derivative of the + :meth:`~org.hipparchus.distribution.RealDistribution.cumulativeProbability`. If the derivative does not exist at + :code:`x`, then an appropriate replacement should be returned, e.g. :code:`Double.POSITIVE_INFINITY`, + :code:`Double.NaN`, or the limit inferior or limit superior of the difference quotient. Note that due to the floating + point precision and under/overflow issues, this method will for some distributions be more precise and faster than + computing the logarithm of :meth:`~org.hipparchus.distribution.RealDistribution.density`. + + The default implementation simply computes the logarithm of :code:`density(x)`. + + Specified by: + :meth:`~org.hipparchus.distribution.RealDistribution.logDensity` in + interface :class:`~org.hipparchus.distribution.RealDistribution` + + Overrides: + :meth:`~org.hipparchus.distribution.continuous.AbstractRealDistribution.logDensity` in + class :class:`~org.hipparchus.distribution.continuous.AbstractRealDistribution` + + Parameters: + x (double): the point at which the PDF is evaluated + + Returns: + the logarithm of the value of the probability density function at point :code:`x` + + + """ + ... class ConstantRealDistribution(AbstractRealDistribution): + """ + public classConstantRealDistribution extends :class:`~org.hipparchus.distribution.continuous.AbstractRealDistribution` + + Implementation of the constant real distribution. + + Also see: + + - :meth:`~serialized` + """ def __init__(self, double: float): ... - def cumulativeProbability(self, double: float) -> float: ... - def density(self, double: float) -> float: ... - def getNumericalMean(self) -> float: ... - def getNumericalVariance(self) -> float: ... - def getSupportLowerBound(self) -> float: ... - def getSupportUpperBound(self) -> float: ... + def cumulativeProbability(self, double: float) -> float: + """ + For a random variable :code:`X` whose values are distributed according to this distribution, this method returns + :code:`P(X <= x)`. In other words, this method represents the (cumulative) distribution function (CDF) for this + distribution. + + Parameters: + x (double): the point at which the CDF is evaluated + + Returns: + the probability that a random variable with this distribution takes a value less than or equal to :code:`x` + + + """ + ... + def density(self, double: float) -> float: + """ + Returns the probability density function (PDF) of this distribution evaluated at the specified point :code:`x`. In + general, the PDF is the derivative of the :meth:`~org.hipparchus.distribution.RealDistribution.cumulativeProbability`. + If the derivative does not exist at :code:`x`, then an appropriate replacement should be returned, e.g. + :code:`Double.POSITIVE_INFINITY`, :code:`Double.NaN`, or the limit inferior or limit superior of the difference + quotient. + + Parameters: + x (double): the point at which the PDF is evaluated + + Returns: + the value of the probability density function at point :code:`x` + + + """ + ... + def getNumericalMean(self) -> float: + """ + Use this method to get the numerical value of the mean of this distribution. + + Returns: + the mean or :code:`Double.NaN` if it is not defined + + + """ + ... + def getNumericalVariance(self) -> float: + """ + Use this method to get the numerical value of the variance of this distribution. + + Returns: + the variance (possibly :code:`Double.POSITIVE_INFINITY` as for certain cases in + :class:`~org.hipparchus.distribution.continuous.TDistribution`) or :code:`Double.NaN` if it is not defined + + + """ + ... + def getSupportLowerBound(self) -> float: + """ + Access the lower bound of the support. This method must return the same value as + :code:`inverseCumulativeProbability(0)`. In other words, this method must return + + :code:`inf {x in R | P(X <= x) > 0}`. + + Returns: + lower bound of the support (might be :code:`Double.NEGATIVE_INFINITY`) + + + """ + ... + def getSupportUpperBound(self) -> float: + """ + Access the upper bound of the support. This method must return the same value as + :code:`inverseCumulativeProbability(1)`. In other words, this method must return + + :code:`inf {x in R | P(X <= x) = 1}`. + + Returns: + upper bound of the support (might be :code:`Double.POSITIVE_INFINITY`) + + + """ + ... def inverseCumulativeProbability(self, double: float) -> float: ... - def isSupportConnected(self) -> bool: ... + def isSupportConnected(self) -> bool: + """ + Use this method to get information about whether the support is connected, i.e. whether all values between the lower and + upper bound of the support are included in the support. + + Returns: + whether the support is connected or not + + + """ + ... class EnumeratedRealDistribution(AbstractRealDistribution): + """ + public classEnumeratedRealDistribution extends :class:`~org.hipparchus.distribution.continuous.AbstractRealDistribution` + + Implementation of a real-valued :class:`~org.hipparchus.distribution.EnumeratedDistribution`. + + Values with zero-probability are allowed but they do not extend the support. + + Duplicate values are allowed. Probabilities of duplicate values are combined when computing cumulative probabilities and + statistics. + + Also see: + + - :meth:`~serialized` + """ @typing.overload def __init__(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]): ... @typing.overload def __init__(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray]): ... - def cumulativeProbability(self, double: float) -> float: ... - def density(self, double: float) -> float: ... - def getNumericalMean(self) -> float: ... - def getNumericalVariance(self) -> float: ... + def cumulativeProbability(self, double: float) -> float: + """ + For a random variable :code:`X` whose values are distributed according to this distribution, this method returns + :code:`P(X <= x)`. In other words, this method represents the (cumulative) distribution function (CDF) for this + distribution. + + Parameters: + x (double): the point at which the CDF is evaluated + + Returns: + the probability that a random variable with this distribution takes a value less than or equal to :code:`x` + + + """ + ... + def density(self, double: float) -> float: + """ + For a random variable :code:`X` whose values are distributed according to this distribution, this method returns + :code:`P(X = x)`. In other words, this method represents the probability mass function (PMF) for the distribution. + + Parameters: + x (double): the point at which the PMF is evaluated + + Returns: + the value of the probability mass function at point :code:`x` + + + """ + ... + def getNumericalMean(self) -> float: + """ + Use this method to get the numerical value of the mean of this distribution. + + Returns: + :code:`sum(singletons[i] * probabilities[i])` + + + """ + ... + def getNumericalVariance(self) -> float: + """ + Use this method to get the numerical value of the variance of this distribution. + + Returns: + :code:`sum((singletons[i] - mean) ^ 2 * probabilities[i])` + + + """ + ... def getPmf(self) -> java.util.List[org.hipparchus.util.Pair[float, float]]: ... - def getSupportLowerBound(self) -> float: ... - def getSupportUpperBound(self) -> float: ... + def getSupportLowerBound(self) -> float: + """ + Access the lower bound of the support. This method must return the same value as + :code:`inverseCumulativeProbability(0)`. In other words, this method must return + + :code:`inf {x in R | P(X <= x) > 0}`. + Returns the lowest value with non-zero probability. + + Returns: + the lowest value with non-zero probability. + + + """ + ... + def getSupportUpperBound(self) -> float: + """ + Access the upper bound of the support. This method must return the same value as + :code:`inverseCumulativeProbability(1)`. In other words, this method must return + + :code:`inf {x in R | P(X <= x) = 1}`. + Returns the highest value with non-zero probability. + + Returns: + the highest value with non-zero probability. + + + """ + ... def inverseCumulativeProbability(self, double: float) -> float: ... - def isSupportConnected(self) -> bool: ... + def isSupportConnected(self) -> bool: + """ + Use this method to get information about whether the support is connected, i.e. whether all values between the lower and + upper bound of the support are included in the support. The support of this distribution is connected. + + Returns: + :code:`true` + + + """ + ... @typing.overload def probability(self, double: float, double2: float) -> float: ... @typing.overload - def probability(self, double: float) -> float: ... + def probability(self, double: float) -> float: + """ + For a random variable :code:`X` whose values are distributed according to this distribution, this method returns + :code:`P(X = x)`. In other words, this method represents the probability mass function (PMF) for the distribution. + + Note that if :code:`x1` and :code:`x2` satisfy :code:`x1.equals(x2)`, or both are null, then :code:`probability(x1) = + probability(x2)`. + + Parameters: + x (double): the point at which the PMF is evaluated + + Returns: + the value of the probability mass function at :code:`x` + + + """ + ... class ExponentialDistribution(AbstractRealDistribution): + """ + public classExponentialDistribution extends :class:`~org.hipparchus.distribution.continuous.AbstractRealDistribution` + + Implementation of the exponential distribution. + + Also see: + + - `Exponential distribution (Wikipedia) <http://en.wikipedia.org/wiki/Exponential_distribution>` + - `Exponential distribution (MathWorld) <http://mathworld.wolfram.com/ExponentialDistribution.html>` + - :meth:`~serialized` + """ def __init__(self, double: float): ... - def cumulativeProbability(self, double: float) -> float: ... - def density(self, double: float) -> float: ... - def getMean(self) -> float: ... - def getNumericalMean(self) -> float: ... - def getNumericalVariance(self) -> float: ... - def getSupportLowerBound(self) -> float: ... - def getSupportUpperBound(self) -> float: ... + def cumulativeProbability(self, double: float) -> float: + """ + For a random variable :code:`X` whose values are distributed according to this distribution, this method returns + :code:`P(X <= x)`. In other words, this method represents the (cumulative) distribution function (CDF) for this + distribution. The implementation of this method is based on: + + - ` Exponential Distribution <http://mathworld.wolfram.com/ExponentialDistribution.html>`, equation (1). + + + Parameters: + x (double): the point at which the CDF is evaluated + + Returns: + the probability that a random variable with this distribution takes a value less than or equal to :code:`x` + + + """ + ... + def density(self, double: float) -> float: + """ + Returns the probability density function (PDF) of this distribution evaluated at the specified point :code:`x`. In + general, the PDF is the derivative of the :meth:`~org.hipparchus.distribution.RealDistribution.cumulativeProbability`. + If the derivative does not exist at :code:`x`, then an appropriate replacement should be returned, e.g. + :code:`Double.POSITIVE_INFINITY`, :code:`Double.NaN`, or the limit inferior or limit superior of the difference + quotient. + + Parameters: + x (double): the point at which the PDF is evaluated + + Returns: + the value of the probability density function at point :code:`x` + + + """ + ... + def getMean(self) -> float: + """ + Access the mean. + + Returns: + the mean. + + + """ + ... + def getNumericalMean(self) -> float: + """ + Use this method to get the numerical value of the mean of this distribution. For mean parameter :code:`k`, the mean is + :code:`k`. + + Returns: + the mean or :code:`Double.NaN` if it is not defined + + + """ + ... + def getNumericalVariance(self) -> float: + """ + Use this method to get the numerical value of the variance of this distribution. For mean parameter :code:`k`, the + variance is :code:`k^2`. + + Returns: + the variance (possibly :code:`Double.POSITIVE_INFINITY` as for certain cases in + :class:`~org.hipparchus.distribution.continuous.TDistribution`) or :code:`Double.NaN` if it is not defined + + + """ + ... + def getSupportLowerBound(self) -> float: + """ + Access the lower bound of the support. This method must return the same value as + :code:`inverseCumulativeProbability(0)`. In other words, this method must return + + :code:`inf {x in R | P(X <= x) > 0}`. + The lower bound of the support is always 0 no matter the mean parameter. + + Returns: + lower bound of the support (always 0) + + + """ + ... + def getSupportUpperBound(self) -> float: + """ + Access the upper bound of the support. This method must return the same value as + :code:`inverseCumulativeProbability(1)`. In other words, this method must return + + :code:`inf {x in R | P(X <= x) = 1}`. + The upper bound of the support is always positive infinity no matter the mean parameter. + + Returns: + upper bound of the support (always Double.POSITIVE_INFINITY) + + + """ + ... def inverseCumulativeProbability(self, double: float) -> float: ... - def isSupportConnected(self) -> bool: ... - def logDensity(self, double: float) -> float: ... + def isSupportConnected(self) -> bool: + """ + Use this method to get information about whether the support is connected, i.e. whether all values between the lower and + upper bound of the support are included in the support. The support of this distribution is connected. + + Returns: + :code:`true` + + + """ + ... + def logDensity(self, double: float) -> float: + """ + Returns the natural logarithm of the probability density function (PDF) of this distribution evaluated at the specified + point :code:`x`. In general, the PDF is the derivative of the + :meth:`~org.hipparchus.distribution.RealDistribution.cumulativeProbability`. If the derivative does not exist at + :code:`x`, then an appropriate replacement should be returned, e.g. :code:`Double.POSITIVE_INFINITY`, + :code:`Double.NaN`, or the limit inferior or limit superior of the difference quotient. Note that due to the floating + point precision and under/overflow issues, this method will for some distributions be more precise and faster than + computing the logarithm of :meth:`~org.hipparchus.distribution.RealDistribution.density`. + + The default implementation simply computes the logarithm of :code:`density(x)`. + + Specified by: + :meth:`~org.hipparchus.distribution.RealDistribution.logDensity` in + interface :class:`~org.hipparchus.distribution.RealDistribution` + + Overrides: + :meth:`~org.hipparchus.distribution.continuous.AbstractRealDistribution.logDensity` in + class :class:`~org.hipparchus.distribution.continuous.AbstractRealDistribution` + + Parameters: + x (double): the point at which the PDF is evaluated + + Returns: + the logarithm of the value of the probability density function at point :code:`x` + + + """ + ... class FDistribution(AbstractRealDistribution): + """ + public classFDistribution extends :class:`~org.hipparchus.distribution.continuous.AbstractRealDistribution` + + Implementation of the F-distribution. + + Also see: + + - `F-distribution (Wikipedia) <http://en.wikipedia.org/wiki/F-distribution>` + - `F-distribution (MathWorld) <http://mathworld.wolfram.com/F-Distribution.html>` + - :meth:`~serialized` + """ @typing.overload def __init__(self, double: float, double2: float): ... @typing.overload def __init__(self, double: float, double2: float, double3: float): ... - def cumulativeProbability(self, double: float) -> float: ... - def density(self, double: float) -> float: ... - def getDenominatorDegreesOfFreedom(self) -> float: ... - def getNumeratorDegreesOfFreedom(self) -> float: ... - def getNumericalMean(self) -> float: ... - def getNumericalVariance(self) -> float: ... - def getSupportLowerBound(self) -> float: ... - def getSupportUpperBound(self) -> float: ... - def isSupportConnected(self) -> bool: ... - def logDensity(self, double: float) -> float: ... + def cumulativeProbability(self, double: float) -> float: + """ + For a random variable :code:`X` whose values are distributed according to this distribution, this method returns + :code:`P(X <= x)`. In other words, this method represents the (cumulative) distribution function (CDF) for this + distribution. The implementation of this method is based on + + - ` F-Distribution <http://mathworld.wolfram.com/F-Distribution.html>`, equation (4). + + + Parameters: + x (double): the point at which the CDF is evaluated + + Returns: + the probability that a random variable with this distribution takes a value less than or equal to :code:`x` + + + """ + ... + def density(self, double: float) -> float: + """ + Returns the probability density function (PDF) of this distribution evaluated at the specified point :code:`x`. In + general, the PDF is the derivative of the :meth:`~org.hipparchus.distribution.RealDistribution.cumulativeProbability`. + If the derivative does not exist at :code:`x`, then an appropriate replacement should be returned, e.g. + :code:`Double.POSITIVE_INFINITY`, :code:`Double.NaN`, or the limit inferior or limit superior of the difference + quotient. + + Parameters: + x (double): the point at which the PDF is evaluated + + Returns: + the value of the probability density function at point :code:`x` + + + """ + ... + def getDenominatorDegreesOfFreedom(self) -> float: + """ + Access the denominator degrees of freedom. + + Returns: + the denominator degrees of freedom. + + + """ + ... + def getNumeratorDegreesOfFreedom(self) -> float: + """ + Access the numerator degrees of freedom. + + Returns: + the numerator degrees of freedom. + + + """ + ... + def getNumericalMean(self) -> float: + """ + Use this method to get the numerical value of the mean of this distribution. For denominator degrees of freedom + parameter :code:`b`, the mean is + + - if :code:`b > 2` then :code:`b / (b - 2)`, + - else undefined (:code:`Double.NaN`). + + + Returns: + the mean or :code:`Double.NaN` if it is not defined + + + """ + ... + def getNumericalVariance(self) -> float: + """ + Use this method to get the numerical value of the variance of this distribution. For numerator degrees of freedom + parameter :code:`a` and denominator degrees of freedom parameter :code:`b`, the variance is + + - if :code:`b > 4` then :code:`[2 * b^2 * (a + b - 2)] / [a * (b - 2)^2 * (b - 4)]`, + - else undefined (:code:`Double.NaN`). + + + Returns: + the variance (possibly :code:`Double.POSITIVE_INFINITY` as for certain cases in + :class:`~org.hipparchus.distribution.continuous.TDistribution`) or :code:`Double.NaN` if it is not defined + + + """ + ... + def getSupportLowerBound(self) -> float: + """ + Access the lower bound of the support. This method must return the same value as + :code:`inverseCumulativeProbability(0)`. In other words, this method must return + + :code:`inf {x in R | P(X <= x) > 0}`. + The lower bound of the support is always 0 no matter the parameters. + + Returns: + lower bound of the support (always 0) + + + """ + ... + def getSupportUpperBound(self) -> float: + """ + Access the upper bound of the support. This method must return the same value as + :code:`inverseCumulativeProbability(1)`. In other words, this method must return + + :code:`inf {x in R | P(X <= x) = 1}`. + The upper bound of the support is always positive infinity no matter the parameters. + + Returns: + upper bound of the support (always Double.POSITIVE_INFINITY) + + + """ + ... + def isSupportConnected(self) -> bool: + """ + Use this method to get information about whether the support is connected, i.e. whether all values between the lower and + upper bound of the support are included in the support. The support of this distribution is connected. + + Returns: + :code:`true` + + + """ + ... + def logDensity(self, double: float) -> float: + """ + Returns the natural logarithm of the probability density function (PDF) of this distribution evaluated at the specified + point :code:`x`. In general, the PDF is the derivative of the + :meth:`~org.hipparchus.distribution.RealDistribution.cumulativeProbability`. If the derivative does not exist at + :code:`x`, then an appropriate replacement should be returned, e.g. :code:`Double.POSITIVE_INFINITY`, + :code:`Double.NaN`, or the limit inferior or limit superior of the difference quotient. Note that due to the floating + point precision and under/overflow issues, this method will for some distributions be more precise and faster than + computing the logarithm of :meth:`~org.hipparchus.distribution.RealDistribution.density`. + + The default implementation simply computes the logarithm of :code:`density(x)`. + + Specified by: + :meth:`~org.hipparchus.distribution.RealDistribution.logDensity` in + interface :class:`~org.hipparchus.distribution.RealDistribution` + + Overrides: + :meth:`~org.hipparchus.distribution.continuous.AbstractRealDistribution.logDensity` in + class :class:`~org.hipparchus.distribution.continuous.AbstractRealDistribution` + + Parameters: + x (double): the point at which the PDF is evaluated + + Returns: + the logarithm of the value of the probability density function at point :code:`x` + + + """ + ... class GammaDistribution(AbstractRealDistribution): + """ + public classGammaDistribution extends :class:`~org.hipparchus.distribution.continuous.AbstractRealDistribution` + + Implementation of the Gamma distribution. + + Also see: + + - `Gamma distribution (Wikipedia) <http://en.wikipedia.org/wiki/Gamma_distribution>` + - `Gamma distribution (MathWorld) <http://mathworld.wolfram.com/GammaDistribution.html>` + - :meth:`~serialized` + """ @typing.overload def __init__(self, double: float, double2: float): ... @typing.overload def __init__(self, double: float, double2: float, double3: float): ... - def cumulativeProbability(self, double: float) -> float: ... - def density(self, double: float) -> float: ... - def getNumericalMean(self) -> float: ... - def getNumericalVariance(self) -> float: ... - def getScale(self) -> float: ... - def getShape(self) -> float: ... - def getSupportLowerBound(self) -> float: ... - def getSupportUpperBound(self) -> float: ... - def isSupportConnected(self) -> bool: ... - def logDensity(self, double: float) -> float: ... + def cumulativeProbability(self, double: float) -> float: + """ + For a random variable :code:`X` whose values are distributed according to this distribution, this method returns + :code:`P(X <= x)`. In other words, this method represents the (cumulative) distribution function (CDF) for this + distribution. The implementation of this method is based on: + + - ` Chi-Squared Distribution <http://mathworld.wolfram.com/Chi-SquaredDistribution.html>`, equation (9). + - Casella, G., & Berger, R. (1990). *Statistical Inference*. Belmont, CA: Duxbury Press. + + + Parameters: + x (double): the point at which the CDF is evaluated + + Returns: + the probability that a random variable with this distribution takes a value less than or equal to :code:`x` + + + """ + ... + def density(self, double: float) -> float: + """ + Returns the probability density function (PDF) of this distribution evaluated at the specified point :code:`x`. In + general, the PDF is the derivative of the :meth:`~org.hipparchus.distribution.RealDistribution.cumulativeProbability`. + If the derivative does not exist at :code:`x`, then an appropriate replacement should be returned, e.g. + :code:`Double.POSITIVE_INFINITY`, :code:`Double.NaN`, or the limit inferior or limit superior of the difference + quotient. + + Parameters: + x (double): the point at which the PDF is evaluated + + Returns: + the value of the probability density function at point :code:`x` + + + """ + ... + def getNumericalMean(self) -> float: + """ + Use this method to get the numerical value of the mean of this distribution. For shape parameter :code:`alpha` and scale + parameter :code:`beta`, the mean is :code:`alpha * beta`. + + Returns: + the mean or :code:`Double.NaN` if it is not defined + + + """ + ... + def getNumericalVariance(self) -> float: + """ + Use this method to get the numerical value of the variance of this distribution. For shape parameter :code:`alpha` and + scale parameter :code:`beta`, the variance is :code:`alpha * beta^2`. + + Returns: + the variance (possibly :code:`Double.POSITIVE_INFINITY` as for certain cases in + :class:`~org.hipparchus.distribution.continuous.TDistribution`) or :code:`Double.NaN` if it is not defined + + + """ + ... + def getScale(self) -> float: + """ + Returns the scale parameter of :code:`this` distribution. + + Returns: + the scale parameter + + + """ + ... + def getShape(self) -> float: + """ + Returns the shape parameter of :code:`this` distribution. + + Returns: + the shape parameter + + + """ + ... + def getSupportLowerBound(self) -> float: + """ + Access the lower bound of the support. This method must return the same value as + :code:`inverseCumulativeProbability(0)`. In other words, this method must return + + :code:`inf {x in R | P(X <= x) > 0}`. + The lower bound of the support is always 0 no matter the parameters. + + Returns: + lower bound of the support (always 0) + + + """ + ... + def getSupportUpperBound(self) -> float: + """ + Access the upper bound of the support. This method must return the same value as + :code:`inverseCumulativeProbability(1)`. In other words, this method must return + + :code:`inf {x in R | P(X <= x) = 1}`. + The upper bound of the support is always positive infinity no matter the parameters. + + Returns: + upper bound of the support (always Double.POSITIVE_INFINITY) + + + """ + ... + def isSupportConnected(self) -> bool: + """ + Use this method to get information about whether the support is connected, i.e. whether all values between the lower and + upper bound of the support are included in the support. The support of this distribution is connected. + + Returns: + :code:`true` + + + """ + ... + def logDensity(self, double: float) -> float: + """ + Returns the natural logarithm of the probability density function (PDF) of this distribution evaluated at the specified + point :code:`x`. In general, the PDF is the derivative of the + :meth:`~org.hipparchus.distribution.RealDistribution.cumulativeProbability`. If the derivative does not exist at + :code:`x`, then an appropriate replacement should be returned, e.g. :code:`Double.POSITIVE_INFINITY`, + :code:`Double.NaN`, or the limit inferior or limit superior of the difference quotient. Note that due to the floating + point precision and under/overflow issues, this method will for some distributions be more precise and faster than + computing the logarithm of :meth:`~org.hipparchus.distribution.RealDistribution.density`. + + The default implementation simply computes the logarithm of :code:`density(x)`. + + Specified by: + :meth:`~org.hipparchus.distribution.RealDistribution.logDensity` in + interface :class:`~org.hipparchus.distribution.RealDistribution` + + Overrides: + :meth:`~org.hipparchus.distribution.continuous.AbstractRealDistribution.logDensity` in + class :class:`~org.hipparchus.distribution.continuous.AbstractRealDistribution` + + Parameters: + x (double): the point at which the PDF is evaluated + + Returns: + the logarithm of the value of the probability density function at point :code:`x` + + + """ + ... class GumbelDistribution(AbstractRealDistribution): + """ + public classGumbelDistribution extends :class:`~org.hipparchus.distribution.continuous.AbstractRealDistribution` + + This class implements the Gumbel distribution. + + Also see: + + - `Gumbel Distribution (Wikipedia) <http://en.wikipedia.org/wiki/Gumbel_distribution>` + - `Gumbel Distribution (Mathworld) <http://mathworld.wolfram.com/GumbelDistribution.html>` + - :meth:`~serialized` + """ def __init__(self, double: float, double2: float): ... - def cumulativeProbability(self, double: float) -> float: ... - def density(self, double: float) -> float: ... - def getLocation(self) -> float: ... - def getNumericalMean(self) -> float: ... - def getNumericalVariance(self) -> float: ... - def getScale(self) -> float: ... - def getSupportLowerBound(self) -> float: ... - def getSupportUpperBound(self) -> float: ... + def cumulativeProbability(self, double: float) -> float: + """ + For a random variable :code:`X` whose values are distributed according to this distribution, this method returns + :code:`P(X <= x)`. In other words, this method represents the (cumulative) distribution function (CDF) for this + distribution. + + Parameters: + x (double): the point at which the CDF is evaluated + + Returns: + the probability that a random variable with this distribution takes a value less than or equal to :code:`x` + + + """ + ... + def density(self, double: float) -> float: + """ + Returns the probability density function (PDF) of this distribution evaluated at the specified point :code:`x`. In + general, the PDF is the derivative of the :meth:`~org.hipparchus.distribution.RealDistribution.cumulativeProbability`. + If the derivative does not exist at :code:`x`, then an appropriate replacement should be returned, e.g. + :code:`Double.POSITIVE_INFINITY`, :code:`Double.NaN`, or the limit inferior or limit superior of the difference + quotient. + + Parameters: + x (double): the point at which the PDF is evaluated + + Returns: + the value of the probability density function at point :code:`x` + + + """ + ... + def getLocation(self) -> float: + """ + Access the location parameter, :code:`mu`. + + Returns: + the location parameter. + + + """ + ... + def getNumericalMean(self) -> float: + """ + Use this method to get the numerical value of the mean of this distribution. + + Returns: + the mean or :code:`Double.NaN` if it is not defined + + + """ + ... + def getNumericalVariance(self) -> float: + """ + Use this method to get the numerical value of the variance of this distribution. + + Returns: + the variance (possibly :code:`Double.POSITIVE_INFINITY` as for certain cases in + :class:`~org.hipparchus.distribution.continuous.TDistribution`) or :code:`Double.NaN` if it is not defined + + + """ + ... + def getScale(self) -> float: + """ + Access the scale parameter, :code:`beta`. + + Returns: + the scale parameter. + + + """ + ... + def getSupportLowerBound(self) -> float: + """ + Access the lower bound of the support. This method must return the same value as + :code:`inverseCumulativeProbability(0)`. In other words, this method must return + + :code:`inf {x in R | P(X <= x) > 0}`. + + Returns: + lower bound of the support (might be :code:`Double.NEGATIVE_INFINITY`) + + + """ + ... + def getSupportUpperBound(self) -> float: + """ + Access the upper bound of the support. This method must return the same value as + :code:`inverseCumulativeProbability(1)`. In other words, this method must return + + :code:`inf {x in R | P(X <= x) = 1}`. + + Returns: + upper bound of the support (might be :code:`Double.POSITIVE_INFINITY`) + + + """ + ... def inverseCumulativeProbability(self, double: float) -> float: ... - def isSupportConnected(self) -> bool: ... + def isSupportConnected(self) -> bool: + """ + Use this method to get information about whether the support is connected, i.e. whether all values between the lower and + upper bound of the support are included in the support. + + Returns: + whether the support is connected or not + + + """ + ... class LaplaceDistribution(AbstractRealDistribution): + """ + public classLaplaceDistribution extends :class:`~org.hipparchus.distribution.continuous.AbstractRealDistribution` + + This class implements the Laplace distribution. + + Also see: + + - `Laplace distribution (Wikipedia) <http://en.wikipedia.org/wiki/Laplace_distribution>` + - :meth:`~serialized` + """ def __init__(self, double: float, double2: float): ... - def cumulativeProbability(self, double: float) -> float: ... - def density(self, double: float) -> float: ... - def getLocation(self) -> float: ... - def getNumericalMean(self) -> float: ... - def getNumericalVariance(self) -> float: ... - def getScale(self) -> float: ... - def getSupportLowerBound(self) -> float: ... - def getSupportUpperBound(self) -> float: ... + def cumulativeProbability(self, double: float) -> float: + """ + For a random variable :code:`X` whose values are distributed according to this distribution, this method returns + :code:`P(X <= x)`. In other words, this method represents the (cumulative) distribution function (CDF) for this + distribution. + + Parameters: + x (double): the point at which the CDF is evaluated + + Returns: + the probability that a random variable with this distribution takes a value less than or equal to :code:`x` + + + """ + ... + def density(self, double: float) -> float: + """ + Returns the probability density function (PDF) of this distribution evaluated at the specified point :code:`x`. In + general, the PDF is the derivative of the :meth:`~org.hipparchus.distribution.RealDistribution.cumulativeProbability`. + If the derivative does not exist at :code:`x`, then an appropriate replacement should be returned, e.g. + :code:`Double.POSITIVE_INFINITY`, :code:`Double.NaN`, or the limit inferior or limit superior of the difference + quotient. + + Parameters: + x (double): the point at which the PDF is evaluated + + Returns: + the value of the probability density function at point :code:`x` + + + """ + ... + def getLocation(self) -> float: + """ + Access the location parameter, :code:`mu`. + + Returns: + the location parameter. + + + """ + ... + def getNumericalMean(self) -> float: + """ + Use this method to get the numerical value of the mean of this distribution. + + Returns: + the mean or :code:`Double.NaN` if it is not defined + + + """ + ... + def getNumericalVariance(self) -> float: + """ + Use this method to get the numerical value of the variance of this distribution. + + Returns: + the variance (possibly :code:`Double.POSITIVE_INFINITY` as for certain cases in + :class:`~org.hipparchus.distribution.continuous.TDistribution`) or :code:`Double.NaN` if it is not defined + + + """ + ... + def getScale(self) -> float: + """ + Access the scale parameter, :code:`beta`. + + Returns: + the scale parameter. + + + """ + ... + def getSupportLowerBound(self) -> float: + """ + Access the lower bound of the support. This method must return the same value as + :code:`inverseCumulativeProbability(0)`. In other words, this method must return + + :code:`inf {x in R | P(X <= x) > 0}`. + + Returns: + lower bound of the support (might be :code:`Double.NEGATIVE_INFINITY`) + + + """ + ... + def getSupportUpperBound(self) -> float: + """ + Access the upper bound of the support. This method must return the same value as + :code:`inverseCumulativeProbability(1)`. In other words, this method must return + + :code:`inf {x in R | P(X <= x) = 1}`. + + Returns: + upper bound of the support (might be :code:`Double.POSITIVE_INFINITY`) + + + """ + ... def inverseCumulativeProbability(self, double: float) -> float: ... - def isSupportConnected(self) -> bool: ... + def isSupportConnected(self) -> bool: + """ + Use this method to get information about whether the support is connected, i.e. whether all values between the lower and + upper bound of the support are included in the support. + + Returns: + whether the support is connected or not + + + """ + ... class LevyDistribution(AbstractRealDistribution): + """ + public classLevyDistribution extends :class:`~org.hipparchus.distribution.continuous.AbstractRealDistribution` + + This class implements the ` Lévy distribution <http://en.wikipedia.org/wiki/L%C3%A9vy_distribution>`. + + Also see: + + - :meth:`~serialized` + """ def __init__(self, double: float, double2: float): ... - def cumulativeProbability(self, double: float) -> float: ... - def density(self, double: float) -> float: ... - def getLocation(self) -> float: ... - def getNumericalMean(self) -> float: ... - def getNumericalVariance(self) -> float: ... - def getScale(self) -> float: ... - def getSupportLowerBound(self) -> float: ... - def getSupportUpperBound(self) -> float: ... + def cumulativeProbability(self, double: float) -> float: + """ + For a random variable :code:`X` whose values are distributed according to this distribution, this method returns + :code:`P(X <= x)`. In other words, this method represents the (cumulative) distribution function (CDF) for this + distribution. + + From Wikipedia: the cumulative distribution function is + + .. code-block: java + + f(x; u, c) = erfc (√ (c / 2 (x - u ))) + + + Parameters: + x (double): the point at which the CDF is evaluated + + Returns: + the probability that a random variable with this distribution takes a value less than or equal to :code:`x` + + + """ + ... + def density(self, double: float) -> float: + """ + Returns the probability density function (PDF) of this distribution evaluated at the specified point :code:`x`. In + general, the PDF is the derivative of the :meth:`~org.hipparchus.distribution.RealDistribution.cumulativeProbability`. + If the derivative does not exist at :code:`x`, then an appropriate replacement should be returned, e.g. + :code:`Double.POSITIVE_INFINITY`, :code:`Double.NaN`, or the limit inferior or limit superior of the difference + quotient. + + From Wikipedia: The probability density function of the Lévy distribution over the domain is + \[ f(x; \mu, c) = \sqrt{\frac{c}{2\pi}} \frac{e^{\frac{-c}{2 (x - \mu)}}}{(x - \mu)^\frac{3}{2}} \] + + For this distribution, :code:`X`, this method returns :code:`P(X < x)`. If :code:`x` is less than location parameter μ, + :code:`Double.NaN` is returned, as in these cases the distribution is not defined. + + Parameters: + x (double): the point at which the PDF is evaluated + + Returns: + the value of the probability density function at point :code:`x` + + + """ + ... + def getLocation(self) -> float: + """ + Get the location parameter of the distribution. + + Returns: + location parameter of the distribution + + + """ + ... + def getNumericalMean(self) -> float: + """ + Use this method to get the numerical value of the mean of this distribution. + + Returns: + the mean or :code:`Double.NaN` if it is not defined + + + """ + ... + def getNumericalVariance(self) -> float: + """ + Use this method to get the numerical value of the variance of this distribution. + + Returns: + the variance (possibly :code:`Double.POSITIVE_INFINITY` as for certain cases in + :class:`~org.hipparchus.distribution.continuous.TDistribution`) or :code:`Double.NaN` if it is not defined + + + """ + ... + def getScale(self) -> float: + """ + Get the scale parameter of the distribution. + + Returns: + scale parameter of the distribution + + + """ + ... + def getSupportLowerBound(self) -> float: + """ + Access the lower bound of the support. This method must return the same value as + :code:`inverseCumulativeProbability(0)`. In other words, this method must return + + :code:`inf {x in R | P(X <= x) > 0}`. + + Returns: + lower bound of the support (might be :code:`Double.NEGATIVE_INFINITY`) + + + """ + ... + def getSupportUpperBound(self) -> float: + """ + Access the upper bound of the support. This method must return the same value as + :code:`inverseCumulativeProbability(1)`. In other words, this method must return + + :code:`inf {x in R | P(X <= x) = 1}`. + + Returns: + upper bound of the support (might be :code:`Double.POSITIVE_INFINITY`) + + + """ + ... def inverseCumulativeProbability(self, double: float) -> float: ... - def isSupportConnected(self) -> bool: ... - def logDensity(self, double: float) -> float: ... + def isSupportConnected(self) -> bool: + """ + Use this method to get information about whether the support is connected, i.e. whether all values between the lower and + upper bound of the support are included in the support. + + Returns: + whether the support is connected or not + + + """ + ... + def logDensity(self, double: float) -> float: + """ + Returns the natural logarithm of the probability density function (PDF) of this distribution evaluated at the specified + point :code:`x`. In general, the PDF is the derivative of the + :meth:`~org.hipparchus.distribution.RealDistribution.cumulativeProbability`. If the derivative does not exist at + :code:`x`, then an appropriate replacement should be returned, e.g. :code:`Double.POSITIVE_INFINITY`, + :code:`Double.NaN`, or the limit inferior or limit superior of the difference quotient. Note that due to the floating + point precision and under/overflow issues, this method will for some distributions be more precise and faster than + computing the logarithm of :meth:`~org.hipparchus.distribution.RealDistribution.density`. + + The default implementation simply computes the logarithm of :code:`density(x)`. See documentation of + :meth:`~org.hipparchus.distribution.continuous.LevyDistribution.density` for computation details. + + Specified by: + :meth:`~org.hipparchus.distribution.RealDistribution.logDensity` in + interface :class:`~org.hipparchus.distribution.RealDistribution` + + Overrides: + :meth:`~org.hipparchus.distribution.continuous.AbstractRealDistribution.logDensity` in + class :class:`~org.hipparchus.distribution.continuous.AbstractRealDistribution` + + Parameters: + x (double): the point at which the PDF is evaluated + + Returns: + the logarithm of the value of the probability density function at point :code:`x` + + + """ + ... class LogNormalDistribution(AbstractRealDistribution): + """ + public classLogNormalDistribution extends :class:`~org.hipparchus.distribution.continuous.AbstractRealDistribution` + + Implementation of the log-normal (gaussian) distribution. + + **Parameters:** :code:`X` is log-normally distributed if its natural logarithm :code:`log(X)` is normally distributed. + The probability distribution function of :code:`X` is given by (for :code:`x > 0`) + + :code:`exp(-0.5 * ((ln(x) - m) / s)^2) / (s * sqrt(2 * pi) * x)` + + - :code:`m` is the *location* parameter: this is the mean of the normally distributed natural logarithm of this + distribution, + - :code:`s` is the *shape* parameter: this is the standard deviation of the normally distributed natural logarithm of this + distribution. + + + Also see: + + - ` Log-normal distribution (Wikipedia) <http://en.wikipedia.org/wiki/Log-normal_distribution>` + - ` Log Normal distribution (MathWorld) <http://mathworld.wolfram.com/LogNormalDistribution.html>` + - :meth:`~serialized` + """ @typing.overload def __init__(self): ... @typing.overload def __init__(self, double: float, double2: float): ... @typing.overload def __init__(self, double: float, double2: float, double3: float): ... - def cumulativeProbability(self, double: float) -> float: ... - def density(self, double: float) -> float: ... - def getLocation(self) -> float: ... - def getNumericalMean(self) -> float: ... - def getNumericalVariance(self) -> float: ... - def getShape(self) -> float: ... - def getSupportLowerBound(self) -> float: ... - def getSupportUpperBound(self) -> float: ... - def isSupportConnected(self) -> bool: ... - def logDensity(self, double: float) -> float: ... + def cumulativeProbability(self, double: float) -> float: + """ + For a random variable :code:`X` whose values are distributed according to this distribution, this method returns + :code:`P(X <= x)`. In other words, this method represents the (cumulative) distribution function (CDF) for this + distribution. For location :code:`m`, and shape :code:`s` of this distribution, the CDF is given by + + - :code:`0` if :code:`x <= 0`, + - :code:`0` if :code:`ln(x) - m < 0` and :code:`m - ln(x) > 40 * s`, as in these cases the actual value is within + :code:`Double.MIN_VALUE` of 0, + - :code:`1` if :code:`ln(x) - m >= 0` and :code:`ln(x) - m > 40 * s`, as in these cases the actual value is within + :code:`Double.MIN_VALUE` of 1, + - :code:`0.5 + 0.5 * erf((ln(x) - m) / (s * sqrt(2))` otherwise. + + + Parameters: + x (double): the point at which the CDF is evaluated + + Returns: + the probability that a random variable with this distribution takes a value less than or equal to :code:`x` + + + """ + ... + def density(self, double: float) -> float: + """ + Returns the probability density function (PDF) of this distribution evaluated at the specified point :code:`x`. In + general, the PDF is the derivative of the :meth:`~org.hipparchus.distribution.RealDistribution.cumulativeProbability`. + If the derivative does not exist at :code:`x`, then an appropriate replacement should be returned, e.g. + :code:`Double.POSITIVE_INFINITY`, :code:`Double.NaN`, or the limit inferior or limit superior of the difference + quotient. For location :code:`m`, and shape :code:`s` of this distribution, the PDF is given by + + - :code:`0` if :code:`x <= 0`, + - :code:`exp(-0.5 * ((ln(x) - m) / s)^2) / (s * sqrt(2 * pi) * x)` otherwise. + + + Parameters: + x (double): the point at which the PDF is evaluated + + Returns: + the value of the probability density function at point :code:`x` + + + """ + ... + def getLocation(self) -> float: + """ + Returns the location parameter of this distribution. + + Returns: + the location parameter + + Since: + 1.4 + + + """ + ... + def getNumericalMean(self) -> float: + """ + Use this method to get the numerical value of the mean of this distribution. For location :code:`m` and shape :code:`s`, + the mean is :code:`exp(m + s^2 / 2)`. + + Returns: + the mean or :code:`Double.NaN` if it is not defined + + + """ + ... + def getNumericalVariance(self) -> float: + """ + Use this method to get the numerical value of the variance of this distribution. For location :code:`m` and shape + :code:`s`, the variance is :code:`(exp(s^2) - 1) * exp(2 * m + s^2)`. + + Returns: + the variance (possibly :code:`Double.POSITIVE_INFINITY` as for certain cases in + :class:`~org.hipparchus.distribution.continuous.TDistribution`) or :code:`Double.NaN` if it is not defined + + + """ + ... + def getShape(self) -> float: + """ + Returns the shape parameter of this distribution. + + Returns: + the shape parameter + + + """ + ... + def getSupportLowerBound(self) -> float: + """ + Access the lower bound of the support. This method must return the same value as + :code:`inverseCumulativeProbability(0)`. In other words, this method must return + + :code:`inf {x in R | P(X <= x) > 0}`. + The lower bound of the support is always 0 no matter the parameters. + + Returns: + lower bound of the support (always 0) + + + """ + ... + def getSupportUpperBound(self) -> float: + """ + Access the upper bound of the support. This method must return the same value as + :code:`inverseCumulativeProbability(1)`. In other words, this method must return + + :code:`inf {x in R | P(X <= x) = 1}`. + The upper bound of the support is always positive infinity no matter the parameters. + + Returns: + upper bound of the support (always :code:`Double.POSITIVE_INFINITY`) + + + """ + ... + def isSupportConnected(self) -> bool: + """ + Use this method to get information about whether the support is connected, i.e. whether all values between the lower and + upper bound of the support are included in the support. The support of this distribution is connected. + + Returns: + :code:`true` + + + """ + ... + def logDensity(self, double: float) -> float: + """ + Returns the natural logarithm of the probability density function (PDF) of this distribution evaluated at the specified + point :code:`x`. In general, the PDF is the derivative of the + :meth:`~org.hipparchus.distribution.RealDistribution.cumulativeProbability`. If the derivative does not exist at + :code:`x`, then an appropriate replacement should be returned, e.g. :code:`Double.POSITIVE_INFINITY`, + :code:`Double.NaN`, or the limit inferior or limit superior of the difference quotient. Note that due to the floating + point precision and under/overflow issues, this method will for some distributions be more precise and faster than + computing the logarithm of :meth:`~org.hipparchus.distribution.RealDistribution.density`. + + The default implementation simply computes the logarithm of :code:`density(x)`. See documentation of + :meth:`~org.hipparchus.distribution.continuous.LogNormalDistribution.density` for computation details. + + Specified by: + :meth:`~org.hipparchus.distribution.RealDistribution.logDensity` in + interface :class:`~org.hipparchus.distribution.RealDistribution` + + Overrides: + :meth:`~org.hipparchus.distribution.continuous.AbstractRealDistribution.logDensity` in + class :class:`~org.hipparchus.distribution.continuous.AbstractRealDistribution` + + Parameters: + x (double): the point at which the PDF is evaluated + + Returns: + the logarithm of the value of the probability density function at point :code:`x` + + + """ + ... def probability(self, double: float, double2: float) -> float: ... class LogisticDistribution(AbstractRealDistribution): + """ + public classLogisticDistribution extends :class:`~org.hipparchus.distribution.continuous.AbstractRealDistribution` + + This class implements the Logistic distribution. + + Also see: + + - `Logistic Distribution (Wikipedia) <http://en.wikipedia.org/wiki/Logistic_distribution>` + - `Logistic Distribution (Mathworld) <http://mathworld.wolfram.com/LogisticDistribution.html>` + - :meth:`~serialized` + """ def __init__(self, double: float, double2: float): ... - def cumulativeProbability(self, double: float) -> float: ... - def density(self, double: float) -> float: ... - def getLocation(self) -> float: ... - def getNumericalMean(self) -> float: ... - def getNumericalVariance(self) -> float: ... - def getScale(self) -> float: ... - def getSupportLowerBound(self) -> float: ... - def getSupportUpperBound(self) -> float: ... + def cumulativeProbability(self, double: float) -> float: + """ + For a random variable :code:`X` whose values are distributed according to this distribution, this method returns + :code:`P(X <= x)`. In other words, this method represents the (cumulative) distribution function (CDF) for this + distribution. + + Parameters: + x (double): the point at which the CDF is evaluated + + Returns: + the probability that a random variable with this distribution takes a value less than or equal to :code:`x` + + + """ + ... + def density(self, double: float) -> float: + """ + Returns the probability density function (PDF) of this distribution evaluated at the specified point :code:`x`. In + general, the PDF is the derivative of the :meth:`~org.hipparchus.distribution.RealDistribution.cumulativeProbability`. + If the derivative does not exist at :code:`x`, then an appropriate replacement should be returned, e.g. + :code:`Double.POSITIVE_INFINITY`, :code:`Double.NaN`, or the limit inferior or limit superior of the difference + quotient. + + Parameters: + x (double): the point at which the PDF is evaluated + + Returns: + the value of the probability density function at point :code:`x` + + + """ + ... + def getLocation(self) -> float: + """ + Access the location parameter, :code:`mu`. + + Returns: + the location parameter. + + + """ + ... + def getNumericalMean(self) -> float: + """ + Use this method to get the numerical value of the mean of this distribution. + + Returns: + the mean or :code:`Double.NaN` if it is not defined + + + """ + ... + def getNumericalVariance(self) -> float: + """ + Use this method to get the numerical value of the variance of this distribution. + + Returns: + the variance (possibly :code:`Double.POSITIVE_INFINITY` as for certain cases in + :class:`~org.hipparchus.distribution.continuous.TDistribution`) or :code:`Double.NaN` if it is not defined + + + """ + ... + def getScale(self) -> float: + """ + Access the scale parameter, :code:`s`. + + Returns: + the scale parameter. + + + """ + ... + def getSupportLowerBound(self) -> float: + """ + Access the lower bound of the support. This method must return the same value as + :code:`inverseCumulativeProbability(0)`. In other words, this method must return + + :code:`inf {x in R | P(X <= x) > 0}`. + + Returns: + lower bound of the support (might be :code:`Double.NEGATIVE_INFINITY`) + + + """ + ... + def getSupportUpperBound(self) -> float: + """ + Access the upper bound of the support. This method must return the same value as + :code:`inverseCumulativeProbability(1)`. In other words, this method must return + + :code:`inf {x in R | P(X <= x) = 1}`. + + Returns: + upper bound of the support (might be :code:`Double.POSITIVE_INFINITY`) + + + """ + ... def inverseCumulativeProbability(self, double: float) -> float: ... - def isSupportConnected(self) -> bool: ... + def isSupportConnected(self) -> bool: + """ + Use this method to get information about whether the support is connected, i.e. whether all values between the lower and + upper bound of the support are included in the support. + + Returns: + whether the support is connected or not + + + """ + ... class NakagamiDistribution(AbstractRealDistribution): + """ + public classNakagamiDistribution extends :class:`~org.hipparchus.distribution.continuous.AbstractRealDistribution` + + This class implements the Nakagami distribution. + + Also see: + + - `Nakagami Distribution (Wikipedia) <http://en.wikipedia.org/wiki/Nakagami_distribution>` + - :meth:`~serialized` + """ @typing.overload def __init__(self, double: float, double2: float): ... @typing.overload def __init__(self, double: float, double2: float, double3: float): ... - def cumulativeProbability(self, double: float) -> float: ... - def density(self, double: float) -> float: ... - def getNumericalMean(self) -> float: ... - def getNumericalVariance(self) -> float: ... - def getScale(self) -> float: ... - def getShape(self) -> float: ... - def getSupportLowerBound(self) -> float: ... - def getSupportUpperBound(self) -> float: ... - def isSupportConnected(self) -> bool: ... + def cumulativeProbability(self, double: float) -> float: + """ + For a random variable :code:`X` whose values are distributed according to this distribution, this method returns + :code:`P(X <= x)`. In other words, this method represents the (cumulative) distribution function (CDF) for this + distribution. + + Parameters: + x (double): the point at which the CDF is evaluated + + Returns: + the probability that a random variable with this distribution takes a value less than or equal to :code:`x` + + + """ + ... + def density(self, double: float) -> float: + """ + Returns the probability density function (PDF) of this distribution evaluated at the specified point :code:`x`. In + general, the PDF is the derivative of the :meth:`~org.hipparchus.distribution.RealDistribution.cumulativeProbability`. + If the derivative does not exist at :code:`x`, then an appropriate replacement should be returned, e.g. + :code:`Double.POSITIVE_INFINITY`, :code:`Double.NaN`, or the limit inferior or limit superior of the difference + quotient. + + Parameters: + x (double): the point at which the PDF is evaluated + + Returns: + the value of the probability density function at point :code:`x` + + + """ + ... + def getNumericalMean(self) -> float: + """ + Use this method to get the numerical value of the mean of this distribution. + + Returns: + the mean or :code:`Double.NaN` if it is not defined + + + """ + ... + def getNumericalVariance(self) -> float: + """ + Use this method to get the numerical value of the variance of this distribution. + + Returns: + the variance (possibly :code:`Double.POSITIVE_INFINITY` as for certain cases in + :class:`~org.hipparchus.distribution.continuous.TDistribution`) or :code:`Double.NaN` if it is not defined + + + """ + ... + def getScale(self) -> float: + """ + Access the scale parameter, :code:`omega`. + + Returns: + the scale parameter. + + + """ + ... + def getShape(self) -> float: + """ + Access the shape parameter, :code:`mu`. + + Returns: + the shape parameter. + + + """ + ... + def getSupportLowerBound(self) -> float: + """ + Access the lower bound of the support. This method must return the same value as + :code:`inverseCumulativeProbability(0)`. In other words, this method must return + + :code:`inf {x in R | P(X <= x) > 0}`. + + Returns: + lower bound of the support (might be :code:`Double.NEGATIVE_INFINITY`) + + + """ + ... + def getSupportUpperBound(self) -> float: + """ + Access the upper bound of the support. This method must return the same value as + :code:`inverseCumulativeProbability(1)`. In other words, this method must return + + :code:`inf {x in R | P(X <= x) = 1}`. + + Returns: + upper bound of the support (might be :code:`Double.POSITIVE_INFINITY`) + + + """ + ... + def isSupportConnected(self) -> bool: + """ + Use this method to get information about whether the support is connected, i.e. whether all values between the lower and + upper bound of the support are included in the support. + + Returns: + whether the support is connected or not + + + """ + ... class NormalDistribution(AbstractRealDistribution): + """ + public classNormalDistribution extends :class:`~org.hipparchus.distribution.continuous.AbstractRealDistribution` + + Implementation of the normal (gaussian) distribution. + + Also see: + + - `Normal distribution (Wikipedia) <http://en.wikipedia.org/wiki/Normal_distribution>` + - `Normal distribution (MathWorld) <http://mathworld.wolfram.com/NormalDistribution.html>` + - :meth:`~serialized` + """ @typing.overload def __init__(self): ... @typing.overload def __init__(self, double: float, double2: float): ... - def cumulativeProbability(self, double: float) -> float: ... - def density(self, double: float) -> float: ... - def getMean(self) -> float: ... - def getNumericalMean(self) -> float: ... - def getNumericalVariance(self) -> float: ... - def getStandardDeviation(self) -> float: ... - def getSupportLowerBound(self) -> float: ... - def getSupportUpperBound(self) -> float: ... + def cumulativeProbability(self, double: float) -> float: + """ + For a random variable :code:`X` whose values are distributed according to this distribution, this method returns + :code:`P(X <= x)`. In other words, this method represents the (cumulative) distribution function (CDF) for this + distribution. If :code:`x` is more than 40 standard deviations from the mean, 0 or 1 is returned, as in these cases the + actual value is within :code:`Double.MIN_VALUE` of 0 or 1. + + Parameters: + x (double): the point at which the CDF is evaluated + + Returns: + the probability that a random variable with this distribution takes a value less than or equal to :code:`x` + + + """ + ... + def density(self, double: float) -> float: + """ + Returns the probability density function (PDF) of this distribution evaluated at the specified point :code:`x`. In + general, the PDF is the derivative of the :meth:`~org.hipparchus.distribution.RealDistribution.cumulativeProbability`. + If the derivative does not exist at :code:`x`, then an appropriate replacement should be returned, e.g. + :code:`Double.POSITIVE_INFINITY`, :code:`Double.NaN`, or the limit inferior or limit superior of the difference + quotient. + + Parameters: + x (double): the point at which the PDF is evaluated + + Returns: + the value of the probability density function at point :code:`x` + + + """ + ... + def getMean(self) -> float: + """ + Access the mean. + + Returns: + the mean for this distribution. + + + """ + ... + def getNumericalMean(self) -> float: + """ + Use this method to get the numerical value of the mean of this distribution. For mean parameter :code:`mu`, the mean is + :code:`mu`. + + Returns: + the mean or :code:`Double.NaN` if it is not defined + + + """ + ... + def getNumericalVariance(self) -> float: + """ + Use this method to get the numerical value of the variance of this distribution. For standard deviation parameter + :code:`s`, the variance is :code:`s^2`. + + Returns: + the variance (possibly :code:`Double.POSITIVE_INFINITY` as for certain cases in + :class:`~org.hipparchus.distribution.continuous.TDistribution`) or :code:`Double.NaN` if it is not defined + + + """ + ... + def getStandardDeviation(self) -> float: + """ + Access the standard deviation. + + Returns: + the standard deviation for this distribution. + + + """ + ... + def getSupportLowerBound(self) -> float: + """ + Access the lower bound of the support. This method must return the same value as + :code:`inverseCumulativeProbability(0)`. In other words, this method must return + + :code:`inf {x in R | P(X <= x) > 0}`. + The lower bound of the support is always negative infinity no matter the parameters. + + Returns: + lower bound of the support (always :code:`Double.NEGATIVE_INFINITY`) + + + """ + ... + def getSupportUpperBound(self) -> float: + """ + Access the upper bound of the support. This method must return the same value as + :code:`inverseCumulativeProbability(1)`. In other words, this method must return + + :code:`inf {x in R | P(X <= x) = 1}`. + The upper bound of the support is always positive infinity no matter the parameters. + + Returns: + upper bound of the support (always :code:`Double.POSITIVE_INFINITY`) + + + """ + ... def inverseCumulativeProbability(self, double: float) -> float: ... - def isSupportConnected(self) -> bool: ... - def logDensity(self, double: float) -> float: ... + def isSupportConnected(self) -> bool: + """ + Use this method to get information about whether the support is connected, i.e. whether all values between the lower and + upper bound of the support are included in the support. The support of this distribution is connected. + + Returns: + :code:`true` + + + """ + ... + def logDensity(self, double: float) -> float: + """ + Returns the natural logarithm of the probability density function (PDF) of this distribution evaluated at the specified + point :code:`x`. In general, the PDF is the derivative of the + :meth:`~org.hipparchus.distribution.RealDistribution.cumulativeProbability`. If the derivative does not exist at + :code:`x`, then an appropriate replacement should be returned, e.g. :code:`Double.POSITIVE_INFINITY`, + :code:`Double.NaN`, or the limit inferior or limit superior of the difference quotient. Note that due to the floating + point precision and under/overflow issues, this method will for some distributions be more precise and faster than + computing the logarithm of :meth:`~org.hipparchus.distribution.RealDistribution.density`. + + The default implementation simply computes the logarithm of :code:`density(x)`. + + Specified by: + :meth:`~org.hipparchus.distribution.RealDistribution.logDensity` in + interface :class:`~org.hipparchus.distribution.RealDistribution` + + Overrides: + :meth:`~org.hipparchus.distribution.continuous.AbstractRealDistribution.logDensity` in + class :class:`~org.hipparchus.distribution.continuous.AbstractRealDistribution` + + Parameters: + x (double): the point at which the PDF is evaluated + + Returns: + the logarithm of the value of the probability density function at point :code:`x` + + + """ + ... def probability(self, double: float, double2: float) -> float: ... class ParetoDistribution(AbstractRealDistribution): + """ + public classParetoDistribution extends :class:`~org.hipparchus.distribution.continuous.AbstractRealDistribution` + + Implementation of the Pareto distribution. + + **Parameters:** The probability distribution function of :code:`X` is given by (for :code:`x >= k`): + + .. code-block: java + + α * k^α / x^(α + 1) + + + - :code:`k` is the *scale* parameter: this is the minimum possible value of :code:`X`, + - :code:`α` is the *shape* parameter: this is the Pareto index + + + Also see: + + - ` Pareto distribution (Wikipedia) <http://en.wikipedia.org/wiki/Pareto_distribution>` + - ` Pareto distribution (MathWorld) <http://mathworld.wolfram.com/ParetoDistribution.html>` + - :meth:`~serialized` + """ @typing.overload def __init__(self): ... @typing.overload def __init__(self, double: float, double2: float): ... @typing.overload def __init__(self, double: float, double2: float, double3: float): ... - def cumulativeProbability(self, double: float) -> float: ... - def density(self, double: float) -> float: ... - def getNumericalMean(self) -> float: ... - def getNumericalVariance(self) -> float: ... - def getScale(self) -> float: ... - def getShape(self) -> float: ... - def getSupportLowerBound(self) -> float: ... - def getSupportUpperBound(self) -> float: ... - def isSupportConnected(self) -> bool: ... - def logDensity(self, double: float) -> float: ... + def cumulativeProbability(self, double: float) -> float: + """ + For a random variable :code:`X` whose values are distributed according to this distribution, this method returns + :code:`P(X <= x)`. In other words, this method represents the (cumulative) distribution function (CDF) for this + distribution. + + For scale :code:`k`, and shape :code:`α` of this distribution, the CDF is given by + + - :code:`0` if :code:`x < k`, + - :code:`1 - (k / x)^α` otherwise. + + + Parameters: + x (double): the point at which the CDF is evaluated + + Returns: + the probability that a random variable with this distribution takes a value less than or equal to :code:`x` + + + """ + ... + def density(self, double: float) -> float: + """ + Returns the probability density function (PDF) of this distribution evaluated at the specified point :code:`x`. In + general, the PDF is the derivative of the :meth:`~org.hipparchus.distribution.RealDistribution.cumulativeProbability`. + If the derivative does not exist at :code:`x`, then an appropriate replacement should be returned, e.g. + :code:`Double.POSITIVE_INFINITY`, :code:`Double.NaN`, or the limit inferior or limit superior of the difference + quotient. + + For scale :code:`k`, and shape :code:`α` of this distribution, the PDF is given by + + - :code:`0` if :code:`x < k`, + - :code:`α * k^α / x^(α + 1)` otherwise. + + + Parameters: + x (double): the point at which the PDF is evaluated + + Returns: + the value of the probability density function at point :code:`x` + + + """ + ... + def getNumericalMean(self) -> float: + """ + Use this method to get the numerical value of the mean of this distribution. + + For scale :code:`k` and shape :code:`α`, the mean is given by + + - :code:`∞` if :code:`α <= 1`, + - :code:`α * k / (α - 1)` otherwise. + + + Returns: + the mean or :code:`Double.NaN` if it is not defined + + + """ + ... + def getNumericalVariance(self) -> float: + """ + Use this method to get the numerical value of the variance of this distribution. + + For scale :code:`k` and shape :code:`α`, the variance is given by + + - :code:`∞` if :code:`1 < α <= 2`, + - :code:`k^2 * α / ((α - 1)^2 * (α - 2))` otherwise. + + + Returns: + the variance (possibly :code:`Double.POSITIVE_INFINITY` as for certain cases in + :class:`~org.hipparchus.distribution.continuous.TDistribution`) or :code:`Double.NaN` if it is not defined + + + """ + ... + def getScale(self) -> float: + """ + Returns the scale parameter of this distribution. + + Returns: + the scale parameter + + + """ + ... + def getShape(self) -> float: + """ + Returns the shape parameter of this distribution. + + Returns: + the shape parameter + + + """ + ... + def getSupportLowerBound(self) -> float: + """ + Access the lower bound of the support. This method must return the same value as + :code:`inverseCumulativeProbability(0)`. In other words, this method must return + + :code:`inf {x in R | P(X <= x) > 0}`. + + The lower bound of the support is equal to the scale parameter :code:`k`. + + Returns: + lower bound of the support + + + """ + ... + def getSupportUpperBound(self) -> float: + """ + Access the upper bound of the support. This method must return the same value as + :code:`inverseCumulativeProbability(1)`. In other words, this method must return + + :code:`inf {x in R | P(X <= x) = 1}`. + + The upper bound of the support is always positive infinity no matter the parameters. + + Returns: + upper bound of the support (always :code:`Double.POSITIVE_INFINITY`) + + + """ + ... + def isSupportConnected(self) -> bool: + """ + Use this method to get information about whether the support is connected, i.e. whether all values between the lower and + upper bound of the support are included in the support. + + The support of this distribution is connected. + + Returns: + :code:`true` + + + """ + ... + def logDensity(self, double: float) -> float: + """ + Returns the natural logarithm of the probability density function (PDF) of this distribution evaluated at the specified + point :code:`x`. In general, the PDF is the derivative of the + :meth:`~org.hipparchus.distribution.RealDistribution.cumulativeProbability`. If the derivative does not exist at + :code:`x`, then an appropriate replacement should be returned, e.g. :code:`Double.POSITIVE_INFINITY`, + :code:`Double.NaN`, or the limit inferior or limit superior of the difference quotient. Note that due to the floating + point precision and under/overflow issues, this method will for some distributions be more precise and faster than + computing the logarithm of :meth:`~org.hipparchus.distribution.RealDistribution.density`. + + The default implementation simply computes the logarithm of :code:`density(x)`. See documentation of + :meth:`~org.hipparchus.distribution.continuous.ParetoDistribution.density` for computation details. + + Specified by: + :meth:`~org.hipparchus.distribution.RealDistribution.logDensity` in + interface :class:`~org.hipparchus.distribution.RealDistribution` + + Overrides: + :meth:`~org.hipparchus.distribution.continuous.AbstractRealDistribution.logDensity` in + class :class:`~org.hipparchus.distribution.continuous.AbstractRealDistribution` + + Parameters: + x (double): the point at which the PDF is evaluated + + Returns: + the logarithm of the value of the probability density function at point :code:`x` + + + """ + ... class TDistribution(AbstractRealDistribution): + """ + public classTDistribution extends :class:`~org.hipparchus.distribution.continuous.AbstractRealDistribution` + + Implementation of Student's t-distribution. + + Also see: + + - :meth:`~serialized` + """ @typing.overload def __init__(self, double: float): ... @typing.overload def __init__(self, double: float, double2: float): ... - def cumulativeProbability(self, double: float) -> float: ... - def density(self, double: float) -> float: ... - def getDegreesOfFreedom(self) -> float: ... - def getNumericalMean(self) -> float: ... - def getNumericalVariance(self) -> float: ... - def getSupportLowerBound(self) -> float: ... - def getSupportUpperBound(self) -> float: ... - def isSupportConnected(self) -> bool: ... - def logDensity(self, double: float) -> float: ... + def cumulativeProbability(self, double: float) -> float: + """ + For a random variable :code:`X` whose values are distributed according to this distribution, this method returns + :code:`P(X <= x)`. In other words, this method represents the (cumulative) distribution function (CDF) for this + distribution. + + Parameters: + x (double): the point at which the CDF is evaluated + + Returns: + the probability that a random variable with this distribution takes a value less than or equal to :code:`x` + + + """ + ... + def density(self, double: float) -> float: + """ + Returns the probability density function (PDF) of this distribution evaluated at the specified point :code:`x`. In + general, the PDF is the derivative of the :meth:`~org.hipparchus.distribution.RealDistribution.cumulativeProbability`. + If the derivative does not exist at :code:`x`, then an appropriate replacement should be returned, e.g. + :code:`Double.POSITIVE_INFINITY`, :code:`Double.NaN`, or the limit inferior or limit superior of the difference + quotient. + + Parameters: + x (double): the point at which the PDF is evaluated + + Returns: + the value of the probability density function at point :code:`x` + + + """ + ... + def getDegreesOfFreedom(self) -> float: + """ + Access the degrees of freedom. + + Returns: + the degrees of freedom. + + + """ + ... + def getNumericalMean(self) -> float: + """ + Use this method to get the numerical value of the mean of this distribution. For degrees of freedom parameter + :code:`df`, the mean is + + - if :code:`df > 1` then :code:`0`, + - else undefined (:code:`Double.NaN`). + + + Returns: + the mean or :code:`Double.NaN` if it is not defined + + + """ + ... + def getNumericalVariance(self) -> float: + """ + Use this method to get the numerical value of the variance of this distribution. For degrees of freedom parameter + :code:`df`, the variance is + + - if :code:`df > 2` then :code:`df / (df - 2)`, + - if :code:`1 < df <= 2` then positive infinity (:code:`Double.POSITIVE_INFINITY`), + - else undefined (:code:`Double.NaN`). + + + Returns: + the variance (possibly :code:`Double.POSITIVE_INFINITY` as for certain cases in + :class:`~org.hipparchus.distribution.continuous.TDistribution`) or :code:`Double.NaN` if it is not defined + + + """ + ... + def getSupportLowerBound(self) -> float: + """ + Access the lower bound of the support. This method must return the same value as + :code:`inverseCumulativeProbability(0)`. In other words, this method must return + + :code:`inf {x in R | P(X <= x) > 0}`. + The lower bound of the support is always negative infinity no matter the parameters. + + Returns: + lower bound of the support (always :code:`Double.NEGATIVE_INFINITY`) + + + """ + ... + def getSupportUpperBound(self) -> float: + """ + Access the upper bound of the support. This method must return the same value as + :code:`inverseCumulativeProbability(1)`. In other words, this method must return + + :code:`inf {x in R | P(X <= x) = 1}`. + The upper bound of the support is always positive infinity no matter the parameters. + + Returns: + upper bound of the support (always :code:`Double.POSITIVE_INFINITY`) + + + """ + ... + def isSupportConnected(self) -> bool: + """ + Use this method to get information about whether the support is connected, i.e. whether all values between the lower and + upper bound of the support are included in the support. The support of this distribution is connected. + + Returns: + :code:`true` + + + """ + ... + def logDensity(self, double: float) -> float: + """ + Returns the natural logarithm of the probability density function (PDF) of this distribution evaluated at the specified + point :code:`x`. In general, the PDF is the derivative of the + :meth:`~org.hipparchus.distribution.RealDistribution.cumulativeProbability`. If the derivative does not exist at + :code:`x`, then an appropriate replacement should be returned, e.g. :code:`Double.POSITIVE_INFINITY`, + :code:`Double.NaN`, or the limit inferior or limit superior of the difference quotient. Note that due to the floating + point precision and under/overflow issues, this method will for some distributions be more precise and faster than + computing the logarithm of :meth:`~org.hipparchus.distribution.RealDistribution.density`. + + The default implementation simply computes the logarithm of :code:`density(x)`. + + Specified by: + :meth:`~org.hipparchus.distribution.RealDistribution.logDensity` in + interface :class:`~org.hipparchus.distribution.RealDistribution` + + Overrides: + :meth:`~org.hipparchus.distribution.continuous.AbstractRealDistribution.logDensity` in + class :class:`~org.hipparchus.distribution.continuous.AbstractRealDistribution` + + Parameters: + x (double): the point at which the PDF is evaluated + + Returns: + the logarithm of the value of the probability density function at point :code:`x` + + + """ + ... class TriangularDistribution(AbstractRealDistribution): + """ + public classTriangularDistribution extends :class:`~org.hipparchus.distribution.continuous.AbstractRealDistribution` + + Implementation of the triangular real distribution. + + Also see: + + - ` Triangular distribution (Wikipedia) <http://en.wikipedia.org/wiki/Triangular_distribution>` + - :meth:`~serialized` + """ def __init__(self, double: float, double2: float, double3: float): ... - def cumulativeProbability(self, double: float) -> float: ... - def density(self, double: float) -> float: ... - def getMode(self) -> float: ... - def getNumericalMean(self) -> float: ... - def getNumericalVariance(self) -> float: ... - def getSupportLowerBound(self) -> float: ... - def getSupportUpperBound(self) -> float: ... + def cumulativeProbability(self, double: float) -> float: + """ + For a random variable :code:`X` whose values are distributed according to this distribution, this method returns + :code:`P(X <= x)`. In other words, this method represents the (cumulative) distribution function (CDF) for this + distribution. For lower limit :code:`a`, upper limit :code:`b` and mode :code:`c`, the CDF is given by + + - :code:`0` if :code:`x < a`, + - :code:`(x - a)^2 / [(b - a) * (c - a)]` if :code:`a <= x < c`, + - :code:`(c - a) / (b - a)` if :code:`x = c`, + - :code:`1 - (b - x)^2 / [(b - a) * (b - c)]` if :code:`c < x <= b`, + - :code:`1` if :code:`x > b`. + + + Parameters: + x (double): the point at which the CDF is evaluated + + Returns: + the probability that a random variable with this distribution takes a value less than or equal to :code:`x` + + + """ + ... + def density(self, double: float) -> float: + """ + Returns the probability density function (PDF) of this distribution evaluated at the specified point :code:`x`. In + general, the PDF is the derivative of the :meth:`~org.hipparchus.distribution.RealDistribution.cumulativeProbability`. + If the derivative does not exist at :code:`x`, then an appropriate replacement should be returned, e.g. + :code:`Double.POSITIVE_INFINITY`, :code:`Double.NaN`, or the limit inferior or limit superior of the difference + quotient. For lower limit :code:`a`, upper limit :code:`b` and mode :code:`c`, the PDF is given by + + - :code:`2 * (x - a) / [(b - a) * (c - a)]` if :code:`a <= x < c`, + - :code:`2 / (b - a)` if :code:`x = c`, + - :code:`2 * (b - x) / [(b - a) * (b - c)]` if :code:`c < x <= b`, + - :code:`0` otherwise. + + + Parameters: + x (double): the point at which the PDF is evaluated + + Returns: + the value of the probability density function at point :code:`x` + + + """ + ... + def getMode(self) -> float: + """ + Returns the mode :code:`c` of this distribution. + + Returns: + the mode :code:`c` of this distribution + + + """ + ... + def getNumericalMean(self) -> float: + """ + Use this method to get the numerical value of the mean of this distribution. For lower limit :code:`a`, upper limit + :code:`b`, and mode :code:`c`, the mean is :code:`(a + b + c) / 3`. + + Returns: + the mean or :code:`Double.NaN` if it is not defined + + + """ + ... + def getNumericalVariance(self) -> float: + """ + Use this method to get the numerical value of the variance of this distribution. For lower limit :code:`a`, upper limit + :code:`b`, and mode :code:`c`, the variance is :code:`(a^2 + b^2 + c^2 - a * b - a * c - b * c) / 18`. + + Returns: + the variance (possibly :code:`Double.POSITIVE_INFINITY` as for certain cases in + :class:`~org.hipparchus.distribution.continuous.TDistribution`) or :code:`Double.NaN` if it is not defined + + + """ + ... + def getSupportLowerBound(self) -> float: + """ + Access the lower bound of the support. This method must return the same value as + :code:`inverseCumulativeProbability(0)`. In other words, this method must return + + :code:`inf {x in R | P(X <= x) > 0}`. + The lower bound of the support is equal to the lower limit parameter :code:`a` of the distribution. + + Returns: + lower bound of the support + + + """ + ... + def getSupportUpperBound(self) -> float: + """ + Access the upper bound of the support. This method must return the same value as + :code:`inverseCumulativeProbability(1)`. In other words, this method must return + + :code:`inf {x in R | P(X <= x) = 1}`. + The upper bound of the support is equal to the upper limit parameter :code:`b` of the distribution. + + Returns: + upper bound of the support + + + """ + ... def inverseCumulativeProbability(self, double: float) -> float: ... - def isSupportConnected(self) -> bool: ... + def isSupportConnected(self) -> bool: + """ + Use this method to get information about whether the support is connected, i.e. whether all values between the lower and + upper bound of the support are included in the support. The support of this distribution is connected. + + Returns: + :code:`true` + + + """ + ... class UniformRealDistribution(AbstractRealDistribution): + """ + public classUniformRealDistribution extends :class:`~org.hipparchus.distribution.continuous.AbstractRealDistribution` + + Implementation of the uniform real distribution. + + Also see: + + - ` Uniform distribution (continuous), at Wikipedia <http://en.wikipedia.org/wiki/Uniform_distribution_(continuous)>` + - :meth:`~serialized` + """ @typing.overload def __init__(self): ... @typing.overload def __init__(self, double: float, double2: float): ... - def cumulativeProbability(self, double: float) -> float: ... - def density(self, double: float) -> float: ... - def getNumericalMean(self) -> float: ... - def getNumericalVariance(self) -> float: ... - def getSupportLowerBound(self) -> float: ... - def getSupportUpperBound(self) -> float: ... + def cumulativeProbability(self, double: float) -> float: + """ + For a random variable :code:`X` whose values are distributed according to this distribution, this method returns + :code:`P(X <= x)`. In other words, this method represents the (cumulative) distribution function (CDF) for this + distribution. + + Parameters: + x (double): the point at which the CDF is evaluated + + Returns: + the probability that a random variable with this distribution takes a value less than or equal to :code:`x` + + + """ + ... + def density(self, double: float) -> float: + """ + Returns the probability density function (PDF) of this distribution evaluated at the specified point :code:`x`. In + general, the PDF is the derivative of the :meth:`~org.hipparchus.distribution.RealDistribution.cumulativeProbability`. + If the derivative does not exist at :code:`x`, then an appropriate replacement should be returned, e.g. + :code:`Double.POSITIVE_INFINITY`, :code:`Double.NaN`, or the limit inferior or limit superior of the difference + quotient. + + Parameters: + x (double): the point at which the PDF is evaluated + + Returns: + the value of the probability density function at point :code:`x` + + + """ + ... + def getNumericalMean(self) -> float: + """ + Use this method to get the numerical value of the mean of this distribution. For lower bound :code:`lower` and upper + bound :code:`upper`, the mean is :code:`0.5 * (lower + upper)`. + + Returns: + the mean or :code:`Double.NaN` if it is not defined + + + """ + ... + def getNumericalVariance(self) -> float: + """ + Use this method to get the numerical value of the variance of this distribution. For lower bound :code:`lower` and upper + bound :code:`upper`, the variance is :code:`(upper - lower)^2 / 12`. + + Returns: + the variance (possibly :code:`Double.POSITIVE_INFINITY` as for certain cases in + :class:`~org.hipparchus.distribution.continuous.TDistribution`) or :code:`Double.NaN` if it is not defined + + + """ + ... + def getSupportLowerBound(self) -> float: + """ + Access the lower bound of the support. This method must return the same value as + :code:`inverseCumulativeProbability(0)`. In other words, this method must return + + :code:`inf {x in R | P(X <= x) > 0}`. + The lower bound of the support is equal to the lower bound parameter of the distribution. + + Returns: + lower bound of the support + + + """ + ... + def getSupportUpperBound(self) -> float: + """ + Access the upper bound of the support. This method must return the same value as + :code:`inverseCumulativeProbability(1)`. In other words, this method must return + + :code:`inf {x in R | P(X <= x) = 1}`. + The upper bound of the support is equal to the upper bound parameter of the distribution. + + Returns: + upper bound of the support + + + """ + ... def inverseCumulativeProbability(self, double: float) -> float: ... - def isSupportConnected(self) -> bool: ... + def isSupportConnected(self) -> bool: + """ + Use this method to get information about whether the support is connected, i.e. whether all values between the lower and + upper bound of the support are included in the support. The support of this distribution is connected. + + Returns: + :code:`true` + + + """ + ... class WeibullDistribution(AbstractRealDistribution): + """ + public classWeibullDistribution extends :class:`~org.hipparchus.distribution.continuous.AbstractRealDistribution` + + Implementation of the Weibull distribution. This implementation uses the two parameter form of the distribution defined + by ` Weibull Distribution <http://mathworld.wolfram.com/WeibullDistribution.html>`, equations (1) and (2). + + Also see: + + - `Weibull distribution (Wikipedia) <http://en.wikipedia.org/wiki/Weibull_distribution>` + - `Weibull distribution (MathWorld) <http://mathworld.wolfram.com/WeibullDistribution.html>` + - :meth:`~serialized` + """ def __init__(self, double: float, double2: float): ... - def cumulativeProbability(self, double: float) -> float: ... - def density(self, double: float) -> float: ... - def getNumericalMean(self) -> float: ... - def getNumericalVariance(self) -> float: ... - def getScale(self) -> float: ... - def getShape(self) -> float: ... - def getSupportLowerBound(self) -> float: ... - def getSupportUpperBound(self) -> float: ... - def inverseCumulativeProbability(self, double: float) -> float: ... - def isSupportConnected(self) -> bool: ... - def logDensity(self, double: float) -> float: ... + def cumulativeProbability(self, double: float) -> float: + """ + For a random variable :code:`X` whose values are distributed according to this distribution, this method returns + :code:`P(X <= x)`. In other words, this method represents the (cumulative) distribution function (CDF) for this + distribution. + + Parameters: + x (double): the point at which the CDF is evaluated + + Returns: + the probability that a random variable with this distribution takes a value less than or equal to :code:`x` + + + """ + ... + def density(self, double: float) -> float: + """ + Returns the probability density function (PDF) of this distribution evaluated at the specified point :code:`x`. In + general, the PDF is the derivative of the :meth:`~org.hipparchus.distribution.RealDistribution.cumulativeProbability`. + If the derivative does not exist at :code:`x`, then an appropriate replacement should be returned, e.g. + :code:`Double.POSITIVE_INFINITY`, :code:`Double.NaN`, or the limit inferior or limit superior of the difference + quotient. + + Parameters: + x (double): the point at which the PDF is evaluated + + Returns: + the value of the probability density function at point :code:`x` + + + """ + ... + def getNumericalMean(self) -> float: + """ + Use this method to get the numerical value of the mean of this distribution. The mean is :code:`scale * Gamma(1 + (1 / + shape))`, where :code:`Gamma()` is the Gamma-function. + + Returns: + the mean or :code:`Double.NaN` if it is not defined + + + """ + ... + def getNumericalVariance(self) -> float: + """ + Use this method to get the numerical value of the variance of this distribution. The variance is :code:`scale^2 * + Gamma(1 + (2 / shape)) - mean^2` where :code:`Gamma()` is the Gamma-function. + + Returns: + the variance (possibly :code:`Double.POSITIVE_INFINITY` as for certain cases in + :class:`~org.hipparchus.distribution.continuous.TDistribution`) or :code:`Double.NaN` if it is not defined + + + """ + ... + def getScale(self) -> float: + """ + Access the scale parameter, :code:`beta`. + + Returns: + the scale parameter, :code:`beta`. + + + """ + ... + def getShape(self) -> float: + """ + Access the shape parameter, :code:`alpha`. + + Returns: + the shape parameter, :code:`alpha`. + + + """ + ... + def getSupportLowerBound(self) -> float: + """ + Access the lower bound of the support. This method must return the same value as + :code:`inverseCumulativeProbability(0)`. In other words, this method must return + + :code:`inf {x in R | P(X <= x) > 0}`. + The lower bound of the support is always 0 no matter the parameters. + + Returns: + lower bound of the support (always 0) + + + """ + ... + def getSupportUpperBound(self) -> float: + """ + Access the upper bound of the support. This method must return the same value as + :code:`inverseCumulativeProbability(1)`. In other words, this method must return + + :code:`inf {x in R | P(X <= x) = 1}`. + The upper bound of the support is always positive infinity no matter the parameters. + + Returns: + upper bound of the support (always :code:`Double.POSITIVE_INFINITY`) + + + """ + ... + def inverseCumulativeProbability(self, double: float) -> float: + """ + Computes the quantile function of this distribution. For a random variable :code:`X` distributed according to this + distribution, the returned value is + + - :code:`inf{x in R | P(X<=x) >= p}` for :code:`0 < p <= 1`, + - :code:`inf{x in R | P(X<=x) > 0}` for :code:`p = 0`. + + The default implementation returns + + - :meth:`~org.hipparchus.distribution.RealDistribution.getSupportLowerBound` for :code:`p = 0`, + - :meth:`~org.hipparchus.distribution.RealDistribution.getSupportUpperBound` for :code:`p = 1`. + + Returns :code:`0` when :code:`p == 0` and :code:`Double.POSITIVE_INFINITY` when :code:`p == 1`. + + Specified by: + :meth:`~org.hipparchus.distribution.RealDistribution.inverseCumulativeProbability` in + interface :class:`~org.hipparchus.distribution.RealDistribution` + + Overrides: + :meth:`~org.hipparchus.distribution.continuous.AbstractRealDistribution.inverseCumulativeProbability` in + class :class:`~org.hipparchus.distribution.continuous.AbstractRealDistribution` + + Parameters: + p (double): the cumulative probability + + Returns: + the smallest :code:`p`-quantile of this distribution (largest 0-quantile for :code:`p = 0`) + + + """ + ... + def isSupportConnected(self) -> bool: + """ + Use this method to get information about whether the support is connected, i.e. whether all values between the lower and + upper bound of the support are included in the support. The support of this distribution is connected. + + Returns: + :code:`true` + + + """ + ... + def logDensity(self, double: float) -> float: + """ + Returns the natural logarithm of the probability density function (PDF) of this distribution evaluated at the specified + point :code:`x`. In general, the PDF is the derivative of the + :meth:`~org.hipparchus.distribution.RealDistribution.cumulativeProbability`. If the derivative does not exist at + :code:`x`, then an appropriate replacement should be returned, e.g. :code:`Double.POSITIVE_INFINITY`, + :code:`Double.NaN`, or the limit inferior or limit superior of the difference quotient. Note that due to the floating + point precision and under/overflow issues, this method will for some distributions be more precise and faster than + computing the logarithm of :meth:`~org.hipparchus.distribution.RealDistribution.density`. + + The default implementation simply computes the logarithm of :code:`density(x)`. + + Specified by: + :meth:`~org.hipparchus.distribution.RealDistribution.logDensity` in + interface :class:`~org.hipparchus.distribution.RealDistribution` + + Overrides: + :meth:`~org.hipparchus.distribution.continuous.AbstractRealDistribution.logDensity` in + class :class:`~org.hipparchus.distribution.continuous.AbstractRealDistribution` + + Parameters: + x (double): the point at which the PDF is evaluated + + Returns: + the logarithm of the value of the probability density function at point :code:`x` + + + """ + ... class __module_protocol__(Protocol): diff --git a/org-stubs/hipparchus/distribution/discrete/__init__.pyi b/org-stubs/hipparchus/distribution/discrete/__init__.pyi index 5ac9411..3556847 100644 --- a/org-stubs/hipparchus/distribution/discrete/__init__.pyi +++ b/org-stubs/hipparchus/distribution/discrete/__init__.pyi @@ -15,100 +15,859 @@ import typing class AbstractIntegerDistribution(org.hipparchus.distribution.IntegerDistribution, java.io.Serializable): + """ + public abstract classAbstractIntegerDistribution extends :class:`~org.hipparchus.distribution.discrete.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.distribution.IntegerDistribution`, :class:`~org.hipparchus.distribution.discrete.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + Base class for integer-valued discrete distributions. + + Default implementations are provided for some of the methods that do not vary from distribution to distribution. + + Also see: + + - :meth:`~serialized` + """ def __init__(self): ... def inverseCumulativeProbability(self, double: float) -> int: ... - def logProbability(self, int: int) -> float: ... + def logProbability(self, int: int) -> float: + """ + For a random variable :code:`X` whose values are distributed according to this distribution, this method returns + :code:`log(P(X = x))`, where :code:`log` is the natural logarithm. In other words, this method represents the logarithm + of the probability mass function (PMF) for the distribution. Note that due to the floating point precision and + under/overflow issues, this method will for some distributions be more precise and faster than computing the logarithm + of :meth:`~org.hipparchus.distribution.IntegerDistribution.probability`. + + The default implementation simply computes the logarithm of :code:`probability(x)`. + + Specified by: + :meth:`~org.hipparchus.distribution.IntegerDistribution.logProbability` in + interface :class:`~org.hipparchus.distribution.IntegerDistribution` + + Parameters: + x (int): the point at which the PMF is evaluated + + Returns: + the logarithm of the value of the probability mass function at :code:`x` + + + """ + ... @typing.overload def probability(self, int: int) -> float: ... @typing.overload def probability(self, int: int, int2: int) -> float: ... class BinomialDistribution(AbstractIntegerDistribution): + """ + public classBinomialDistribution extends :class:`~org.hipparchus.distribution.discrete.AbstractIntegerDistribution` + + Implementation of the binomial distribution. + + Also see: + + - `Binomial distribution (Wikipedia) <http://en.wikipedia.org/wiki/Binomial_distribution>` + - `Binomial Distribution (MathWorld) <http://mathworld.wolfram.com/BinomialDistribution.html>` + - :meth:`~serialized` + """ def __init__(self, int: int, double: float): ... - def cumulativeProbability(self, int: int) -> float: ... - def getNumberOfTrials(self) -> int: ... - def getNumericalMean(self) -> float: ... - def getNumericalVariance(self) -> float: ... - def getProbabilityOfSuccess(self) -> float: ... - def getSupportLowerBound(self) -> int: ... - def getSupportUpperBound(self) -> int: ... - def isSupportConnected(self) -> bool: ... - def logProbability(self, int: int) -> float: ... + def cumulativeProbability(self, int: int) -> float: + """ + For a random variable :code:`X` whose values are distributed according to this distribution, this method returns + :code:`P(X <= x)`. In other words, this method represents the (cumulative) distribution function (CDF) for this + distribution. + + Parameters: + x (int): the point at which the CDF is evaluated + + Returns: + the probability that a random variable with this distribution takes a value less than or equal to :code:`x` + + + """ + ... + def getNumberOfTrials(self) -> int: + """ + Access the number of trials for this distribution. + + Returns: + the number of trials. + + + """ + ... + def getNumericalMean(self) -> float: + """ + Use this method to get the numerical value of the mean of this distribution. For :code:`n` trials and probability + parameter :code:`p`, the mean is :code:`n * p`. + + Returns: + the mean or :code:`Double.NaN` if it is not defined + + + """ + ... + def getNumericalVariance(self) -> float: + """ + Use this method to get the numerical value of the variance of this distribution. For :code:`n` trials and probability + parameter :code:`p`, the variance is :code:`n * p * (1 - p)`. + + Returns: + the variance (possibly :code:`Double.POSITIVE_INFINITY` or :code:`Double.NaN` if it is not defined) + + + """ + ... + def getProbabilityOfSuccess(self) -> float: + """ + Access the probability of success for this distribution. + + Returns: + the probability of success. + + + """ + ... + def getSupportLowerBound(self) -> int: + """ + Access the lower bound of the support. This method must return the same value as + :code:`inverseCumulativeProbability(0)`. In other words, this method must return + + :code:`inf {x in Z | P(X <= x) > 0}`. + The lower bound of the support is always 0 except for the probability parameter :code:`p = 1`. + + Returns: + lower bound of the support (0 or the number of trials) + + + """ + ... + def getSupportUpperBound(self) -> int: + """ + Access the upper bound of the support. This method must return the same value as + :code:`inverseCumulativeProbability(1)`. In other words, this method must return + + :code:`inf {x in R | P(X <= x) = 1}`. + The upper bound of the support is the number of trials except for the probability parameter :code:`p = 0`. + + Returns: + upper bound of the support (number of trials or 0) + + + """ + ... + def isSupportConnected(self) -> bool: + """ + Use this method to get information about whether the support is connected, i.e. whether all integers between the lower + and upper bound of the support are included in the support. The support of this distribution is connected. + + Returns: + :code:`true` + + + """ + ... + def logProbability(self, int: int) -> float: + """ + For a random variable :code:`X` whose values are distributed according to this distribution, this method returns + :code:`log(P(X = x))`, where :code:`log` is the natural logarithm. In other words, this method represents the logarithm + of the probability mass function (PMF) for the distribution. Note that due to the floating point precision and + under/overflow issues, this method will for some distributions be more precise and faster than computing the logarithm + of :meth:`~org.hipparchus.distribution.IntegerDistribution.probability`. + + The default implementation simply computes the logarithm of :code:`probability(x)`. + + Specified by: + :meth:`~org.hipparchus.distribution.IntegerDistribution.logProbability` in + interface :class:`~org.hipparchus.distribution.IntegerDistribution` + + Overrides: + :meth:`~org.hipparchus.distribution.discrete.AbstractIntegerDistribution.logProbability` in + class :class:`~org.hipparchus.distribution.discrete.AbstractIntegerDistribution` + + Parameters: + x (int): the point at which the PMF is evaluated + + Returns: + the logarithm of the value of the probability mass function at :code:`x` + + + """ + ... @typing.overload def probability(self, int: int, int2: int) -> float: ... @typing.overload - def probability(self, int: int) -> float: ... + def probability(self, int: int) -> float: + """ + For a random variable :code:`X` whose values are distributed according to this distribution, this method returns + :code:`P(X = x)`. In other words, this method represents the probability mass function (PMF) for the distribution. + + Parameters: + x (int): the point at which the PMF is evaluated + + Returns: + the value of the probability mass function at :code:`x` + + + """ + ... class EnumeratedIntegerDistribution(AbstractIntegerDistribution): + """ + public classEnumeratedIntegerDistribution extends :class:`~org.hipparchus.distribution.discrete.AbstractIntegerDistribution` + + Implementation of an integer-valued :class:`~org.hipparchus.distribution.EnumeratedDistribution`. + + Values with zero-probability are allowed but they do not extend the support. + + Duplicate values are allowed. Probabilities of duplicate values are combined when computing cumulative probabilities and + statistics. + + Also see: + + - :meth:`~serialized` + """ @typing.overload def __init__(self, intArray: typing.Union[typing.List[int], jpype.JArray]): ... @typing.overload def __init__(self, intArray: typing.Union[typing.List[int], jpype.JArray], doubleArray: typing.Union[typing.List[float], jpype.JArray]): ... - def cumulativeProbability(self, int: int) -> float: ... - def getNumericalMean(self) -> float: ... - def getNumericalVariance(self) -> float: ... + def cumulativeProbability(self, int: int) -> float: + """ + For a random variable :code:`X` whose values are distributed according to this distribution, this method returns + :code:`P(X <= x)`. In other words, this method represents the (cumulative) distribution function (CDF) for this + distribution. + + Parameters: + x (int): the point at which the CDF is evaluated + + Returns: + the probability that a random variable with this distribution takes a value less than or equal to :code:`x` + + + """ + ... + def getNumericalMean(self) -> float: + """ + Use this method to get the numerical value of the mean of this distribution. + + Returns: + :code:`sum(singletons[i] * probabilities[i])` + + + """ + ... + def getNumericalVariance(self) -> float: + """ + Use this method to get the numerical value of the variance of this distribution. + + Returns: + :code:`sum((singletons[i] - mean) ^ 2 * probabilities[i])` + + + """ + ... def getPmf(self) -> java.util.List[org.hipparchus.util.Pair[int, float]]: ... - def getSupportLowerBound(self) -> int: ... - def getSupportUpperBound(self) -> int: ... - def isSupportConnected(self) -> bool: ... + def getSupportLowerBound(self) -> int: + """ + Access the lower bound of the support. This method must return the same value as + :code:`inverseCumulativeProbability(0)`. In other words, this method must return + + :code:`inf {x in Z | P(X <= x) > 0}`. + Returns the lowest value with non-zero probability. + + Returns: + the lowest value with non-zero probability. + + + """ + ... + def getSupportUpperBound(self) -> int: + """ + Access the upper bound of the support. This method must return the same value as + :code:`inverseCumulativeProbability(1)`. In other words, this method must return + + :code:`inf {x in R | P(X <= x) = 1}`. + Returns the highest value with non-zero probability. + + Returns: + the highest value with non-zero probability. + + + """ + ... + def isSupportConnected(self) -> bool: + """ + Use this method to get information about whether the support is connected, i.e. whether all integers between the lower + and upper bound of the support are included in the support. The support of this distribution is connected. + + Returns: + :code:`true` + + + """ + ... @typing.overload def probability(self, int: int, int2: int) -> float: ... @typing.overload - def probability(self, int: int) -> float: ... + def probability(self, int: int) -> float: + """ + For a random variable :code:`X` whose values are distributed according to this distribution, this method returns + :code:`P(X = x)`. In other words, this method represents the probability mass function (PMF) for the distribution. + + Parameters: + x (int): the point at which the PMF is evaluated + + Returns: + the value of the probability mass function at :code:`x` + + + """ + ... class GeometricDistribution(AbstractIntegerDistribution): + """ + public classGeometricDistribution extends :class:`~org.hipparchus.distribution.discrete.AbstractIntegerDistribution` + + Implementation of the geometric distribution. + + Also see: + + - `Geometric distribution (Wikipedia) <http://en.wikipedia.org/wiki/Geometric_distribution>` + - `Geometric Distribution (MathWorld) <http://mathworld.wolfram.com/GeometricDistribution.html>` + - :meth:`~serialized` + """ def __init__(self, double: float): ... - def cumulativeProbability(self, int: int) -> float: ... - def getNumericalMean(self) -> float: ... - def getNumericalVariance(self) -> float: ... - def getProbabilityOfSuccess(self) -> float: ... - def getSupportLowerBound(self) -> int: ... - def getSupportUpperBound(self) -> int: ... + def cumulativeProbability(self, int: int) -> float: + """ + For a random variable :code:`X` whose values are distributed according to this distribution, this method returns + :code:`P(X <= x)`. In other words, this method represents the (cumulative) distribution function (CDF) for this + distribution. + + Parameters: + x (int): the point at which the CDF is evaluated + + Returns: + the probability that a random variable with this distribution takes a value less than or equal to :code:`x` + + + """ + ... + def getNumericalMean(self) -> float: + """ + Use this method to get the numerical value of the mean of this distribution. For probability parameter :code:`p`, the + mean is :code:`(1 - p) / p`. + + Returns: + the mean or :code:`Double.NaN` if it is not defined + + + """ + ... + def getNumericalVariance(self) -> float: + """ + Use this method to get the numerical value of the variance of this distribution. For probability parameter :code:`p`, + the variance is :code:`(1 - p) / (p * p)`. + + Returns: + the variance (possibly :code:`Double.POSITIVE_INFINITY` or :code:`Double.NaN` if it is not defined) + + + """ + ... + def getProbabilityOfSuccess(self) -> float: + """ + Access the probability of success for this distribution. + + Returns: + the probability of success. + + + """ + ... + def getSupportLowerBound(self) -> int: + """ + Access the lower bound of the support. This method must return the same value as + :code:`inverseCumulativeProbability(0)`. In other words, this method must return + + :code:`inf {x in Z | P(X <= x) > 0}`. + The lower bound of the support is always 0. + + Returns: + lower bound of the support (always 0) + + + """ + ... + def getSupportUpperBound(self) -> int: + """ + Access the upper bound of the support. This method must return the same value as + :code:`inverseCumulativeProbability(1)`. In other words, this method must return + + :code:`inf {x in R | P(X <= x) = 1}`. + The upper bound of the support is infinite (which we approximate as :code:`Integer.MAX_VALUE`). + + Returns: + upper bound of the support (always Integer.MAX_VALUE) + + + """ + ... def inverseCumulativeProbability(self, double: float) -> int: ... - def isSupportConnected(self) -> bool: ... - def logProbability(self, int: int) -> float: ... + def isSupportConnected(self) -> bool: + """ + Use this method to get information about whether the support is connected, i.e. whether all integers between the lower + and upper bound of the support are included in the support. The support of this distribution is connected. + + Returns: + :code:`true` + + + """ + ... + def logProbability(self, int: int) -> float: + """ + For a random variable :code:`X` whose values are distributed according to this distribution, this method returns + :code:`log(P(X = x))`, where :code:`log` is the natural logarithm. In other words, this method represents the logarithm + of the probability mass function (PMF) for the distribution. Note that due to the floating point precision and + under/overflow issues, this method will for some distributions be more precise and faster than computing the logarithm + of :meth:`~org.hipparchus.distribution.IntegerDistribution.probability`. + + The default implementation simply computes the logarithm of :code:`probability(x)`. + + Specified by: + :meth:`~org.hipparchus.distribution.IntegerDistribution.logProbability` in + interface :class:`~org.hipparchus.distribution.IntegerDistribution` + + Overrides: + :meth:`~org.hipparchus.distribution.discrete.AbstractIntegerDistribution.logProbability` in + class :class:`~org.hipparchus.distribution.discrete.AbstractIntegerDistribution` + + Parameters: + x (int): the point at which the PMF is evaluated + + Returns: + the logarithm of the value of the probability mass function at :code:`x` + + + """ + ... @typing.overload def probability(self, int: int, int2: int) -> float: ... @typing.overload - def probability(self, int: int) -> float: ... + def probability(self, int: int) -> float: + """ + For a random variable :code:`X` whose values are distributed according to this distribution, this method returns + :code:`P(X = x)`. In other words, this method represents the probability mass function (PMF) for the distribution. + + Parameters: + x (int): the point at which the PMF is evaluated + + Returns: + the value of the probability mass function at :code:`x` + + + """ + ... class HypergeometricDistribution(AbstractIntegerDistribution): + """ + public classHypergeometricDistribution extends :class:`~org.hipparchus.distribution.discrete.AbstractIntegerDistribution` + + Implementation of the hypergeometric distribution. + + Also see: + + - `Hypergeometric distribution (Wikipedia) <http://en.wikipedia.org/wiki/Hypergeometric_distribution>` + - `Hypergeometric distribution (MathWorld) <http://mathworld.wolfram.com/HypergeometricDistribution.html>` + - :meth:`~serialized` + """ def __init__(self, int: int, int2: int, int3: int): ... - def cumulativeProbability(self, int: int) -> float: ... - def getNumberOfSuccesses(self) -> int: ... - def getNumericalMean(self) -> float: ... - def getNumericalVariance(self) -> float: ... - def getPopulationSize(self) -> int: ... - def getSampleSize(self) -> int: ... - def getSupportLowerBound(self) -> int: ... - def getSupportUpperBound(self) -> int: ... - def isSupportConnected(self) -> bool: ... - def logProbability(self, int: int) -> float: ... + def cumulativeProbability(self, int: int) -> float: + """ + For a random variable :code:`X` whose values are distributed according to this distribution, this method returns + :code:`P(X <= x)`. In other words, this method represents the (cumulative) distribution function (CDF) for this + distribution. + + Parameters: + x (int): the point at which the CDF is evaluated + + Returns: + the probability that a random variable with this distribution takes a value less than or equal to :code:`x` + + + """ + ... + def getNumberOfSuccesses(self) -> int: + """ + Access the number of successes. + + Returns: + the number of successes. + + + """ + ... + def getNumericalMean(self) -> float: + """ + Use this method to get the numerical value of the mean of this distribution. For population size :code:`N`, number of + successes :code:`m`, and sample size :code:`n`, the mean is :code:`n * m / N`. + + Returns: + the mean or :code:`Double.NaN` if it is not defined + + + """ + ... + def getNumericalVariance(self) -> float: + """ + Use this method to get the numerical value of the variance of this distribution. For population size :code:`N`, number + of successes :code:`m`, and sample size :code:`n`, the variance is :code:`[n * m * (N - n) * (N - m)] / [N^2 * (N - + 1)]`. + + Returns: + the variance (possibly :code:`Double.POSITIVE_INFINITY` or :code:`Double.NaN` if it is not defined) + + + """ + ... + def getPopulationSize(self) -> int: + """ + Access the population size. + + Returns: + the population size. + + + """ + ... + def getSampleSize(self) -> int: + """ + Access the sample size. + + Returns: + the sample size. + + + """ + ... + def getSupportLowerBound(self) -> int: + """ + Access the lower bound of the support. This method must return the same value as + :code:`inverseCumulativeProbability(0)`. In other words, this method must return + + :code:`inf {x in Z | P(X <= x) > 0}`. + For population size :code:`N`, number of successes :code:`m`, and sample size :code:`n`, the lower bound of the support + is :code:`max(0, n + m - N)`. + + Returns: + lower bound of the support + + + """ + ... + def getSupportUpperBound(self) -> int: + """ + Access the upper bound of the support. This method must return the same value as + :code:`inverseCumulativeProbability(1)`. In other words, this method must return + + :code:`inf {x in R | P(X <= x) = 1}`. + For number of successes :code:`m` and sample size :code:`n`, the upper bound of the support is :code:`min(m, n)`. + + Returns: + upper bound of the support + + + """ + ... + def isSupportConnected(self) -> bool: + """ + Use this method to get information about whether the support is connected, i.e. whether all integers between the lower + and upper bound of the support are included in the support. The support of this distribution is connected. + + Returns: + :code:`true` + + + """ + ... + def logProbability(self, int: int) -> float: + """ + For a random variable :code:`X` whose values are distributed according to this distribution, this method returns + :code:`log(P(X = x))`, where :code:`log` is the natural logarithm. In other words, this method represents the logarithm + of the probability mass function (PMF) for the distribution. Note that due to the floating point precision and + under/overflow issues, this method will for some distributions be more precise and faster than computing the logarithm + of :meth:`~org.hipparchus.distribution.IntegerDistribution.probability`. + + The default implementation simply computes the logarithm of :code:`probability(x)`. + + Specified by: + :meth:`~org.hipparchus.distribution.IntegerDistribution.logProbability` in + interface :class:`~org.hipparchus.distribution.IntegerDistribution` + + Overrides: + :meth:`~org.hipparchus.distribution.discrete.AbstractIntegerDistribution.logProbability` in + class :class:`~org.hipparchus.distribution.discrete.AbstractIntegerDistribution` + + Parameters: + x (int): the point at which the PMF is evaluated + + Returns: + the logarithm of the value of the probability mass function at :code:`x` + + + """ + ... @typing.overload def probability(self, int: int, int2: int) -> float: ... @typing.overload - def probability(self, int: int) -> float: ... - def upperCumulativeProbability(self, int: int) -> float: ... + def probability(self, int: int) -> float: + """ + For a random variable :code:`X` whose values are distributed according to this distribution, this method returns + :code:`P(X = x)`. In other words, this method represents the probability mass function (PMF) for the distribution. + + Parameters: + x (int): the point at which the PMF is evaluated + + Returns: + the value of the probability mass function at :code:`x` + + + """ + ... + def upperCumulativeProbability(self, int: int) -> float: + """ + For this distribution, :code:`X`, this method returns :code:`P(X >= x)`. + + Parameters: + x (int): Value at which the CDF is evaluated. + + Returns: + the upper tail CDF for this distribution. + + + """ + ... class PascalDistribution(AbstractIntegerDistribution): + """ + public classPascalDistribution extends :class:`~org.hipparchus.distribution.discrete.AbstractIntegerDistribution` + + Implementation of the Pascal distribution. + + The Pascal distribution is a special case of the Negative Binomial distribution where the number of successes parameter + is an integer. + + There are various ways to express the probability mass and distribution functions for the Pascal distribution. The + present implementation represents the distribution of the number of failures before :code:`r` successes occur. This is + the convention adopted in e.g. `MathWorld <http://mathworld.wolfram.com/NegativeBinomialDistribution.html>`, but *not* + in `Wikipedia <http://en.wikipedia.org/wiki/Negative_binomial_distribution>`. + + For a random variable :code:`X` whose values are distributed according to this distribution, the probability mass + function is given by + + + :code:`P(X = k) = C(k + r - 1, r - 1) * p^r * (1 - p)^k,` + + + where :code:`r` is the number of successes, :code:`p` is the probability of success, and :code:`X` is the total number + of failures. :code:`C(n, k)` is the binomial coefficient (:code:`n` choose :code:`k`). The mean and variance of + :code:`X` are + + + :code:`E(X) = (1 - p) * r / p, var(X) = (1 - p) * r / p^2.` + + + Finally, the cumulative distribution function is given by + + + :code:`P(X <= k) = I(p, r, k + 1)`, where I is the regularized incomplete Beta function. + + Also see: + + - ` Negative binomial distribution (Wikipedia) <http://en.wikipedia.org/wiki/Negative_binomial_distribution>` + - ` Negative binomial distribution (MathWorld) <http://mathworld.wolfram.com/NegativeBinomialDistribution.html>` + - :meth:`~serialized` + """ def __init__(self, int: int, double: float): ... - def cumulativeProbability(self, int: int) -> float: ... - def getNumberOfSuccesses(self) -> int: ... - def getNumericalMean(self) -> float: ... - def getNumericalVariance(self) -> float: ... - def getProbabilityOfSuccess(self) -> float: ... - def getSupportLowerBound(self) -> int: ... - def getSupportUpperBound(self) -> int: ... - def isSupportConnected(self) -> bool: ... - def logProbability(self, int: int) -> float: ... + def cumulativeProbability(self, int: int) -> float: + """ + For a random variable :code:`X` whose values are distributed according to this distribution, this method returns + :code:`P(X <= x)`. In other words, this method represents the (cumulative) distribution function (CDF) for this + distribution. + + Parameters: + x (int): the point at which the CDF is evaluated + + Returns: + the probability that a random variable with this distribution takes a value less than or equal to :code:`x` + + + """ + ... + def getNumberOfSuccesses(self) -> int: + """ + Access the number of successes for this distribution. + + Returns: + the number of successes. + + + """ + ... + def getNumericalMean(self) -> float: + """ + Use this method to get the numerical value of the mean of this distribution. For number of successes :code:`r` and + probability of success :code:`p`, the mean is :code:`r * (1 - p) / p`. + + Returns: + the mean or :code:`Double.NaN` if it is not defined + + + """ + ... + def getNumericalVariance(self) -> float: + """ + Use this method to get the numerical value of the variance of this distribution. For number of successes :code:`r` and + probability of success :code:`p`, the variance is :code:`r * (1 - p) / p^2`. + + Returns: + the variance (possibly :code:`Double.POSITIVE_INFINITY` or :code:`Double.NaN` if it is not defined) + + + """ + ... + def getProbabilityOfSuccess(self) -> float: + """ + Access the probability of success for this distribution. + + Returns: + the probability of success. + + + """ + ... + def getSupportLowerBound(self) -> int: + """ + Access the lower bound of the support. This method must return the same value as + :code:`inverseCumulativeProbability(0)`. In other words, this method must return + + :code:`inf {x in Z | P(X <= x) > 0}`. + The lower bound of the support is always 0 no matter the parameters. + + Returns: + lower bound of the support (always 0) + + + """ + ... + def getSupportUpperBound(self) -> int: + """ + Access the upper bound of the support. This method must return the same value as + :code:`inverseCumulativeProbability(1)`. In other words, this method must return + + :code:`inf {x in R | P(X <= x) = 1}`. + The upper bound of the support is always positive infinity no matter the parameters. Positive infinity is symbolized by + :code:`Integer.MAX_VALUE`. + + Returns: + upper bound of the support (always :code:`Integer.MAX_VALUE` for positive infinity) + + + """ + ... + def isSupportConnected(self) -> bool: + """ + Use this method to get information about whether the support is connected, i.e. whether all integers between the lower + and upper bound of the support are included in the support. The support of this distribution is connected. + + Returns: + :code:`true` + + + """ + ... + def logProbability(self, int: int) -> float: + """ + For a random variable :code:`X` whose values are distributed according to this distribution, this method returns + :code:`log(P(X = x))`, where :code:`log` is the natural logarithm. In other words, this method represents the logarithm + of the probability mass function (PMF) for the distribution. Note that due to the floating point precision and + under/overflow issues, this method will for some distributions be more precise and faster than computing the logarithm + of :meth:`~org.hipparchus.distribution.IntegerDistribution.probability`. + + The default implementation simply computes the logarithm of :code:`probability(x)`. + + Specified by: + :meth:`~org.hipparchus.distribution.IntegerDistribution.logProbability` in + interface :class:`~org.hipparchus.distribution.IntegerDistribution` + + Overrides: + :meth:`~org.hipparchus.distribution.discrete.AbstractIntegerDistribution.logProbability` in + class :class:`~org.hipparchus.distribution.discrete.AbstractIntegerDistribution` + + Parameters: + x (int): the point at which the PMF is evaluated + + Returns: + the logarithm of the value of the probability mass function at :code:`x` + + + """ + ... @typing.overload def probability(self, int: int, int2: int) -> float: ... @typing.overload - def probability(self, int: int) -> float: ... + def probability(self, int: int) -> float: + """ + For a random variable :code:`X` whose values are distributed according to this distribution, this method returns + :code:`P(X = x)`. In other words, this method represents the probability mass function (PMF) for the distribution. + + Parameters: + x (int): the point at which the PMF is evaluated + + Returns: + the value of the probability mass function at :code:`x` + + + """ + ... class PoissonDistribution(AbstractIntegerDistribution): + """ + public classPoissonDistribution extends :class:`~org.hipparchus.distribution.discrete.AbstractIntegerDistribution` + + Implementation of the Poisson distribution. + + Also see: + + - `Poisson distribution (Wikipedia) <http://en.wikipedia.org/wiki/Poisson_distribution>` + - `Poisson distribution (MathWorld) <http://mathworld.wolfram.com/PoissonDistribution.html>` + - :meth:`~serialized` + """ DEFAULT_MAX_ITERATIONS: typing.ClassVar[int] = ... + """ + public static final int DEFAULT_MAX_ITERATIONS + + Default maximum number of iterations for cumulative probability calculations. + + Also see: + + - :meth:`~constant` + + + + """ DEFAULT_EPSILON: typing.ClassVar[float] = ... + """ + public static final double DEFAULT_EPSILON + + Default convergence criterion. + + Also see: + + - :meth:`~constant` + + + + """ @typing.overload def __init__(self, double: float): ... @typing.overload @@ -117,48 +876,435 @@ class PoissonDistribution(AbstractIntegerDistribution): def __init__(self, double: float, double2: float, int: int): ... @typing.overload def __init__(self, double: float, int: int): ... - def cumulativeProbability(self, int: int) -> float: ... - def getMean(self) -> float: ... - def getNumericalMean(self) -> float: ... - def getNumericalVariance(self) -> float: ... - def getSupportLowerBound(self) -> int: ... - def getSupportUpperBound(self) -> int: ... - def isSupportConnected(self) -> bool: ... - def logProbability(self, int: int) -> float: ... - def normalApproximateProbability(self, int: int) -> float: ... + def cumulativeProbability(self, int: int) -> float: + """ + For a random variable :code:`X` whose values are distributed according to this distribution, this method returns + :code:`P(X <= x)`. In other words, this method represents the (cumulative) distribution function (CDF) for this + distribution. + + Parameters: + x (int): the point at which the CDF is evaluated + + Returns: + the probability that a random variable with this distribution takes a value less than or equal to :code:`x` + + + """ + ... + def getMean(self) -> float: + """ + Get the mean for the distribution. + + Returns: + the mean for the distribution. + + + """ + ... + def getNumericalMean(self) -> float: + """ + Use this method to get the numerical value of the mean of this distribution. For mean parameter :code:`p`, the mean is + :code:`p`. + + Returns: + the mean or :code:`Double.NaN` if it is not defined + + + """ + ... + def getNumericalVariance(self) -> float: + """ + Use this method to get the numerical value of the variance of this distribution. For mean parameter :code:`p`, the + variance is :code:`p`. + + Returns: + the variance (possibly :code:`Double.POSITIVE_INFINITY` or :code:`Double.NaN` if it is not defined) + + + """ + ... + def getSupportLowerBound(self) -> int: + """ + Access the lower bound of the support. This method must return the same value as + :code:`inverseCumulativeProbability(0)`. In other words, this method must return + + :code:`inf {x in Z | P(X <= x) > 0}`. + The lower bound of the support is always 0 no matter the mean parameter. + + Returns: + lower bound of the support (always 0) + + + """ + ... + def getSupportUpperBound(self) -> int: + """ + Access the upper bound of the support. This method must return the same value as + :code:`inverseCumulativeProbability(1)`. In other words, this method must return + + :code:`inf {x in R | P(X <= x) = 1}`. + The upper bound of the support is positive infinity, regardless of the parameter values. There is no integer infinity, + so this method returns :code:`Integer.MAX_VALUE`. + + Returns: + upper bound of the support (always :code:`Integer.MAX_VALUE` for positive infinity) + + + """ + ... + def isSupportConnected(self) -> bool: + """ + Use this method to get information about whether the support is connected, i.e. whether all integers between the lower + and upper bound of the support are included in the support. The support of this distribution is connected. + + Returns: + :code:`true` + + + """ + ... + def logProbability(self, int: int) -> float: + """ + For a random variable :code:`X` whose values are distributed according to this distribution, this method returns + :code:`log(P(X = x))`, where :code:`log` is the natural logarithm. In other words, this method represents the logarithm + of the probability mass function (PMF) for the distribution. Note that due to the floating point precision and + under/overflow issues, this method will for some distributions be more precise and faster than computing the logarithm + of :meth:`~org.hipparchus.distribution.IntegerDistribution.probability`. + + The default implementation simply computes the logarithm of :code:`probability(x)`. + + Specified by: + :meth:`~org.hipparchus.distribution.IntegerDistribution.logProbability` in + interface :class:`~org.hipparchus.distribution.IntegerDistribution` + + Overrides: + :meth:`~org.hipparchus.distribution.discrete.AbstractIntegerDistribution.logProbability` in + class :class:`~org.hipparchus.distribution.discrete.AbstractIntegerDistribution` + + Parameters: + x (int): the point at which the PMF is evaluated + + Returns: + the logarithm of the value of the probability mass function at :code:`x` + + + """ + ... + def normalApproximateProbability(self, int: int) -> float: + """ + Calculates the Poisson distribution function using a normal approximation. The :code:`N(mean, sqrt(mean))` distribution + is used to approximate the Poisson distribution. The computation uses "half-correction" (evaluating the normal + distribution function at :code:`x + 0.5`). + + Parameters: + x (int): Upper bound, inclusive. + + Returns: + the distribution function value calculated using a normal approximation. + + + """ + ... @typing.overload def probability(self, int: int, int2: int) -> float: ... @typing.overload - def probability(self, int: int) -> float: ... + def probability(self, int: int) -> float: + """ + For a random variable :code:`X` whose values are distributed according to this distribution, this method returns + :code:`P(X = x)`. In other words, this method represents the probability mass function (PMF) for the distribution. + + Parameters: + x (int): the point at which the PMF is evaluated + + Returns: + the value of the probability mass function at :code:`x` + + + """ + ... class UniformIntegerDistribution(AbstractIntegerDistribution): + """ + public classUniformIntegerDistribution extends :class:`~org.hipparchus.distribution.discrete.AbstractIntegerDistribution` + + Implementation of the uniform integer distribution. + + Also see: + + - ` Uniform distribution (discrete), at Wikipedia <http://en.wikipedia.org/wiki/Uniform_distribution_(discrete)>` + - :meth:`~serialized` + """ def __init__(self, int: int, int2: int): ... - def cumulativeProbability(self, int: int) -> float: ... - def getNumericalMean(self) -> float: ... - def getNumericalVariance(self) -> float: ... - def getSupportLowerBound(self) -> int: ... - def getSupportUpperBound(self) -> int: ... - def isSupportConnected(self) -> bool: ... + def cumulativeProbability(self, int: int) -> float: + """ + For a random variable :code:`X` whose values are distributed according to this distribution, this method returns + :code:`P(X <= x)`. In other words, this method represents the (cumulative) distribution function (CDF) for this + distribution. + + Parameters: + x (int): the point at which the CDF is evaluated + + Returns: + the probability that a random variable with this distribution takes a value less than or equal to :code:`x` + + + """ + ... + def getNumericalMean(self) -> float: + """ + Use this method to get the numerical value of the mean of this distribution. For lower bound :code:`lower` and upper + bound :code:`upper`, the mean is :code:`0.5 * (lower + upper)`. + + Returns: + the mean or :code:`Double.NaN` if it is not defined + + + """ + ... + def getNumericalVariance(self) -> float: + """ + Use this method to get the numerical value of the variance of this distribution. For lower bound :code:`lower` and upper + bound :code:`upper`, and :code:`n = upper - lower + 1`, the variance is :code:`(n^2 - 1) / 12`. + + Returns: + the variance (possibly :code:`Double.POSITIVE_INFINITY` or :code:`Double.NaN` if it is not defined) + + + """ + ... + def getSupportLowerBound(self) -> int: + """ + Access the lower bound of the support. This method must return the same value as + :code:`inverseCumulativeProbability(0)`. In other words, this method must return + + :code:`inf {x in Z | P(X <= x) > 0}`. + The lower bound of the support is equal to the lower bound parameter of the distribution. + + Returns: + lower bound of the support + + + """ + ... + def getSupportUpperBound(self) -> int: + """ + Access the upper bound of the support. This method must return the same value as + :code:`inverseCumulativeProbability(1)`. In other words, this method must return + + :code:`inf {x in R | P(X <= x) = 1}`. + The upper bound of the support is equal to the upper bound parameter of the distribution. + + Returns: + upper bound of the support + + + """ + ... + def isSupportConnected(self) -> bool: + """ + Use this method to get information about whether the support is connected, i.e. whether all integers between the lower + and upper bound of the support are included in the support. The support of this distribution is connected. + + Returns: + :code:`true` + + + """ + ... @typing.overload def probability(self, int: int, int2: int) -> float: ... @typing.overload - def probability(self, int: int) -> float: ... + def probability(self, int: int) -> float: + """ + For a random variable :code:`X` whose values are distributed according to this distribution, this method returns + :code:`P(X = x)`. In other words, this method represents the probability mass function (PMF) for the distribution. + + Parameters: + x (int): the point at which the PMF is evaluated + + Returns: + the value of the probability mass function at :code:`x` + + + """ + ... class ZipfDistribution(AbstractIntegerDistribution): + """ + public classZipfDistribution extends :class:`~org.hipparchus.distribution.discrete.AbstractIntegerDistribution` + + Implementation of the Zipf distribution. + + **Parameters:** For a random variable :code:`X` whose values are distributed according to this distribution, the + probability mass function is given by + + .. code-block: java + + P(X = k) = H(N,s) * 1 / k^s for k = 1,2,...,N. + + + :code:`H(N,s)` is the normalizing constant which corresponds to the generalized harmonic number of order N of s. + + - :code:`N` is the number of elements + - :code:`s` is the exponent + + + Also see: + + - :class:`~org.hipparchus.distribution.discrete.https:.en.wikipedia.org.wiki.Zipf's_law` + - :meth:`~org.hipparchus.distribution.discrete.https:.en.wikipedia.org.wiki.Harmonic_number#Generalized_harmonic_numbers` + - :meth:`~serialized` + """ def __init__(self, int: int, double: float): ... - def cumulativeProbability(self, int: int) -> float: ... - def getExponent(self) -> float: ... - def getNumberOfElements(self) -> int: ... - def getNumericalMean(self) -> float: ... - def getNumericalVariance(self) -> float: ... - def getSupportLowerBound(self) -> int: ... - def getSupportUpperBound(self) -> int: ... - def isSupportConnected(self) -> bool: ... - def logProbability(self, int: int) -> float: ... + def cumulativeProbability(self, int: int) -> float: + """ + For a random variable :code:`X` whose values are distributed according to this distribution, this method returns + :code:`P(X <= x)`. In other words, this method represents the (cumulative) distribution function (CDF) for this + distribution. + + Parameters: + x (int): the point at which the CDF is evaluated + + Returns: + the probability that a random variable with this distribution takes a value less than or equal to :code:`x` + + + """ + ... + def getExponent(self) -> float: + """ + Get the exponent characterizing the distribution. + + Returns: + the exponent + + + """ + ... + def getNumberOfElements(self) -> int: + """ + Get the number of elements (e.g. corpus size) for the distribution. + + Returns: + the number of elements + + + """ + ... + def getNumericalMean(self) -> float: + """ + Use this method to get the numerical value of the mean of this distribution. For number of elements :code:`N` and + exponent :code:`s`, the mean is :code:`Hs1 / Hs`, where + + - :code:`Hs1 = generalizedHarmonic(N, s - 1)`, + - :code:`Hs = generalizedHarmonic(N, s)`. + + + Returns: + the mean or :code:`Double.NaN` if it is not defined + + + """ + ... + def getNumericalVariance(self) -> float: + """ + Use this method to get the numerical value of the variance of this distribution. For number of elements :code:`N` and + exponent :code:`s`, the mean is :code:`(Hs2 / Hs) - (Hs1^2 / Hs^2)`, where + + - :code:`Hs2 = generalizedHarmonic(N, s - 2)`, + - :code:`Hs1 = generalizedHarmonic(N, s - 1)`, + - :code:`Hs = generalizedHarmonic(N, s)`. + + + Returns: + the variance (possibly :code:`Double.POSITIVE_INFINITY` or :code:`Double.NaN` if it is not defined) + + + """ + ... + def getSupportLowerBound(self) -> int: + """ + Access the lower bound of the support. This method must return the same value as + :code:`inverseCumulativeProbability(0)`. In other words, this method must return + + :code:`inf {x in Z | P(X <= x) > 0}`. + The lower bound of the support is always 1 no matter the parameters. + + Returns: + lower bound of the support (always 1) + + + """ + ... + def getSupportUpperBound(self) -> int: + """ + Access the upper bound of the support. This method must return the same value as + :code:`inverseCumulativeProbability(1)`. In other words, this method must return + + :code:`inf {x in R | P(X <= x) = 1}`. + The upper bound of the support is the number of elements. + + Returns: + upper bound of the support + + + """ + ... + def isSupportConnected(self) -> bool: + """ + Use this method to get information about whether the support is connected, i.e. whether all integers between the lower + and upper bound of the support are included in the support. The support of this distribution is connected. + + Returns: + :code:`true` + + + """ + ... + def logProbability(self, int: int) -> float: + """ + For a random variable :code:`X` whose values are distributed according to this distribution, this method returns + :code:`log(P(X = x))`, where :code:`log` is the natural logarithm. In other words, this method represents the logarithm + of the probability mass function (PMF) for the distribution. Note that due to the floating point precision and + under/overflow issues, this method will for some distributions be more precise and faster than computing the logarithm + of :meth:`~org.hipparchus.distribution.IntegerDistribution.probability`. + + The default implementation simply computes the logarithm of :code:`probability(x)`. + + Specified by: + :meth:`~org.hipparchus.distribution.IntegerDistribution.logProbability` in + interface :class:`~org.hipparchus.distribution.IntegerDistribution` + + Overrides: + :meth:`~org.hipparchus.distribution.discrete.AbstractIntegerDistribution.logProbability` in + class :class:`~org.hipparchus.distribution.discrete.AbstractIntegerDistribution` + + Parameters: + x (int): the point at which the PMF is evaluated + + Returns: + the logarithm of the value of the probability mass function at :code:`x` + + + """ + ... @typing.overload def probability(self, int: int, int2: int) -> float: ... @typing.overload - def probability(self, int: int) -> float: ... + def probability(self, int: int) -> float: + """ + For a random variable :code:`X` whose values are distributed according to this distribution, this method returns + :code:`P(X = x)`. In other words, this method represents the probability mass function (PMF) for the distribution. + + Parameters: + x (int): the point at which the PMF is evaluated + + Returns: + the value of the probability mass function at :code:`x` + + + """ + ... class __module_protocol__(Protocol): diff --git a/org-stubs/hipparchus/distribution/multivariate/__init__.pyi b/org-stubs/hipparchus/distribution/multivariate/__init__.pyi index 2bdd9dc..450e416 100644 --- a/org-stubs/hipparchus/distribution/multivariate/__init__.pyi +++ b/org-stubs/hipparchus/distribution/multivariate/__init__.pyi @@ -16,28 +16,158 @@ import typing class AbstractMultivariateRealDistribution(org.hipparchus.distribution.MultivariateRealDistribution): - def getDimension(self) -> int: ... - def reseedRandomGenerator(self, long: int) -> None: ... + """ + public abstract classAbstractMultivariateRealDistribution extends :class:`~org.hipparchus.distribution.multivariate.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.distribution.MultivariateRealDistribution` + + Base class for multivariate probability distributions. + """ + def getDimension(self) -> int: + """ + Gets the number of random variables of the distribution. It is the size of the array returned by the + :meth:`~org.hipparchus.distribution.MultivariateRealDistribution.sample` method. + + Specified by: + :meth:`~org.hipparchus.distribution.MultivariateRealDistribution.getDimension` in + interface :class:`~org.hipparchus.distribution.MultivariateRealDistribution` + + Returns: + the number of variables. + + + """ + ... + def reseedRandomGenerator(self, long: int) -> None: + """ + Reseeds the random generator used to generate samples. + + Specified by: + :meth:`~org.hipparchus.distribution.MultivariateRealDistribution.reseedRandomGenerator` in + interface :class:`~org.hipparchus.distribution.MultivariateRealDistribution` + + Parameters: + seed (long): Seed with which to initialize the random number generator. + + + """ + ... @typing.overload - def sample(self) -> typing.MutableSequence[float]: ... + def sample(self) -> typing.MutableSequence[float]: + """ + Generates a random value vector sampled from this distribution. + + Specified by: + :meth:`~org.hipparchus.distribution.MultivariateRealDistribution.sample` in + interface :class:`~org.hipparchus.distribution.MultivariateRealDistribution` + + Returns: + a random value vector. + + """ + ... @typing.overload - def sample(self, int: int) -> typing.MutableSequence[typing.MutableSequence[float]]: ... + def sample(self, int: int) -> typing.MutableSequence[typing.MutableSequence[float]]: + """ + Generates a list of a random value vectors from the distribution. + + Specified by: + :meth:`~org.hipparchus.distribution.MultivariateRealDistribution.sample` in + interface :class:`~org.hipparchus.distribution.MultivariateRealDistribution` + + Parameters: + sampleSize (int): the number of random vectors to generate. + + Returns: + an array representing the random samples. + + Also see: + + - :meth:`~org.hipparchus.distribution.MultivariateRealDistribution.sample` + + + + """ + ... _MixtureMultivariateRealDistribution__T = typing.TypeVar('_MixtureMultivariateRealDistribution__T', bound=org.hipparchus.distribution.MultivariateRealDistribution) # <T> class MixtureMultivariateRealDistribution(AbstractMultivariateRealDistribution, typing.Generic[_MixtureMultivariateRealDistribution__T]): + """ + public classMixtureMultivariateRealDistribution<T extends :class:`~org.hipparchus.distribution.MultivariateRealDistribution`> extends :class:`~org.hipparchus.distribution.multivariate.AbstractMultivariateRealDistribution` + + Class for representing ` mixture model <http://en.wikipedia.org/wiki/Mixture_model>` distributions. + """ @typing.overload def __init__(self, list: java.util.List[org.hipparchus.util.Pair[float, _MixtureMultivariateRealDistribution__T]]): ... @typing.overload def __init__(self, randomGenerator: org.hipparchus.random.RandomGenerator, list: java.util.List[org.hipparchus.util.Pair[float, _MixtureMultivariateRealDistribution__T]]): ... - def density(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> float: ... + def density(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> float: + """ + Returns the probability density function (PDF) of this distribution evaluated at the specified point :code:`x`. In + general, the PDF is the derivative of the cumulative distribution function. If the derivative does not exist at + :code:`x`, then an appropriate replacement should be returned, e.g. :code:`Double.POSITIVE_INFINITY`, + :code:`Double.NaN`, or the limit inferior or limit superior of the difference quotient. + + Parameters: + values (double[]): Point at which the PDF is evaluated. + + Returns: + the value of the probability density function at point :code:`x`. + + + """ + ... def getComponents(self) -> java.util.List[org.hipparchus.util.Pair[float, _MixtureMultivariateRealDistribution__T]]: ... - def reseedRandomGenerator(self, long: int) -> None: ... + def reseedRandomGenerator(self, long: int) -> None: + """ + Reseeds the random generator used to generate samples. + + Specified by: + :meth:`~org.hipparchus.distribution.MultivariateRealDistribution.reseedRandomGenerator` in + interface :class:`~org.hipparchus.distribution.MultivariateRealDistribution` + + Overrides: + :meth:`~org.hipparchus.distribution.multivariate.AbstractMultivariateRealDistribution.reseedRandomGenerator` in + class :class:`~org.hipparchus.distribution.multivariate.AbstractMultivariateRealDistribution` + + Parameters: + seed (long): Seed with which to initialize the random number generator. + + + """ + ... @typing.overload - def sample(self) -> typing.MutableSequence[float]: ... + def sample(self) -> typing.MutableSequence[float]: + """ + Generates a random value vector sampled from this distribution. + + Specified by: + :meth:`~org.hipparchus.distribution.MultivariateRealDistribution.sample` in + interface :class:`~org.hipparchus.distribution.MultivariateRealDistribution` + + Specified by: + :meth:`~org.hipparchus.distribution.multivariate.AbstractMultivariateRealDistribution.sample` in + class :class:`~org.hipparchus.distribution.multivariate.AbstractMultivariateRealDistribution` + + Returns: + a random value vector. + + + """ + ... @typing.overload def sample(self, int: int) -> typing.MutableSequence[typing.MutableSequence[float]]: ... class MultivariateNormalDistribution(AbstractMultivariateRealDistribution): + """ + public classMultivariateNormalDistribution extends :class:`~org.hipparchus.distribution.multivariate.AbstractMultivariateRealDistribution` + + Implementation of the multivariate normal (Gaussian) distribution. + + Also see: + + - ` Multivariate normal distribution (Wikipedia) <http://en.wikipedia.org/wiki/Multivariate_normal_distribution>` + - ` Multivariate normal distribution (MathWorld) <http://mathworld.wolfram.com/MultivariateNormalDistribution.html>` + """ @typing.overload def __init__(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[typing.MutableSequence[float]], jpype.JArray]): ... @typing.overload @@ -47,16 +177,78 @@ class MultivariateNormalDistribution(AbstractMultivariateRealDistribution): @typing.overload def __init__(self, randomGenerator: org.hipparchus.random.RandomGenerator, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[typing.MutableSequence[float]], jpype.JArray], double3: float): ... def density(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> float: ... - def getCovariances(self) -> org.hipparchus.linear.RealMatrix: ... - def getMeans(self) -> typing.MutableSequence[float]: ... - def getSingularMatrixCheckTolerance(self) -> float: ... - def getStandardDeviations(self) -> typing.MutableSequence[float]: ... + def getCovariances(self) -> org.hipparchus.linear.RealMatrix: + """ + Gets the covariance matrix. + + Returns: + the covariance matrix. + + + """ + ... + def getMeans(self) -> typing.MutableSequence[float]: + """ + Gets the mean vector. + + Returns: + the mean vector. + + + """ + ... + def getSingularMatrixCheckTolerance(self) -> float: + """ + Gets the current setting for the tolerance check used during singular checks before inversion + + Returns: + tolerance + + + """ + ... + def getStandardDeviations(self) -> typing.MutableSequence[float]: + """ + Gets the square root of each element on the diagonal of the covariance matrix. + + Returns: + the standard deviations. + + + """ + ... @typing.overload - def sample(self) -> typing.MutableSequence[float]: ... + def sample(self) -> typing.MutableSequence[float]: + """ + Generates a random value vector sampled from this distribution. + + Specified by: + :meth:`~org.hipparchus.distribution.MultivariateRealDistribution.sample` in + interface :class:`~org.hipparchus.distribution.MultivariateRealDistribution` + + Specified by: + :meth:`~org.hipparchus.distribution.multivariate.AbstractMultivariateRealDistribution.sample` in + class :class:`~org.hipparchus.distribution.multivariate.AbstractMultivariateRealDistribution` + + Returns: + a random value vector. + + + """ + ... @typing.overload def sample(self, int: int) -> typing.MutableSequence[typing.MutableSequence[float]]: ... class MixtureMultivariateNormalDistribution(MixtureMultivariateRealDistribution[MultivariateNormalDistribution]): + """ + public classMixtureMultivariateNormalDistribution extends :class:`~org.hipparchus.distribution.multivariate.MixtureMultivariateRealDistribution`<:class:`~org.hipparchus.distribution.multivariate.MultivariateNormalDistribution`> + + Multivariate normal mixture distribution. This class is mainly syntactic sugar. + + Also see: + + - :class:`~org.hipparchus.distribution.multivariate.MixtureMultivariateRealDistribution` + """ @typing.overload def __init__(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[typing.MutableSequence[float]], jpype.JArray], doubleArray3: typing.Union[typing.List[typing.MutableSequence[typing.MutableSequence[float]]], jpype.JArray]): ... @typing.overload diff --git a/org-stubs/hipparchus/exception/__init__.pyi b/org-stubs/hipparchus/exception/__init__.pyi index 61ab2f7..792e5e3 100644 --- a/org-stubs/hipparchus/exception/__init__.pyi +++ b/org-stubs/hipparchus/exception/__init__.pyi @@ -13,25 +13,157 @@ import typing class Localizable(java.io.Serializable): - def getLocalizedString(self, locale: java.util.Locale) -> str: ... - def getSourceString(self) -> str: ... + """ + public interfaceLocalizableextends :class:`~org.hipparchus.exception.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + Interface for localizable strings. + """ + def getLocalizedString(self, locale: java.util.Locale) -> str: + """ + Gets the localized string. + + Parameters: + locale (:class:`~org.hipparchus.exception.https:.docs.oracle.com.javase.8.docs.api.java.util.Locale`): locale into which to get the string. + + Returns: + the localized string or the source string if no localized version is available. + + + """ + ... + def getSourceString(self) -> str: + """ + Gets the source (non-localized) string. + + Returns: + the source string. + + + """ + ... class LocalizedException: - def getMessage(self, locale: java.util.Locale) -> str: ... - def getParts(self) -> typing.MutableSequence[typing.Any]: ... - def getSpecifier(self) -> Localizable: ... + """ + public interfaceLocalizedException + + This interface specified methods implemented by localized exception classes. + + This interface has been copied from the interface with the same name from Orekit. + """ + def getMessage(self, locale: java.util.Locale) -> str: + """ + Gets the message in a specified locale. + + Parameters: + locale (:class:`~org.hipparchus.exception.https:.docs.oracle.com.javase.8.docs.api.java.util.Locale`): Locale in which the message should be translated + + Returns: + localized message + + + """ + ... + def getParts(self) -> typing.MutableSequence[typing.Any]: + """ + Get the variable parts of the error message. + + Returns: + a copy of the variable parts of the error message + + + """ + ... + def getSpecifier(self) -> Localizable: + """ + Get the localizable specifier of the error message. + + Returns: + localizable specifier of the error message + + + """ + ... class UTF8Control(java.util.ResourceBundle.Control): + """ + public classUTF8Control extends :class:`~org.hipparchus.exception.https:.docs.oracle.com.javase.8.docs.api.java.util.ResourceBundle.Control` + + Control class loading properties in UTF-8 encoding. + + This class has been very slightly adapted from BalusC answer to question: ` How to use UTF-8 in resource properties with + ResourceBundle + <http://stackoverflow.com/questions/4659929/how-to-use-utf-8-in-resource-properties-with-resourcebundle>`. + """ def __init__(self): ... def newBundle(self, string: str, locale: java.util.Locale, string2: str, classLoader: java.lang.ClassLoader, boolean: bool) -> java.util.ResourceBundle: ... class DummyLocalizable(Localizable): + """ + public classDummyLocalizable extends :class:`~org.hipparchus.exception.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.exception.Localizable` + + Dummy implementation of the :class:`~org.hipparchus.exception.Localizable` interface, without localization. + + Also see: + + - :meth:`~serialized` + """ def __init__(self, string: str): ... - def getLocalizedString(self, locale: java.util.Locale) -> str: ... - def getSourceString(self) -> str: ... - def toString(self) -> str: ... + def getLocalizedString(self, locale: java.util.Locale) -> str: + """ + Gets the localized string. + + Specified by: + :meth:`~org.hipparchus.exception.Localizable.getLocalizedString` in + interface :class:`~org.hipparchus.exception.Localizable` + + Parameters: + locale (:class:`~org.hipparchus.exception.https:.docs.oracle.com.javase.8.docs.api.java.util.Locale`): locale into which to get the string. + + Returns: + the localized string or the source string if no localized version is available. + + + """ + ... + def getSourceString(self) -> str: + """ + Gets the source (non-localized) string. + + Specified by: + :meth:`~org.hipparchus.exception.Localizable.getSourceString` in + interface :class:`~org.hipparchus.exception.Localizable` + + Returns: + the source string. + + + """ + ... + def toString(self) -> str: + """ + + Overrides: + :meth:`~org.hipparchus.exception.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.toString` in + class :class:`~org.hipparchus.exception.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + + """ + ... class LocalizedCoreFormats(java.lang.Enum['LocalizedCoreFormats'], Localizable): + """ + public enumLocalizedCoreFormats extends :class:`~org.hipparchus.exception.https:.docs.oracle.com.javase.8.docs.api.java.lang.Enum`<:class:`~org.hipparchus.exception.LocalizedCoreFormats`> + implements :class:`~org.hipparchus.exception.Localizable` + + Enumeration for localized messages formats used in exceptions messages. + + The constants in this enumeration represent the available formats as localized strings. These formats are intended to be + localized using simple properties files, using the constant name as the key and the property value as the message + format. The source English format is provided in the constants themselves to serve both as a reminder for developers to + understand the parameters needed by each format, as a basis for translators to create localized properties files, and as + a default format if some translation is missing. + """ ARRAY_SIZE_EXCEEDS_MAX_VARIABLES: typing.ClassVar['LocalizedCoreFormats'] = ... ARRAY_SIZES_SHOULD_HAVE_DIFFERENCE_1: typing.ClassVar['LocalizedCoreFormats'] = ... ARRAY_SUMS_TO_ZERO: typing.ClassVar['LocalizedCoreFormats'] = ... @@ -216,57 +348,298 @@ class LocalizedCoreFormats(java.lang.Enum['LocalizedCoreFormats'], Localizable): ZERO_STATE_SIZE: typing.ClassVar['LocalizedCoreFormats'] = ... RIGHT_EDGE_GREATER_THAN_LEFT_EDGE: typing.ClassVar['LocalizedCoreFormats'] = ... INPUT_EXPECTED_BETWEEN_ZERO_AND_ONE_INCLUDED: typing.ClassVar['LocalizedCoreFormats'] = ... - def getLocalizedString(self, locale: java.util.Locale) -> str: ... - def getSourceString(self) -> str: ... + def getLocalizedString(self, locale: java.util.Locale) -> str: + """ + Gets the localized string. + + Specified by: + :meth:`~org.hipparchus.exception.Localizable.getLocalizedString` in + interface :class:`~org.hipparchus.exception.Localizable` + + Parameters: + locale (:class:`~org.hipparchus.exception.https:.docs.oracle.com.javase.8.docs.api.java.util.Locale`): locale into which to get the string. + + Returns: + the localized string or the source string if no localized version is available. + + + """ + ... + def getSourceString(self) -> str: + """ + Gets the source (non-localized) string. + + Specified by: + :meth:`~org.hipparchus.exception.Localizable.getSourceString` in + interface :class:`~org.hipparchus.exception.Localizable` + + Returns: + the source string. + + + """ + ... _valueOf_0__T = typing.TypeVar('_valueOf_0__T', bound=java.lang.Enum) # <T> @typing.overload @staticmethod def valueOf(class_: typing.Type[_valueOf_0__T], string: str) -> _valueOf_0__T: ... @typing.overload @staticmethod - def valueOf(string: str) -> 'LocalizedCoreFormats': ... + def valueOf(string: str) -> 'LocalizedCoreFormats': + """ + Returns the enum constant of this type with the specified name. The string must match *exactly* an identifier used to + declare an enum constant in this type. (Extraneous whitespace characters are not permitted.) + + Parameters: + name (:class:`~org.hipparchus.exception.https:.docs.oracle.com.javase.8.docs.api.java.lang.String`): the name of the enum constant to be returned. + + Returns: + the enum constant with the specified name + + Raises: + :class:`~org.hipparchus.exception.https:.docs.oracle.com.javase.8.docs.api.java.lang.IllegalArgumentException`: if this enum type has no constant with the specified name + :class:`~org.hipparchus.exception.https:.docs.oracle.com.javase.8.docs.api.java.lang.NullPointerException`: if the argument is null + + + """ + ... @staticmethod - def values() -> typing.MutableSequence['LocalizedCoreFormats']: ... + def values() -> typing.MutableSequence['LocalizedCoreFormats']: + """ + Returns an array containing the constants of this enum type, in the order they are declared. + + Returns: + an array containing the constants of this enum type, in the order they are declared + + + """ + ... class MathRuntimeException(java.lang.RuntimeException, LocalizedException): + """ + public classMathRuntimeException extends :class:`~org.hipparchus.exception.https:.docs.oracle.com.javase.8.docs.api.java.lang.RuntimeException` + implements :class:`~org.hipparchus.exception.LocalizedException` + + All exceptions thrown by the Hipparchus code inherit from this class. + + Also see: + + - :meth:`~serialized` + """ @typing.overload def __init__(self, throwable: java.lang.Throwable, localizable: Localizable, *object: typing.Any): ... @typing.overload def __init__(self, localizable: Localizable, *object: typing.Any): ... @typing.overload @staticmethod - def createInternalError() -> 'MathRuntimeException': ... + def createInternalError() -> 'MathRuntimeException': + """ + Create an exception for an internal error. + + Returns: + a new runtime exception indicating an internal error + + """ + ... @typing.overload @staticmethod - def createInternalError(throwable: java.lang.Throwable) -> 'MathRuntimeException': ... - def getLocalizedMessage(self) -> str: ... + def createInternalError(throwable: java.lang.Throwable) -> 'MathRuntimeException': + """ + Create an exception for an internal error. + + Parameters: + cause (:class:`~org.hipparchus.exception.https:.docs.oracle.com.javase.8.docs.api.java.lang.Throwable`): root cause + + Returns: + a new runtime exception, indicating an internal error and wrapping the given throwable + + + """ + ... + def getLocalizedMessage(self) -> str: + """ + + Overrides: + :meth:`~org.hipparchus.exception.https:.docs.oracle.com.javase.8.docs.api.java.lang.Throwable.getLocalizedMessage` in + class :class:`~org.hipparchus.exception.https:.docs.oracle.com.javase.8.docs.api.java.lang.Throwable` + + + """ + ... @typing.overload - def getMessage(self) -> str: ... + def getMessage(self) -> str: + """ + + Overrides: + :meth:`~org.hipparchus.exception.https:.docs.oracle.com.javase.8.docs.api.java.lang.Throwable.getMessage` in + class :class:`~org.hipparchus.exception.https:.docs.oracle.com.javase.8.docs.api.java.lang.Throwable` + + + """ + ... @typing.overload - def getMessage(self, locale: java.util.Locale) -> str: ... - def getParts(self) -> typing.MutableSequence[typing.Any]: ... - def getSpecifier(self) -> Localizable: ... + def getMessage(self, locale: java.util.Locale) -> str: + """ + Gets the message in a specified locale. + + Specified by: + :meth:`~org.hipparchus.exception.LocalizedException.getMessage` in + interface :class:`~org.hipparchus.exception.LocalizedException` + + Parameters: + locale (:class:`~org.hipparchus.exception.https:.docs.oracle.com.javase.8.docs.api.java.util.Locale`): Locale in which the message should be translated + + Returns: + localized message + + """ + ... + def getParts(self) -> typing.MutableSequence[typing.Any]: + """ + Get the variable parts of the error message. + + Specified by: + :meth:`~org.hipparchus.exception.LocalizedException.getParts` in + interface :class:`~org.hipparchus.exception.LocalizedException` + + Returns: + a copy of the variable parts of the error message + + + """ + ... + def getSpecifier(self) -> Localizable: + """ + Get the localizable specifier of the error message. + + Specified by: + :meth:`~org.hipparchus.exception.LocalizedException.getSpecifier` in + interface :class:`~org.hipparchus.exception.LocalizedException` + + Returns: + localizable specifier of the error message + + + """ + ... class NullArgumentException(java.lang.NullPointerException, LocalizedException): + """ + public classNullArgumentException extends :class:`~org.hipparchus.exception.https:.docs.oracle.com.javase.8.docs.api.java.lang.NullPointerException` + implements :class:`~org.hipparchus.exception.LocalizedException` + + All conditions checks that fail due to a :code:`null` argument must throw this exception. This class is meant to signal + a precondition violation ("null is an illegal argument") and so does not extend the standard + :code:`NullPointerException`. Propagation of :code:`NullPointerException` from within Hipparchus is construed to be a + bug. + + Note: from 1.0 onwards, this class extends + :class:`~org.hipparchus.exception.https:.docs.oracle.com.javase.8.docs.api.java.lang.NullPointerException` instead of + :class:`~org.hipparchus.exception.MathIllegalArgumentException`. + + Also see: + + - :meth:`~serialized` + """ @typing.overload def __init__(self): ... @typing.overload def __init__(self, localizable: Localizable, *object: typing.Any): ... - def getLocalizedMessage(self) -> str: ... + def getLocalizedMessage(self) -> str: + """ + + Overrides: + :meth:`~org.hipparchus.exception.https:.docs.oracle.com.javase.8.docs.api.java.lang.Throwable.getLocalizedMessage` in + class :class:`~org.hipparchus.exception.https:.docs.oracle.com.javase.8.docs.api.java.lang.Throwable` + + + """ + ... @typing.overload - def getMessage(self) -> str: ... + def getMessage(self) -> str: + """ + + Overrides: + :meth:`~org.hipparchus.exception.https:.docs.oracle.com.javase.8.docs.api.java.lang.NullPointerException.getMessage` in + class :class:`~org.hipparchus.exception.https:.docs.oracle.com.javase.8.docs.api.java.lang.NullPointerException` + + + """ + ... @typing.overload - def getMessage(self, locale: java.util.Locale) -> str: ... - def getParts(self) -> typing.MutableSequence[typing.Any]: ... - def getSpecifier(self) -> Localizable: ... + def getMessage(self, locale: java.util.Locale) -> str: + """ + Gets the message in a specified locale. + + Specified by: + :meth:`~org.hipparchus.exception.LocalizedException.getMessage` in + interface :class:`~org.hipparchus.exception.LocalizedException` + + Parameters: + locale (:class:`~org.hipparchus.exception.https:.docs.oracle.com.javase.8.docs.api.java.util.Locale`): Locale in which the message should be translated + + Returns: + localized message + + """ + ... + def getParts(self) -> typing.MutableSequence[typing.Any]: + """ + Get the variable parts of the error message. + + Specified by: + :meth:`~org.hipparchus.exception.LocalizedException.getParts` in + interface :class:`~org.hipparchus.exception.LocalizedException` + + Returns: + a copy of the variable parts of the error message + + + """ + ... + def getSpecifier(self) -> Localizable: + """ + Get the localizable specifier of the error message. + + Specified by: + :meth:`~org.hipparchus.exception.LocalizedException.getSpecifier` in + interface :class:`~org.hipparchus.exception.LocalizedException` + + Returns: + localizable specifier of the error message + + + """ + ... class MathIllegalArgumentException(MathRuntimeException): + """ + public classMathIllegalArgumentException extends :class:`~org.hipparchus.exception.MathRuntimeException` + + Base class for all preconditions violation exceptions. In most cases, this class should not be instantiated directly: it + should serve as a base class to create all the exceptions that have the semantics of the standard + :class:`~org.hipparchus.exception.https:.docs.oracle.com.javase.8.docs.api.java.lang.IllegalArgumentException`. + + Also see: + + - :meth:`~serialized` + """ @typing.overload def __init__(self, throwable: java.lang.Throwable, localizable: Localizable, *object: typing.Any): ... @typing.overload def __init__(self, localizable: Localizable, *object: typing.Any): ... class MathIllegalStateException(MathRuntimeException): + """ + public classMathIllegalStateException extends :class:`~org.hipparchus.exception.MathRuntimeException` + + Base class for all exceptions that signal that the process throwing the exception is in a state that does not comply + with the set of states that it is designed to be in. + + Also see: + + - :meth:`~serialized` + """ @typing.overload def __init__(self, throwable: java.lang.Throwable, localizable: Localizable, *object: typing.Any): ... @typing.overload diff --git a/org-stubs/hipparchus/filtering/kalman/__init__.pyi b/org-stubs/hipparchus/filtering/kalman/__init__.pyi index 45f8b4c..d52e332 100644 --- a/org-stubs/hipparchus/filtering/kalman/__init__.pyi +++ b/org-stubs/hipparchus/filtering/kalman/__init__.pyi @@ -15,32 +15,218 @@ import typing _KalmanFilter__T = typing.TypeVar('_KalmanFilter__T', bound='Measurement') # <T> class KalmanFilter(typing.Generic[_KalmanFilter__T]): + """ + public interfaceKalmanFilter<T extends :class:`~org.hipparchus.filtering.kalman.Measurement`> + + Interface representing a Kalman filter. + + Since: + 1.3 + """ def estimationStep(self, t: _KalmanFilter__T) -> 'ProcessEstimate': ... - def getCorrected(self) -> 'ProcessEstimate': ... - def getPredicted(self) -> 'ProcessEstimate': ... + def getCorrected(self) -> 'ProcessEstimate': + """ + Get the current corrected state. + + Returns: + current corrected state + + + """ + ... + def getPredicted(self) -> 'ProcessEstimate': + """ + Get the current predicted state. + + Returns: + current predicted state + + + """ + ... class Measurement: - def getCovariance(self) -> org.hipparchus.linear.RealMatrix: ... - def getTime(self) -> float: ... - def getValue(self) -> org.hipparchus.linear.RealVector: ... + """ + public interfaceMeasurement + + Interface defining a measurement on process. + + Since: + 1.3 + """ + def getCovariance(self) -> org.hipparchus.linear.RealMatrix: + """ + Get the measurement covariance. + + Returns: + measurement covariance + + + """ + ... + def getTime(self) -> float: + """ + Get the process time. + + Returns: + process time (typically the time or index of a measurement) + + + """ + ... + def getValue(self) -> org.hipparchus.linear.RealVector: + """ + Get the measurement vector. + + Returns: + measurement vector + + + """ + ... class ProcessEstimate: + """ + public classProcessEstimate extends :class:`~org.hipparchus.filtering.kalman.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Holder for process state and covariance. + + The estimate always contains time, state and covariance. These data are the only ones needed to start a Kalman filter. + Once a filter has been started and produces new estimates, these new estimates will always contain a state transition + matrix and if the measurement has not been ignored, they will also contain measurement Jacobian, innovation covariance + and Kalman gain. + + Since: + 1.3 + """ @typing.overload def __init__(self, double: float, realVector: org.hipparchus.linear.RealVector, realMatrix: org.hipparchus.linear.RealMatrix): ... @typing.overload def __init__(self, double: float, realVector: org.hipparchus.linear.RealVector, realMatrix: org.hipparchus.linear.RealMatrix, realMatrix2: org.hipparchus.linear.RealMatrix, realMatrix3: org.hipparchus.linear.RealMatrix, realMatrix4: org.hipparchus.linear.RealMatrix, realMatrix5: org.hipparchus.linear.RealMatrix): ... - def getCovariance(self) -> org.hipparchus.linear.RealMatrix: ... - def getInnovationCovariance(self) -> org.hipparchus.linear.RealMatrix: ... - def getKalmanGain(self) -> org.hipparchus.linear.RealMatrix: ... - def getMeasurementJacobian(self) -> org.hipparchus.linear.RealMatrix: ... - def getState(self) -> org.hipparchus.linear.RealVector: ... - def getStateTransitionMatrix(self) -> org.hipparchus.linear.RealMatrix: ... - def getTime(self) -> float: ... + def getCovariance(self) -> org.hipparchus.linear.RealMatrix: + """ + Get the state covariance. + + Returns: + state covariance + + + """ + ... + def getInnovationCovariance(self) -> org.hipparchus.linear.RealMatrix: + """ + Get the innovation covariance matrix. + + Returns: + innovation covariance matrix (may be null for initial process estimate or if the measurement has been ignored) + + Since: + 1.4 + + + """ + ... + def getKalmanGain(self) -> org.hipparchus.linear.RealMatrix: + """ + Get the Kalman gain matrix. + + Returns: + Kalman gain matrix (may be null for initial process estimate or if the measurement has been ignored) + + Since: + 1.4 + + + """ + ... + def getMeasurementJacobian(self) -> org.hipparchus.linear.RealMatrix: + """ + Get the Jacobian of the measurement with respect to the state (H matrix). + + Returns: + Jacobian of the measurement with respect to the state (may be null for initial process estimate or if the measurement + has been ignored) + + Since: + 1.4 + + + """ + ... + def getState(self) -> org.hipparchus.linear.RealVector: + """ + Get the state vector. + + Returns: + state vector + + + """ + ... + def getStateTransitionMatrix(self) -> org.hipparchus.linear.RealMatrix: + """ + Get state transition matrix between previous state and estimated (but not yet corrected) state. + + Returns: + state transition matrix between previous state and estimated state (but not yet corrected) (may be null for initial + process estimate) + + Since: + 1.4 + + + """ + ... + def getTime(self) -> float: + """ + Get the process time. + + Returns: + process time (typically the time or index of a measurement) + + + """ + ... _AbstractKalmanFilter__T = typing.TypeVar('_AbstractKalmanFilter__T', bound=Measurement) # <T> class AbstractKalmanFilter(KalmanFilter[_AbstractKalmanFilter__T], typing.Generic[_AbstractKalmanFilter__T]): - def getCorrected(self) -> ProcessEstimate: ... - def getPredicted(self) -> ProcessEstimate: ... + """ + public abstract classAbstractKalmanFilter<T extends :class:`~org.hipparchus.filtering.kalman.Measurement`> extends :class:`~org.hipparchus.filtering.kalman.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.filtering.kalman.KalmanFilter`<T> + + Shared parts between linear and non-linear Kalman filters. + + Since: + 1.3 + """ + def getCorrected(self) -> ProcessEstimate: + """ + Get the corrected state. + + Specified by: + :meth:`~org.hipparchus.filtering.kalman.KalmanFilter.getCorrected` in + interface :class:`~org.hipparchus.filtering.kalman.KalmanFilter` + + Returns: + corrected state + + + """ + ... + def getPredicted(self) -> ProcessEstimate: + """ + Get the predicted state. + + Specified by: + :meth:`~org.hipparchus.filtering.kalman.KalmanFilter.getPredicted` in + interface :class:`~org.hipparchus.filtering.kalman.KalmanFilter` + + Returns: + predicted state + + + """ + ... class __module_protocol__(Protocol): diff --git a/org-stubs/hipparchus/filtering/kalman/extended/__init__.pyi b/org-stubs/hipparchus/filtering/kalman/extended/__init__.pyi index a197420..252ef8d 100644 --- a/org-stubs/hipparchus/filtering/kalman/extended/__init__.pyi +++ b/org-stubs/hipparchus/filtering/kalman/extended/__init__.pyi @@ -13,21 +13,131 @@ import typing _ExtendedKalmanFilter__T = typing.TypeVar('_ExtendedKalmanFilter__T', bound=org.hipparchus.filtering.kalman.Measurement) # <T> class ExtendedKalmanFilter(org.hipparchus.filtering.kalman.AbstractKalmanFilter[_ExtendedKalmanFilter__T], typing.Generic[_ExtendedKalmanFilter__T]): + """ + public classExtendedKalmanFilter<T extends :class:`~org.hipparchus.filtering.kalman.Measurement`> extends :class:`~org.hipparchus.filtering.kalman.AbstractKalmanFilter`<T> + + Kalman filter for :class:`~org.hipparchus.filtering.kalman.extended.NonLinearProcess`. + + Since: + 1.3 + """ def __init__(self, matrixDecomposer: typing.Union[org.hipparchus.linear.MatrixDecomposer, typing.Callable], nonLinearProcess: 'NonLinearProcess'[_ExtendedKalmanFilter__T], processEstimate: org.hipparchus.filtering.kalman.ProcessEstimate): ... def estimationStep(self, t: _ExtendedKalmanFilter__T) -> org.hipparchus.filtering.kalman.ProcessEstimate: ... class NonLinearEvolution: + """ + public classNonLinearEvolution extends :class:`~org.hipparchus.filtering.kalman.extended.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Container for :class:`~org.hipparchus.filtering.kalman.extended.NonLinearProcess` evolution data. + + Since: + 1.3 + + Also see: + + - :class:`~org.hipparchus.filtering.kalman.extended.NonLinearProcess` + """ def __init__(self, double: float, realVector: org.hipparchus.linear.RealVector, realMatrix: org.hipparchus.linear.RealMatrix, realMatrix2: org.hipparchus.linear.RealMatrix, realMatrix3: org.hipparchus.linear.RealMatrix): ... - def getCurrentState(self) -> org.hipparchus.linear.RealVector: ... - def getCurrentTime(self) -> float: ... - def getMeasurementJacobian(self) -> org.hipparchus.linear.RealMatrix: ... - def getProcessNoiseMatrix(self) -> org.hipparchus.linear.RealMatrix: ... - def getStateTransitionMatrix(self) -> org.hipparchus.linear.RealMatrix: ... + def getCurrentState(self) -> org.hipparchus.linear.RealVector: + """ + Get current state. + + Returns: + current state + + + """ + ... + def getCurrentTime(self) -> float: + """ + Get current time. + + Returns: + current time + + + """ + ... + def getMeasurementJacobian(self) -> org.hipparchus.linear.RealMatrix: + """ + Get measurement Jacobian. + + Returns: + Jacobian of the measurement with respect to the state (may be null if measurement should be ignored) + + + """ + ... + def getProcessNoiseMatrix(self) -> org.hipparchus.linear.RealMatrix: + """ + Get process noise. + + Returns: + process noise + + + """ + ... + def getStateTransitionMatrix(self) -> org.hipparchus.linear.RealMatrix: + """ + Get state transition matrix between previous and current state. + + Returns: + state transition matrix between previous and current state + + + """ + ... _NonLinearProcess__T = typing.TypeVar('_NonLinearProcess__T', bound=org.hipparchus.filtering.kalman.Measurement) # <T> class NonLinearProcess(typing.Generic[_NonLinearProcess__T]): - def getEvolution(self, double: float, realVector: org.hipparchus.linear.RealVector, t: _NonLinearProcess__T) -> NonLinearEvolution: ... - def getInnovation(self, t: _NonLinearProcess__T, nonLinearEvolution: NonLinearEvolution, realMatrix: org.hipparchus.linear.RealMatrix) -> org.hipparchus.linear.RealVector: ... + """ + public interfaceNonLinearProcess<T extends :class:`~org.hipparchus.filtering.kalman.Measurement`> + + Non-linear process that can be estimated by a :class:`~org.hipparchus.filtering.kalman.extended.ExtendedKalmanFilter`. + + This interface must be implemented by users to represent the behavior of the process to be estimated + + Since: + 1.3 + + Also see: + + - :class:`~org.hipparchus.filtering.kalman.extended.ExtendedKalmanFilter` + - :class:`~org.hipparchus.filtering.kalman.linear.LinearProcess` + """ + def getEvolution(self, double: float, realVector: org.hipparchus.linear.RealVector, t: _NonLinearProcess__T) -> NonLinearEvolution: + """ + Get the state evolution between two times. + + Parameters: + previousTime (double): time of the previous state + previousState (:class:`~org.hipparchus.filtering.kalman.extended.https:.www.hipparchus.org.hipparchus`): process state at :code:`previousTime` + measurement (:class:`~org.hipparchus.filtering.kalman.extended.NonLinearProcess`): measurement to process + + Returns: + state evolution + + + """ + ... + def getInnovation(self, t: _NonLinearProcess__T, nonLinearEvolution: NonLinearEvolution, realMatrix: org.hipparchus.linear.RealMatrix) -> org.hipparchus.linear.RealVector: + """ + Get the innovation brought by a measurement. + + Parameters: + measurement (:class:`~org.hipparchus.filtering.kalman.extended.NonLinearProcess`): measurement to process + evolution (:class:`~org.hipparchus.filtering.kalman.extended.NonLinearEvolution`): evolution returned by a previous call to :meth:`~org.hipparchus.filtering.kalman.extended.NonLinearProcess.getEvolution` + innovationCovarianceMatrix (:class:`~org.hipparchus.filtering.kalman.extended.https:.www.hipparchus.org.hipparchus`): innovation covariance matrix, defined as \(h.P.h^T + r\) where h is the + :meth:`~org.hipparchus.filtering.kalman.extended.NonLinearEvolution.getMeasurementJacobian`, P is the predicted + covariance and r is :meth:`~org.hipparchus.filtering.kalman.Measurement.getCovariance` + + Returns: + innovation brought by a measurement, may be null if measurement should be rejected + + + """ + ... class __module_protocol__(Protocol): diff --git a/org-stubs/hipparchus/filtering/kalman/linear/__init__.pyi b/org-stubs/hipparchus/filtering/kalman/linear/__init__.pyi index 2c5399b..570913a 100644 --- a/org-stubs/hipparchus/filtering/kalman/linear/__init__.pyi +++ b/org-stubs/hipparchus/filtering/kalman/linear/__init__.pyi @@ -12,21 +12,121 @@ import typing class LinearEvolution: + """ + public classLinearEvolution extends :class:`~org.hipparchus.filtering.kalman.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Container for :class:`~org.hipparchus.filtering.kalman.linear.LinearProcess` evolution data. + + Since: + 1.3 + + Also see: + + - :class:`~org.hipparchus.filtering.kalman.linear.LinearProcess` + """ def __init__(self, realMatrix: org.hipparchus.linear.RealMatrix, realMatrix2: org.hipparchus.linear.RealMatrix, realVector: org.hipparchus.linear.RealVector, realMatrix3: org.hipparchus.linear.RealMatrix, realMatrix4: org.hipparchus.linear.RealMatrix): ... - def getCommand(self) -> org.hipparchus.linear.RealVector: ... - def getControlMatrix(self) -> org.hipparchus.linear.RealMatrix: ... - def getMeasurementJacobian(self) -> org.hipparchus.linear.RealMatrix: ... - def getProcessNoiseMatrix(self) -> org.hipparchus.linear.RealMatrix: ... - def getStateTransitionMatrix(self) -> org.hipparchus.linear.RealMatrix: ... + def getCommand(self) -> org.hipparchus.linear.RealVector: + """ + Get the command u :sub:`k-1` . + + Returns: + command vector u :sub:`k-1` (can be null if there is no control) + + + """ + ... + def getControlMatrix(self) -> org.hipparchus.linear.RealMatrix: + """ + Get the control matrix B :sub:`k-1` . + + Returns: + control matrix B :sub:`k-1` (can be null if there is no control) + + + """ + ... + def getMeasurementJacobian(self) -> org.hipparchus.linear.RealMatrix: + """ + Get measurement Jacobian. + + Returns: + Jacobian of the measurement with respect to the state (may be null if measurement should be ignored) + + + """ + ... + def getProcessNoiseMatrix(self) -> org.hipparchus.linear.RealMatrix: + """ + Get the process noise matrix Q :sub:`k-1` . + + Returns: + process noise matrix :sub:`k-1` + + + """ + ... + def getStateTransitionMatrix(self) -> org.hipparchus.linear.RealMatrix: + """ + Get the state transition matrix A :sub:`k-1` . + + Returns: + state transition matrix A :sub:`k-1` + + + """ + ... _LinearKalmanFilter__T = typing.TypeVar('_LinearKalmanFilter__T', bound=org.hipparchus.filtering.kalman.Measurement) # <T> class LinearKalmanFilter(org.hipparchus.filtering.kalman.AbstractKalmanFilter[_LinearKalmanFilter__T], typing.Generic[_LinearKalmanFilter__T]): + """ + public classLinearKalmanFilter<T extends :class:`~org.hipparchus.filtering.kalman.Measurement`> extends :class:`~org.hipparchus.filtering.kalman.AbstractKalmanFilter`<T> + + Kalman filter for :class:`~org.hipparchus.filtering.kalman.linear.LinearProcess`. + + Since: + 1.3 + """ def __init__(self, matrixDecomposer: typing.Union[org.hipparchus.linear.MatrixDecomposer, typing.Callable], linearProcess: typing.Union['LinearProcess'[_LinearKalmanFilter__T], typing.Callable[[_LinearKalmanFilter__T], LinearEvolution]], processEstimate: org.hipparchus.filtering.kalman.ProcessEstimate): ... def estimationStep(self, t: _LinearKalmanFilter__T) -> org.hipparchus.filtering.kalman.ProcessEstimate: ... _LinearProcess__T = typing.TypeVar('_LinearProcess__T', bound=org.hipparchus.filtering.kalman.Measurement) # <T> class LinearProcess(typing.Generic[_LinearProcess__T]): - def getEvolution(self, t: _LinearProcess__T) -> LinearEvolution: ... + """ + public interfaceLinearProcess<T extends :class:`~org.hipparchus.filtering.kalman.Measurement`> + + Linear process that can be estimated by a :class:`~org.hipparchus.filtering.kalman.linear.LinearKalmanFilter`. + + This interface must be implemented by users to represent the behavior of the process to be estimated + + A linear process is governed by the equation: \( x_k = A_{k-1} x_{k-1} + B_{k-1} u_{k-1} + w_{k-1} \) where + + - A :sub:`k-1` is the state transition matrix in the absence of control, + - B :sub:`k-1` is the control matrix, + - u :sub:`k-1` is the command + - w :sub:`k-1` is the process noise, which has covariance matrix Q :sub:`k-1` + + + Since: + 1.3 + + Also see: + + - :class:`~org.hipparchus.filtering.kalman.linear.LinearKalmanFilter` + - :class:`~org.hipparchus.filtering.kalman.extended.NonLinearProcess` + """ + def getEvolution(self, t: _LinearProcess__T) -> LinearEvolution: + """ + Get the state evolution between two times. + + Parameters: + measurement (:class:`~org.hipparchus.filtering.kalman.linear.LinearProcess`): measurement to process + + Returns: + state evolution + + + """ + ... class __module_protocol__(Protocol): diff --git a/org-stubs/hipparchus/filtering/kalman/unscented/__init__.pyi b/org-stubs/hipparchus/filtering/kalman/unscented/__init__.pyi index 63d09d8..adbec65 100644 --- a/org-stubs/hipparchus/filtering/kalman/unscented/__init__.pyi +++ b/org-stubs/hipparchus/filtering/kalman/unscented/__init__.pyi @@ -14,25 +14,171 @@ import typing class UnscentedEvolution: + """ + public classUnscentedEvolution extends :class:`~org.hipparchus.filtering.kalman.unscented.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Container for :class:`~org.hipparchus.filtering.kalman.unscented.UnscentedProcess` evolution data. + + Since: + 2.2 + + Also see: + + - :class:`~org.hipparchus.filtering.kalman.unscented.UnscentedProcess` + """ def __init__(self, double: float, realVectorArray: typing.Union[typing.List[org.hipparchus.linear.RealVector], jpype.JArray], realMatrix: org.hipparchus.linear.RealMatrix): ... - def getCurrentStates(self) -> typing.MutableSequence[org.hipparchus.linear.RealVector]: ... - def getCurrentTime(self) -> float: ... - def getProcessNoiseMatrix(self) -> org.hipparchus.linear.RealMatrix: ... + def getCurrentStates(self) -> typing.MutableSequence[org.hipparchus.linear.RealVector]: + """ + Get current states. + + Returns: + current states + + + """ + ... + def getCurrentTime(self) -> float: + """ + Get current time. + + Returns: + current time + + + """ + ... + def getProcessNoiseMatrix(self) -> org.hipparchus.linear.RealMatrix: + """ + Get process noise. + + Returns: + process noise + + + """ + ... _UnscentedKalmanFilter__T = typing.TypeVar('_UnscentedKalmanFilter__T', bound=org.hipparchus.filtering.kalman.Measurement) # <T> class UnscentedKalmanFilter(org.hipparchus.filtering.kalman.KalmanFilter[_UnscentedKalmanFilter__T], typing.Generic[_UnscentedKalmanFilter__T]): + """ + public classUnscentedKalmanFilter<T extends :class:`~org.hipparchus.filtering.kalman.Measurement`> extends :class:`~org.hipparchus.filtering.kalman.unscented.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.filtering.kalman.KalmanFilter`<T> + + Unscented Kalman filter for :class:`~org.hipparchus.filtering.kalman.unscented.UnscentedProcess`. + + Since: + 2.2 + + Also see: + + - "Wan, E. A., & Van Der Merwe, R. (2000, October). The unscented Kalman filter for nonlinear estimation. In Proceedings + of the IEEE 2000 Adaptive Systems for Signal Processing, Communications, and Control Symposium (Cat. No. 00EX373) (pp. + 153-158)" + """ def __init__(self, matrixDecomposer: typing.Union[org.hipparchus.linear.MatrixDecomposer, typing.Callable], unscentedProcess: 'UnscentedProcess'[_UnscentedKalmanFilter__T], processEstimate: org.hipparchus.filtering.kalman.ProcessEstimate, unscentedTransformProvider: org.hipparchus.util.UnscentedTransformProvider): ... def estimationStep(self, t: _UnscentedKalmanFilter__T) -> org.hipparchus.filtering.kalman.ProcessEstimate: ... - def getCorrected(self) -> org.hipparchus.filtering.kalman.ProcessEstimate: ... - def getPredicted(self) -> org.hipparchus.filtering.kalman.ProcessEstimate: ... - def getUnscentedTransformProvider(self) -> org.hipparchus.util.UnscentedTransformProvider: ... + def getCorrected(self) -> org.hipparchus.filtering.kalman.ProcessEstimate: + """ + Get the corrected state. + + Specified by: + :meth:`~org.hipparchus.filtering.kalman.KalmanFilter.getCorrected` in + interface :class:`~org.hipparchus.filtering.kalman.KalmanFilter` + + Returns: + corrected state + + + """ + ... + def getPredicted(self) -> org.hipparchus.filtering.kalman.ProcessEstimate: + """ + Get the predicted state. + + Specified by: + :meth:`~org.hipparchus.filtering.kalman.KalmanFilter.getPredicted` in + interface :class:`~org.hipparchus.filtering.kalman.KalmanFilter` + + Returns: + predicted state + + + """ + ... + def getUnscentedTransformProvider(self) -> org.hipparchus.util.UnscentedTransformProvider: + """ + Get the unscented transform provider. + + Returns: + unscented transform provider + + + """ + ... def predictionAndCorrectionSteps(self, t: _UnscentedKalmanFilter__T, realVectorArray: typing.Union[typing.List[org.hipparchus.linear.RealVector], jpype.JArray]) -> org.hipparchus.filtering.kalman.ProcessEstimate: ... _UnscentedProcess__T = typing.TypeVar('_UnscentedProcess__T', bound=org.hipparchus.filtering.kalman.Measurement) # <T> class UnscentedProcess(typing.Generic[_UnscentedProcess__T]): - def getEvolution(self, double: float, realVectorArray: typing.Union[typing.List[org.hipparchus.linear.RealVector], jpype.JArray], t: _UnscentedProcess__T) -> UnscentedEvolution: ... - def getInnovation(self, t: _UnscentedProcess__T, realVector: org.hipparchus.linear.RealVector, realVector2: org.hipparchus.linear.RealVector, realMatrix: org.hipparchus.linear.RealMatrix) -> org.hipparchus.linear.RealVector: ... - def getPredictedMeasurements(self, realVectorArray: typing.Union[typing.List[org.hipparchus.linear.RealVector], jpype.JArray], t: _UnscentedProcess__T) -> typing.MutableSequence[org.hipparchus.linear.RealVector]: ... + """ + public interfaceUnscentedProcess<T extends :class:`~org.hipparchus.filtering.kalman.Measurement`> + + Unscented process that can be estimated by a :class:`~org.hipparchus.filtering.kalman.unscented.UnscentedKalmanFilter`. + + This interface must be implemented by users to represent the behavior of the process to be estimated + + Since: + 2.2 + + Also see: + + - :class:`~org.hipparchus.filtering.kalman.unscented.UnscentedKalmanFilter` + - :class:`~org.hipparchus.filtering.kalman.unscented.UnscentedProcess` + """ + def getEvolution(self, double: float, realVectorArray: typing.Union[typing.List[org.hipparchus.linear.RealVector], jpype.JArray], t: _UnscentedProcess__T) -> UnscentedEvolution: + """ + Get the state evolution between two times. + + Parameters: + previousTime (double): time of the previous state + sigmaPoints (:class:`~org.hipparchus.filtering.kalman.unscented.https:.www.hipparchus.org.hipparchus`[]): sigma points + measurement (:class:`~org.hipparchus.filtering.kalman.unscented.UnscentedProcess`): measurement to process + + Returns: + states evolution + + + """ + ... + def getInnovation(self, t: _UnscentedProcess__T, realVector: org.hipparchus.linear.RealVector, realVector2: org.hipparchus.linear.RealVector, realMatrix: org.hipparchus.linear.RealMatrix) -> org.hipparchus.linear.RealVector: + """ + Get the innovation brought by a measurement. + + Parameters: + measurement (:class:`~org.hipparchus.filtering.kalman.unscented.UnscentedProcess`): measurement to process + predictedMeasurement (:class:`~org.hipparchus.filtering.kalman.unscented.https:.www.hipparchus.org.hipparchus`): predicted measurement + predictedState (:class:`~org.hipparchus.filtering.kalman.unscented.https:.www.hipparchus.org.hipparchus`): predicted state + innovationCovarianceMatrix (:class:`~org.hipparchus.filtering.kalman.unscented.https:.www.hipparchus.org.hipparchus`): innovation covariance matrix + + Returns: + innovation brought by a measurement, may be null if measurement should be rejected + + + """ + ... + def getPredictedMeasurements(self, realVectorArray: typing.Union[typing.List[org.hipparchus.linear.RealVector], jpype.JArray], t: _UnscentedProcess__T) -> typing.MutableSequence[org.hipparchus.linear.RealVector]: + """ + Get the state evolution between two times. + + Parameters: + predictedSigmaPoints (:class:`~org.hipparchus.filtering.kalman.unscented.https:.www.hipparchus.org.hipparchus`[]): predicted state sigma points + measurement (:class:`~org.hipparchus.filtering.kalman.unscented.UnscentedProcess`): measurement to process + + Returns: + predicted measurement sigma points + + + """ + ... class __module_protocol__(Protocol): diff --git a/org-stubs/hipparchus/fitting/__init__.pyi b/org-stubs/hipparchus/fitting/__init__.pyi index 63c9299..fec2c35 100644 --- a/org-stubs/hipparchus/fitting/__init__.pyi +++ b/org-stubs/hipparchus/fitting/__init__.pyi @@ -14,55 +14,411 @@ import typing class AbstractCurveFitter: + """ + public abstract classAbstractCurveFitter extends :class:`~org.hipparchus.fitting.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Base class that contains common code for fitting parametric univariate real functions :code:`y = f(p :sub:`i` ;x)`, + where :code:`x` is the independent variable and the :code:`p :sub:`i`` are the *parameters*. + + + A fitter will find the optimal values of the parameters by *fitting* the curve so it remains very close to a set of + :code:`N` observed points :code:`(x :sub:`k` , y :sub:`k` )`, :code:`0 <= k < N`. + + + An algorithm usually performs the fit by finding the parameter values that minimizes the objective function + + .. code-block: java + + ∑y :sub:`k` - f(x :sub:`k` ) :sup:`2` , + + which is actually a least-squares problem. This class contains boilerplate code for calling the + :meth:`~org.hipparchus.fitting.AbstractCurveFitter.fit` method for obtaining the parameters. The problem setup, such as + the choice of optimization algorithm for fitting a specific function is delegated to subclasses. + """ def __init__(self): ... def fit(self, collection: typing.Union[java.util.Collection['WeightedObservedPoint'], typing.Sequence['WeightedObservedPoint'], typing.Set['WeightedObservedPoint']]) -> typing.MutableSequence[float]: ... class WeightedObservedPoint(java.io.Serializable): + """ + public classWeightedObservedPoint extends :class:`~org.hipparchus.fitting.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.fitting.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + This class is a simple container for weighted observed point in :class:`~org.hipparchus.fitting.AbstractCurveFitter`. + + Instances of this class are guaranteed to be immutable. + + Also see: + + - :meth:`~serialized` + """ def __init__(self, double: float, double2: float, double3: float): ... - def getWeight(self) -> float: ... - def getX(self) -> float: ... - def getY(self) -> float: ... + def getWeight(self) -> float: + """ + Gets the weight of the measurement in the fitting process. + + Returns: + the weight of the measurement in the fitting process. + + + """ + ... + def getX(self) -> float: + """ + Gets the abscissa of the point. + + Returns: + the abscissa of the point. + + + """ + ... + def getY(self) -> float: + """ + Gets the observed value of the function at x. + + Returns: + the observed value of the function at x. + + + """ + ... class WeightedObservedPoints(java.io.Serializable): + """ + public classWeightedObservedPoints extends :class:`~org.hipparchus.fitting.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.fitting.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + Simple container for weighted observed points used in :class:`~org.hipparchus.fitting.AbstractCurveFitter` algorithms. + + Also see: + + - :meth:`~serialized` + """ def __init__(self): ... @typing.overload - def add(self, double: float, double2: float) -> None: ... + def add(self, double: float, double2: float) -> None: + """ + Adds a point to the sample. Calling this method is equivalent to calling :code:`add(1.0, x, y)`. + + Parameters: + x (double): Abscissa of the point. + y (double): Observed value at :code:`x`. After fitting we should have :code:`f(x)` as close as possible to this value. + + Also see: + + - :meth:`~org.hipparchus.fitting.WeightedObservedPoints.add` + - :meth:`~org.hipparchus.fitting.WeightedObservedPoints.add` + - :meth:`~org.hipparchus.fitting.WeightedObservedPoints.toList` + + + Adds a point to the sample. + + Parameters: + weight (double): Weight of the observed point. + x (double): Abscissa of the point. + y (double): Observed value at :code:`x`. After fitting we should have :code:`f(x)` as close as possible to this value. + + Also see: + + - :meth:`~org.hipparchus.fitting.WeightedObservedPoints.add` + - :meth:`~org.hipparchus.fitting.WeightedObservedPoints.add` + - :meth:`~org.hipparchus.fitting.WeightedObservedPoints.toList` + + + """ + ... @typing.overload def add(self, double: float, double2: float, double3: float) -> None: ... @typing.overload - def add(self, weightedObservedPoint: WeightedObservedPoint) -> None: ... - def clear(self) -> None: ... + def add(self, weightedObservedPoint: WeightedObservedPoint) -> None: + """ + Adds a point to the sample. + + Parameters: + observed (:class:`~org.hipparchus.fitting.WeightedObservedPoint`): Observed point to add. + + Also see: + + - :meth:`~org.hipparchus.fitting.WeightedObservedPoints.add` + - :meth:`~org.hipparchus.fitting.WeightedObservedPoints.add` + - :meth:`~org.hipparchus.fitting.WeightedObservedPoints.toList` + + + + """ + ... + def clear(self) -> None: + """ + Removes all observations from this container. + + """ + ... def toList(self) -> java.util.List[WeightedObservedPoint]: ... class GaussianCurveFitter(AbstractCurveFitter): + """ + public classGaussianCurveFitter extends :class:`~org.hipparchus.fitting.AbstractCurveFitter` + + Fits points to a :class:`~org.hipparchus.fitting.https:.www.hipparchus.org.hipparchus` function. + + + The :meth:`~org.hipparchus.fitting.GaussianCurveFitter.withStartPoint` must be passed in the following order: + + - Normalization + - Mean + - Sigma + + The optimal values will be returned in the same order. + + Usage example: + + .. code-block: java + + WeightedObservedPoints obs = new WeightedObservedPoints(); + obs.add(4.0254623, 531026.0); + obs.add(4.03128248, 984167.0); + obs.add(4.03839603, 1887233.0); + obs.add(4.04421621, 2687152.0); + obs.add(4.05132976, 3461228.0); + obs.add(4.05326982, 3580526.0); + obs.add(4.05779662, 3439750.0); + obs.add(4.0636168, 2877648.0); + obs.add(4.06943698, 2175960.0); + obs.add(4.07525716, 1447024.0); + obs.add(4.08237071, 717104.0); + obs.add(4.08366408, 620014.0); + double[] parameters = GaussianCurveFitter.create().fit(obs.toList()); + """ @staticmethod - def create() -> 'GaussianCurveFitter': ... - def withMaxIterations(self, int: int) -> 'GaussianCurveFitter': ... - def withStartPoint(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> 'GaussianCurveFitter': ... + def create() -> 'GaussianCurveFitter': + """ + Creates a default curve fitter. The initial guess for the parameters will be + :class:`~org.hipparchus.fitting.GaussianCurveFitter.ParameterGuesser` computed automatically, and the maximum number of + iterations of the optimization algorithm is set to + :meth:`~org.hipparchus.fitting.https:.docs.oracle.com.javase.8.docs.api.java.lang.Integer.MAX_VALUE`. + + Returns: + a curve fitter. + + Also see: + + - :meth:`~org.hipparchus.fitting.GaussianCurveFitter.withStartPoint` + - :meth:`~org.hipparchus.fitting.GaussianCurveFitter.withMaxIterations` + + + + """ + ... + def withMaxIterations(self, int: int) -> 'GaussianCurveFitter': + """ + Configure the maximum number of iterations. + + Parameters: + newMaxIter (int): maximum number of iterations + + Returns: + a new instance. + + + """ + ... + def withStartPoint(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> 'GaussianCurveFitter': + """ + Configure the start point (initial guess). + + Parameters: + newStart (double[]): new start point (initial guess) + + Returns: + a new instance. + + + """ + ... class ParameterGuesser: def __init__(self, collection: typing.Union[java.util.Collection[WeightedObservedPoint], typing.Sequence[WeightedObservedPoint], typing.Set[WeightedObservedPoint]]): ... def guess(self) -> typing.MutableSequence[float]: ... class HarmonicCurveFitter(AbstractCurveFitter): + """ + public classHarmonicCurveFitter extends :class:`~org.hipparchus.fitting.AbstractCurveFitter` + + Fits points to a :class:`~org.hipparchus.fitting.https:.www.hipparchus.org.hipparchus` function. + + + The :meth:`~org.hipparchus.fitting.HarmonicCurveFitter.withStartPoint` must be passed in the following order: + + - Amplitude + - Angular frequency + - phase + + The optimal values will be returned in the same order. + """ @staticmethod - def create() -> 'HarmonicCurveFitter': ... - def withMaxIterations(self, int: int) -> 'HarmonicCurveFitter': ... - def withStartPoint(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> 'HarmonicCurveFitter': ... + def create() -> 'HarmonicCurveFitter': + """ + Creates a default curve fitter. The initial guess for the parameters will be + :class:`~org.hipparchus.fitting.HarmonicCurveFitter.ParameterGuesser` computed automatically, and the maximum number of + iterations of the optimization algorithm is set to + :meth:`~org.hipparchus.fitting.https:.docs.oracle.com.javase.8.docs.api.java.lang.Integer.MAX_VALUE`. + + Returns: + a curve fitter. + + Also see: + + - :meth:`~org.hipparchus.fitting.HarmonicCurveFitter.withStartPoint` + - :meth:`~org.hipparchus.fitting.HarmonicCurveFitter.withMaxIterations` + + + + """ + ... + def withMaxIterations(self, int: int) -> 'HarmonicCurveFitter': + """ + Configure the maximum number of iterations. + + Parameters: + newMaxIter (int): maximum number of iterations + + Returns: + a new instance. + + + """ + ... + def withStartPoint(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> 'HarmonicCurveFitter': + """ + Configure the start point (initial guess). + + Parameters: + newStart (double[]): new start point (initial guess) + + Returns: + a new instance. + + + """ + ... class ParameterGuesser: def __init__(self, collection: typing.Union[java.util.Collection[WeightedObservedPoint], typing.Sequence[WeightedObservedPoint], typing.Set[WeightedObservedPoint]]): ... def guess(self) -> typing.MutableSequence[float]: ... class PolynomialCurveFitter(AbstractCurveFitter): + """ + public classPolynomialCurveFitter extends :class:`~org.hipparchus.fitting.AbstractCurveFitter` + + Fits points to a :class:`~org.hipparchus.fitting.https:.www.hipparchus.org.hipparchus` function. + + + The size of the :meth:`~org.hipparchus.fitting.PolynomialCurveFitter.withStartPoint` array defines the degree of the + polynomial to be fitted. They must be sorted in increasing order of the polynomial's degree. The optimal values of the + coefficients will be returned in the same order. + """ @staticmethod - def create(int: int) -> 'PolynomialCurveFitter': ... - def withMaxIterations(self, int: int) -> 'PolynomialCurveFitter': ... - def withStartPoint(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> 'PolynomialCurveFitter': ... + def create(int: int) -> 'PolynomialCurveFitter': + """ + Creates a default curve fitter. Zero will be used as initial guess for the coefficients, and the maximum number of + iterations of the optimization algorithm is set to + :meth:`~org.hipparchus.fitting.https:.docs.oracle.com.javase.8.docs.api.java.lang.Integer.MAX_VALUE`. + + Parameters: + degree (int): Degree of the polynomial to be fitted. + + Returns: + a curve fitter. + + Also see: + + - :meth:`~org.hipparchus.fitting.PolynomialCurveFitter.withStartPoint` + - :meth:`~org.hipparchus.fitting.PolynomialCurveFitter.withMaxIterations` + + + + """ + ... + def withMaxIterations(self, int: int) -> 'PolynomialCurveFitter': + """ + Configure the maximum number of iterations. + + Parameters: + newMaxIter (int): maximum number of iterations + + Returns: + a new instance. + + + """ + ... + def withStartPoint(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> 'PolynomialCurveFitter': + """ + Configure the start point (initial guess). + + Parameters: + newStart (double[]): new start point (initial guess) + + Returns: + a new instance. + + + """ + ... class SimpleCurveFitter(AbstractCurveFitter): + """ + public classSimpleCurveFitter extends :class:`~org.hipparchus.fitting.AbstractCurveFitter` + + Fits points to a user-defined :class:`~org.hipparchus.fitting.https:.www.hipparchus.org.hipparchus`. + """ @staticmethod - def create(parametricUnivariateFunction: org.hipparchus.analysis.ParametricUnivariateFunction, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> 'SimpleCurveFitter': ... - def withMaxIterations(self, int: int) -> 'SimpleCurveFitter': ... - def withStartPoint(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> 'SimpleCurveFitter': ... + def create(parametricUnivariateFunction: org.hipparchus.analysis.ParametricUnivariateFunction, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> 'SimpleCurveFitter': + """ + Creates a curve fitter. The maximum number of iterations of the optimization algorithm is set to + :meth:`~org.hipparchus.fitting.https:.docs.oracle.com.javase.8.docs.api.java.lang.Integer.MAX_VALUE`. + + Parameters: + f (:class:`~org.hipparchus.fitting.https:.www.hipparchus.org.hipparchus`): Function to fit. + start (double[]): Initial guess for the parameters. Cannot be :code:`null`. Its length must be consistent with the number of parameters of + the function to fit. + + Returns: + a curve fitter. + + Also see: + + - :meth:`~org.hipparchus.fitting.SimpleCurveFitter.withStartPoint` + - :meth:`~org.hipparchus.fitting.SimpleCurveFitter.withMaxIterations` + + + + """ + ... + def withMaxIterations(self, int: int) -> 'SimpleCurveFitter': + """ + Configure the maximum number of iterations. + + Parameters: + newMaxIter (int): maximum number of iterations + + Returns: + a new instance. + + + """ + ... + def withStartPoint(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> 'SimpleCurveFitter': + """ + Configure the start point (initial guess). + + Parameters: + newStart (double[]): new start point (initial guess) + + Returns: + a new instance. + + + """ + ... class __module_protocol__(Protocol): diff --git a/org-stubs/hipparchus/fraction/__init__.pyi b/org-stubs/hipparchus/fraction/__init__.pyi index 7e640d8..4f350ac 100644 --- a/org-stubs/hipparchus/fraction/__init__.pyi +++ b/org-stubs/hipparchus/fraction/__init__.pyi @@ -19,20 +19,114 @@ import typing class BigFraction(java.lang.Number, org.hipparchus.FieldElement['BigFraction'], java.lang.Comparable['BigFraction'], java.io.Serializable): + """ + public classBigFraction extends :class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.Number` + implements :class:`~org.hipparchus.FieldElement`<:class:`~org.hipparchus.fraction.BigFraction`>, :class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.Comparable`<:class:`~org.hipparchus.fraction.BigFraction`>, :class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + Representation of a rational number without any overflow. This class is immutable. + + Also see: + + - :meth:`~serialized` + """ TWO: typing.ClassVar['BigFraction'] = ... + """ + public static final :class:`~org.hipparchus.fraction.BigFraction` TWO + + A fraction representing "2 / 1". + + """ ONE: typing.ClassVar['BigFraction'] = ... + """ + public static final :class:`~org.hipparchus.fraction.BigFraction` ONE + + A fraction representing "1". + + """ ZERO: typing.ClassVar['BigFraction'] = ... + """ + public static final :class:`~org.hipparchus.fraction.BigFraction` ZERO + + A fraction representing "0". + + """ MINUS_ONE: typing.ClassVar['BigFraction'] = ... + """ + public static final :class:`~org.hipparchus.fraction.BigFraction` MINUS_ONE + + A fraction representing "-1 / 1". + + """ FOUR_FIFTHS: typing.ClassVar['BigFraction'] = ... + """ + public static final :class:`~org.hipparchus.fraction.BigFraction` FOUR_FIFTHS + + A fraction representing "4/5". + + """ ONE_FIFTH: typing.ClassVar['BigFraction'] = ... + """ + public static final :class:`~org.hipparchus.fraction.BigFraction` ONE_FIFTH + + A fraction representing "1/5". + + """ ONE_HALF: typing.ClassVar['BigFraction'] = ... + """ + public static final :class:`~org.hipparchus.fraction.BigFraction` ONE_HALF + + A fraction representing "1/2". + + """ ONE_QUARTER: typing.ClassVar['BigFraction'] = ... + """ + public static final :class:`~org.hipparchus.fraction.BigFraction` ONE_QUARTER + + A fraction representing "1/4". + + """ ONE_THIRD: typing.ClassVar['BigFraction'] = ... + """ + public static final :class:`~org.hipparchus.fraction.BigFraction` ONE_THIRD + + A fraction representing "1/3". + + """ THREE_FIFTHS: typing.ClassVar['BigFraction'] = ... + """ + public static final :class:`~org.hipparchus.fraction.BigFraction` THREE_FIFTHS + + A fraction representing "3/5". + + """ THREE_QUARTERS: typing.ClassVar['BigFraction'] = ... + """ + public static final :class:`~org.hipparchus.fraction.BigFraction` THREE_QUARTERS + + A fraction representing "3/4". + + """ TWO_FIFTHS: typing.ClassVar['BigFraction'] = ... + """ + public static final :class:`~org.hipparchus.fraction.BigFraction` TWO_FIFTHS + + A fraction representing "2/5". + + """ TWO_QUARTERS: typing.ClassVar['BigFraction'] = ... + """ + public static final :class:`~org.hipparchus.fraction.BigFraction` TWO_QUARTERS + + A fraction representing "2/4". + + """ TWO_THIRDS: typing.ClassVar['BigFraction'] = ... + """ + public static final :class:`~org.hipparchus.fraction.BigFraction` TWO_THIRDS + + A fraction representing "2/3". + + """ @typing.overload def __init__(self, double: float): ... @typing.overload @@ -51,9 +145,56 @@ class BigFraction(java.lang.Number, org.hipparchus.FieldElement['BigFraction'], def __init__(self, long: int): ... @typing.overload def __init__(self, long: int, long2: int): ... - def abs(self) -> 'BigFraction': ... - @typing.overload - def add(self, int: int) -> 'BigFraction': ... + def abs(self) -> 'BigFraction': + """ + + Returns the absolute value of this :class:`~org.hipparchus.fraction.BigFraction`. + + Returns: + the absolute value as a :class:`~org.hipparchus.fraction.BigFraction`. + + + """ + ... + @typing.overload + def add(self, int: int) -> 'BigFraction': + """ + + Adds the value of this fraction to the passed :code:`integer`, returning the result in reduced form. + + Parameters: + i (int): the :code:`integer` to add. + + Returns: + a :code:`BigFraction` instance with the resulting values. + + + Adds the value of this fraction to the passed :code:`long`, returning the result in reduced form. + + Parameters: + l (long): the :code:`long` to add. + + Returns: + a :code:`BigFraction` instance with the resulting values. + + + Adds the value of this fraction to another, returning the result in reduced form. + + Specified by: + :meth:`~org.hipparchus.FieldElement.add` in interface :class:`~org.hipparchus.FieldElement` + + Parameters: + fraction (:class:`~org.hipparchus.fraction.BigFraction`): the :class:`~org.hipparchus.fraction.BigFraction` to add, must not be :code:`null`. + + Returns: + a :class:`~org.hipparchus.fraction.BigFraction` instance with the resulting values. + + Raises: + :class:`~org.hipparchus.exception.NullArgumentException`: if the :class:`~org.hipparchus.fraction.BigFraction` is :code:`null`. + + + """ + ... @typing.overload def add(self, bigInteger: java.math.BigInteger) -> 'BigFraction': ... @typing.overload @@ -61,100 +202,894 @@ class BigFraction(java.lang.Number, org.hipparchus.FieldElement['BigFraction'], @typing.overload def add(self, bigFraction: 'BigFraction') -> 'BigFraction': ... @typing.overload - def bigDecimalValue(self) -> java.math.BigDecimal: ... - @typing.overload - def bigDecimalValue(self, int: int, roundingMode: java.math.RoundingMode) -> java.math.BigDecimal: ... - @typing.overload - def bigDecimalValue(self, roundingMode: java.math.RoundingMode) -> java.math.BigDecimal: ... - def compareTo(self, bigFraction: 'BigFraction') -> int: ... + def bigDecimalValue(self) -> java.math.BigDecimal: + """ + + Gets the fraction as a :code:`BigDecimal`. This calculates the fraction as the numerator divided by denominator. + + Returns: + the fraction as a :code:`BigDecimal`. + + Raises: + :class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.ArithmeticException`: if the exact quotient does not have a terminating decimal expansion. + + Also see: + + - :class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.math.BigDecimal` + + + """ + ... + @typing.overload + def bigDecimalValue(self, int: int, roundingMode: java.math.RoundingMode) -> java.math.BigDecimal: + """ + + Gets the fraction as a :code:`BigDecimal` following the passed scale and rounding mode. This calculates the fraction as + the numerator divided by denominator. + + Parameters: + scale (int): scale of the :code:`BigDecimal` quotient to be returned. see + :class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.math.BigDecimal` for more information. + roundingMode (:class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.math.RoundingMode`): rounding mode to apply. see + :class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.math.BigDecimal` constants. + + Returns: + the fraction as a :code:`BigDecimal`. + + Also see: + + - :class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.math.BigDecimal` + + + + """ + ... + @typing.overload + def bigDecimalValue(self, roundingMode: java.math.RoundingMode) -> java.math.BigDecimal: + """ + + Gets the fraction as a :code:`BigDecimal` following the passed rounding mode. This calculates the fraction as the + numerator divided by denominator. + + Parameters: + roundingMode (:class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.math.RoundingMode`): rounding mode to apply. see + :class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.math.BigDecimal` constants. + + Returns: + the fraction as a :code:`BigDecimal`. + + Raises: + :class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.IllegalArgumentException`: if :code:`roundingMode` does not represent a valid rounding mode. + + Also see: + + - :class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.math.BigDecimal` + + + """ + ... + def compareTo(self, bigFraction: 'BigFraction') -> int: + """ + + Compares this object to another based on size. + + Specified by: + :meth:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.Comparable.compareTo` in + interface :class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.Comparable` + + Parameters: + object (:class:`~org.hipparchus.fraction.BigFraction`): the object to compare to, must not be :code:`null`. + + Returns: + -1 if this is less than :code:`object`, +1 if this is greater than :code:`object`, 0 if they are equal. + + Also see: + + - :meth:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.Comparable.compareTo` + + + + """ + ... @staticmethod def convergent(double: float, int: int, convergenceTest: typing.Union['BigFraction.ConvergenceTest', typing.Callable]) -> org.hipparchus.util.Pair['BigFraction', bool]: ... @staticmethod def convergents(double: float, int: int) -> java.util.stream.Stream['BigFraction']: ... @typing.overload - def divide(self, int: int) -> 'BigFraction': ... + def divide(self, int: int) -> 'BigFraction': + """ + + Divide the value of this fraction by the passed :code:`BigInteger`, ie :code:`this * 1 / bg`, returning the result in + reduced form. + + Parameters: + bg (:class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.math.BigInteger`): the :code:`BigInteger` to divide by, must not be :code:`null` + + Returns: + a :class:`~org.hipparchus.fraction.BigFraction` instance with the resulting values + + Raises: + :class:`~org.hipparchus.exception.NullArgumentException`: if the :code:`BigInteger` is :code:`null` + :class:`~org.hipparchus.exception.MathRuntimeException`: if the fraction to divide by is zero + + + Divide the value of this fraction by the passed :code:`int`, ie :code:`this * 1 / i`, returning the result in reduced + form. + + Parameters: + i (int): the :code:`int` to divide by + + Returns: + a :class:`~org.hipparchus.fraction.BigFraction` instance with the resulting values + + Raises: + :class:`~org.hipparchus.exception.MathRuntimeException`: if the fraction to divide by is zero + + + Divide the value of this fraction by the passed :code:`long`, ie :code:`this * 1 / l`, returning the result in reduced + form. + + Parameters: + l (long): the :code:`long` to divide by + + Returns: + a :class:`~org.hipparchus.fraction.BigFraction` instance with the resulting values + + Raises: + :class:`~org.hipparchus.exception.MathRuntimeException`: if the fraction to divide by is zero + + + Divide the value of this fraction by another, returning the result in reduced form. + + Specified by: + :meth:`~org.hipparchus.FieldElement.divide` in interface :class:`~org.hipparchus.FieldElement` + + Parameters: + fraction (:class:`~org.hipparchus.fraction.BigFraction`): Fraction to divide by, must not be :code:`null`. + + Returns: + a :class:`~org.hipparchus.fraction.BigFraction` instance with the resulting values. + + Raises: + :class:`~org.hipparchus.exception.NullArgumentException`: if the :code:`fraction` is :code:`null`. + :class:`~org.hipparchus.exception.MathRuntimeException`: if the fraction to divide by is zero + + + """ + ... @typing.overload def divide(self, bigInteger: java.math.BigInteger) -> 'BigFraction': ... @typing.overload def divide(self, long: int) -> 'BigFraction': ... @typing.overload def divide(self, bigFraction: 'BigFraction') -> 'BigFraction': ... - def doubleValue(self) -> float: ... - def equals(self, object: typing.Any) -> bool: ... - def floatValue(self) -> float: ... - def gcd(self, bigFraction: 'BigFraction') -> 'BigFraction': ... - def getDenominator(self) -> java.math.BigInteger: ... - def getDenominatorAsInt(self) -> int: ... - def getDenominatorAsLong(self) -> int: ... - def getField(self) -> 'BigFractionField': ... - def getNumerator(self) -> java.math.BigInteger: ... - def getNumeratorAsInt(self) -> int: ... - def getNumeratorAsLong(self) -> int: ... - def getReal(self) -> float: ... + def doubleValue(self) -> float: + """ + + Gets the fraction as a :code:`double`. This calculates the fraction as the numerator divided by denominator. + + Specified by: + :meth:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.Number.doubleValue` in + class :class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.Number` + + Returns: + the fraction as a :code:`double` + + Also see: + + - :meth:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.Number.doubleValue` + + + + """ + ... + def equals(self, object: typing.Any) -> bool: + """ + + Test for the equality of two fractions. If the lowest term numerator and denominators are the same for both fractions, + the two fractions are considered to be equal. + + Overrides: + :meth:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.equals` in + class :class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Parameters: + other (:class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object`): fraction to test for equality to this fraction, can be :code:`null`. + + Returns: + true if two fractions are equal, false if object is :code:`null`, not an instance of + :class:`~org.hipparchus.fraction.BigFraction`, or not equal to this fraction instance. + + Also see: + + - :meth:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.equals` + + + + """ + ... + def floatValue(self) -> float: + """ + + Gets the fraction as a :code:`float`. This calculates the fraction as the numerator divided by denominator. + + Specified by: + :meth:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.Number.floatValue` in + class :class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.Number` + + Returns: + the fraction as a :code:`float`. + + Also see: + + - :meth:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.Number.floatValue` + + + + """ + ... + def gcd(self, bigFraction: 'BigFraction') -> 'BigFraction': + """ + Rational number greatest common divisor. + + Parameters: + s (:class:`~org.hipparchus.fraction.BigFraction`): fraction. + + Returns: + gcd(this, s). + + Since: + 3.1 + + + """ + ... + def getDenominator(self) -> java.math.BigInteger: + """ + + Access the denominator as a :code:`BigInteger`. + + Returns: + the denominator as a :code:`BigInteger`. + + + """ + ... + def getDenominatorAsInt(self) -> int: + """ + + Access the denominator as a :code:`int`. + + Returns: + the denominator as a :code:`int`. + + + """ + ... + def getDenominatorAsLong(self) -> int: + """ + + Access the denominator as a :code:`long`. + + Returns: + the denominator as a :code:`long`. + + + """ + ... + def getField(self) -> 'BigFractionField': + """ + Get the :class:`~org.hipparchus.Field` to which the instance belongs. + + Specified by: + :meth:`~org.hipparchus.FieldElement.getField` in interface :class:`~org.hipparchus.FieldElement` + + Returns: + :class:`~org.hipparchus.Field` to which the instance belongs + + + """ + ... + def getNumerator(self) -> java.math.BigInteger: + """ + + Access the numerator as a :code:`BigInteger`. + + Returns: + the numerator as a :code:`BigInteger`. + + + """ + ... + def getNumeratorAsInt(self) -> int: + """ + + Access the numerator as a :code:`int`. + + Returns: + the numerator as a :code:`int`. + + + """ + ... + def getNumeratorAsLong(self) -> int: + """ + + Access the numerator as a :code:`long`. + + Returns: + the numerator as a :code:`long`. + + + """ + ... + def getReal(self) -> float: + """ + Get the real value of the number. + + Specified by: + :meth:`~org.hipparchus.FieldElement.getReal` in interface :class:`~org.hipparchus.FieldElement` + + Returns: + real value + + + """ + ... @staticmethod - def getReducedFraction(int: int, int2: int) -> 'BigFraction': ... - def hashCode(self) -> int: ... - def intValue(self) -> int: ... - def isInteger(self) -> bool: ... - def lcm(self, bigFraction: 'BigFraction') -> 'BigFraction': ... - def longValue(self) -> int: ... - @typing.overload - def multiply(self, int: int) -> 'BigFraction': ... + def getReducedFraction(int: int, int2: int) -> 'BigFraction': + """ + + Creates a :code:`BigFraction` instance with the 2 parts of a fraction Y/Z. + + Any negative signs are resolved to be on the numerator. + + Parameters: + numerator (int): the numerator, for example the three in 'three sevenths'. + denominator (int): the denominator, for example the seven in 'three sevenths'. + + Returns: + a new fraction instance, with the numerator and denominator reduced. + + Raises: + :class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.ArithmeticException`: if the denominator is :code:`zero`. + + + """ + ... + def hashCode(self) -> int: + """ + + Gets a hashCode for the fraction. + + Overrides: + :meth:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.hashCode` in + class :class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Returns: + a hash code value for this object. + + Also see: + + - :meth:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.hashCode` + + + + """ + ... + def intValue(self) -> int: + """ + + Gets the fraction as an :code:`int`. This returns the whole number part of the fraction. + + Specified by: + :meth:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.Number.intValue` in + class :class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.Number` + + Returns: + the whole number fraction part. + + Also see: + + - :meth:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.Number.intValue` + + + + """ + ... + def isInteger(self) -> bool: + """ + Check if a fraction is an integer. + + Returns: + true of fraction is an integer + + + """ + ... + def lcm(self, bigFraction: 'BigFraction') -> 'BigFraction': + """ + Rational number least common multiple. + + Parameters: + s (:class:`~org.hipparchus.fraction.BigFraction`): fraction. + + Returns: + lcm(this, s). + + Since: + 3.1 + + + """ + ... + def longValue(self) -> int: + """ + + Gets the fraction as a :code:`long`. This returns the whole number part of the fraction. + + Specified by: + :meth:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.Number.longValue` in + class :class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.Number` + + Returns: + the whole number fraction part. + + Also see: + + - :meth:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.Number.longValue` + + + + """ + ... + @typing.overload + def multiply(self, int: int) -> 'BigFraction': + """ + + Multiplies the value of this fraction by the passed :code:`BigInteger`, returning the result in reduced form. + + Parameters: + bg (:class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.math.BigInteger`): the :code:`BigInteger` to multiply by. + + Returns: + a :code:`BigFraction` instance with the resulting values. + + Raises: + :class:`~org.hipparchus.exception.NullArgumentException`: if :code:`bg` is :code:`null`. + + + Multiply the value of this fraction by the passed :code:`int`, returning the result in reduced form. + + Specified by: + :meth:`~org.hipparchus.FieldElement.multiply` in interface :class:`~org.hipparchus.FieldElement` + + Parameters: + i (int): the :code:`int` to multiply by. + + Returns: + a :class:`~org.hipparchus.fraction.BigFraction` instance with the resulting values. + + + Multiply the value of this fraction by the passed :code:`long`, returning the result in reduced form. + + Parameters: + l (long): the :code:`long` to multiply by. + + Returns: + a :class:`~org.hipparchus.fraction.BigFraction` instance with the resulting values. + + + Multiplies the value of this fraction by another, returning the result in reduced form. + + Specified by: + :meth:`~org.hipparchus.FieldElement.multiply` in interface :class:`~org.hipparchus.FieldElement` + + Parameters: + fraction (:class:`~org.hipparchus.fraction.BigFraction`): Fraction to multiply by, must not be :code:`null`. + + Returns: + a :class:`~org.hipparchus.fraction.BigFraction` instance with the resulting values. + + Raises: + :class:`~org.hipparchus.exception.NullArgumentException`: if :code:`fraction` is :code:`null`. + + + """ + ... @typing.overload def multiply(self, bigInteger: java.math.BigInteger) -> 'BigFraction': ... @typing.overload def multiply(self, long: int) -> 'BigFraction': ... @typing.overload def multiply(self, bigFraction: 'BigFraction') -> 'BigFraction': ... - def negate(self) -> 'BigFraction': ... - def percentageValue(self) -> float: ... - @typing.overload - def pow(self, double: float) -> float: ... + def negate(self) -> 'BigFraction': + """ + + Return the additive inverse of this fraction, returning the result in reduced form. + + Specified by: + :meth:`~org.hipparchus.FieldElement.negate` in interface :class:`~org.hipparchus.FieldElement` + + Returns: + the negation of this fraction. + + + """ + ... + def percentageValue(self) -> float: + """ + + Gets the fraction percentage as a :code:`double`. This calculates the fraction as the numerator divided by denominator + multiplied by 100. + + Returns: + the fraction percentage as a :code:`double`. + + + """ + ... + @typing.overload + def pow(self, double: float) -> float: + """ + + Returns a :code:`BigFraction` whose value is :code:`(this<sup>exponent</sup>)`, returning the result in reduced form. + + Parameters: + exponent (int): exponent to which this :code:`BigFraction` is to be raised. + + Returns: + this :sup:`exponent` + + + Returns a :code:`BigFraction` whose value is this :sup:`exponent` , returning the result in reduced form. + + Parameters: + exponent (long): exponent to which this :code:`BigFraction` is to be raised. + + Returns: + this :sup:`exponent` as a :code:`BigFraction`. + + + Returns a :code:`BigFraction` whose value is this :sup:`exponent` , returning the result in reduced form. + + Parameters: + exponent (:class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.math.BigInteger`): exponent to which this :code:`BigFraction` is to be raised. + + Returns: + this :sup:`exponent` as a :code:`BigFraction`. + + + Returns a :code:`double` whose value is this :sup:`exponent` , returning the result in reduced form. + + Parameters: + exponent (double): exponent to which this :code:`BigFraction` is to be raised. + + Returns: + this :sup:`exponent` + + + """ + ... @typing.overload def pow(self, int: int) -> 'BigFraction': ... @typing.overload def pow(self, bigInteger: java.math.BigInteger) -> 'BigFraction': ... @typing.overload def pow(self, long: int) -> 'BigFraction': ... - def reciprocal(self) -> 'BigFraction': ... - def reduce(self) -> 'BigFraction': ... - def signum(self) -> int: ... - @typing.overload - def subtract(self, int: int) -> 'BigFraction': ... + def reciprocal(self) -> 'BigFraction': + """ + + Return the multiplicative inverse of this fraction. + + Specified by: + :meth:`~org.hipparchus.FieldElement.reciprocal` in interface :class:`~org.hipparchus.FieldElement` + + Returns: + the reciprocal fraction. + + + """ + ... + def reduce(self) -> 'BigFraction': + """ + + Reduce this :code:`BigFraction` to its lowest terms. + + Returns: + the reduced :code:`BigFraction`. It doesn't change anything if the fraction can be reduced. + + + """ + ... + def signum(self) -> int: + """ + Returns the signum function of this :class:`~org.hipparchus.fraction.BigFraction`. + + The return value is -1 if the specified value is negative; 0 if the specified value is zero; and 1 if the specified + value is positive. + + Returns: + the signum function of this :class:`~org.hipparchus.fraction.BigFraction` + + Since: + 1.7 + + + """ + ... + @typing.overload + def subtract(self, int: int) -> 'BigFraction': + """ + + Subtracts the value of an + :class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.math.BigInteger` from the value of this + :code:`BigFraction`, returning the result in reduced form. + + Parameters: + bg (:class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.math.BigInteger`): the :class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.math.BigInteger` to subtract, cannot + be :code:`null`. + + Returns: + a :code:`BigFraction` instance with the resulting values. + + Raises: + :class:`~org.hipparchus.exception.NullArgumentException`: if the :class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.math.BigInteger` is :code:`null`. + + + Subtracts the value of an :code:`integer` from the value of this :code:`BigFraction`, returning the result in reduced + form. + + Parameters: + i (int): the :code:`integer` to subtract. + + Returns: + a :code:`BigFraction` instance with the resulting values. + + + Subtracts the value of a :code:`long` from the value of this :code:`BigFraction`, returning the result in reduced form. + + Parameters: + l (long): the :code:`long` to subtract. + + Returns: + a :code:`BigFraction` instance with the resulting values. + + + Subtracts the value of another fraction from the value of this one, returning the result in reduced form. + + Specified by: + :meth:`~org.hipparchus.FieldElement.subtract` in interface :class:`~org.hipparchus.FieldElement` + + Parameters: + fraction (:class:`~org.hipparchus.fraction.BigFraction`): :class:`~org.hipparchus.fraction.BigFraction` to subtract, must not be :code:`null`. + + Returns: + a :class:`~org.hipparchus.fraction.BigFraction` instance with the resulting values + + Raises: + :class:`~org.hipparchus.exception.NullArgumentException`: if the :code:`fraction` is :code:`null`. + + + """ + ... @typing.overload def subtract(self, bigInteger: java.math.BigInteger) -> 'BigFraction': ... @typing.overload def subtract(self, long: int) -> 'BigFraction': ... @typing.overload def subtract(self, bigFraction: 'BigFraction') -> 'BigFraction': ... - def toString(self) -> str: ... + def toString(self) -> str: + """ + + Returns the :code:`String` representing this fraction, ie "num / dem" or just "num" if the denominator is one. + + Overrides: + :meth:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.toString` in + class :class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Returns: + a string representation of the fraction. + + Also see: + + - :meth:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.toString` + + + + """ + ... class ConvergenceTest: def test(self, long: int, long2: int) -> bool: ... class BigFractionField(org.hipparchus.Field[BigFraction], java.io.Serializable): - def equals(self, object: typing.Any) -> bool: ... + """ + public classBigFractionField extends :class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.Field`<:class:`~org.hipparchus.fraction.BigFraction`>, :class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + Representation of the fractional numbers without any overflow field. + + This class is a singleton. + + Also see: + + - :class:`~org.hipparchus.fraction.Fraction` + - :meth:`~serialized` + """ + def equals(self, object: typing.Any) -> bool: + """ + + Overrides: + :meth:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.equals` in + class :class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + + """ + ... @staticmethod - def getInstance() -> 'BigFractionField': ... - def getOne(self) -> BigFraction: ... + def getInstance() -> 'BigFractionField': + """ + Get the unique instance. + + Returns: + the unique instance + + + """ + ... + def getOne(self) -> BigFraction: + """ + Get the multiplicative identity of the field. + + The multiplicative identity is the element e :sub:`1` of the field such that for all elements a of the field, the + equalities a × e :sub:`1` = e :sub:`1` × a = a hold. + + Specified by: + :meth:`~org.hipparchus.Field.getOne` in interface :class:`~org.hipparchus.Field` + + Returns: + multiplicative identity of the field + + + """ + ... def getRuntimeClass(self) -> typing.Type[BigFraction]: ... - def getZero(self) -> BigFraction: ... - def hashCode(self) -> int: ... + def getZero(self) -> BigFraction: + """ + Get the additive identity of the field. + + The additive identity is the element e :sub:`0` of the field such that for all elements a of the field, the equalities a + + e :sub:`0` = e :sub:`0` + a = a hold. + + Specified by: + :meth:`~org.hipparchus.Field.getZero` in interface :class:`~org.hipparchus.Field` + + Returns: + additive identity of the field + + + """ + ... + def hashCode(self) -> int: + """ + + Overrides: + :meth:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.hashCode` in + class :class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + + """ + ... class Fraction(java.lang.Number, org.hipparchus.FieldElement['Fraction'], java.lang.Comparable['Fraction'], java.io.Serializable): + """ + public classFraction extends :class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.Number` + implements :class:`~org.hipparchus.FieldElement`<:class:`~org.hipparchus.fraction.Fraction`>, :class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.Comparable`<:class:`~org.hipparchus.fraction.Fraction`>, :class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + Representation of a rational number. + + Also see: + + - :meth:`~serialized` + """ TWO: typing.ClassVar['Fraction'] = ... + """ + public static final :class:`~org.hipparchus.fraction.Fraction` TWO + + A fraction representing "2 / 1". + + """ ONE: typing.ClassVar['Fraction'] = ... + """ + public static final :class:`~org.hipparchus.fraction.Fraction` ONE + + A fraction representing "1". + + """ ZERO: typing.ClassVar['Fraction'] = ... + """ + public static final :class:`~org.hipparchus.fraction.Fraction` ZERO + + A fraction representing "0". + + """ FOUR_FIFTHS: typing.ClassVar['Fraction'] = ... + """ + public static final :class:`~org.hipparchus.fraction.Fraction` FOUR_FIFTHS + + A fraction representing "4/5". + + """ ONE_FIFTH: typing.ClassVar['Fraction'] = ... + """ + public static final :class:`~org.hipparchus.fraction.Fraction` ONE_FIFTH + + A fraction representing "1/5". + + """ ONE_HALF: typing.ClassVar['Fraction'] = ... + """ + public static final :class:`~org.hipparchus.fraction.Fraction` ONE_HALF + + A fraction representing "1/2". + + """ ONE_QUARTER: typing.ClassVar['Fraction'] = ... + """ + public static final :class:`~org.hipparchus.fraction.Fraction` ONE_QUARTER + + A fraction representing "1/4". + + """ ONE_THIRD: typing.ClassVar['Fraction'] = ... + """ + public static final :class:`~org.hipparchus.fraction.Fraction` ONE_THIRD + + A fraction representing "1/3". + + """ THREE_FIFTHS: typing.ClassVar['Fraction'] = ... + """ + public static final :class:`~org.hipparchus.fraction.Fraction` THREE_FIFTHS + + A fraction representing "3/5". + + """ THREE_QUARTERS: typing.ClassVar['Fraction'] = ... + """ + public static final :class:`~org.hipparchus.fraction.Fraction` THREE_QUARTERS + + A fraction representing "3/4". + + """ TWO_FIFTHS: typing.ClassVar['Fraction'] = ... + """ + public static final :class:`~org.hipparchus.fraction.Fraction` TWO_FIFTHS + + A fraction representing "2/5". + + """ TWO_QUARTERS: typing.ClassVar['Fraction'] = ... + """ + public static final :class:`~org.hipparchus.fraction.Fraction` TWO_QUARTERS + + A fraction representing "2/4". + + """ TWO_THIRDS: typing.ClassVar['Fraction'] = ... + """ + public static final :class:`~org.hipparchus.fraction.Fraction` TWO_THIRDS + + A fraction representing "2/3". + + """ MINUS_ONE: typing.ClassVar['Fraction'] = ... + """ + public static final :class:`~org.hipparchus.fraction.Fraction` MINUS_ONE + + A fraction representing "-1 / 1". + + """ @typing.overload def __init__(self, double: float): ... @typing.overload @@ -165,61 +1100,529 @@ class Fraction(java.lang.Number, org.hipparchus.FieldElement['Fraction'], java.l def __init__(self, int: int): ... @typing.overload def __init__(self, int: int, int2: int): ... - def abs(self) -> 'Fraction': ... - @typing.overload - def add(self, int: int) -> 'Fraction': ... + def abs(self) -> 'Fraction': + """ + Returns the absolute value of this fraction. + + Returns: + the absolute value. + + + """ + ... + @typing.overload + def add(self, int: int) -> 'Fraction': + """ + Adds the value of this fraction to another, returning the result in reduced form. The algorithm follows Knuth, 4.5.1. + + Specified by: + :meth:`~org.hipparchus.FieldElement.add` in interface :class:`~org.hipparchus.FieldElement` + + Parameters: + fraction (:class:`~org.hipparchus.fraction.Fraction`): the fraction to add, must not be :code:`null` + + Returns: + a :code:`Fraction` instance with the resulting values + + Raises: + :class:`~org.hipparchus.exception.NullArgumentException`: if the fraction is :code:`null` + :class:`~org.hipparchus.exception.MathRuntimeException`: if the resulting numerator or denominator exceeds :code:`Integer.MAX_VALUE` + + Add an integer to the fraction. + + Parameters: + i (int): the :code:`integer` to add. + + Returns: + this + i + + + """ + ... @typing.overload def add(self, fraction: 'Fraction') -> 'Fraction': ... - def compareTo(self, fraction: 'Fraction') -> int: ... + def compareTo(self, fraction: 'Fraction') -> int: + """ + Compares this object to another based on size. + + Specified by: + :meth:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.Comparable.compareTo` in + interface :class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.Comparable` + + Parameters: + object (:class:`~org.hipparchus.fraction.Fraction`): the object to compare to + + Returns: + -1 if this is less than :code:`object`, +1 if this is greater than :code:`object`, 0 if they are equal. + + + """ + ... @staticmethod def convergent(double: float, int: int, convergenceTest: typing.Union['Fraction.ConvergenceTest', typing.Callable]) -> org.hipparchus.util.Pair['Fraction', bool]: ... @staticmethod def convergents(double: float, int: int) -> java.util.stream.Stream['Fraction']: ... @typing.overload - def divide(self, int: int) -> 'Fraction': ... + def divide(self, int: int) -> 'Fraction': + """ + Divide the value of this fraction by another. + + Specified by: + :meth:`~org.hipparchus.FieldElement.divide` in interface :class:`~org.hipparchus.FieldElement` + + Parameters: + fraction (:class:`~org.hipparchus.fraction.Fraction`): the fraction to divide by, must not be :code:`null` + + Returns: + a :code:`Fraction` instance with the resulting values + + Raises: + :class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.IllegalArgumentException`: if the fraction is :code:`null` + :class:`~org.hipparchus.exception.MathRuntimeException`: if the fraction to divide by is zero + :class:`~org.hipparchus.exception.MathRuntimeException`: if the resulting numerator or denominator exceeds :code:`Integer.MAX_VALUE` + + Divide the fraction by an integer. + + Parameters: + i (int): the :code:`integer` to divide by. + + Returns: + this * i + + + """ + ... @typing.overload def divide(self, fraction: 'Fraction') -> 'Fraction': ... - def doubleValue(self) -> float: ... - def equals(self, object: typing.Any) -> bool: ... - def floatValue(self) -> float: ... - def gcd(self, fraction: 'Fraction') -> 'Fraction': ... - def getDenominator(self) -> int: ... - def getField(self) -> 'FractionField': ... - def getNumerator(self) -> int: ... - def getReal(self) -> float: ... + def doubleValue(self) -> float: + """ + Gets the fraction as a :code:`double`. This calculates the fraction as the numerator divided by denominator. + + Specified by: + :meth:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.Number.doubleValue` in + class :class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.Number` + + Returns: + the fraction as a :code:`double` + + + """ + ... + def equals(self, object: typing.Any) -> bool: + """ + Test for the equality of two fractions. If the lowest term numerator and denominators are the same for both fractions, + the two fractions are considered to be equal. + + Overrides: + :meth:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.equals` in + class :class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Parameters: + other (:class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object`): fraction to test for equality to this fraction + + Returns: + true if two fractions are equal, false if object is :code:`null`, not an instance of + :class:`~org.hipparchus.fraction.Fraction`, or not equal to this fraction instance. + + + """ + ... + def floatValue(self) -> float: + """ + Gets the fraction as a :code:`float`. This calculates the fraction as the numerator divided by denominator. + + Specified by: + :meth:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.Number.floatValue` in + class :class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.Number` + + Returns: + the fraction as a :code:`float` + + + """ + ... + def gcd(self, fraction: 'Fraction') -> 'Fraction': + """ + Rational number greatest common divisor. + + Parameters: + s (:class:`~org.hipparchus.fraction.Fraction`): fraction. + + Returns: + gcd(this, s). + + Since: + 3.1 + + + """ + ... + def getDenominator(self) -> int: + """ + Access the denominator. + + Returns: + the denominator. + + + """ + ... + def getField(self) -> 'FractionField': + """ + Get the :class:`~org.hipparchus.Field` to which the instance belongs. + + Specified by: + :meth:`~org.hipparchus.FieldElement.getField` in interface :class:`~org.hipparchus.FieldElement` + + Returns: + :class:`~org.hipparchus.Field` to which the instance belongs + + + """ + ... + def getNumerator(self) -> int: + """ + Access the numerator. + + Returns: + the numerator. + + + """ + ... + def getReal(self) -> float: + """ + Get the real value of the number. + + Specified by: + :meth:`~org.hipparchus.FieldElement.getReal` in interface :class:`~org.hipparchus.FieldElement` + + Returns: + real value + + + """ + ... @staticmethod - def getReducedFraction(int: int, int2: int) -> 'Fraction': ... - def hashCode(self) -> int: ... - def intValue(self) -> int: ... - def isInteger(self) -> bool: ... - def lcm(self, fraction: 'Fraction') -> 'Fraction': ... - def longValue(self) -> int: ... - @typing.overload - def multiply(self, int: int) -> 'Fraction': ... + def getReducedFraction(int: int, int2: int) -> 'Fraction': + """ + Creates a :code:`Fraction` instance with the 2 parts of a fraction Y/Z. + + Any negative signs are resolved to be on the numerator. + + Parameters: + numerator (int): the numerator, for example the three in 'three sevenths' + denominator (int): the denominator, for example the seven in 'three sevenths' + + Returns: + a new fraction instance, with the numerator and denominator reduced + + Raises: + :class:`~org.hipparchus.exception.MathRuntimeException`: if the denominator is :code:`zero` + + + """ + ... + def hashCode(self) -> int: + """ + Gets a hashCode for the fraction. + + Overrides: + :meth:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.hashCode` in + class :class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Returns: + a hash code value for this object + + + """ + ... + def intValue(self) -> int: + """ + Gets the fraction as an :code:`int`. This returns the whole number part of the fraction. + + Specified by: + :meth:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.Number.intValue` in + class :class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.Number` + + Returns: + the whole number fraction part + + + """ + ... + def isInteger(self) -> bool: + """ + Check if a fraction is an integer. + + Returns: + true of fraction is an integer + + + """ + ... + def lcm(self, fraction: 'Fraction') -> 'Fraction': + """ + Rational number least common multiple. + + Parameters: + s (:class:`~org.hipparchus.fraction.Fraction`): fraction. + + Returns: + lcm(this, s). + + Since: + 3.1 + + + """ + ... + def longValue(self) -> int: + """ + Gets the fraction as a :code:`long`. This returns the whole number part of the fraction. + + Specified by: + :meth:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.Number.longValue` in + class :class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.Number` + + Returns: + the whole number fraction part + + + """ + ... + @typing.overload + def multiply(self, int: int) -> 'Fraction': + """ + Multiplies the value of this fraction by another, returning the result in reduced form. + + Specified by: + :meth:`~org.hipparchus.FieldElement.multiply` in interface :class:`~org.hipparchus.FieldElement` + + Parameters: + fraction (:class:`~org.hipparchus.fraction.Fraction`): the fraction to multiply by, must not be :code:`null` + + Returns: + a :code:`Fraction` instance with the resulting values + + Raises: + :class:`~org.hipparchus.exception.NullArgumentException`: if the fraction is :code:`null` + :class:`~org.hipparchus.exception.MathRuntimeException`: if the resulting numerator or denominator exceeds :code:`Integer.MAX_VALUE` + + Multiply the fraction by an integer. + + Specified by: + :meth:`~org.hipparchus.FieldElement.multiply` in interface :class:`~org.hipparchus.FieldElement` + + Parameters: + i (int): the :code:`integer` to multiply by. + + Returns: + this * i + + + """ + ... @typing.overload def multiply(self, fraction: 'Fraction') -> 'Fraction': ... - def negate(self) -> 'Fraction': ... - def percentageValue(self) -> float: ... - def reciprocal(self) -> 'Fraction': ... - def signum(self) -> int: ... - @typing.overload - def subtract(self, int: int) -> 'Fraction': ... + def negate(self) -> 'Fraction': + """ + Return the additive inverse of this fraction. + + Specified by: + :meth:`~org.hipparchus.FieldElement.negate` in interface :class:`~org.hipparchus.FieldElement` + + Returns: + the negation of this fraction. + + + """ + ... + def percentageValue(self) -> float: + """ + Gets the fraction percentage as a :code:`double`. This calculates the fraction as the numerator divided by denominator + multiplied by 100. + + Returns: + the fraction percentage as a :code:`double`. + + + """ + ... + def reciprocal(self) -> 'Fraction': + """ + Return the multiplicative inverse of this fraction. + + Specified by: + :meth:`~org.hipparchus.FieldElement.reciprocal` in interface :class:`~org.hipparchus.FieldElement` + + Returns: + the reciprocal fraction + + + """ + ... + def signum(self) -> int: + """ + Returns the signum function of this fraction. + + The return value is -1 if the specified value is negative; 0 if the specified value is zero; and 1 if the specified + value is positive. + + Returns: + the signum function of this fraction + + Since: + 1.7 + + + """ + ... + @typing.overload + def subtract(self, int: int) -> 'Fraction': + """ + Subtracts the value of another fraction from the value of this one, returning the result in reduced form. + + Specified by: + :meth:`~org.hipparchus.FieldElement.subtract` in interface :class:`~org.hipparchus.FieldElement` + + Parameters: + fraction (:class:`~org.hipparchus.fraction.Fraction`): the fraction to subtract, must not be :code:`null` + + Returns: + a :code:`Fraction` instance with the resulting values + + Raises: + :class:`~org.hipparchus.exception.NullArgumentException`: if the fraction is :code:`null` + :class:`~org.hipparchus.exception.MathRuntimeException`: if the resulting numerator or denominator cannot be represented in an :code:`int`. + + Subtract an integer from the fraction. + + Parameters: + i (int): the :code:`integer` to subtract. + + Returns: + this - i + + + """ + ... @typing.overload def subtract(self, fraction: 'Fraction') -> 'Fraction': ... - def toString(self) -> str: ... + def toString(self) -> str: + """ + Returns the :code:`String` representing this fraction, ie "num / dem" or just "num" if the denominator is one. + + Overrides: + :meth:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.toString` in + class :class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Returns: + a string representation of the fraction. + + Also see: + + - :meth:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.toString` + + + + """ + ... class ConvergenceTest: def test(self, int: int, int2: int) -> bool: ... class FractionField(org.hipparchus.Field[Fraction], java.io.Serializable): - def equals(self, object: typing.Any) -> bool: ... + """ + public classFractionField extends :class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.Field`<:class:`~org.hipparchus.fraction.Fraction`>, :class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + Representation of the fractional numbers field. + + This class is a singleton. + + Also see: + + - :class:`~org.hipparchus.fraction.Fraction` + - :meth:`~serialized` + """ + def equals(self, object: typing.Any) -> bool: + """ + + Overrides: + :meth:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.equals` in + class :class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + + """ + ... @staticmethod - def getInstance() -> 'FractionField': ... - def getOne(self) -> Fraction: ... + def getInstance() -> 'FractionField': + """ + Get the unique instance. + + Returns: + the unique instance + + + """ + ... + def getOne(self) -> Fraction: + """ + Get the multiplicative identity of the field. + + The multiplicative identity is the element e :sub:`1` of the field such that for all elements a of the field, the + equalities a × e :sub:`1` = e :sub:`1` × a = a hold. + + Specified by: + :meth:`~org.hipparchus.Field.getOne` in interface :class:`~org.hipparchus.Field` + + Returns: + multiplicative identity of the field + + + """ + ... def getRuntimeClass(self) -> typing.Type[Fraction]: ... - def getZero(self) -> Fraction: ... - def hashCode(self) -> int: ... + def getZero(self) -> Fraction: + """ + Get the additive identity of the field. + + The additive identity is the element e :sub:`0` of the field such that for all elements a of the field, the equalities a + + e :sub:`0` = e :sub:`0` + a = a hold. + + Specified by: + :meth:`~org.hipparchus.Field.getZero` in interface :class:`~org.hipparchus.Field` + + Returns: + additive identity of the field + + + """ + ... + def hashCode(self) -> int: + """ + + Overrides: + :meth:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.hashCode` in + class :class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + + """ + ... class BigFractionFormat(org.hipparchus.fraction.AbstractFormat, java.io.Serializable): + """ + public classBigFractionFormat extends :class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.text.NumberFormat` + implements :class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + Formats a BigFraction number in proper format or improper format. + + The number format for each of the whole number, numerator and, denominator can be configured. + + Also see: + + - :meth:`~serialized` + """ @typing.overload def __init__(self): ... @typing.overload @@ -227,7 +1630,88 @@ class BigFractionFormat(org.hipparchus.fraction.AbstractFormat, java.io.Serializ @typing.overload def __init__(self, numberFormat: java.text.NumberFormat, numberFormat2: java.text.NumberFormat): ... @typing.overload - def format(self, object: typing.Any) -> str: ... + def format(self, object: typing.Any) -> str: + """ + Formats a :class:`~org.hipparchus.fraction.BigFraction` object to produce a string. The BigFraction is output in + improper format. + + Parameters: + BigFraction (:class:`~org.hipparchus.fraction.BigFraction`): the object to format. + toAppendTo (:class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.StringBuffer`): where the text is to be appended + pos (:class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.text.FieldPosition`): On input: an alignment field, if desired. On output: the offsets of the alignment field + + Returns: + the value passed in as toAppendTo. + + Formats an object and appends the result to a StringBuffer. :code:`obj` must be either a + :class:`~org.hipparchus.fraction.BigFraction` object or a + :class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.math.BigInteger` object or a + :class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.Number` object. Any other type of + object will result in an + :class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.IllegalArgumentException` being + thrown. + + Overrides: + :meth:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.text.NumberFormat.format` in + class :class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.text.NumberFormat` + + Parameters: + obj (:class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object`): the object to format. + toAppendTo (:class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.StringBuffer`): where the text is to be appended + pos (:class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.text.FieldPosition`): On input: an alignment field, if desired. On output: the offsets of the alignment field + + Returns: + the value passed in as toAppendTo. + + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if :code:`obj` is not a valid type. + + Also see: + + - :meth:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.text.Format.format` + + + Formats a double value as a fraction and appends the result to a StringBuffer. + + Specified by: + :meth:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.text.NumberFormat.format` in + class :class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.text.NumberFormat` + + Parameters: + value (double): the double value to format + buffer (:class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.StringBuffer`): StringBuffer to append to + position (:class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.text.FieldPosition`): On input: an alignment field, if desired. On output: the offsets of the alignment field + + Returns: + a reference to the appended buffer + + Also see: + + - :meth:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.text.NumberFormat.format` + + + Formats a long value as a fraction and appends the result to a StringBuffer. + + Specified by: + :meth:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.text.NumberFormat.format` in + class :class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.text.NumberFormat` + + Parameters: + value (long): the long value to format + buffer (:class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.StringBuffer`): StringBuffer to append to + position (:class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.text.FieldPosition`): On input: an alignment field, if desired. On output: the offsets of the alignment field + + Returns: + a reference to the appended buffer + + Also see: + + - :meth:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.text.NumberFormat.format` + + + + """ + ... @typing.overload def format(self, double: float) -> str: ... @typing.overload @@ -237,27 +1721,118 @@ class BigFractionFormat(org.hipparchus.fraction.AbstractFormat, java.io.Serializ @typing.overload def format(self, bigFraction: BigFraction, stringBuffer: java.lang.StringBuffer, fieldPosition: java.text.FieldPosition) -> java.lang.StringBuffer: ... @staticmethod - def formatBigFraction(bigFraction: BigFraction) -> str: ... + def formatBigFraction(bigFraction: BigFraction) -> str: + """ + This static method calls formatBigFraction() on a default instance of BigFractionFormat. + + Parameters: + f (:class:`~org.hipparchus.fraction.BigFraction`): BigFraction object to format + + Returns: + A formatted BigFraction in proper form. + + + """ + ... @staticmethod - def getAvailableLocales() -> typing.MutableSequence[java.util.Locale]: ... + def getAvailableLocales() -> typing.MutableSequence[java.util.Locale]: + """ + Get the set of locales for which complex formats are available. This is the same set as the + :class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.text.NumberFormat` set. + + Returns: + available complex format locales. + + + """ + ... @typing.overload @staticmethod - def getImproperInstance() -> 'BigFractionFormat': ... + def getImproperInstance() -> 'BigFractionFormat': + """ + Returns the default complex format for the current locale. + + Returns: + the default complex format. + + """ + ... @typing.overload @staticmethod - def getImproperInstance(locale: java.util.Locale) -> 'BigFractionFormat': ... + def getImproperInstance(locale: java.util.Locale) -> 'BigFractionFormat': + """ + Returns the default complex format for the given locale. + + Parameters: + locale (:class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.util.Locale`): the specific locale used by the format. + + Returns: + the complex format specific to the given locale. + + + """ + ... @typing.overload @staticmethod - def getProperInstance() -> 'BigFractionFormat': ... + def getProperInstance() -> 'BigFractionFormat': + """ + Returns the default complex format for the current locale. + + Returns: + the default complex format. + + """ + ... @typing.overload @staticmethod - def getProperInstance(locale: java.util.Locale) -> 'BigFractionFormat': ... - @typing.overload - def parse(self, string: str) -> BigFraction: ... + def getProperInstance(locale: java.util.Locale) -> 'BigFractionFormat': + """ + Returns the default complex format for the given locale. + + Parameters: + locale (:class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.util.Locale`): the specific locale used by the format. + + Returns: + the complex format specific to the given locale. + + + """ + ... + @typing.overload + def parse(self, string: str) -> BigFraction: + """ + Parses a string to produce a :class:`~org.hipparchus.fraction.BigFraction` object. This method expects the string to be + formatted as an improper BigFraction. + + Specified by: + :meth:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.text.NumberFormat.parse` in + class :class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.text.NumberFormat` + + Parameters: + source (:class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.String`): the string to parse + pos (:class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.text.ParsePosition`): input/output parsing parameter. + + Returns: + the parsed :class:`~org.hipparchus.fraction.BigFraction` object. + + + """ + ... @typing.overload def parse(self, string: str, parsePosition: java.text.ParsePosition) -> BigFraction: ... class FractionFormat(org.hipparchus.fraction.AbstractFormat): + """ + public classFractionFormat extends :class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.text.NumberFormat` + + Formats a Fraction number in proper format or improper format. + + The number format for each of the whole number, numerator and, denominator can be configured. + + Also see: + + - :meth:`~serialized` + """ @typing.overload def __init__(self): ... @typing.overload @@ -265,7 +1840,90 @@ class FractionFormat(org.hipparchus.fraction.AbstractFormat): @typing.overload def __init__(self, numberFormat: java.text.NumberFormat, numberFormat2: java.text.NumberFormat): ... @typing.overload - def format(self, object: typing.Any) -> str: ... + def format(self, object: typing.Any) -> str: + """ + Formats a :class:`~org.hipparchus.fraction.Fraction` object to produce a string. The fraction is output in improper + format. + + Parameters: + fraction (:class:`~org.hipparchus.fraction.Fraction`): the object to format. + toAppendTo (:class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.StringBuffer`): where the text is to be appended + pos (:class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.text.FieldPosition`): On input: an alignment field, if desired. On output: the offsets of the alignment field + + Returns: + the value passed in as toAppendTo. + + public :class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.StringBuffer` format(:class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` obj, :class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.StringBuffer` toAppendTo, :class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.text.FieldPosition` pos) throws :class:`~org.hipparchus.exception.MathIllegalArgumentException`, :class:`~org.hipparchus.exception.MathIllegalStateException` + + Formats an object and appends the result to a StringBuffer. :code:`obj` must be either a + :class:`~org.hipparchus.fraction.Fraction` object or a + :class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.Number` object. Any other type of + object will result in an + :class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.IllegalArgumentException` being + thrown. + + Overrides: + :meth:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.text.NumberFormat.format` in + class :class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.text.NumberFormat` + + Parameters: + obj (:class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object`): the object to format. + toAppendTo (:class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.StringBuffer`): where the text is to be appended + pos (:class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.text.FieldPosition`): On input: an alignment field, if desired. On output: the offsets of the alignment field + + Returns: + the value passed in as toAppendTo. + + Raises: + :class:`~org.hipparchus.exception.MathIllegalStateException`: if the number cannot be converted to a fraction + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if :code:`obj` is not a valid type. + + Also see: + + - :meth:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.text.Format.format` + + + Formats a double value as a fraction and appends the result to a StringBuffer. + + Specified by: + :meth:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.text.NumberFormat.format` in + class :class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.text.NumberFormat` + + Parameters: + value (double): the double value to format + buffer (:class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.StringBuffer`): StringBuffer to append to + position (:class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.text.FieldPosition`): On input: an alignment field, if desired. On output: the offsets of the alignment field + + Returns: + a reference to the appended buffer + + Also see: + + - :meth:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.text.NumberFormat.format` + + + Formats a long value as a fraction and appends the result to a StringBuffer. + + Specified by: + :meth:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.text.NumberFormat.format` in + class :class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.text.NumberFormat` + + Parameters: + value (long): the long value to format + buffer (:class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.StringBuffer`): StringBuffer to append to + position (:class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.text.FieldPosition`): On input: an alignment field, if desired. On output: the offsets of the alignment field + + Returns: + a reference to the appended buffer + + Also see: + + - :meth:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.text.NumberFormat.format` + + + + """ + ... @typing.overload def format(self, double: float) -> str: ... @typing.overload @@ -275,27 +1933,120 @@ class FractionFormat(org.hipparchus.fraction.AbstractFormat): @typing.overload def format(self, fraction: Fraction, stringBuffer: java.lang.StringBuffer, fieldPosition: java.text.FieldPosition) -> java.lang.StringBuffer: ... @staticmethod - def formatFraction(fraction: Fraction) -> str: ... + def formatFraction(fraction: Fraction) -> str: + """ + This static method calls formatFraction() on a default instance of FractionFormat. + + Parameters: + f (:class:`~org.hipparchus.fraction.Fraction`): Fraction object to format + + Returns: + a formatted fraction in proper form. + + + """ + ... @staticmethod - def getAvailableLocales() -> typing.MutableSequence[java.util.Locale]: ... + def getAvailableLocales() -> typing.MutableSequence[java.util.Locale]: + """ + Get the set of locales for which complex formats are available. This is the same set as the + :class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.text.NumberFormat` set. + + Returns: + available complex format locales. + + + """ + ... @typing.overload @staticmethod - def getImproperInstance() -> 'FractionFormat': ... + def getImproperInstance() -> 'FractionFormat': + """ + Returns the default complex format for the current locale. + + Returns: + the default complex format. + + """ + ... @typing.overload @staticmethod - def getImproperInstance(locale: java.util.Locale) -> 'FractionFormat': ... + def getImproperInstance(locale: java.util.Locale) -> 'FractionFormat': + """ + Returns the default complex format for the given locale. + + Parameters: + locale (:class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.util.Locale`): the specific locale used by the format. + + Returns: + the complex format specific to the given locale. + + + """ + ... @typing.overload @staticmethod - def getProperInstance() -> 'FractionFormat': ... + def getProperInstance() -> 'FractionFormat': + """ + Returns the default complex format for the current locale. + + Returns: + the default complex format. + + """ + ... @typing.overload @staticmethod - def getProperInstance(locale: java.util.Locale) -> 'FractionFormat': ... - @typing.overload - def parse(self, string: str) -> Fraction: ... + def getProperInstance(locale: java.util.Locale) -> 'FractionFormat': + """ + Returns the default complex format for the given locale. + + Parameters: + locale (:class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.util.Locale`): the specific locale used by the format. + + Returns: + the complex format specific to the given locale. + + + """ + ... + @typing.overload + def parse(self, string: str) -> Fraction: + """ + Parses a string to produce a :class:`~org.hipparchus.fraction.Fraction` object. This method expects the string to be + formatted as an improper fraction. + + Specified by: + :meth:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.text.NumberFormat.parse` in + class :class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.text.NumberFormat` + + Parameters: + source (:class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.String`): the string to parse + pos (:class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.text.ParsePosition`): input/output parsing parameter. + + Returns: + the parsed :class:`~org.hipparchus.fraction.Fraction` object. + + + """ + ... @typing.overload def parse(self, string: str, parsePosition: java.text.ParsePosition) -> Fraction: ... class ProperBigFractionFormat(BigFractionFormat): + """ + public classProperBigFractionFormat extends :class:`~org.hipparchus.fraction.BigFractionFormat` + + Formats a BigFraction number in proper format. The number format for each of the whole number, numerator and, + denominator can be configured. + + Minus signs are only allowed in the whole number part - i.e., "-3 1/2" is legitimate and denotes -7/2, but "-3 -1/2" is + invalid and will result in a :code:`ParseException`. + + Also see: + + - :meth:`~serialized` + """ @typing.overload def __init__(self): ... @typing.overload @@ -303,7 +2054,63 @@ class ProperBigFractionFormat(BigFractionFormat): @typing.overload def __init__(self, numberFormat: java.text.NumberFormat, numberFormat2: java.text.NumberFormat, numberFormat3: java.text.NumberFormat): ... @typing.overload - def format(self, object: typing.Any) -> str: ... + def format(self, object: typing.Any) -> str: + """ + Formats a :class:`~org.hipparchus.fraction.BigFraction` object to produce a string. The BigFraction is output in proper + format. + + Overrides: + :meth:`~org.hipparchus.fraction.BigFractionFormat.format` in class :class:`~org.hipparchus.fraction.BigFractionFormat` + + Parameters: + fraction (:class:`~org.hipparchus.fraction.BigFraction`): the object to format. + toAppendTo (:class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.StringBuffer`): where the text is to be appended + pos (:class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.text.FieldPosition`): On input: an alignment field, if desired. On output: the offsets of the alignment field + + Returns: + the value passed in as toAppendTo. + + Formats a double value as a fraction and appends the result to a StringBuffer. + + Specified by: + :meth:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.text.NumberFormat.format` in + class :class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.text.NumberFormat` + + Parameters: + value (double): the double value to format + buffer (:class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.StringBuffer`): StringBuffer to append to + position (:class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.text.FieldPosition`): On input: an alignment field, if desired. On output: the offsets of the alignment field + + Returns: + a reference to the appended buffer + + Also see: + + - :meth:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.text.NumberFormat.format` + + + Formats a long value as a fraction and appends the result to a StringBuffer. + + Specified by: + :meth:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.text.NumberFormat.format` in + class :class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.text.NumberFormat` + + Parameters: + value (long): the long value to format + buffer (:class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.StringBuffer`): StringBuffer to append to + position (:class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.text.FieldPosition`): On input: an alignment field, if desired. On output: the offsets of the alignment field + + Returns: + a reference to the appended buffer + + Also see: + + - :meth:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.text.NumberFormat.format` + + + + """ + ... @typing.overload def format(self, double: float) -> str: ... @typing.overload @@ -312,13 +2119,55 @@ class ProperBigFractionFormat(BigFractionFormat): def format(self, object: typing.Any, stringBuffer: java.lang.StringBuffer, fieldPosition: java.text.FieldPosition) -> java.lang.StringBuffer: ... @typing.overload def format(self, bigFraction: BigFraction, stringBuffer: java.lang.StringBuffer, fieldPosition: java.text.FieldPosition) -> java.lang.StringBuffer: ... - def getWholeFormat(self) -> java.text.NumberFormat: ... - @typing.overload - def parse(self, string: str) -> BigFraction: ... + def getWholeFormat(self) -> java.text.NumberFormat: + """ + Access the whole format. + + Returns: + the whole format. + + + """ + ... + @typing.overload + def parse(self, string: str) -> BigFraction: + """ + Parses a string to produce a :class:`~org.hipparchus.fraction.BigFraction` object. This method expects the string to be + formatted as a proper BigFraction. + + Minus signs are only allowed in the whole number part - i.e., "-3 1/2" is legitimate and denotes -7/2, but "-3 -1/2" is + invalid and will result in a :code:`ParseException`. + + Overrides: + :meth:`~org.hipparchus.fraction.BigFractionFormat.parse` in class :class:`~org.hipparchus.fraction.BigFractionFormat` + + Parameters: + source (:class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.String`): the string to parse + pos (:class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.text.ParsePosition`): input/ouput parsing parameter. + + Returns: + the parsed :class:`~org.hipparchus.fraction.BigFraction` object. + + + """ + ... @typing.overload def parse(self, string: str, parsePosition: java.text.ParsePosition) -> BigFraction: ... class ProperFractionFormat(FractionFormat): + """ + public classProperFractionFormat extends :class:`~org.hipparchus.fraction.FractionFormat` + + Formats a Fraction number in proper format. The number format for each of the whole number, numerator and, denominator + can be configured. + + Minus signs are only allowed in the whole number part - i.e., "-3 1/2" is legitimate and denotes -7/2, but "-3 -1/2" is + invalid and will result in a :code:`ParseException`. + + Also see: + + - :meth:`~serialized` + """ @typing.overload def __init__(self): ... @typing.overload @@ -326,7 +2175,63 @@ class ProperFractionFormat(FractionFormat): @typing.overload def __init__(self, numberFormat: java.text.NumberFormat, numberFormat2: java.text.NumberFormat, numberFormat3: java.text.NumberFormat): ... @typing.overload - def format(self, object: typing.Any) -> str: ... + def format(self, object: typing.Any) -> str: + """ + Formats a :class:`~org.hipparchus.fraction.Fraction` object to produce a string. The fraction is output in proper + format. + + Overrides: + :meth:`~org.hipparchus.fraction.FractionFormat.format` in class :class:`~org.hipparchus.fraction.FractionFormat` + + Parameters: + fraction (:class:`~org.hipparchus.fraction.Fraction`): the object to format. + toAppendTo (:class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.StringBuffer`): where the text is to be appended + pos (:class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.text.FieldPosition`): On input: an alignment field, if desired. On output: the offsets of the alignment field + + Returns: + the value passed in as toAppendTo. + + Formats a double value as a fraction and appends the result to a StringBuffer. + + Specified by: + :meth:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.text.NumberFormat.format` in + class :class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.text.NumberFormat` + + Parameters: + value (double): the double value to format + buffer (:class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.StringBuffer`): StringBuffer to append to + position (:class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.text.FieldPosition`): On input: an alignment field, if desired. On output: the offsets of the alignment field + + Returns: + a reference to the appended buffer + + Also see: + + - :meth:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.text.NumberFormat.format` + + + Formats a long value as a fraction and appends the result to a StringBuffer. + + Specified by: + :meth:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.text.NumberFormat.format` in + class :class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.text.NumberFormat` + + Parameters: + value (long): the long value to format + buffer (:class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.StringBuffer`): StringBuffer to append to + position (:class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.text.FieldPosition`): On input: an alignment field, if desired. On output: the offsets of the alignment field + + Returns: + a reference to the appended buffer + + Also see: + + - :meth:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.text.NumberFormat.format` + + + + """ + ... @typing.overload def format(self, double: float) -> str: ... @typing.overload @@ -335,9 +2240,38 @@ class ProperFractionFormat(FractionFormat): def format(self, object: typing.Any, stringBuffer: java.lang.StringBuffer, fieldPosition: java.text.FieldPosition) -> java.lang.StringBuffer: ... @typing.overload def format(self, fraction: Fraction, stringBuffer: java.lang.StringBuffer, fieldPosition: java.text.FieldPosition) -> java.lang.StringBuffer: ... - def getWholeFormat(self) -> java.text.NumberFormat: ... - @typing.overload - def parse(self, string: str) -> Fraction: ... + def getWholeFormat(self) -> java.text.NumberFormat: + """ + Access the whole format. + + Returns: + the whole format. + + + """ + ... + @typing.overload + def parse(self, string: str) -> Fraction: + """ + Parses a string to produce a :class:`~org.hipparchus.fraction.Fraction` object. This method expects the string to be + formatted as a proper fraction. + + Minus signs are only allowed in the whole number part - i.e., "-3 1/2" is legitimate and denotes -7/2, but "-3 -1/2" is + invalid and will result in a :code:`ParseException`. + + Overrides: + :meth:`~org.hipparchus.fraction.FractionFormat.parse` in class :class:`~org.hipparchus.fraction.FractionFormat` + + Parameters: + source (:class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.lang.String`): the string to parse + pos (:class:`~org.hipparchus.fraction.https:.docs.oracle.com.javase.8.docs.api.java.text.ParsePosition`): input/ouput parsing parameter. + + Returns: + the parsed :class:`~org.hipparchus.fraction.Fraction` object. + + + """ + ... @typing.overload def parse(self, string: str, parsePosition: java.text.ParsePosition) -> Fraction: ... diff --git a/org-stubs/hipparchus/geometry/__init__.pyi b/org-stubs/hipparchus/geometry/__init__.pyi index 1e134e5..51c8138 100644 --- a/org-stubs/hipparchus/geometry/__init__.pyi +++ b/org-stubs/hipparchus/geometry/__init__.pyi @@ -21,6 +21,18 @@ import typing class LocalizedGeometryFormats(java.lang.Enum['LocalizedGeometryFormats'], org.hipparchus.exception.Localizable): + """ + public enumLocalizedGeometryFormats extends :class:`~org.hipparchus.geometry.https:.docs.oracle.com.javase.8.docs.api.java.lang.Enum`<:class:`~org.hipparchus.geometry.LocalizedGeometryFormats`> + implements :class:`~org.hipparchus.geometry.https:.www.hipparchus.org.hipparchus` + + Enumeration for localized messages formats used in exceptions messages. + + The constants in this enumeration represent the available formats as localized strings. These formats are intended to be + localized using simple properties files, using the constant name as the key and the property value as the message + format. The source English format is provided in the constants themselves to serve both as a reminder for developers to + understand the parameters needed by each format, as a basis for translators to create localized properties files, and as + a default format if some translation is missing. + """ CANNOT_NORMALIZE_A_ZERO_NORM_VECTOR: typing.ClassVar['LocalizedGeometryFormats'] = ... CLOSE_VERTICES: typing.ClassVar['LocalizedGeometryFormats'] = ... CLOSEST_ORTHOGONAL_MATRIX_HAS_NEGATIVE_DETERMINANT: typing.ClassVar['LocalizedGeometryFormats'] = ... @@ -41,44 +53,251 @@ class LocalizedGeometryFormats(java.lang.Enum['LocalizedGeometryFormats'], org.h ZERO_NORM_FOR_ROTATION_DEFINING_VECTOR: typing.ClassVar['LocalizedGeometryFormats'] = ... TOO_SMALL_TOLERANCE: typing.ClassVar['LocalizedGeometryFormats'] = ... INVALID_ROTATION_ORDER_NAME: typing.ClassVar['LocalizedGeometryFormats'] = ... - def getLocalizedString(self, locale: java.util.Locale) -> str: ... - def getSourceString(self) -> str: ... + def getLocalizedString(self, locale: java.util.Locale) -> str: + """ + + Specified by: + :meth:`~org.hipparchus.geometry.https:.www.hipparchus.org.hipparchus` in + interface :class:`~org.hipparchus.geometry.https:.www.hipparchus.org.hipparchus` + + + """ + ... + def getSourceString(self) -> str: + """ + + Specified by: + :meth:`~org.hipparchus.geometry.https:.www.hipparchus.org.hipparchus` in + interface :class:`~org.hipparchus.geometry.https:.www.hipparchus.org.hipparchus` + + + """ + ... _valueOf_0__T = typing.TypeVar('_valueOf_0__T', bound=java.lang.Enum) # <T> @typing.overload @staticmethod def valueOf(class_: typing.Type[_valueOf_0__T], string: str) -> _valueOf_0__T: ... @typing.overload @staticmethod - def valueOf(string: str) -> 'LocalizedGeometryFormats': ... + def valueOf(string: str) -> 'LocalizedGeometryFormats': + """ + Returns the enum constant of this type with the specified name. The string must match *exactly* an identifier used to + declare an enum constant in this type. (Extraneous whitespace characters are not permitted.) + + Parameters: + name (:class:`~org.hipparchus.geometry.https:.docs.oracle.com.javase.8.docs.api.java.lang.String`): the name of the enum constant to be returned. + + Returns: + the enum constant with the specified name + + Raises: + :class:`~org.hipparchus.geometry.https:.docs.oracle.com.javase.8.docs.api.java.lang.IllegalArgumentException`: if this enum type has no constant with the specified name + :class:`~org.hipparchus.geometry.https:.docs.oracle.com.javase.8.docs.api.java.lang.NullPointerException`: if the argument is null + + + """ + ... @staticmethod - def values() -> typing.MutableSequence['LocalizedGeometryFormats']: ... + def values() -> typing.MutableSequence['LocalizedGeometryFormats']: + """ + Returns an array containing the constants of this enum type, in the order they are declared. + + Returns: + an array containing the constants of this enum type, in the order they are declared + + + """ + ... _Point__S = typing.TypeVar('_Point__S', bound='Space') # <S> class Point(java.io.Serializable, typing.Generic[_Point__S]): + """ + public interfacePoint<S extends :class:`~org.hipparchus.geometry.Space`>extends :class:`~org.hipparchus.geometry.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + This interface represents a generic geometrical point. + + Also see: + + - :class:`~org.hipparchus.geometry.Space` + - :class:`~org.hipparchus.geometry.Vector` + """ def distance(self, point: 'Point'[_Point__S]) -> float: ... - def getSpace(self) -> 'Space': ... - def isNaN(self) -> bool: ... + def getSpace(self) -> 'Space': + """ + Get the space to which the point belongs. + + Returns: + containing space + + + """ + ... + def isNaN(self) -> bool: + """ + Returns true if any coordinate of this point is NaN; false otherwise + + Returns: + true if any coordinate of this point is NaN; false otherwise + + + """ + ... class Space(java.io.Serializable): - def getDimension(self) -> int: ... + """ + public interfaceSpaceextends :class:`~org.hipparchus.geometry.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + This interface represents a generic space, with affine and vectorial counterparts. + + Also see: + + - :class:`~org.hipparchus.geometry.Vector` + """ + def getDimension(self) -> int: + """ + Get the dimension of the space. + + Returns: + dimension of the space + + + """ + ... def getSubSpace(self) -> 'Space': ... _VectorFormat__S = typing.TypeVar('_VectorFormat__S', bound=Space) # <S> _VectorFormat__V = typing.TypeVar('_VectorFormat__V', bound='Vector') # <V> class VectorFormat(typing.Generic[_VectorFormat__S, _VectorFormat__V]): + """ + public abstract classVectorFormat<S extends :class:`~org.hipparchus.geometry.Space`,V extends :class:`~org.hipparchus.geometry.Vector`<S,V>> extends :class:`~org.hipparchus.geometry.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Formats a vector in components list format "{x; y; ...}". + + The prefix and suffix "{" and "}" and the separator "; " can be replaced by any user-defined strings. The number format + for components can be configured. + + White space is ignored at parse time, even if it is in the prefix, suffix or separator specifications. So even if the + default separator does include a space character that is used at format time, both input string "{1;1;1}" and " { 1 ; 1 + ; 1 } " will be parsed without error and the same vector will be returned. In the second case, however, the parse + position after parsing will be just after the closing curly brace, i.e. just before the trailing space. + + **Note:** using "," as a separator may interfere with the grouping separator of the default + :class:`~org.hipparchus.geometry.https:.docs.oracle.com.javase.8.docs.api.java.text.NumberFormat` for the current + locale. Thus it is advised to use a + :class:`~org.hipparchus.geometry.https:.docs.oracle.com.javase.8.docs.api.java.text.NumberFormat` instance with disabled + grouping in such a case. + """ DEFAULT_PREFIX: typing.ClassVar[str] = ... + """ + public static final :class:`~org.hipparchus.geometry.https:.docs.oracle.com.javase.8.docs.api.java.lang.String` DEFAULT_PREFIX + + The default prefix: "{". + + Also see: + + - :meth:`~constant` + + + + """ DEFAULT_SUFFIX: typing.ClassVar[str] = ... + """ + public static final :class:`~org.hipparchus.geometry.https:.docs.oracle.com.javase.8.docs.api.java.lang.String` DEFAULT_SUFFIX + + The default suffix: "}". + + Also see: + + - :meth:`~constant` + + + + """ DEFAULT_SEPARATOR: typing.ClassVar[str] = ... + """ + public static final :class:`~org.hipparchus.geometry.https:.docs.oracle.com.javase.8.docs.api.java.lang.String` DEFAULT_SEPARATOR + + The default separator: ", ". + + Also see: + + - :meth:`~constant` + + + + """ @typing.overload - def format(self, vector: 'Vector'[_VectorFormat__S, _VectorFormat__V], stringBuffer: java.lang.StringBuffer, fieldPosition: java.text.FieldPosition) -> java.lang.StringBuffer: ... + def format(self, vector: 'Vector'[_VectorFormat__S, _VectorFormat__V], stringBuffer: java.lang.StringBuffer, fieldPosition: java.text.FieldPosition) -> java.lang.StringBuffer: + """ + Formats the coordinates of a :class:`~org.hipparchus.geometry.Vector` to produce a string. + + Parameters: + toAppendTo (:class:`~org.hipparchus.geometry.https:.docs.oracle.com.javase.8.docs.api.java.lang.StringBuffer`): where the text is to be appended + pos (:class:`~org.hipparchus.geometry.https:.docs.oracle.com.javase.8.docs.api.java.text.FieldPosition`): On input: an alignment field, if desired. On output: the offsets of the alignment field + coordinates (double...): coordinates of the object to format. + + Returns: + the value passed in as toAppendTo. + + + """ + ... @typing.overload def format(self, vector: 'Vector'[_VectorFormat__S, _VectorFormat__V]) -> str: ... @staticmethod - def getAvailableLocales() -> typing.MutableSequence[java.util.Locale]: ... - def getFormat(self) -> java.text.NumberFormat: ... - def getPrefix(self) -> str: ... - def getSeparator(self) -> str: ... - def getSuffix(self) -> str: ... + def getAvailableLocales() -> typing.MutableSequence[java.util.Locale]: + """ + Get the set of locales for which point/vector formats are available. + + This is the same set as the + :class:`~org.hipparchus.geometry.https:.docs.oracle.com.javase.8.docs.api.java.text.NumberFormat` set. + + Returns: + available point/vector format locales. + + + """ + ... + def getFormat(self) -> java.text.NumberFormat: + """ + Get the components format. + + Returns: + components format. + + + """ + ... + def getPrefix(self) -> str: + """ + Get the format prefix. + + Returns: + format prefix. + + + """ + ... + def getSeparator(self) -> str: + """ + Get the format separator between components. + + Returns: + format separator. + + + """ + ... + def getSuffix(self) -> str: + """ + Get the format suffix. + + Returns: + format suffix. + + + """ + ... @typing.overload def parse(self, string: str) -> 'Vector'[_VectorFormat__S, _VectorFormat__V]: ... @typing.overload @@ -87,6 +306,16 @@ class VectorFormat(typing.Generic[_VectorFormat__S, _VectorFormat__V]): _Vector__S = typing.TypeVar('_Vector__S', bound=Space) # <S> _Vector__V = typing.TypeVar('_Vector__V', bound='Vector') # <V> class Vector(Point[_Vector__S], org.hipparchus.util.Blendable['Vector'[_Vector__S, _Vector__V]], typing.Generic[_Vector__S, _Vector__V]): + """ + public interfaceVector<S extends :class:`~org.hipparchus.geometry.Space`,V extends Vector<S,V>>extends :class:`~org.hipparchus.geometry.Point`<S>, :class:`~org.hipparchus.geometry.https:.www.hipparchus.org.hipparchus`<:class:`~org.hipparchus.geometry.Vector`<S,V>> + + This interface represents a generic vector in a vectorial space or a point in an affine space. + + Also see: + + - :class:`~org.hipparchus.geometry.Space` + - :class:`~org.hipparchus.geometry.Point` + """ @typing.overload def add(self, double: float, vector: 'Vector'[_Vector__S, _Vector__V]) -> _Vector__V: ... @typing.overload @@ -96,20 +325,107 @@ class Vector(Point[_Vector__S], org.hipparchus.util.Blendable['Vector'[_Vector__ def distanceInf(self, vector: 'Vector'[_Vector__S, _Vector__V]) -> float: ... def distanceSq(self, vector: 'Vector'[_Vector__S, _Vector__V]) -> float: ... def dotProduct(self, vector: 'Vector'[_Vector__S, _Vector__V]) -> float: ... - def getNorm(self) -> float: ... - def getNorm1(self) -> float: ... - def getNormInf(self) -> float: ... - def getNormSq(self) -> float: ... - def getZero(self) -> _Vector__V: ... - def isInfinite(self) -> bool: ... - def negate(self) -> _Vector__V: ... + def getNorm(self) -> float: + """ + Get the L :sub:`2` norm for the vector. + + Returns: + Euclidean norm for the vector + + + """ + ... + def getNorm1(self) -> float: + """ + Get the L :sub:`1` norm for the vector. + + Returns: + L :sub:`1` norm for the vector + + + """ + ... + def getNormInf(self) -> float: + """ + Get the L :sub:`∞` norm for the vector. + + Returns: + L :sub:`∞` norm for the vector + + + """ + ... + def getNormSq(self) -> float: + """ + Get the square of the norm for the vector. + + Returns: + square of the Euclidean norm for the vector + + + """ + ... + def getZero(self) -> _Vector__V: + """ + Get the null vector of the vectorial space or origin point of the affine space. + + Returns: + null vector of the vectorial space or origin point of the affine space + + + """ + ... + def isInfinite(self) -> bool: + """ + Returns true if any coordinate of this vector is infinite and none are NaN; false otherwise + + Returns: + true if any coordinate of this vector is infinite and none are NaN; false otherwise + + + """ + ... + def negate(self) -> _Vector__V: + """ + Get the opposite of the instance. + + Returns: + a new vector which is opposite to the instance + + + """ + ... def normalize(self) -> _Vector__V: ... - def scalarMultiply(self, double: float) -> _Vector__V: ... + def scalarMultiply(self, double: float) -> _Vector__V: + """ + Multiply the instance by a scalar. + + Parameters: + a (double): scalar + + Returns: + a new vector + + + """ + ... @typing.overload def subtract(self, double: float, vector: 'Vector'[_Vector__S, _Vector__V]) -> _Vector__V: ... @typing.overload def subtract(self, vector: 'Vector'[_Vector__S, _Vector__V]) -> _Vector__V: ... - def toString(self, numberFormat: java.text.NumberFormat) -> str: ... + def toString(self, numberFormat: java.text.NumberFormat) -> str: + """ + Get a string representation of this vector. + + Parameters: + format (:class:`~org.hipparchus.geometry.https:.docs.oracle.com.javase.8.docs.api.java.text.NumberFormat`): the custom format for components + + Returns: + a string representation of this vector + + + """ + ... class __module_protocol__(Protocol): diff --git a/org-stubs/hipparchus/geometry/enclosing/__init__.pyi b/org-stubs/hipparchus/geometry/enclosing/__init__.pyi index ea18747..e718cbe 100644 --- a/org-stubs/hipparchus/geometry/enclosing/__init__.pyi +++ b/org-stubs/hipparchus/geometry/enclosing/__init__.pyi @@ -16,29 +16,133 @@ import typing _Encloser__S = typing.TypeVar('_Encloser__S', bound=org.hipparchus.geometry.Space) # <S> _Encloser__P = typing.TypeVar('_Encloser__P', bound=org.hipparchus.geometry.Point) # <P> class Encloser(typing.Generic[_Encloser__S, _Encloser__P]): + """ + public interfaceEncloser<S extends :class:`~org.hipparchus.geometry.Space`,P extends :class:`~org.hipparchus.geometry.Point`<S>> + + Interface for algorithms computing enclosing balls. + + Also see: + + - :class:`~org.hipparchus.geometry.enclosing.EnclosingBall` + """ def enclose(self, iterable: typing.Union[java.lang.Iterable[_Encloser__P], typing.Sequence[_Encloser__P], typing.Set[_Encloser__P], typing.Callable[[], java.util.Iterator[typing.Any]]]) -> 'EnclosingBall'[_Encloser__S, _Encloser__P]: ... _EnclosingBall__S = typing.TypeVar('_EnclosingBall__S', bound=org.hipparchus.geometry.Space) # <S> _EnclosingBall__P = typing.TypeVar('_EnclosingBall__P', bound=org.hipparchus.geometry.Point) # <P> class EnclosingBall(java.io.Serializable, typing.Generic[_EnclosingBall__S, _EnclosingBall__P]): + """ + public classEnclosingBall<S extends :class:`~org.hipparchus.geometry.Space`,P extends :class:`~org.hipparchus.geometry.Point`<S>> extends :class:`~org.hipparchus.geometry.enclosing.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.geometry.enclosing.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + This class represents a ball enclosing some points. + + Also see: + + - :class:`~org.hipparchus.geometry.Space` + - :class:`~org.hipparchus.geometry.Point` + - :class:`~org.hipparchus.geometry.enclosing.Encloser` + - :meth:`~serialized` + """ def __init__(self, p: _EnclosingBall__P, double: float, *p2: _EnclosingBall__P): ... @typing.overload - def contains(self, p: _EnclosingBall__P) -> bool: ... + def contains(self, p: _EnclosingBall__P) -> bool: + """ + Check if a point is within the ball or at boundary. + + Parameters: + point (:class:`~org.hipparchus.geometry.enclosing.EnclosingBall`): point to test + + Returns: + true if the point is within the ball or at boundary + + Check if a point is within an enlarged ball or at boundary. + + Parameters: + point (:class:`~org.hipparchus.geometry.enclosing.EnclosingBall`): point to test + margin (double): margin to consider + + Returns: + true if the point is within the ball enlarged by the margin or at boundary + + + """ + ... @typing.overload def contains(self, p: _EnclosingBall__P, double: float) -> bool: ... - def getCenter(self) -> _EnclosingBall__P: ... - def getRadius(self) -> float: ... - def getSupport(self) -> typing.MutableSequence[_EnclosingBall__P]: ... - def getSupportSize(self) -> int: ... + def getCenter(self) -> _EnclosingBall__P: + """ + Get the center of the ball. + + Returns: + center of the ball + + + """ + ... + def getRadius(self) -> float: + """ + Get the radius of the ball. + + Returns: + radius of the ball (can be negative if the ball is empty) + + + """ + ... + def getSupport(self) -> typing.MutableSequence[_EnclosingBall__P]: + """ + Get the support points used to define the ball. + + Returns: + support points used to define the ball + + + """ + ... + def getSupportSize(self) -> int: + """ + Get the number of support points used to define the ball. + + Returns: + number of support points used to define the ball + + + """ + ... _SupportBallGenerator__S = typing.TypeVar('_SupportBallGenerator__S', bound=org.hipparchus.geometry.Space) # <S> _SupportBallGenerator__P = typing.TypeVar('_SupportBallGenerator__P', bound=org.hipparchus.geometry.Point) # <P> class SupportBallGenerator(typing.Generic[_SupportBallGenerator__S, _SupportBallGenerator__P]): + """ + public interfaceSupportBallGenerator<S extends :class:`~org.hipparchus.geometry.Space`,P extends :class:`~org.hipparchus.geometry.Point`<S>> + + Interface for generating balls based on support points. + + This generator is used in the :class:`~org.hipparchus.geometry.enclosing.WelzlEncloser` algorithm and its derivatives. + + Also see: + + - :class:`~org.hipparchus.geometry.enclosing.EnclosingBall` + """ def ballOnSupport(self, list: java.util.List[_SupportBallGenerator__P]) -> EnclosingBall[_SupportBallGenerator__S, _SupportBallGenerator__P]: ... _WelzlEncloser__S = typing.TypeVar('_WelzlEncloser__S', bound=org.hipparchus.geometry.Space) # <S> _WelzlEncloser__P = typing.TypeVar('_WelzlEncloser__P', bound=org.hipparchus.geometry.Point) # <P> class WelzlEncloser(Encloser[_WelzlEncloser__S, _WelzlEncloser__P], typing.Generic[_WelzlEncloser__S, _WelzlEncloser__P]): + """ + public classWelzlEncloser<S extends :class:`~org.hipparchus.geometry.Space`,P extends :class:`~org.hipparchus.geometry.Point`<S>> extends :class:`~org.hipparchus.geometry.enclosing.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.geometry.enclosing.Encloser`<S,P> + + Class implementing Emo Welzl algorithm to find the smallest enclosing ball in linear time. + + The class implements the algorithm described in paper `Smallest Enclosing Disks (Balls and Ellipsoids) + <http://www.inf.ethz.ch/personal/emo/PublFiles/SmallEnclDisk_LNCS555_91.pdf>` by Emo Welzl, Lecture Notes in Computer + Science 555 (1991) 359-370. The pivoting improvement published in the paper `Fast and Robust Smallest Enclosing Balls + <http://www.inf.ethz.ch/personal/gaertner/texts/own_work/esa99_final.pdf>`, by Bernd Gärtner and further modified in + paper ` Efficient Computation of Smallest Enclosing Balls in Three Dimensions + <http://www.idt.mdh.se/kurser/ct3340/ht12/MINICONFERENCE/FinalPapers/ircse12_submission_30.pdf>` by Linus Källberg to + avoid performing local copies of data have been included. + """ def __init__(self, double: float, supportBallGenerator: typing.Union[SupportBallGenerator[_WelzlEncloser__S, _WelzlEncloser__P], typing.Callable[[java.util.List[org.hipparchus.geometry.Point]], EnclosingBall[org.hipparchus.geometry.Space, org.hipparchus.geometry.Point]]]): ... def enclose(self, iterable: typing.Union[java.lang.Iterable[_WelzlEncloser__P], typing.Sequence[_WelzlEncloser__P], typing.Set[_WelzlEncloser__P], typing.Callable[[], java.util.Iterator[typing.Any]]]) -> EnclosingBall[_WelzlEncloser__S, _WelzlEncloser__P]: ... def selectFarthest(self, iterable: typing.Union[java.lang.Iterable[_WelzlEncloser__P], typing.Sequence[_WelzlEncloser__P], typing.Set[_WelzlEncloser__P], typing.Callable[[], java.util.Iterator[typing.Any]]], enclosingBall: EnclosingBall[_WelzlEncloser__S, _WelzlEncloser__P]) -> _WelzlEncloser__P: ... diff --git a/org-stubs/hipparchus/geometry/euclidean/oned/__init__.pyi b/org-stubs/hipparchus/geometry/euclidean/oned/__init__.pyi index 4ff520b..bbdeb5c 100644 --- a/org-stubs/hipparchus/geometry/euclidean/oned/__init__.pyi +++ b/org-stubs/hipparchus/geometry/euclidean/oned/__init__.pyi @@ -17,22 +17,119 @@ import typing class Euclidean1D(java.io.Serializable, org.hipparchus.geometry.Space): - def getDimension(self) -> int: ... + """ + public classEuclidean1D extends :class:`~org.hipparchus.geometry.euclidean.oned.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.geometry.euclidean.oned.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable`, :class:`~org.hipparchus.geometry.Space` + + This class implements a one-dimensional space. + + Also see: + + - :meth:`~serialized` + """ + def getDimension(self) -> int: + """ + Get the dimension of the space. + + Specified by: + :meth:`~org.hipparchus.geometry.Space.getDimension` in interface :class:`~org.hipparchus.geometry.Space` + + Returns: + dimension of the space + + + """ + ... @staticmethod - def getInstance() -> 'Euclidean1D': ... + def getInstance() -> 'Euclidean1D': + """ + Get the unique instance. + + Returns: + the unique instance + + + """ + ... def getSubSpace(self) -> org.hipparchus.geometry.Space: ... class NoSubSpaceException(org.hipparchus.exception.MathRuntimeException): def __init__(self): ... class Interval: + """ + public classInterval extends :class:`~org.hipparchus.geometry.euclidean.oned.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + This class represents a 1D interval. + + Also see: + + - :class:`~org.hipparchus.geometry.euclidean.oned.IntervalsSet` + """ def __init__(self, double: float, double2: float): ... - def checkPoint(self, double: float, double2: float) -> org.hipparchus.geometry.partitioning.Region.Location: ... - def getBarycenter(self) -> float: ... - def getInf(self) -> float: ... - def getSize(self) -> float: ... - def getSup(self) -> float: ... + def checkPoint(self, double: float, double2: float) -> org.hipparchus.geometry.partitioning.Region.Location: + """ + Check a point with respect to the interval. + + Parameters: + point (double): point to check + tolerance (double): tolerance below which points are considered to belong to the boundary + + Returns: + a code representing the point status: either :meth:`~org.hipparchus.geometry.partitioning.Region.Location.INSIDE`, + :meth:`~org.hipparchus.geometry.partitioning.Region.Location.OUTSIDE` or + :meth:`~org.hipparchus.geometry.partitioning.Region.Location.BOUNDARY` + + + """ + ... + def getBarycenter(self) -> float: + """ + Get the barycenter of the interval. + + Returns: + barycenter of the interval + + + """ + ... + def getInf(self) -> float: + """ + Get the lower bound of the interval. + + Returns: + lower bound of the interval + + + """ + ... + def getSize(self) -> float: + """ + Get the size of the interval. + + Returns: + size of the interval + + + """ + ... + def getSup(self) -> float: + """ + Get the upper bound of the interval. + + Returns: + upper bound of the interval + + + """ + ... class IntervalsSet(org.hipparchus.geometry.partitioning.AbstractRegion[Euclidean1D, Euclidean1D], java.lang.Iterable[typing.MutableSequence[float]]): + """ + public classIntervalsSet extends :class:`~org.hipparchus.geometry.partitioning.AbstractRegion`<:class:`~org.hipparchus.geometry.euclidean.oned.Euclidean1D`,:class:`~org.hipparchus.geometry.euclidean.oned.Euclidean1D`> + implements :class:`~org.hipparchus.geometry.euclidean.oned.https:.docs.oracle.com.javase.8.docs.api.java.lang.Iterable`<double[]> + + This class represents a 1D region: a set of intervals. + """ @typing.overload def __init__(self, double: float): ... @typing.overload @@ -43,40 +140,268 @@ class IntervalsSet(org.hipparchus.geometry.partitioning.AbstractRegion[Euclidean def __init__(self, bSPTree: org.hipparchus.geometry.partitioning.BSPTree[Euclidean1D], double: float): ... def asList(self) -> java.util.List[Interval]: ... def buildNew(self, bSPTree: org.hipparchus.geometry.partitioning.BSPTree[Euclidean1D]) -> 'IntervalsSet': ... - def getInf(self) -> float: ... - def getSup(self) -> float: ... - def iterator(self) -> java.util.Iterator[typing.MutableSequence[float]]: ... + def getInf(self) -> float: + """ + Get the lowest value belonging to the instance. + + Returns: + lowest value belonging to the instance (:code:`Double.NEGATIVE_INFINITY` if the instance doesn't have any low bound, + :code:`Double.POSITIVE_INFINITY` if the instance is empty) + + + """ + ... + def getSup(self) -> float: + """ + Get the highest value belonging to the instance. + + Returns: + highest value belonging to the instance (:code:`Double.POSITIVE_INFINITY` if the instance doesn't have any high bound, + :code:`Double.NEGATIVE_INFINITY` if the instance is empty) + + + """ + ... + def iterator(self) -> java.util.Iterator[typing.MutableSequence[float]]: + """ + + The iterator returns the limit values of sub-intervals in ascending order. + + The iterator does *not* support the optional :code:`remove` operation. + + Specified by: + :meth:`~org.hipparchus.geometry.euclidean.oned.https:.docs.oracle.com.javase.8.docs.api.java.lang.Iterable.iterator` in + interface :class:`~org.hipparchus.geometry.euclidean.oned.https:.docs.oracle.com.javase.8.docs.api.java.lang.Iterable` + + + """ + ... def projectToBoundary(self, point: org.hipparchus.geometry.Point[Euclidean1D]) -> org.hipparchus.geometry.partitioning.BoundaryProjection[Euclidean1D]: ... class OrientedPoint(org.hipparchus.geometry.partitioning.Hyperplane[Euclidean1D]): + """ + public classOrientedPoint extends :class:`~org.hipparchus.geometry.euclidean.oned.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.geometry.partitioning.Hyperplane`<:class:`~org.hipparchus.geometry.euclidean.oned.Euclidean1D`> + + This class represents a 1D oriented hyperplane. + + An hyperplane in 1D is a simple point, its orientation being a boolean. + + Instances of this class are guaranteed to be immutable. + """ def __init__(self, vector1D: 'Vector1D', boolean: bool, double: float): ... - def copySelf(self) -> 'OrientedPoint': ... - def emptyHyperplane(self) -> 'SubOrientedPoint': ... - def getLocation(self) -> 'Vector1D': ... + def copySelf(self) -> 'OrientedPoint': + """ + Copy the instance. + + Since instances are immutable, this method directly returns the instance. + + Specified by: + :meth:`~org.hipparchus.geometry.partitioning.Hyperplane.copySelf` in + interface :class:`~org.hipparchus.geometry.partitioning.Hyperplane` + + Returns: + the instance itself + + + """ + ... + def emptyHyperplane(self) -> 'SubOrientedPoint': + """ + Build a sub-hyperplane covering nothing.. + + Since this class represent zero dimension spaces which does not have lower dimension sub-spaces, this method returns a + dummy implementation of a :class:`~org.hipparchus.geometry.partitioning.SubHyperplane`. This implementation is only used + to allow the :class:`~org.hipparchus.geometry.partitioning.SubHyperplane` class implementation to work properly, it + should *not* be used otherwise. + + Specified by: + :meth:`~org.hipparchus.geometry.partitioning.Hyperplane.emptyHyperplane` in + interface :class:`~org.hipparchus.geometry.partitioning.Hyperplane` + + Returns: + a dummy sub hyperplane + + + """ + ... + def getLocation(self) -> 'Vector1D': + """ + Get the hyperplane location on the real line. + + Returns: + the hyperplane location + + + """ + ... @typing.overload def getOffset(self, point: org.hipparchus.geometry.Point[Euclidean1D]) -> float: ... @typing.overload def getOffset(self, vector: org.hipparchus.geometry.Vector[Euclidean1D, 'Vector1D']) -> float: ... - def getTolerance(self) -> float: ... - def isDirect(self) -> bool: ... + def getTolerance(self) -> float: + """ + Get the tolerance below which points are considered to belong to the hyperplane. + + Specified by: + :meth:`~org.hipparchus.geometry.partitioning.Hyperplane.getTolerance` in + interface :class:`~org.hipparchus.geometry.partitioning.Hyperplane` + + Returns: + tolerance below which points are considered to belong to the hyperplane + + + """ + ... + def isDirect(self) -> bool: + """ + Check if the hyperplane orientation is direct. + + Returns: + true if the plus side of the hyperplane is towards abscissae greater than hyperplane location + + + """ + ... def project(self, point: org.hipparchus.geometry.Point[Euclidean1D]) -> org.hipparchus.geometry.Point[Euclidean1D]: ... - def revertSelf(self) -> None: ... + def revertSelf(self) -> None: + """ + Revert the instance. + + """ + ... def sameOrientationAs(self, hyperplane: org.hipparchus.geometry.partitioning.Hyperplane[Euclidean1D]) -> bool: ... - def wholeHyperplane(self) -> 'SubOrientedPoint': ... - def wholeSpace(self) -> IntervalsSet: ... + def wholeHyperplane(self) -> 'SubOrientedPoint': + """ + Build a region covering the whole hyperplane. + + Since this class represent zero dimension spaces which does not have lower dimension sub-spaces, this method returns a + dummy implementation of a :class:`~org.hipparchus.geometry.partitioning.SubHyperplane`. This implementation is only used + to allow the :class:`~org.hipparchus.geometry.partitioning.SubHyperplane` class implementation to work properly, it + should *not* be used otherwise. + + Specified by: + :meth:`~org.hipparchus.geometry.partitioning.Hyperplane.wholeHyperplane` in + interface :class:`~org.hipparchus.geometry.partitioning.Hyperplane` + + Returns: + a dummy sub hyperplane + + + """ + ... + def wholeSpace(self) -> IntervalsSet: + """ + Build a region covering the whole space. + + Specified by: + :meth:`~org.hipparchus.geometry.partitioning.Hyperplane.wholeSpace` in + interface :class:`~org.hipparchus.geometry.partitioning.Hyperplane` + + Returns: + a region containing the instance (really an :class:`~org.hipparchus.geometry.euclidean.oned.IntervalsSet` instance) + + + """ + ... class SubOrientedPoint(org.hipparchus.geometry.partitioning.AbstractSubHyperplane[Euclidean1D, Euclidean1D]): + """ + public classSubOrientedPoint extends :class:`~org.hipparchus.geometry.partitioning.AbstractSubHyperplane`<:class:`~org.hipparchus.geometry.euclidean.oned.Euclidean1D`,:class:`~org.hipparchus.geometry.euclidean.oned.Euclidean1D`> + + This class represents sub-hyperplane for :class:`~org.hipparchus.geometry.euclidean.oned.OrientedPoint`. + + An hyperplane in 1D is a simple point, its orientation being a boolean. + + Instances of this class are guaranteed to be immutable. + """ def __init__(self, hyperplane: org.hipparchus.geometry.partitioning.Hyperplane[Euclidean1D], region: org.hipparchus.geometry.partitioning.Region[Euclidean1D]): ... - def getSize(self) -> float: ... - def isEmpty(self) -> bool: ... + def getSize(self) -> float: + """ + Get the size of the instance. + + Specified by: + :meth:`~org.hipparchus.geometry.partitioning.SubHyperplane.getSize` in + interface :class:`~org.hipparchus.geometry.partitioning.SubHyperplane` + + Overrides: + :meth:`~org.hipparchus.geometry.partitioning.AbstractSubHyperplane.getSize` in + class :class:`~org.hipparchus.geometry.partitioning.AbstractSubHyperplane` + + Returns: + the size of the instance (this is a length in 1D, an area in 2D, a volume in 3D ...) + + + """ + ... + def isEmpty(self) -> bool: + """ + Check if the instance is empty. + + Specified by: + :meth:`~org.hipparchus.geometry.partitioning.SubHyperplane.isEmpty` in + interface :class:`~org.hipparchus.geometry.partitioning.SubHyperplane` + + Overrides: + :meth:`~org.hipparchus.geometry.partitioning.AbstractSubHyperplane.isEmpty` in + class :class:`~org.hipparchus.geometry.partitioning.AbstractSubHyperplane` + + Returns: + true if the instance is empty + + + """ + ... def split(self, hyperplane: org.hipparchus.geometry.partitioning.Hyperplane[Euclidean1D]) -> org.hipparchus.geometry.partitioning.SubHyperplane.SplitSubHyperplane[Euclidean1D]: ... class Vector1D(org.hipparchus.geometry.Vector[Euclidean1D, 'Vector1D']): + """ + public classVector1D extends :class:`~org.hipparchus.geometry.euclidean.oned.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.geometry.Vector`<:class:`~org.hipparchus.geometry.euclidean.oned.Euclidean1D`,:class:`~org.hipparchus.geometry.euclidean.oned.Vector1D`> + + This class represents a 1D vector. + + Instances of this class are guaranteed to be immutable. + + Also see: + + - :meth:`~serialized` + """ ZERO: typing.ClassVar['Vector1D'] = ... + """ + public static final :class:`~org.hipparchus.geometry.euclidean.oned.Vector1D` ZERO + + Origin (coordinates: 0). + + """ ONE: typing.ClassVar['Vector1D'] = ... + """ + public static final :class:`~org.hipparchus.geometry.euclidean.oned.Vector1D` ONE + + Unit (coordinates: 1). + + """ NaN: typing.ClassVar['Vector1D'] = ... + """ + public static final :class:`~org.hipparchus.geometry.euclidean.oned.Vector1D` NaN + + A vector with all coordinates set to NaN. + + """ POSITIVE_INFINITY: typing.ClassVar['Vector1D'] = ... + """ + public static final :class:`~org.hipparchus.geometry.euclidean.oned.Vector1D` POSITIVE_INFINITY + + A vector with all coordinates set to positive infinity. + + """ NEGATIVE_INFINITY: typing.ClassVar['Vector1D'] = ... + """ + public static final :class:`~org.hipparchus.geometry.euclidean.oned.Vector1D` NEGATIVE_INFINITY + + A vector with all coordinates set to negative infinity. + + """ @typing.overload def __init__(self, double: float): ... @typing.overload @@ -92,46 +417,340 @@ class Vector1D(org.hipparchus.geometry.Vector[Euclidean1D, 'Vector1D']): @typing.overload def add(self, vector: org.hipparchus.geometry.Vector[Euclidean1D, 'Vector1D']) -> 'Vector1D': ... @typing.overload - def distance(self, point: org.hipparchus.geometry.Point[Euclidean1D]) -> float: ... + def distance(self, point: org.hipparchus.geometry.Point[Euclidean1D]) -> float: + """ + Compute the distance between two vectors according to the L :sub:`2` norm. + + Calling this method is equivalent to calling: :code:`p1.subtract(p2).getNorm()` except that no intermediate vector is + built + + Parameters: + p1 (:class:`~org.hipparchus.geometry.euclidean.oned.Vector1D`): first vector + p2 (:class:`~org.hipparchus.geometry.euclidean.oned.Vector1D`): second vector + + Returns: + the distance between p1 and p2 according to the L :sub:`2` norm + + + """ + ... @typing.overload @staticmethod def distance(vector1D: 'Vector1D', vector1D2: 'Vector1D') -> float: ... def distance1(self, vector: org.hipparchus.geometry.Vector[Euclidean1D, 'Vector1D']) -> float: ... @typing.overload - def distanceInf(self, vector: org.hipparchus.geometry.Vector[Euclidean1D, 'Vector1D']) -> float: ... + def distanceInf(self, vector: org.hipparchus.geometry.Vector[Euclidean1D, 'Vector1D']) -> float: + """ + Compute the distance between two vectors according to the L :sub:`∞` norm. + + Calling this method is equivalent to calling: :code:`p1.subtract(p2).getNormInf()` except that no intermediate vector is + built + + Parameters: + p1 (:class:`~org.hipparchus.geometry.euclidean.oned.Vector1D`): first vector + p2 (:class:`~org.hipparchus.geometry.euclidean.oned.Vector1D`): second vector + + Returns: + the distance between p1 and p2 according to the L :sub:`∞` norm + + + """ + ... @typing.overload @staticmethod def distanceInf(vector1D: 'Vector1D', vector1D2: 'Vector1D') -> float: ... @typing.overload - def distanceSq(self, vector: org.hipparchus.geometry.Vector[Euclidean1D, 'Vector1D']) -> float: ... + def distanceSq(self, vector: org.hipparchus.geometry.Vector[Euclidean1D, 'Vector1D']) -> float: + """ + Compute the square of the distance between two vectors. + + Calling this method is equivalent to calling: :code:`p1.subtract(p2).getNormSq()` except that no intermediate vector is + built + + Parameters: + p1 (:class:`~org.hipparchus.geometry.euclidean.oned.Vector1D`): first vector + p2 (:class:`~org.hipparchus.geometry.euclidean.oned.Vector1D`): second vector + + Returns: + the square of the distance between p1 and p2 + + + """ + ... @typing.overload @staticmethod def distanceSq(vector1D: 'Vector1D', vector1D2: 'Vector1D') -> float: ... def dotProduct(self, vector: org.hipparchus.geometry.Vector[Euclidean1D, 'Vector1D']) -> float: ... - def equals(self, object: typing.Any) -> bool: ... - def equalsIeee754(self, object: typing.Any) -> bool: ... - def getNorm(self) -> float: ... - def getNorm1(self) -> float: ... - def getNormInf(self) -> float: ... - def getNormSq(self) -> float: ... - def getSpace(self) -> org.hipparchus.geometry.Space: ... - def getX(self) -> float: ... - def getZero(self) -> 'Vector1D': ... - def hashCode(self) -> int: ... - def isInfinite(self) -> bool: ... - def isNaN(self) -> bool: ... - def negate(self) -> 'Vector1D': ... - def scalarMultiply(self, double: float) -> 'Vector1D': ... + def equals(self, object: typing.Any) -> bool: + """ + Test for the equality of two 1D vectors. + + If all coordinates of two 1D vectors are exactly the same, and none are :code:`Double.NaN`, the two 1D vectors are + considered to be equal. + + :code:`NaN` coordinates are considered to affect globally the vector and be equals to each other - i.e, if either (or + all) coordinates of the 1D vector are equal to :code:`Double.NaN`, the 1D vector is equal to + :meth:`~org.hipparchus.geometry.euclidean.oned.Vector1D.NaN`. + + Overrides: + :meth:`~org.hipparchus.geometry.euclidean.oned.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.equals` in + class :class:`~org.hipparchus.geometry.euclidean.oned.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Parameters: + other (:class:`~org.hipparchus.geometry.euclidean.oned.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object`): Object to test for equality to this + + Returns: + true if two 1D vector objects are equal, false if object is null, not an instance of Vector1D, or not equal to this + Vector1D instance + + + """ + ... + def equalsIeee754(self, object: typing.Any) -> bool: + """ + Test for the equality of two 1D vectors. + + If all coordinates of two 1D vectors are exactly the same, and none are :code:`NaN`, the two 1D vectors are considered + to be equal. + + In compliance with IEEE754 handling, if any coordinates of any of the two vectors are :code:`NaN`, then the vectors are + considered different. This implies that + :meth:`~org.hipparchus.geometry.euclidean.oned.Vector1D.NaN`.equals(:meth:`~org.hipparchus.geometry.euclidean.oned.Vector1D.NaN`) + returns :code:`false` despite the instance is checked against itself. + + Parameters: + other (:class:`~org.hipparchus.geometry.euclidean.oned.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object`): Object to test for equality to this + + Returns: + true if two 1D vector objects are equal, false if object is null, not an instance of Vector1D, or not equal to this + Vector1D instance + + Since: + 2.1 + + + """ + ... + def getNorm(self) -> float: + """ + Get the L :sub:`2` norm for the vector. + + Specified by: + :meth:`~org.hipparchus.geometry.Vector.getNorm` in interface :class:`~org.hipparchus.geometry.Vector` + + Returns: + Euclidean norm for the vector + + + """ + ... + def getNorm1(self) -> float: + """ + Get the L :sub:`1` norm for the vector. + + Specified by: + :meth:`~org.hipparchus.geometry.Vector.getNorm1` in interface :class:`~org.hipparchus.geometry.Vector` + + Returns: + L :sub:`1` norm for the vector + + + """ + ... + def getNormInf(self) -> float: + """ + Get the L :sub:`∞` norm for the vector. + + Specified by: + :meth:`~org.hipparchus.geometry.Vector.getNormInf` in interface :class:`~org.hipparchus.geometry.Vector` + + Returns: + L :sub:`∞` norm for the vector + + + """ + ... + def getNormSq(self) -> float: + """ + Get the square of the norm for the vector. + + Specified by: + :meth:`~org.hipparchus.geometry.Vector.getNormSq` in interface :class:`~org.hipparchus.geometry.Vector` + + Returns: + square of the Euclidean norm for the vector + + + """ + ... + def getSpace(self) -> org.hipparchus.geometry.Space: + """ + Get the space to which the point belongs. + + Specified by: + :meth:`~org.hipparchus.geometry.Point.getSpace` in interface :class:`~org.hipparchus.geometry.Point` + + Returns: + containing space + + + """ + ... + def getX(self) -> float: + """ + Get the abscissa of the vector. + + Returns: + abscissa of the vector + + Also see: + + - :meth:`~org.hipparchus.geometry.euclidean.oned.Vector1D.%3Cinit%3E` + + + + """ + ... + def getZero(self) -> 'Vector1D': + """ + Get the null vector of the vectorial space or origin point of the affine space. + + Specified by: + :meth:`~org.hipparchus.geometry.Vector.getZero` in interface :class:`~org.hipparchus.geometry.Vector` + + Returns: + null vector of the vectorial space or origin point of the affine space + + + """ + ... + def hashCode(self) -> int: + """ + Get a hashCode for the 1D vector. + + All NaN values have the same hash code. + + Overrides: + :meth:`~org.hipparchus.geometry.euclidean.oned.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.hashCode` in + class :class:`~org.hipparchus.geometry.euclidean.oned.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Returns: + a hash code value for this object + + + """ + ... + def isInfinite(self) -> bool: + """ + Returns true if any coordinate of this vector is infinite and none are NaN; false otherwise + + Specified by: + :meth:`~org.hipparchus.geometry.Vector.isInfinite` in interface :class:`~org.hipparchus.geometry.Vector` + + Returns: + true if any coordinate of this vector is infinite and none are NaN; false otherwise + + + """ + ... + def isNaN(self) -> bool: + """ + Returns true if any coordinate of this point is NaN; false otherwise + + Specified by: + :meth:`~org.hipparchus.geometry.Point.isNaN` in interface :class:`~org.hipparchus.geometry.Point` + + Returns: + true if any coordinate of this point is NaN; false otherwise + + + """ + ... + def negate(self) -> 'Vector1D': + """ + Get the opposite of the instance. + + Specified by: + :meth:`~org.hipparchus.geometry.Vector.negate` in interface :class:`~org.hipparchus.geometry.Vector` + + Returns: + a new vector which is opposite to the instance + + + """ + ... + def scalarMultiply(self, double: float) -> 'Vector1D': + """ + Multiply the instance by a scalar. + + Specified by: + :meth:`~org.hipparchus.geometry.Vector.scalarMultiply` in interface :class:`~org.hipparchus.geometry.Vector` + + Parameters: + a (double): scalar + + Returns: + a new vector + + + """ + ... @typing.overload def subtract(self, double: float, vector: org.hipparchus.geometry.Vector[Euclidean1D, 'Vector1D']) -> 'Vector1D': ... @typing.overload def subtract(self, vector: org.hipparchus.geometry.Vector[Euclidean1D, 'Vector1D']) -> 'Vector1D': ... @typing.overload - def toString(self) -> str: ... - @typing.overload - def toString(self, numberFormat: java.text.NumberFormat) -> str: ... + def toString(self) -> str: + """ + Get a string representation of this vector. + + Overrides: + :meth:`~org.hipparchus.geometry.euclidean.oned.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.toString` in + class :class:`~org.hipparchus.geometry.euclidean.oned.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Returns: + a string representation of this vector + + """ + ... + @typing.overload + def toString(self, numberFormat: java.text.NumberFormat) -> str: + """ + Get a string representation of this vector. + + Specified by: + :meth:`~org.hipparchus.geometry.Vector.toString` in interface :class:`~org.hipparchus.geometry.Vector` + + Parameters: + format (:class:`~org.hipparchus.geometry.euclidean.oned.https:.docs.oracle.com.javase.8.docs.api.java.text.NumberFormat`): the custom format for components + + Returns: + a string representation of this vector + + + """ + ... class Vector1DFormat(org.hipparchus.geometry.VectorFormat[Euclidean1D, Vector1D]): + """ + public classVector1DFormat extends :class:`~org.hipparchus.geometry.VectorFormat`<:class:`~org.hipparchus.geometry.euclidean.oned.Euclidean1D`,:class:`~org.hipparchus.geometry.euclidean.oned.Vector1D`> + + Formats a 1D vector in components list format "{x}". + + The prefix and suffix "{" and "}" can be replaced by any user-defined strings. The number format for components can be + configured. + + White space is ignored at parse time, even if it is in the prefix, suffix or separator specifications. So even if the + default separator does include a space character that is used at format time, both input string "{1}" and " { 1 } " will + be parsed without error and the same vector will be returned. In the second case, however, the parse position after + parsing will be just after the closing curly brace, i.e. just before the trailing space. + + **Note:** using "," as a separator may interfere with the grouping separator of the default + :class:`~org.hipparchus.geometry.euclidean.oned.https:.docs.oracle.com.javase.8.docs.api.java.text.NumberFormat` for the + current locale. Thus it is advised to use a + :class:`~org.hipparchus.geometry.euclidean.oned.https:.docs.oracle.com.javase.8.docs.api.java.text.NumberFormat` + instance with disabled grouping in such a case. + """ @typing.overload def __init__(self): ... @typing.overload @@ -146,12 +765,54 @@ class Vector1DFormat(org.hipparchus.geometry.VectorFormat[Euclidean1D, Vector1D] def format(self, vector: org.hipparchus.geometry.Vector[Euclidean1D, Vector1D], stringBuffer: java.lang.StringBuffer, fieldPosition: java.text.FieldPosition) -> java.lang.StringBuffer: ... @typing.overload @staticmethod - def getVector1DFormat() -> 'Vector1DFormat': ... + def getVector1DFormat() -> 'Vector1DFormat': + """ + Returns the default 1D vector format for the current locale. + + Returns: + the default 1D vector format. + + Since: + 1.4 + + """ + ... @typing.overload @staticmethod - def getVector1DFormat(locale: java.util.Locale) -> 'Vector1DFormat': ... - @typing.overload - def parse(self, string: str) -> Vector1D: ... + def getVector1DFormat(locale: java.util.Locale) -> 'Vector1DFormat': + """ + Returns the default 1D vector format for the given locale. + + Parameters: + locale (:class:`~org.hipparchus.geometry.euclidean.oned.https:.docs.oracle.com.javase.8.docs.api.java.util.Locale`): the specific locale used by the format. + + Returns: + the 1D vector format specific to the given locale. + + Since: + 1.4 + + + """ + ... + @typing.overload + def parse(self, string: str) -> Vector1D: + """ + Parses a string to produce a :class:`~org.hipparchus.geometry.Vector` object. + + Specified by: + :meth:`~org.hipparchus.geometry.VectorFormat.parse` in class :class:`~org.hipparchus.geometry.VectorFormat` + + Parameters: + source (:class:`~org.hipparchus.geometry.euclidean.oned.https:.docs.oracle.com.javase.8.docs.api.java.lang.String`): the string to parse + pos (:class:`~org.hipparchus.geometry.euclidean.oned.https:.docs.oracle.com.javase.8.docs.api.java.text.ParsePosition`): input/output parsing parameter. + + Returns: + the parsed :class:`~org.hipparchus.geometry.Vector` object. + + + """ + ... @typing.overload def parse(self, string: str, parsePosition: java.text.ParsePosition) -> Vector1D: ... diff --git a/org-stubs/hipparchus/geometry/euclidean/threed/__init__.pyi b/org-stubs/hipparchus/geometry/euclidean/threed/__init__.pyi index fc23b02..f6b3418 100644 --- a/org-stubs/hipparchus/geometry/euclidean/threed/__init__.pyi +++ b/org-stubs/hipparchus/geometry/euclidean/threed/__init__.pyi @@ -22,35 +22,149 @@ import typing class Euclidean3D(java.io.Serializable, org.hipparchus.geometry.Space): - def getDimension(self) -> int: ... + """ + public classEuclidean3D extends :class:`~org.hipparchus.geometry.euclidean.threed.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.geometry.euclidean.threed.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable`, :class:`~org.hipparchus.geometry.Space` + + This class implements a three-dimensional space. + + Also see: + + - :meth:`~serialized` + """ + def getDimension(self) -> int: + """ + Get the dimension of the space. + + Specified by: + :meth:`~org.hipparchus.geometry.Space.getDimension` in interface :class:`~org.hipparchus.geometry.Space` + + Returns: + dimension of the space + + + """ + ... @staticmethod - def getInstance() -> 'Euclidean3D': ... - def getSubSpace(self) -> org.hipparchus.geometry.euclidean.twod.Euclidean2D: ... + def getInstance() -> 'Euclidean3D': + """ + Get the unique instance. + + Returns: + the unique instance + + + """ + ... + def getSubSpace(self) -> org.hipparchus.geometry.euclidean.twod.Euclidean2D: + """ + Get the n-1 dimension subspace of this space. + + Specified by: + :meth:`~org.hipparchus.geometry.Space.getSubSpace` in interface :class:`~org.hipparchus.geometry.Space` + + Returns: + n-1 dimension sub-space of this space + + Also see: + + - :meth:`~org.hipparchus.geometry.Space.getDimension` + + + + """ + ... _FieldLine__T = typing.TypeVar('_FieldLine__T', bound=org.hipparchus.CalculusFieldElement) # <T> class FieldLine(typing.Generic[_FieldLine__T]): + """ + public classFieldLine<T extends :class:`~org.hipparchus.geometry.euclidean.threed.https:.www.hipparchus.org.hipparchus`<T>> extends :class:`~org.hipparchus.geometry.euclidean.threed.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + The class represent lines in a three dimensional space. + + Each oriented line is intrinsically associated with an abscissa which is a coordinate on the line. The point at abscissa + 0 is the orthogonal projection of the origin on the line, another equivalent way to express this is to say that it is + the point of the line which is closest to the origin. Abscissa increases in the line direction. + """ @typing.overload def __init__(self, fieldLine: 'FieldLine'[_FieldLine__T]): ... @typing.overload def __init__(self, fieldVector3D: 'FieldVector3D'[_FieldLine__T], fieldVector3D2: 'FieldVector3D'[_FieldLine__T], double: float): ... def closestPoint(self, fieldLine: 'FieldLine'[_FieldLine__T]) -> 'FieldVector3D'[_FieldLine__T]: ... @typing.overload - def contains(self, fieldVector3D: 'FieldVector3D'[_FieldLine__T]) -> bool: ... + def contains(self, fieldVector3D: 'FieldVector3D'[_FieldLine__T]) -> bool: + """ + Check if the instance contains a point. + + Parameters: + p (:class:`~org.hipparchus.geometry.euclidean.threed.Vector3D`): point to check + + Returns: + true if p belongs to the line + + + """ + ... @typing.overload def contains(self, vector3D: 'Vector3D') -> bool: ... @typing.overload - def distance(self, fieldLine: 'FieldLine'[_FieldLine__T]) -> _FieldLine__T: ... + def distance(self, fieldLine: 'FieldLine'[_FieldLine__T]) -> _FieldLine__T: + """ + Compute the distance between the instance and a point. + + Parameters: + p (:class:`~org.hipparchus.geometry.euclidean.threed.Vector3D`): to check + + Returns: + distance between the instance and the point + + public :class:`~org.hipparchus.geometry.euclidean.threed.FieldLine` distance(:class:`~org.hipparchus.geometry.euclidean.threed.FieldLine`<:class:`~org.hipparchus.geometry.euclidean.threed.FieldLine`> line) + + Compute the shortest distance between the instance and another line. + + Parameters: + line (:class:`~org.hipparchus.geometry.euclidean.threed.FieldLine`<:class:`~org.hipparchus.geometry.euclidean.threed.FieldLine`> line): line to check against the instance + + Returns: + shortest distance between the instance and the line + + + """ + ... @typing.overload def distance(self, fieldVector3D: 'FieldVector3D'[_FieldLine__T]) -> _FieldLine__T: ... @typing.overload def distance(self, vector3D: 'Vector3D') -> _FieldLine__T: ... @typing.overload - def getAbscissa(self, fieldVector3D: 'FieldVector3D'[_FieldLine__T]) -> _FieldLine__T: ... + def getAbscissa(self, fieldVector3D: 'FieldVector3D'[_FieldLine__T]) -> _FieldLine__T: + """ + Get the abscissa of a point with respect to the line. + + The abscissa is 0 if the projection of the point and the projection of the frame origin on the line are the same point. + + Parameters: + point (:class:`~org.hipparchus.geometry.euclidean.threed.Vector3D`): point to check + + Returns: + abscissa of the point + + + """ + ... @typing.overload def getAbscissa(self, vector3D: 'Vector3D') -> _FieldLine__T: ... def getDirection(self) -> 'FieldVector3D'[_FieldLine__T]: ... def getOrigin(self) -> 'FieldVector3D'[_FieldLine__T]: ... - def getTolerance(self) -> float: ... + def getTolerance(self) -> float: + """ + Get the tolerance below which points are considered identical. + + Returns: + tolerance below which points are considered identical + + + """ + ... def intersection(self, fieldLine: 'FieldLine'[_FieldLine__T]) -> 'FieldVector3D'[_FieldLine__T]: ... def isSimilarTo(self, fieldLine: 'FieldLine'[_FieldLine__T]) -> bool: ... @typing.overload @@ -62,6 +176,21 @@ class FieldLine(typing.Generic[_FieldLine__T]): _FieldRotation__T = typing.TypeVar('_FieldRotation__T', bound=org.hipparchus.CalculusFieldElement) # <T> class FieldRotation(java.io.Serializable, typing.Generic[_FieldRotation__T]): + """ + public classFieldRotation<T extends :class:`~org.hipparchus.geometry.euclidean.threed.https:.www.hipparchus.org.hipparchus`<T>> extends :class:`~org.hipparchus.geometry.euclidean.threed.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.geometry.euclidean.threed.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + This class is a re-implementation of :class:`~org.hipparchus.geometry.euclidean.threed.Rotation` using + :class:`~org.hipparchus.geometry.euclidean.threed.https:.www.hipparchus.org.hipparchus`. + + Instance of this class are guaranteed to be immutable. + + Also see: + + - :class:`~org.hipparchus.geometry.euclidean.threed.FieldVector3D` + - :class:`~org.hipparchus.geometry.euclidean.threed.RotationOrder` + - :meth:`~serialized` + """ @typing.overload def __init__(self, t: _FieldRotation__T, t2: _FieldRotation__T, t3: _FieldRotation__T, t4: _FieldRotation__T, boolean: bool): ... @typing.overload @@ -88,12 +217,78 @@ class FieldRotation(java.io.Serializable, typing.Generic[_FieldRotation__T]): def applyInverseTo(self, vector3D: 'Vector3D') -> 'FieldVector3D'[_FieldRotation__T]: ... @typing.overload @staticmethod - def applyInverseTo(rotation: 'Rotation', fieldRotation: 'FieldRotation'[_applyInverseTo_4__T]) -> 'FieldRotation'[_applyInverseTo_4__T]: ... + def applyInverseTo(rotation: 'Rotation', fieldRotation: 'FieldRotation'[_applyInverseTo_4__T]) -> 'FieldRotation'[_applyInverseTo_4__T]: + """ + Apply the inverse of a rotation to a vector. + + Parameters: + r (:class:`~org.hipparchus.geometry.euclidean.threed.Rotation`): rotation to apply + u (:class:`~org.hipparchus.geometry.euclidean.threed.FieldVector3D`<T> u): vector to apply the inverse of the rotation to + + Returns: + a new vector which such that u is its image by the rotation + + public :class:`~org.hipparchus.geometry.euclidean.threed.FieldRotation`<:class:`~org.hipparchus.geometry.euclidean.threed.FieldRotation`> applyInverseTo(:class:`~org.hipparchus.geometry.euclidean.threed.FieldRotation`<:class:`~org.hipparchus.geometry.euclidean.threed.FieldRotation`> r) + + Apply the inverse of the instance to another rotation. + + Calling this method is equivalent to call + :meth:`~org.hipparchus.geometry.euclidean.threed.FieldRotation.composeInverse`. + + Parameters: + r (:class:`~org.hipparchus.geometry.euclidean.threed.FieldRotation`<:class:`~org.hipparchus.geometry.euclidean.threed.FieldRotation`> r): rotation to apply the rotation to + + Returns: + a new rotation which is the composition of r by the inverse of the instance + + public :class:`~org.hipparchus.geometry.euclidean.threed.FieldRotation`<:class:`~org.hipparchus.geometry.euclidean.threed.FieldRotation`> applyInverseTo(:class:`~org.hipparchus.geometry.euclidean.threed.Rotation` r) + + Apply the inverse of the instance to another rotation. + + Calling this method is equivalent to call + :meth:`~org.hipparchus.geometry.euclidean.threed.FieldRotation.composeInverse`. + + Parameters: + r (:class:`~org.hipparchus.geometry.euclidean.threed.Rotation`): rotation to apply the rotation to + + Returns: + a new rotation which is the composition of r by the inverse of the instance + + Apply the inverse of a rotation to another rotation. Applying the inverse of a rotation to another rotation is computing + the composition in an order compliant with the following rule : let u be any vector and v its image by rInner (i.e. + rInner.applyTo(u) = v), let w be the inverse image of v by rOuter (i.e. rOuter.applyInverseTo(v) = w), then w = + comp.applyTo(u), where comp = applyInverseTo(rOuter, rInner). + + Parameters: + rOuter (:class:`~org.hipparchus.geometry.euclidean.threed.Rotation`): rotation to apply the rotation to + rInner (:class:`~org.hipparchus.geometry.euclidean.threed.FieldRotation`<T> rInner): rotation to apply the rotation to + + Returns: + a new rotation which is the composition of r by the inverse of the instance + + + """ + ... @typing.overload @staticmethod def applyInverseTo(rotation: 'Rotation', fieldVector3D: 'FieldVector3D'[_applyInverseTo_5__T]) -> 'FieldVector3D'[_applyInverseTo_5__T]: ... @typing.overload - def applyInverseTo(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], tArray: typing.Union[typing.List[_FieldRotation__T], jpype.JArray]) -> None: ... + def applyInverseTo(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], tArray: typing.Union[typing.List[_FieldRotation__T], jpype.JArray]) -> None: + """ + Apply the inverse of the rotation to a vector stored in an array. + + Parameters: + in (:class:`~org.hipparchus.geometry.euclidean.threed.FieldRotation`[]): an array with three items which stores vector to rotate + out (:class:`~org.hipparchus.geometry.euclidean.threed.FieldRotation`[]): an array with three items to put result to (it can be the same array as in) + + Apply the inverse of the rotation to a vector stored in an array. + + Parameters: + in (double[]): an array with three items which stores vector to rotate + out (:class:`~org.hipparchus.geometry.euclidean.threed.FieldRotation`[]): an array with three items to put result to + + """ + ... @typing.overload def applyInverseTo(self, tArray: typing.Union[typing.List[_FieldRotation__T], jpype.JArray], tArray2: typing.Union[typing.List[_FieldRotation__T], jpype.JArray]) -> None: ... _applyTo_4__T = typing.TypeVar('_applyTo_4__T', bound=org.hipparchus.CalculusFieldElement) # <T> @@ -108,12 +303,75 @@ class FieldRotation(java.io.Serializable, typing.Generic[_FieldRotation__T]): def applyTo(self, vector3D: 'Vector3D') -> 'FieldVector3D'[_FieldRotation__T]: ... @typing.overload @staticmethod - def applyTo(rotation: 'Rotation', fieldRotation: 'FieldRotation'[_applyTo_4__T]) -> 'FieldRotation'[_applyTo_4__T]: ... + def applyTo(rotation: 'Rotation', fieldRotation: 'FieldRotation'[_applyTo_4__T]) -> 'FieldRotation'[_applyTo_4__T]: + """ + Apply a rotation to a vector. + + Parameters: + r (:class:`~org.hipparchus.geometry.euclidean.threed.Rotation`): rotation to apply + u (:class:`~org.hipparchus.geometry.euclidean.threed.FieldVector3D`<T> u): vector to apply the rotation to + + Returns: + a new vector which is the image of u by the rotation + + public :class:`~org.hipparchus.geometry.euclidean.threed.FieldRotation`<:class:`~org.hipparchus.geometry.euclidean.threed.FieldRotation`> applyTo(:class:`~org.hipparchus.geometry.euclidean.threed.FieldRotation`<:class:`~org.hipparchus.geometry.euclidean.threed.FieldRotation`> r) + + Apply the instance to another rotation. + + Calling this method is equivalent to call :meth:`~org.hipparchus.geometry.euclidean.threed.FieldRotation.compose`. + + Parameters: + r (:class:`~org.hipparchus.geometry.euclidean.threed.FieldRotation`<:class:`~org.hipparchus.geometry.euclidean.threed.FieldRotation`> r): rotation to apply the rotation to + + Returns: + a new rotation which is the composition of r by the instance + + public :class:`~org.hipparchus.geometry.euclidean.threed.FieldRotation`<:class:`~org.hipparchus.geometry.euclidean.threed.FieldRotation`> applyTo(:class:`~org.hipparchus.geometry.euclidean.threed.Rotation` r) + + Apply the instance to another rotation. + + Calling this method is equivalent to call :meth:`~org.hipparchus.geometry.euclidean.threed.FieldRotation.compose`. + + Parameters: + r (:class:`~org.hipparchus.geometry.euclidean.threed.Rotation`): rotation to apply the rotation to + + Returns: + a new rotation which is the composition of r by the instance + + Apply a rotation to another rotation. Applying a rotation to another rotation is computing the composition in an order + compliant with the following rule : let u be any vector and v its image by rInner (i.e. rInner.applyTo(u) = v), let w be + the image of v by rOuter (i.e. rOuter.applyTo(v) = w), then w = comp.applyTo(u), where comp = applyTo(rOuter, rInner). + + Parameters: + r1 (:class:`~org.hipparchus.geometry.euclidean.threed.Rotation`): rotation to apply + rInner (:class:`~org.hipparchus.geometry.euclidean.threed.FieldRotation`<T> rInner): rotation to apply the rotation to + + Returns: + a new rotation which is the composition of r by the instance + + + """ + ... @typing.overload @staticmethod def applyTo(rotation: 'Rotation', fieldVector3D: 'FieldVector3D'[_applyTo_5__T]) -> 'FieldVector3D'[_applyTo_5__T]: ... @typing.overload - def applyTo(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], tArray: typing.Union[typing.List[_FieldRotation__T], jpype.JArray]) -> None: ... + def applyTo(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], tArray: typing.Union[typing.List[_FieldRotation__T], jpype.JArray]) -> None: + """ + Apply the rotation to a vector stored in an array. + + Parameters: + in (:class:`~org.hipparchus.geometry.euclidean.threed.FieldRotation`[]): an array with three items which stores vector to rotate + out (:class:`~org.hipparchus.geometry.euclidean.threed.FieldRotation`[]): an array with three items to put result to (it can be the same array as in) + + Apply the rotation to a vector stored in an array. + + Parameters: + in (double[]): an array with three items which stores vector to rotate + out (:class:`~org.hipparchus.geometry.euclidean.threed.FieldRotation`[]): an array with three items to put result to + + """ + ... @typing.overload def applyTo(self, tArray: typing.Union[typing.List[_FieldRotation__T], jpype.JArray], tArray2: typing.Union[typing.List[_FieldRotation__T], jpype.JArray]) -> None: ... @typing.overload @@ -126,23 +384,173 @@ class FieldRotation(java.io.Serializable, typing.Generic[_FieldRotation__T]): def composeInverse(self, rotation: 'Rotation', rotationConvention: 'RotationConvention') -> 'FieldRotation'[_FieldRotation__T]: ... _distance__T = typing.TypeVar('_distance__T', bound=org.hipparchus.CalculusFieldElement) # <T> @staticmethod - def distance(fieldRotation: 'FieldRotation'[_distance__T], fieldRotation2: 'FieldRotation'[_distance__T]) -> _distance__T: ... - def getAngle(self) -> _FieldRotation__T: ... - def getAngles(self, rotationOrder: 'RotationOrder', rotationConvention: 'RotationConvention') -> typing.MutableSequence[_FieldRotation__T]: ... + def distance(fieldRotation: 'FieldRotation'[_distance__T], fieldRotation2: 'FieldRotation'[_distance__T]) -> _distance__T: + """ + Compute the *distance* between two rotations. + + The *distance* is intended here as a way to check if two rotations are almost similar (i.e. they transform vectors the + same way) or very different. It is mathematically defined as the angle of the rotation r that prepended to one of the + rotations gives the other one: \(r_1(r) = r_2\) + + This distance is an angle between 0 and Ï€. Its value is the smallest possible upper bound of the angle in radians + between r :sub:`1` (v) and r :sub:`2` (v) for all possible vectors v. This upper bound is reached for some v. The + distance is equal to 0 if and only if the two rotations are identical. + + Comparing two rotations should always be done using this value rather than for example comparing the components of the + quaternions. It is much more stable, and has a geometric meaning. Also comparing quaternions components is error prone + since for example quaternions (0.36, 0.48, -0.48, -0.64) and (-0.36, -0.48, 0.48, 0.64) represent exactly the same + rotation despite their components are different (they are exact opposites). + + Parameters: + r1 (:class:`~org.hipparchus.geometry.euclidean.threed.FieldRotation`<T> r1): first rotation + r2 (:class:`~org.hipparchus.geometry.euclidean.threed.FieldRotation`<T> r2): second rotation + + Returns: + *distance* between r1 and r2 + + + """ + ... + def getAngle(self) -> _FieldRotation__T: + """ + Get the angle of the rotation. + + Returns: + angle of the rotation (between 0 and Ï€) + + Also see: + + - :meth:`~org.hipparchus.geometry.euclidean.threed.FieldRotation.%3Cinit%3E` + + + + """ + ... + def getAngles(self, rotationOrder: 'RotationOrder', rotationConvention: 'RotationConvention') -> typing.MutableSequence[_FieldRotation__T]: + """ + Get the Cardan or Euler angles corresponding to the instance. + + The equations show that each rotation can be defined by two different values of the Cardan or Euler angles set. For + example if Cardan angles are used, the rotation defined by the angles a :sub:`1` , a :sub:`2` and a :sub:`3` is the same + as the rotation defined by the angles Ï€ + a :sub:`1` , Ï€ - a :sub:`2` and Ï€ + a :sub:`3` . This method implements the + following arbitrary choices: + + - for Cardan angles, the chosen set is the one for which the second angle is between -Ï€/2 and Ï€/2 (i.e its cosine is + positive), + - for Euler angles, the chosen set is the one for which the second angle is between 0 and Ï€ (i.e its sine is positive). + + + Cardan and Euler angle have a very disappointing drawback: all of them have singularities. This means that if the + instance is too close to the singularities corresponding to the given rotation order, it will be impossible to retrieve + the angles. For Cardan angles, this is often called gimbal lock. There is *nothing* to do to prevent this, it is an + intrinsic problem with Cardan and Euler representation (but not a problem with the rotation itself, which is perfectly + well defined). For Cardan angles, singularities occur when the second angle is close to -Ï€/2 or +Ï€/2, for Euler angle + singularities occur when the second angle is close to 0 or Ï€, this implies that the identity rotation is always + singular for Euler angles! + + Parameters: + order (:class:`~org.hipparchus.geometry.euclidean.threed.RotationOrder`): rotation order to use + convention (:class:`~org.hipparchus.geometry.euclidean.threed.RotationConvention`): convention to use for the semantics of the angle + + Returns: + an array of three angles, in the order specified by the set + + + """ + ... def getAxis(self, rotationConvention: 'RotationConvention') -> 'FieldVector3D'[_FieldRotation__T]: ... _getIdentity__T = typing.TypeVar('_getIdentity__T', bound=org.hipparchus.CalculusFieldElement) # <T> @staticmethod - def getIdentity(field: org.hipparchus.Field[_getIdentity__T]) -> 'FieldRotation'[_getIdentity__T]: ... - def getMatrix(self) -> typing.MutableSequence[typing.MutableSequence[_FieldRotation__T]]: ... - def getQ0(self) -> _FieldRotation__T: ... - def getQ1(self) -> _FieldRotation__T: ... - def getQ2(self) -> _FieldRotation__T: ... - def getQ3(self) -> _FieldRotation__T: ... + def getIdentity(field: org.hipparchus.Field[_getIdentity__T]) -> 'FieldRotation'[_getIdentity__T]: + """ + Get identity rotation. + + Parameters: + field (:class:`~org.hipparchus.geometry.euclidean.threed.https:.www.hipparchus.org.hipparchus`<T> field): field for the components + + Returns: + a new rotation + + + """ + ... + def getMatrix(self) -> typing.MutableSequence[typing.MutableSequence[_FieldRotation__T]]: + """ + Get the 3X3 matrix corresponding to the instance + + Returns: + the matrix corresponding to the instance + + + """ + ... + def getQ0(self) -> _FieldRotation__T: + """ + Get the scalar coordinate of the quaternion. + + Returns: + scalar coordinate of the quaternion + + + """ + ... + def getQ1(self) -> _FieldRotation__T: + """ + Get the first coordinate of the vectorial part of the quaternion. + + Returns: + first coordinate of the vectorial part of the quaternion + + + """ + ... + def getQ2(self) -> _FieldRotation__T: + """ + Get the second coordinate of the vectorial part of the quaternion. + + Returns: + second coordinate of the vectorial part of the quaternion + + + """ + ... + def getQ3(self) -> _FieldRotation__T: + """ + Get the third coordinate of the vectorial part of the quaternion. + + Returns: + third coordinate of the vectorial part of the quaternion + + + """ + ... def revert(self) -> 'FieldRotation'[_FieldRotation__T]: ... - def toRotation(self) -> 'Rotation': ... + def toRotation(self) -> 'Rotation': + """ + Convert to a constant vector without derivatives. + + Returns: + a constant vector + + + """ + ... _FieldVector3D__T = typing.TypeVar('_FieldVector3D__T', bound=org.hipparchus.CalculusFieldElement) # <T> class FieldVector3D(org.hipparchus.util.FieldBlendable['FieldVector3D'[_FieldVector3D__T], _FieldVector3D__T], java.io.Serializable, typing.Generic[_FieldVector3D__T]): + """ + public classFieldVector3D<T extends :class:`~org.hipparchus.geometry.euclidean.threed.https:.www.hipparchus.org.hipparchus`<T>> extends :class:`~org.hipparchus.geometry.euclidean.threed.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.geometry.euclidean.threed.https:.www.hipparchus.org.hipparchus`<:class:`~org.hipparchus.geometry.euclidean.threed.FieldVector3D`<T>,T>, :class:`~org.hipparchus.geometry.euclidean.threed.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + This class is a re-implementation of :class:`~org.hipparchus.geometry.euclidean.threed.Vector3D` using + :class:`~org.hipparchus.geometry.euclidean.threed.https:.www.hipparchus.org.hipparchus`. + + Instance of this class are guaranteed to be immutable. + + Also see: + + - :meth:`~serialized` + """ @typing.overload def __init__(self, double: float, fieldVector3D: 'FieldVector3D'[_FieldVector3D__T]): ... @typing.overload @@ -209,7 +617,38 @@ class FieldVector3D(org.hipparchus.util.FieldBlendable['FieldVector3D'[_FieldVec def crossProduct(self, vector3D: 'Vector3D') -> 'FieldVector3D'[_FieldVector3D__T]: ... @typing.overload @staticmethod - def crossProduct(fieldVector3D: 'FieldVector3D'[_crossProduct_2__T], fieldVector3D2: 'FieldVector3D'[_crossProduct_2__T]) -> 'FieldVector3D'[_crossProduct_2__T]: ... + def crossProduct(fieldVector3D: 'FieldVector3D'[_crossProduct_2__T], fieldVector3D2: 'FieldVector3D'[_crossProduct_2__T]) -> 'FieldVector3D'[_crossProduct_2__T]: + """ + Compute the cross-product of two vectors. + + Parameters: + v1 (:class:`~org.hipparchus.geometry.euclidean.threed.FieldVector3D`<T> v1): first vector + v2 (:class:`~org.hipparchus.geometry.euclidean.threed.FieldVector3D`<T> v2): second vector + + Returns: + the cross product v1 ^ v2 as a new Vector + + Compute the cross-product of two vectors. + + Parameters: + v1 (:class:`~org.hipparchus.geometry.euclidean.threed.FieldVector3D`<T> v1): first vector + v2 (:class:`~org.hipparchus.geometry.euclidean.threed.Vector3D`): second vector + + Returns: + the cross product v1 ^ v2 as a new Vector + + Compute the cross-product of two vectors. + + Parameters: + v1 (:class:`~org.hipparchus.geometry.euclidean.threed.Vector3D`): first vector + v2 (:class:`~org.hipparchus.geometry.euclidean.threed.FieldVector3D`<T> v2): second vector + + Returns: + the cross product v1 ^ v2 as a new Vector + + + """ + ... @typing.overload @staticmethod def crossProduct(fieldVector3D: 'FieldVector3D'[_crossProduct_3__T], vector3D: 'Vector3D') -> 'FieldVector3D'[_crossProduct_3__T]: ... @@ -220,12 +659,66 @@ class FieldVector3D(org.hipparchus.util.FieldBlendable['FieldVector3D'[_FieldVec _distance_3__T = typing.TypeVar('_distance_3__T', bound=org.hipparchus.CalculusFieldElement) # <T> _distance_4__T = typing.TypeVar('_distance_4__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload - def distance(self, fieldVector3D: 'FieldVector3D'[_FieldVector3D__T]) -> _FieldVector3D__T: ... + def distance(self, fieldVector3D: 'FieldVector3D'[_FieldVector3D__T]) -> _FieldVector3D__T: + """ + Compute the distance between the instance and another vector according to the L :sub:`2` norm. + + Calling this method is equivalent to calling: :code:`q.subtract(p).getNorm()` except that no intermediate vector is + built + + Parameters: + v (:class:`~org.hipparchus.geometry.euclidean.threed.Vector3D`): second vector + + Returns: + the distance between the instance and p according to the L :sub:`2` norm + + """ + ... @typing.overload def distance(self, vector3D: 'Vector3D') -> _FieldVector3D__T: ... @typing.overload @staticmethod - def distance(fieldVector3D: 'FieldVector3D'[_distance_2__T], fieldVector3D2: 'FieldVector3D'[_distance_2__T]) -> _distance_2__T: ... + def distance(fieldVector3D: 'FieldVector3D'[_distance_2__T], fieldVector3D2: 'FieldVector3D'[_distance_2__T]) -> _distance_2__T: + """ + Compute the distance between two vectors according to the L :sub:`2` norm. + + Calling this method is equivalent to calling: :code:`v1.subtract(v2).getNorm()` except that no intermediate vector is + built + + Parameters: + v1 (:class:`~org.hipparchus.geometry.euclidean.threed.FieldVector3D`<T> v1): first vector + v2 (:class:`~org.hipparchus.geometry.euclidean.threed.FieldVector3D`<T> v2): second vector + + Returns: + the distance between v1 and v2 according to the L :sub:`2` norm + + Compute the distance between two vectors according to the L :sub:`2` norm. + + Calling this method is equivalent to calling: :code:`v1.subtract(v2).getNorm()` except that no intermediate vector is + built + + Parameters: + v1 (:class:`~org.hipparchus.geometry.euclidean.threed.FieldVector3D`<T> v1): first vector + v2 (:class:`~org.hipparchus.geometry.euclidean.threed.Vector3D`): second vector + + Returns: + the distance between v1 and v2 according to the L :sub:`2` norm + + Compute the distance between two vectors according to the L :sub:`2` norm. + + Calling this method is equivalent to calling: :code:`v1.subtract(v2).getNorm()` except that no intermediate vector is + built + + Parameters: + v1 (:class:`~org.hipparchus.geometry.euclidean.threed.Vector3D`): first vector + v2 (:class:`~org.hipparchus.geometry.euclidean.threed.FieldVector3D`<T> v2): second vector + + Returns: + the distance between v1 and v2 according to the L :sub:`2` norm + + + """ + ... @typing.overload @staticmethod def distance(fieldVector3D: 'FieldVector3D'[_distance_3__T], vector3D: 'Vector3D') -> _distance_3__T: ... @@ -236,12 +729,66 @@ class FieldVector3D(org.hipparchus.util.FieldBlendable['FieldVector3D'[_FieldVec _distance1_3__T = typing.TypeVar('_distance1_3__T', bound=org.hipparchus.CalculusFieldElement) # <T> _distance1_4__T = typing.TypeVar('_distance1_4__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload - def distance1(self, fieldVector3D: 'FieldVector3D'[_FieldVector3D__T]) -> _FieldVector3D__T: ... + def distance1(self, fieldVector3D: 'FieldVector3D'[_FieldVector3D__T]) -> _FieldVector3D__T: + """ + Compute the distance between the instance and another vector according to the L :sub:`1` norm. + + Calling this method is equivalent to calling: :code:`q.subtract(p).getNorm1()` except that no intermediate vector is + built + + Parameters: + v (:class:`~org.hipparchus.geometry.euclidean.threed.Vector3D`): second vector + + Returns: + the distance between the instance and p according to the L :sub:`1` norm + + """ + ... @typing.overload def distance1(self, vector3D: 'Vector3D') -> _FieldVector3D__T: ... @typing.overload @staticmethod - def distance1(fieldVector3D: 'FieldVector3D'[_distance1_2__T], fieldVector3D2: 'FieldVector3D'[_distance1_2__T]) -> _distance1_2__T: ... + def distance1(fieldVector3D: 'FieldVector3D'[_distance1_2__T], fieldVector3D2: 'FieldVector3D'[_distance1_2__T]) -> _distance1_2__T: + """ + Compute the distance between two vectors according to the L :sub:`1` norm. + + Calling this method is equivalent to calling: :code:`v1.subtract(v2).getNorm1()` except that no intermediate vector is + built + + Parameters: + v1 (:class:`~org.hipparchus.geometry.euclidean.threed.FieldVector3D`<T> v1): first vector + v2 (:class:`~org.hipparchus.geometry.euclidean.threed.FieldVector3D`<T> v2): second vector + + Returns: + the distance between v1 and v2 according to the L :sub:`1` norm + + Compute the distance between two vectors according to the L :sub:`1` norm. + + Calling this method is equivalent to calling: :code:`v1.subtract(v2).getNorm1()` except that no intermediate vector is + built + + Parameters: + v1 (:class:`~org.hipparchus.geometry.euclidean.threed.FieldVector3D`<T> v1): first vector + v2 (:class:`~org.hipparchus.geometry.euclidean.threed.Vector3D`): second vector + + Returns: + the distance between v1 and v2 according to the L :sub:`1` norm + + Compute the distance between two vectors according to the L :sub:`1` norm. + + Calling this method is equivalent to calling: :code:`v1.subtract(v2).getNorm1()` except that no intermediate vector is + built + + Parameters: + v1 (:class:`~org.hipparchus.geometry.euclidean.threed.Vector3D`): first vector + v2 (:class:`~org.hipparchus.geometry.euclidean.threed.FieldVector3D`<T> v2): second vector + + Returns: + the distance between v1 and v2 according to the L :sub:`1` norm + + + """ + ... @typing.overload @staticmethod def distance1(fieldVector3D: 'FieldVector3D'[_distance1_3__T], vector3D: 'Vector3D') -> _distance1_3__T: ... @@ -252,12 +799,66 @@ class FieldVector3D(org.hipparchus.util.FieldBlendable['FieldVector3D'[_FieldVec _distanceInf_3__T = typing.TypeVar('_distanceInf_3__T', bound=org.hipparchus.CalculusFieldElement) # <T> _distanceInf_4__T = typing.TypeVar('_distanceInf_4__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload - def distanceInf(self, fieldVector3D: 'FieldVector3D'[_FieldVector3D__T]) -> _FieldVector3D__T: ... + def distanceInf(self, fieldVector3D: 'FieldVector3D'[_FieldVector3D__T]) -> _FieldVector3D__T: + """ + Compute the distance between the instance and another vector according to the L :sub:`∞` norm. + + Calling this method is equivalent to calling: :code:`q.subtract(p).getNormInf()` except that no intermediate vector is + built + + Parameters: + v (:class:`~org.hipparchus.geometry.euclidean.threed.Vector3D`): second vector + + Returns: + the distance between the instance and p according to the L :sub:`∞` norm + + """ + ... @typing.overload def distanceInf(self, vector3D: 'Vector3D') -> _FieldVector3D__T: ... @typing.overload @staticmethod - def distanceInf(fieldVector3D: 'FieldVector3D'[_distanceInf_2__T], fieldVector3D2: 'FieldVector3D'[_distanceInf_2__T]) -> _distanceInf_2__T: ... + def distanceInf(fieldVector3D: 'FieldVector3D'[_distanceInf_2__T], fieldVector3D2: 'FieldVector3D'[_distanceInf_2__T]) -> _distanceInf_2__T: + """ + Compute the distance between two vectors according to the L :sub:`∞` norm. + + Calling this method is equivalent to calling: :code:`v1.subtract(v2).getNormInf()` except that no intermediate vector is + built + + Parameters: + v1 (:class:`~org.hipparchus.geometry.euclidean.threed.FieldVector3D`<T> v1): first vector + v2 (:class:`~org.hipparchus.geometry.euclidean.threed.FieldVector3D`<T> v2): second vector + + Returns: + the distance between v1 and v2 according to the L :sub:`∞` norm + + Compute the distance between two vectors according to the L :sub:`∞` norm. + + Calling this method is equivalent to calling: :code:`v1.subtract(v2).getNormInf()` except that no intermediate vector is + built + + Parameters: + v1 (:class:`~org.hipparchus.geometry.euclidean.threed.FieldVector3D`<T> v1): first vector + v2 (:class:`~org.hipparchus.geometry.euclidean.threed.Vector3D`): second vector + + Returns: + the distance between v1 and v2 according to the L :sub:`∞` norm + + Compute the distance between two vectors according to the L :sub:`∞` norm. + + Calling this method is equivalent to calling: :code:`v1.subtract(v2).getNormInf()` except that no intermediate vector is + built + + Parameters: + v1 (:class:`~org.hipparchus.geometry.euclidean.threed.Vector3D`): first vector + v2 (:class:`~org.hipparchus.geometry.euclidean.threed.FieldVector3D`<T> v2): second vector + + Returns: + the distance between v1 and v2 according to the L :sub:`∞` norm + + + """ + ... @typing.overload @staticmethod def distanceInf(fieldVector3D: 'FieldVector3D'[_distanceInf_3__T], vector3D: 'Vector3D') -> _distanceInf_3__T: ... @@ -268,12 +869,66 @@ class FieldVector3D(org.hipparchus.util.FieldBlendable['FieldVector3D'[_FieldVec _distanceSq_3__T = typing.TypeVar('_distanceSq_3__T', bound=org.hipparchus.CalculusFieldElement) # <T> _distanceSq_4__T = typing.TypeVar('_distanceSq_4__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload - def distanceSq(self, fieldVector3D: 'FieldVector3D'[_FieldVector3D__T]) -> _FieldVector3D__T: ... + def distanceSq(self, fieldVector3D: 'FieldVector3D'[_FieldVector3D__T]) -> _FieldVector3D__T: + """ + Compute the square of the distance between the instance and another vector. + + Calling this method is equivalent to calling: :code:`q.subtract(p).getNormSq()` except that no intermediate vector is + built + + Parameters: + v (:class:`~org.hipparchus.geometry.euclidean.threed.Vector3D`): second vector + + Returns: + the square of the distance between the instance and p + + """ + ... @typing.overload def distanceSq(self, vector3D: 'Vector3D') -> _FieldVector3D__T: ... @typing.overload @staticmethod - def distanceSq(fieldVector3D: 'FieldVector3D'[_distanceSq_2__T], fieldVector3D2: 'FieldVector3D'[_distanceSq_2__T]) -> _distanceSq_2__T: ... + def distanceSq(fieldVector3D: 'FieldVector3D'[_distanceSq_2__T], fieldVector3D2: 'FieldVector3D'[_distanceSq_2__T]) -> _distanceSq_2__T: + """ + Compute the square of the distance between two vectors. + + Calling this method is equivalent to calling: :code:`v1.subtract(v2).getNormSq()` except that no intermediate vector is + built + + Parameters: + v1 (:class:`~org.hipparchus.geometry.euclidean.threed.FieldVector3D`<T> v1): first vector + v2 (:class:`~org.hipparchus.geometry.euclidean.threed.FieldVector3D`<T> v2): second vector + + Returns: + the square of the distance between v1 and v2 + + Compute the square of the distance between two vectors. + + Calling this method is equivalent to calling: :code:`v1.subtract(v2).getNormSq()` except that no intermediate vector is + built + + Parameters: + v1 (:class:`~org.hipparchus.geometry.euclidean.threed.FieldVector3D`<T> v1): first vector + v2 (:class:`~org.hipparchus.geometry.euclidean.threed.Vector3D`): second vector + + Returns: + the square of the distance between v1 and v2 + + Compute the square of the distance between two vectors. + + Calling this method is equivalent to calling: :code:`v1.subtract(v2).getNormSq()` except that no intermediate vector is + built + + Parameters: + v1 (:class:`~org.hipparchus.geometry.euclidean.threed.Vector3D`): first vector + v2 (:class:`~org.hipparchus.geometry.euclidean.threed.FieldVector3D`<T> v2): second vector + + Returns: + the square of the distance between v1 and v2 + + + """ + ... @typing.overload @staticmethod def distanceSq(fieldVector3D: 'FieldVector3D'[_distanceSq_3__T], vector3D: 'Vector3D') -> _distanceSq_3__T: ... @@ -284,61 +939,394 @@ class FieldVector3D(org.hipparchus.util.FieldBlendable['FieldVector3D'[_FieldVec _dotProduct_3__T = typing.TypeVar('_dotProduct_3__T', bound=org.hipparchus.CalculusFieldElement) # <T> _dotProduct_4__T = typing.TypeVar('_dotProduct_4__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload - def dotProduct(self, fieldVector3D: 'FieldVector3D'[_FieldVector3D__T]) -> _FieldVector3D__T: ... + def dotProduct(self, fieldVector3D: 'FieldVector3D'[_FieldVector3D__T]) -> _FieldVector3D__T: + """ + Compute the dot-product of the instance and another vector. + + The implementation uses specific multiplication and addition algorithms to preserve accuracy and reduce cancellation + effects. It should be very accurate even for nearly orthogonal vectors. + + Parameters: + v (:class:`~org.hipparchus.geometry.euclidean.threed.Vector3D`): second vector + + Returns: + the dot product this.v + + Also see: + + - :meth:`~org.hipparchus.geometry.euclidean.threed.https:.www.hipparchus.org.hipparchus` + + + """ + ... @typing.overload def dotProduct(self, vector3D: 'Vector3D') -> _FieldVector3D__T: ... @typing.overload @staticmethod - def dotProduct(fieldVector3D: 'FieldVector3D'[_dotProduct_2__T], fieldVector3D2: 'FieldVector3D'[_dotProduct_2__T]) -> _dotProduct_2__T: ... + def dotProduct(fieldVector3D: 'FieldVector3D'[_dotProduct_2__T], fieldVector3D2: 'FieldVector3D'[_dotProduct_2__T]) -> _dotProduct_2__T: + """ + Compute the dot-product of two vectors. + + Parameters: + v1 (:class:`~org.hipparchus.geometry.euclidean.threed.FieldVector3D`<T> v1): first vector + v2 (:class:`~org.hipparchus.geometry.euclidean.threed.FieldVector3D`<T> v2): second vector + + Returns: + the dot product v1.v2 + + Compute the dot-product of two vectors. + + Parameters: + v1 (:class:`~org.hipparchus.geometry.euclidean.threed.FieldVector3D`<T> v1): first vector + v2 (:class:`~org.hipparchus.geometry.euclidean.threed.Vector3D`): second vector + + Returns: + the dot product v1.v2 + + Compute the dot-product of two vectors. + + Parameters: + v1 (:class:`~org.hipparchus.geometry.euclidean.threed.Vector3D`): first vector + v2 (:class:`~org.hipparchus.geometry.euclidean.threed.FieldVector3D`<T> v2): second vector + + Returns: + the dot product v1.v2 + + + """ + ... @typing.overload @staticmethod def dotProduct(fieldVector3D: 'FieldVector3D'[_dotProduct_3__T], vector3D: 'Vector3D') -> _dotProduct_3__T: ... @typing.overload @staticmethod def dotProduct(vector3D: 'Vector3D', fieldVector3D: 'FieldVector3D'[_dotProduct_4__T]) -> _dotProduct_4__T: ... - def equals(self, object: typing.Any) -> bool: ... - def getAlpha(self) -> _FieldVector3D__T: ... - def getDelta(self) -> _FieldVector3D__T: ... + def equals(self, object: typing.Any) -> bool: + """ + Test for the equality of two 3D vectors. + + If all coordinates of two 3D vectors are exactly the same, and none of their + :meth:`~org.hipparchus.geometry.euclidean.threed.https:.www.hipparchus.org.hipparchus` are :code:`NaN`, the two 3D + vectors are considered to be equal. + + :code:`NaN` coordinates are considered to affect globally the vector and be equals to each other - i.e, if either (or + all) real part of the coordinates of the 3D vector are :code:`NaN`, the 3D vector is :code:`NaN`. + + Overrides: + :meth:`~org.hipparchus.geometry.euclidean.threed.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.equals` in + class :class:`~org.hipparchus.geometry.euclidean.threed.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Parameters: + other (:class:`~org.hipparchus.geometry.euclidean.threed.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object`): Object to test for equality to this + + Returns: + true if two 3D vector objects are equal, false if object is null, not an instance of FieldVector3D, or not equal to this + FieldVector3D instance + + + """ + ... + def getAlpha(self) -> _FieldVector3D__T: + """ + Get the azimuth of the vector. + + Returns: + azimuth (α) of the vector, between -Ï€ and +Ï€ + + Also see: + + - :meth:`~org.hipparchus.geometry.euclidean.threed.FieldVector3D.%3Cinit%3E` + + + + """ + ... + def getDelta(self) -> _FieldVector3D__T: + """ + Get the elevation of the vector. + + Returns: + elevation (δ) of the vector, between -Ï€/2 and +Ï€/2 + + Also see: + + - :meth:`~org.hipparchus.geometry.euclidean.threed.FieldVector3D.%3Cinit%3E` + + + + """ + ... _getMinusI__T = typing.TypeVar('_getMinusI__T', bound=org.hipparchus.CalculusFieldElement) # <T> @staticmethod - def getMinusI(field: org.hipparchus.Field[_getMinusI__T]) -> 'FieldVector3D'[_getMinusI__T]: ... + def getMinusI(field: org.hipparchus.Field[_getMinusI__T]) -> 'FieldVector3D'[_getMinusI__T]: + """ + Get opposite of the first canonical vector (coordinates: -1, 0, 0). + + Parameters: + field (:class:`~org.hipparchus.geometry.euclidean.threed.https:.www.hipparchus.org.hipparchus`<T> field): field for the components + + Returns: + a new vector + + + """ + ... _getMinusJ__T = typing.TypeVar('_getMinusJ__T', bound=org.hipparchus.CalculusFieldElement) # <T> @staticmethod - def getMinusJ(field: org.hipparchus.Field[_getMinusJ__T]) -> 'FieldVector3D'[_getMinusJ__T]: ... + def getMinusJ(field: org.hipparchus.Field[_getMinusJ__T]) -> 'FieldVector3D'[_getMinusJ__T]: + """ + Get opposite of the second canonical vector (coordinates: 0, -1, 0). + + Parameters: + field (:class:`~org.hipparchus.geometry.euclidean.threed.https:.www.hipparchus.org.hipparchus`<T> field): field for the components + + Returns: + a new vector + + + """ + ... _getMinusK__T = typing.TypeVar('_getMinusK__T', bound=org.hipparchus.CalculusFieldElement) # <T> @staticmethod - def getMinusK(field: org.hipparchus.Field[_getMinusK__T]) -> 'FieldVector3D'[_getMinusK__T]: ... + def getMinusK(field: org.hipparchus.Field[_getMinusK__T]) -> 'FieldVector3D'[_getMinusK__T]: + """ + Get opposite of the third canonical vector (coordinates: 0, 0, -1). + + Parameters: + field (:class:`~org.hipparchus.geometry.euclidean.threed.https:.www.hipparchus.org.hipparchus`<T> field): field for the components + + Returns: + a new vector + + + """ + ... _getNaN__T = typing.TypeVar('_getNaN__T', bound=org.hipparchus.CalculusFieldElement) # <T> @staticmethod - def getNaN(field: org.hipparchus.Field[_getNaN__T]) -> 'FieldVector3D'[_getNaN__T]: ... + def getNaN(field: org.hipparchus.Field[_getNaN__T]) -> 'FieldVector3D'[_getNaN__T]: + """ + Get a vector with all coordinates set to NaN. + + Parameters: + field (:class:`~org.hipparchus.geometry.euclidean.threed.https:.www.hipparchus.org.hipparchus`<T> field): field for the components + + Returns: + a new vector + + + """ + ... _getNegativeInfinity__T = typing.TypeVar('_getNegativeInfinity__T', bound=org.hipparchus.CalculusFieldElement) # <T> @staticmethod - def getNegativeInfinity(field: org.hipparchus.Field[_getNegativeInfinity__T]) -> 'FieldVector3D'[_getNegativeInfinity__T]: ... - def getNorm(self) -> _FieldVector3D__T: ... - def getNorm1(self) -> _FieldVector3D__T: ... - def getNormInf(self) -> _FieldVector3D__T: ... - def getNormSq(self) -> _FieldVector3D__T: ... + def getNegativeInfinity(field: org.hipparchus.Field[_getNegativeInfinity__T]) -> 'FieldVector3D'[_getNegativeInfinity__T]: + """ + Get a vector with all coordinates set to negative infinity. + + Parameters: + field (:class:`~org.hipparchus.geometry.euclidean.threed.https:.www.hipparchus.org.hipparchus`<T> field): field for the components + + Returns: + a new vector + + + """ + ... + def getNorm(self) -> _FieldVector3D__T: + """ + Get the L :sub:`2` norm for the vector. + + Returns: + Euclidean norm for the vector + + + """ + ... + def getNorm1(self) -> _FieldVector3D__T: + """ + Get the L :sub:`1` norm for the vector. + + Returns: + L :sub:`1` norm for the vector + + + """ + ... + def getNormInf(self) -> _FieldVector3D__T: + """ + Get the L :sub:`∞` norm for the vector. + + Returns: + L :sub:`∞` norm for the vector + + + """ + ... + def getNormSq(self) -> _FieldVector3D__T: + """ + Get the square of the norm for the vector. + + Returns: + square of the Euclidean norm for the vector + + + """ + ... _getPlusI__T = typing.TypeVar('_getPlusI__T', bound=org.hipparchus.CalculusFieldElement) # <T> @staticmethod - def getPlusI(field: org.hipparchus.Field[_getPlusI__T]) -> 'FieldVector3D'[_getPlusI__T]: ... + def getPlusI(field: org.hipparchus.Field[_getPlusI__T]) -> 'FieldVector3D'[_getPlusI__T]: + """ + Get first canonical vector (coordinates: 1, 0, 0). + + Parameters: + field (:class:`~org.hipparchus.geometry.euclidean.threed.https:.www.hipparchus.org.hipparchus`<T> field): field for the components + + Returns: + a new vector + + + """ + ... _getPlusJ__T = typing.TypeVar('_getPlusJ__T', bound=org.hipparchus.CalculusFieldElement) # <T> @staticmethod - def getPlusJ(field: org.hipparchus.Field[_getPlusJ__T]) -> 'FieldVector3D'[_getPlusJ__T]: ... + def getPlusJ(field: org.hipparchus.Field[_getPlusJ__T]) -> 'FieldVector3D'[_getPlusJ__T]: + """ + Get second canonical vector (coordinates: 0, 1, 0). + + Parameters: + field (:class:`~org.hipparchus.geometry.euclidean.threed.https:.www.hipparchus.org.hipparchus`<T> field): field for the components + + Returns: + a new vector + + + """ + ... _getPlusK__T = typing.TypeVar('_getPlusK__T', bound=org.hipparchus.CalculusFieldElement) # <T> @staticmethod - def getPlusK(field: org.hipparchus.Field[_getPlusK__T]) -> 'FieldVector3D'[_getPlusK__T]: ... + def getPlusK(field: org.hipparchus.Field[_getPlusK__T]) -> 'FieldVector3D'[_getPlusK__T]: + """ + Get third canonical vector (coordinates: 0, 0, 1). + + Parameters: + field (:class:`~org.hipparchus.geometry.euclidean.threed.https:.www.hipparchus.org.hipparchus`<T> field): field for the components + + Returns: + a new vector + + + """ + ... _getPositiveInfinity__T = typing.TypeVar('_getPositiveInfinity__T', bound=org.hipparchus.CalculusFieldElement) # <T> @staticmethod - def getPositiveInfinity(field: org.hipparchus.Field[_getPositiveInfinity__T]) -> 'FieldVector3D'[_getPositiveInfinity__T]: ... - def getX(self) -> _FieldVector3D__T: ... - def getY(self) -> _FieldVector3D__T: ... - def getZ(self) -> _FieldVector3D__T: ... + def getPositiveInfinity(field: org.hipparchus.Field[_getPositiveInfinity__T]) -> 'FieldVector3D'[_getPositiveInfinity__T]: + """ + Get a vector with all coordinates set to positive infinity. + + Parameters: + field (:class:`~org.hipparchus.geometry.euclidean.threed.https:.www.hipparchus.org.hipparchus`<T> field): field for the components + + Returns: + a new vector + + + """ + ... + def getX(self) -> _FieldVector3D__T: + """ + Get the abscissa of the vector. + + Returns: + abscissa of the vector + + Also see: + + - :meth:`~org.hipparchus.geometry.euclidean.threed.FieldVector3D.%3Cinit%3E` + + + + """ + ... + def getY(self) -> _FieldVector3D__T: + """ + Get the ordinate of the vector. + + Returns: + ordinate of the vector + + Also see: + + - :meth:`~org.hipparchus.geometry.euclidean.threed.FieldVector3D.%3Cinit%3E` + + + + """ + ... + def getZ(self) -> _FieldVector3D__T: + """ + Get the height of the vector. + + Returns: + height of the vector + + Also see: + + - :meth:`~org.hipparchus.geometry.euclidean.threed.FieldVector3D.%3Cinit%3E` + + + + """ + ... _getZero__T = typing.TypeVar('_getZero__T', bound=org.hipparchus.CalculusFieldElement) # <T> @staticmethod - def getZero(field: org.hipparchus.Field[_getZero__T]) -> 'FieldVector3D'[_getZero__T]: ... - def hashCode(self) -> int: ... - def isInfinite(self) -> bool: ... - def isNaN(self) -> bool: ... + def getZero(field: org.hipparchus.Field[_getZero__T]) -> 'FieldVector3D'[_getZero__T]: + """ + Get null vector (coordinates: 0, 0, 0). + + Parameters: + field (:class:`~org.hipparchus.geometry.euclidean.threed.https:.www.hipparchus.org.hipparchus`<T> field): field for the components + + Returns: + a new vector + + + """ + ... + def hashCode(self) -> int: + """ + Get a hashCode for the 3D vector. + + All NaN values have the same hash code. + + Overrides: + :meth:`~org.hipparchus.geometry.euclidean.threed.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.hashCode` in + class :class:`~org.hipparchus.geometry.euclidean.threed.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Returns: + a hash code value for this object + + + """ + ... + def isInfinite(self) -> bool: + """ + Returns true if any coordinate of this vector is infinite and none are NaN; false otherwise + + Returns: + true if any coordinate of this vector is infinite and none are NaN; false otherwise + + + """ + ... + def isNaN(self) -> bool: + """ + Returns true if any coordinate of this vector is NaN; false otherwise + + Returns: + true if any coordinate of this vector is NaN; false otherwise + + + """ + ... def negate(self) -> 'FieldVector3D'[_FieldVector3D__T]: ... def normalize(self) -> 'FieldVector3D'[_FieldVector3D__T]: ... def orthogonal(self) -> 'FieldVector3D'[_FieldVector3D__T]: ... @@ -358,35 +1346,252 @@ class FieldVector3D(org.hipparchus.util.FieldBlendable['FieldVector3D'[_FieldVec def subtract(self, fieldVector3D: 'FieldVector3D'[_FieldVector3D__T]) -> 'FieldVector3D'[_FieldVector3D__T]: ... @typing.overload def subtract(self, vector3D: 'Vector3D') -> 'FieldVector3D'[_FieldVector3D__T]: ... - def toArray(self) -> typing.MutableSequence[_FieldVector3D__T]: ... - @typing.overload - def toString(self) -> str: ... - @typing.overload - def toString(self, numberFormat: java.text.NumberFormat) -> str: ... - def toVector3D(self) -> 'Vector3D': ... + def toArray(self) -> typing.MutableSequence[_FieldVector3D__T]: + """ + Get the vector coordinates as a dimension 3 array. + + Returns: + vector coordinates + + Also see: + + - :meth:`~org.hipparchus.geometry.euclidean.threed.FieldVector3D.%3Cinit%3E` + + + + """ + ... + @typing.overload + def toString(self) -> str: + """ + Get a string representation of this vector. + + Overrides: + :meth:`~org.hipparchus.geometry.euclidean.threed.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.toString` in + class :class:`~org.hipparchus.geometry.euclidean.threed.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Returns: + a string representation of this vector + + """ + ... + @typing.overload + def toString(self, numberFormat: java.text.NumberFormat) -> str: + """ + Get a string representation of this vector. + + Parameters: + format (:class:`~org.hipparchus.geometry.euclidean.threed.https:.docs.oracle.com.javase.8.docs.api.java.text.NumberFormat`): the custom format for components + + Returns: + a string representation of this vector + + + """ + ... + def toVector3D(self) -> 'Vector3D': + """ + Convert to a constant vector without extra field parts. + + Returns: + a constant vector + + + """ + ... class Line(org.hipparchus.geometry.partitioning.Embedding[Euclidean3D, org.hipparchus.geometry.euclidean.oned.Euclidean1D]): + """ + public classLine extends :class:`~org.hipparchus.geometry.euclidean.threed.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.geometry.partitioning.Embedding`<:class:`~org.hipparchus.geometry.euclidean.threed.Euclidean3D`,:class:`~org.hipparchus.geometry.euclidean.oned.Euclidean1D`> + + The class represent lines in a three dimensional space. + + Each oriented line is intrinsically associated with an abscissa which is a coordinate on the line. The point at abscissa + 0 is the orthogonal projection of the origin on the line, another equivalent way to express this is to say that it is + the point of the line which is closest to the origin. Abscissa increases in the line direction. + + Also see: + + - :meth:`~org.hipparchus.geometry.euclidean.threed.Line.fromDirection` + - :meth:`~org.hipparchus.geometry.euclidean.threed.Line.%3Cinit%3E` + """ @typing.overload def __init__(self, line: 'Line'): ... @typing.overload def __init__(self, vector3D: 'Vector3D', vector3D2: 'Vector3D', double: float): ... - def closestPoint(self, line: 'Line') -> 'Vector3D': ... - def contains(self, vector3D: 'Vector3D') -> bool: ... - @typing.overload - def distance(self, line: 'Line') -> float: ... + def closestPoint(self, line: 'Line') -> 'Vector3D': + """ + Compute the point of the instance closest to another line. + + Parameters: + line (:class:`~org.hipparchus.geometry.euclidean.threed.Line`): line to check against the instance + + Returns: + point of the instance closest to another line + + + """ + ... + def contains(self, vector3D: 'Vector3D') -> bool: + """ + Check if the instance contains a point. + + Parameters: + p (:class:`~org.hipparchus.geometry.euclidean.threed.Vector3D`): point to check + + Returns: + true if p belongs to the line + + + """ + ... + @typing.overload + def distance(self, line: 'Line') -> float: + """ + Compute the distance between the instance and a point. + + Parameters: + p (:class:`~org.hipparchus.geometry.euclidean.threed.Vector3D`): to check + + Returns: + distance between the instance and the point + + Compute the shortest distance between the instance and another line. + + Parameters: + line (:class:`~org.hipparchus.geometry.euclidean.threed.Line`): line to check against the instance + + Returns: + shortest distance between the instance and the line + + + """ + ... @typing.overload def distance(self, vector3D: 'Vector3D') -> float: ... @staticmethod - def fromDirection(vector3D: 'Vector3D', vector3D2: 'Vector3D', double: float) -> 'Line': ... - def getAbscissa(self, vector3D: 'Vector3D') -> float: ... - def getDirection(self) -> 'Vector3D': ... - def getOrigin(self) -> 'Vector3D': ... - def getTolerance(self) -> float: ... - def intersection(self, line: 'Line') -> 'Vector3D': ... - def isSimilarTo(self, line: 'Line') -> bool: ... - def pointAt(self, double: float) -> 'Vector3D': ... + def fromDirection(vector3D: 'Vector3D', vector3D2: 'Vector3D', double: float) -> 'Line': + """ + Create a line from a point and a direction. Line = :code:`point` + t * :code:`direction`, where t is any real number. + + Parameters: + point (:class:`~org.hipparchus.geometry.euclidean.threed.Vector3D`): on the line. Can be any point. + direction (:class:`~org.hipparchus.geometry.euclidean.threed.Vector3D`): of the line. Must not be the zero vector. + tolerance (double): below which points are considered identical. + + Returns: + a new Line with the given point and direction. + + Raises: + :class:`~org.hipparchus.geometry.euclidean.threed.https:.www.hipparchus.org.hipparchus`: if :code:`direction` is the zero vector. + + Also see: + + - :meth:`~org.hipparchus.geometry.euclidean.threed.Line.%3Cinit%3E` + + + + """ + ... + def getAbscissa(self, vector3D: 'Vector3D') -> float: + """ + Get the abscissa of a point with respect to the line. + + The abscissa is 0 if the projection of the point and the projection of the frame origin on the line are the same point. + + Parameters: + point (:class:`~org.hipparchus.geometry.euclidean.threed.Vector3D`): point to check + + Returns: + abscissa of the point + + + """ + ... + def getDirection(self) -> 'Vector3D': + """ + Get the normalized direction vector. + + Returns: + normalized direction vector + + + """ + ... + def getOrigin(self) -> 'Vector3D': + """ + Get the line point closest to the origin. + + Returns: + line point closest to the origin + + + """ + ... + def getTolerance(self) -> float: + """ + Get the tolerance below which points are considered identical. + + Returns: + tolerance below which points are considered identical + + + """ + ... + def intersection(self, line: 'Line') -> 'Vector3D': + """ + Get the intersection point of the instance and another line. + + Parameters: + line (:class:`~org.hipparchus.geometry.euclidean.threed.Line`): other line + + Returns: + intersection point of the instance and the other line or null if there are no intersection points + + + """ + ... + def isSimilarTo(self, line: 'Line') -> bool: + """ + Check if the instance is similar to another line. + + Lines are considered similar if they contain the same points. This does not mean they are equal since they can have + opposite directions. + + Parameters: + line (:class:`~org.hipparchus.geometry.euclidean.threed.Line`): line to which instance should be compared + + Returns: + true if the lines are similar + + + """ + ... + def pointAt(self, double: float) -> 'Vector3D': + """ + Get one point from the line. + + Parameters: + abscissa (double): desired abscissa for the point + + Returns: + one point belonging to the line, at specified abscissa + + + """ + ... def reset(self, vector3D: 'Vector3D', vector3D2: 'Vector3D') -> None: ... - def revert(self) -> 'Line': ... + def revert(self) -> 'Line': + """ + Get a line with reversed direction. + + Returns: + a new instance, with reversed direction + + + """ + ... @typing.overload def toSpace(self, point: org.hipparchus.geometry.Point[org.hipparchus.geometry.euclidean.oned.Euclidean1D]) -> 'Vector3D': ... @typing.overload @@ -395,13 +1600,48 @@ class Line(org.hipparchus.geometry.partitioning.Embedding[Euclidean3D, org.hippa def toSubSpace(self, point: org.hipparchus.geometry.Point[Euclidean3D]) -> org.hipparchus.geometry.euclidean.oned.Vector1D: ... @typing.overload def toSubSpace(self, vector: org.hipparchus.geometry.Vector[Euclidean3D, 'Vector3D']) -> org.hipparchus.geometry.euclidean.oned.Vector1D: ... - def wholeLine(self) -> 'SubLine': ... + def wholeLine(self) -> 'SubLine': + """ + Build a sub-line covering the whole line. + + Returns: + a sub-line covering the whole line + + + """ + ... class OutlineExtractor: + """ + public classOutlineExtractor extends :class:`~org.hipparchus.geometry.euclidean.threed.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Extractor for :class:`~org.hipparchus.geometry.euclidean.twod.PolygonsSet` outlines. + + This class extracts the 2D outlines from {:class:`~org.hipparchus.geometry.euclidean.twod.PolygonsSet` in a specified + projection plane. + """ def __init__(self, vector3D: 'Vector3D', vector3D2: 'Vector3D'): ... - def getOutline(self, polyhedronsSet: 'PolyhedronsSet') -> typing.MutableSequence[typing.MutableSequence[org.hipparchus.geometry.euclidean.twod.Vector2D]]: ... + def getOutline(self, polyhedronsSet: 'PolyhedronsSet') -> typing.MutableSequence[typing.MutableSequence[org.hipparchus.geometry.euclidean.twod.Vector2D]]: + """ + Extract the outline of a polyhedrons set. + + Parameters: + polyhedronsSet (:class:`~org.hipparchus.geometry.euclidean.threed.PolyhedronsSet`): polyhedrons set whose outline must be extracted + + Returns: + an outline, as an array of loops. + + + """ + ... class Plane(org.hipparchus.geometry.partitioning.Hyperplane[Euclidean3D], org.hipparchus.geometry.partitioning.Embedding[Euclidean3D, org.hipparchus.geometry.euclidean.twod.Euclidean2D]): + """ + public classPlane extends :class:`~org.hipparchus.geometry.euclidean.threed.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.geometry.partitioning.Hyperplane`<:class:`~org.hipparchus.geometry.euclidean.threed.Euclidean3D`>, :class:`~org.hipparchus.geometry.partitioning.Embedding`<:class:`~org.hipparchus.geometry.euclidean.threed.Euclidean3D`,:class:`~org.hipparchus.geometry.euclidean.twod.Euclidean2D`> + + The class represent planes in a three dimensional space. + """ @typing.overload def __init__(self, plane: 'Plane'): ... @typing.overload @@ -410,36 +1650,302 @@ class Plane(org.hipparchus.geometry.partitioning.Hyperplane[Euclidean3D], org.hi def __init__(self, vector3D: 'Vector3D', vector3D2: 'Vector3D', double: float): ... @typing.overload def __init__(self, vector3D: 'Vector3D', vector3D2: 'Vector3D', vector3D3: 'Vector3D', double: float): ... - def contains(self, vector3D: 'Vector3D') -> bool: ... - def copySelf(self) -> 'Plane': ... - def emptyHyperplane(self) -> 'SubPlane': ... - def getNormal(self) -> 'Vector3D': ... - @typing.overload - def getOffset(self, point: org.hipparchus.geometry.Point[Euclidean3D]) -> float: ... + def contains(self, vector3D: 'Vector3D') -> bool: + """ + Check if the instance contains a point. + + Parameters: + p (:class:`~org.hipparchus.geometry.euclidean.threed.Vector3D`): point to check + + Returns: + true if p belongs to the plane + + + """ + ... + def copySelf(self) -> 'Plane': + """ + Copy the instance. + + The instance created is completely independant of the original one. A deep copy is used, none of the underlying objects + are shared (except for immutable objects). + + Specified by: + :meth:`~org.hipparchus.geometry.partitioning.Hyperplane.copySelf` in + interface :class:`~org.hipparchus.geometry.partitioning.Hyperplane` + + Returns: + a new hyperplane, copy of the instance + + + """ + ... + def emptyHyperplane(self) -> 'SubPlane': + """ + Build a sub-hyperplane covering nothing. + + Specified by: + :meth:`~org.hipparchus.geometry.partitioning.Hyperplane.emptyHyperplane` in + interface :class:`~org.hipparchus.geometry.partitioning.Hyperplane` + + Returns: + a sub-hyperplane covering nothing + + + """ + ... + def getNormal(self) -> 'Vector3D': + """ + Get the normalized normal vector. + + The frame defined by (:meth:`~org.hipparchus.geometry.euclidean.threed.Plane.getU`, + :meth:`~org.hipparchus.geometry.euclidean.threed.Plane.getV`, + :meth:`~org.hipparchus.geometry.euclidean.threed.Plane.getNormal`) is a rigth-handed orthonormalized frame). + + Returns: + normalized normal vector + + Also see: + + - :meth:`~org.hipparchus.geometry.euclidean.threed.Plane.getU` + - :meth:`~org.hipparchus.geometry.euclidean.threed.Plane.getV` + + + + """ + ... + @typing.overload + def getOffset(self, point: org.hipparchus.geometry.Point[Euclidean3D]) -> float: + """ + Get the offset (oriented distance) of a parallel plane. + + This method should be called only for parallel planes otherwise the result is not meaningful. + + The offset is 0 if both planes are the same, it is positive if the plane is on the plus side of the instance and + negative if it is on the minus side, according to its natural orientation. + + Parameters: + plane (:class:`~org.hipparchus.geometry.euclidean.threed.Plane`): plane to check + + Returns: + offset of the plane + + public double getOffset(:class:`~org.hipparchus.geometry.Vector`<:class:`~org.hipparchus.geometry.euclidean.threed.Euclidean3D`,:class:`~org.hipparchus.geometry.euclidean.threed.Vector3D`> vector) + + Get the offset (oriented distance) of a vector. + + Parameters: + vector (:class:`~org.hipparchus.geometry.Vector`<:class:`~org.hipparchus.geometry.euclidean.threed.Euclidean3D`,:class:`~org.hipparchus.geometry.euclidean.threed.Vector3D`> vector): vector to check + + Returns: + offset of the vector + + public double getOffset(:class:`~org.hipparchus.geometry.Point`<:class:`~org.hipparchus.geometry.euclidean.threed.Euclidean3D`> point) + + Get the offset (oriented distance) of a point. + + The offset is 0 if the point is on the underlying hyperplane, it is positive if the point is on one particular side of + the hyperplane, and it is negative if the point is on the other side, according to the hyperplane natural orientation. + + Specified by: + :meth:`~org.hipparchus.geometry.partitioning.Hyperplane.getOffset` in + interface :class:`~org.hipparchus.geometry.partitioning.Hyperplane` + + Parameters: + point (:class:`~org.hipparchus.geometry.Point`<:class:`~org.hipparchus.geometry.euclidean.threed.Euclidean3D`> point): point to check + + Returns: + offset of the point + + + """ + ... @typing.overload def getOffset(self, vector: org.hipparchus.geometry.Vector[Euclidean3D, 'Vector3D']) -> float: ... @typing.overload def getOffset(self, plane: 'Plane') -> float: ... - def getOrigin(self) -> 'Vector3D': ... - def getPointAt(self, vector2D: org.hipparchus.geometry.euclidean.twod.Vector2D, double: float) -> 'Vector3D': ... - def getTolerance(self) -> float: ... - def getU(self) -> 'Vector3D': ... - def getV(self) -> 'Vector3D': ... - @typing.overload - def intersection(self, plane: 'Plane') -> Line: ... + def getOrigin(self) -> 'Vector3D': + """ + Get the origin point of the plane frame. + + The point returned is the orthogonal projection of the 3D-space origin in the plane. + + Returns: + the origin point of the plane frame (point closest to the 3D-space origin) + + + """ + ... + def getPointAt(self, vector2D: org.hipparchus.geometry.euclidean.twod.Vector2D, double: float) -> 'Vector3D': + """ + Get one point from the 3D-space. + + Parameters: + inPlane (:class:`~org.hipparchus.geometry.euclidean.twod.Vector2D`): desired in-plane coordinates for the point in the plane + offset (double): desired offset for the point + + Returns: + one point in the 3D-space, with given coordinates and offset relative to the plane + + + """ + ... + def getTolerance(self) -> float: + """ + Get the tolerance below which points are considered to belong to the hyperplane. + + Specified by: + :meth:`~org.hipparchus.geometry.partitioning.Hyperplane.getTolerance` in + interface :class:`~org.hipparchus.geometry.partitioning.Hyperplane` + + Returns: + tolerance below which points are considered to belong to the hyperplane + + + """ + ... + def getU(self) -> 'Vector3D': + """ + Get the plane first canonical vector. + + The frame defined by (:meth:`~org.hipparchus.geometry.euclidean.threed.Plane.getU`, + :meth:`~org.hipparchus.geometry.euclidean.threed.Plane.getV`, + :meth:`~org.hipparchus.geometry.euclidean.threed.Plane.getNormal`) is a rigth-handed orthonormalized frame). + + Returns: + normalized first canonical vector + + Also see: + + - :meth:`~org.hipparchus.geometry.euclidean.threed.Plane.getV` + - :meth:`~org.hipparchus.geometry.euclidean.threed.Plane.getNormal` + + + + """ + ... + def getV(self) -> 'Vector3D': + """ + Get the plane second canonical vector. + + The frame defined by (:meth:`~org.hipparchus.geometry.euclidean.threed.Plane.getU`, + :meth:`~org.hipparchus.geometry.euclidean.threed.Plane.getV`, + :meth:`~org.hipparchus.geometry.euclidean.threed.Plane.getNormal`) is a rigth-handed orthonormalized frame). + + Returns: + normalized second canonical vector + + Also see: + + - :meth:`~org.hipparchus.geometry.euclidean.threed.Plane.getU` + - :meth:`~org.hipparchus.geometry.euclidean.threed.Plane.getNormal` + + + + """ + ... + @typing.overload + def intersection(self, plane: 'Plane') -> Line: + """ + Get the intersection of a line with the instance. + + Parameters: + line (:class:`~org.hipparchus.geometry.euclidean.threed.Line`): line intersecting the instance + + Returns: + intersection point between between the line and the instance (null if the line is parallel to the instance) + + Build the line shared by the instance and another plane. + + Parameters: + other (:class:`~org.hipparchus.geometry.euclidean.threed.Plane`): other plane + + Returns: + line at the intersection of the instance and the other plane (really a + :class:`~org.hipparchus.geometry.euclidean.threed.Line` instance) + + Get the intersection point of three planes. + + Parameters: + plane1 (:class:`~org.hipparchus.geometry.euclidean.threed.Plane`): first plane1 + plane2 (:class:`~org.hipparchus.geometry.euclidean.threed.Plane`): second plane2 + plane3 (:class:`~org.hipparchus.geometry.euclidean.threed.Plane`): third plane2 + + Returns: + intersection point of three planes, null if some planes are parallel + + + """ + ... @typing.overload def intersection(self, line: Line) -> 'Vector3D': ... @typing.overload @staticmethod def intersection(plane: 'Plane', plane2: 'Plane', plane3: 'Plane') -> 'Vector3D': ... - def isSimilarTo(self, plane: 'Plane') -> bool: ... + def isSimilarTo(self, plane: 'Plane') -> bool: + """ + Check if the instance is similar to another plane. + + Planes are considered similar if they contain the same points. This does not mean they are equal since they can have + opposite normals. + + Parameters: + plane (:class:`~org.hipparchus.geometry.euclidean.threed.Plane`): plane to which the instance is compared + + Returns: + true if the planes are similar + + + """ + ... def project(self, point: org.hipparchus.geometry.Point[Euclidean3D]) -> org.hipparchus.geometry.Point[Euclidean3D]: ... @typing.overload - def reset(self, plane: 'Plane') -> None: ... + def reset(self, plane: 'Plane') -> None: + """ + Reset the instance from another one. + + The updated instance is completely independant of the original one. A deep reset is used none of the underlying object + is shared. + + Parameters: + original (:class:`~org.hipparchus.geometry.euclidean.threed.Plane`): plane to reset from + + + """ + ... @typing.overload def reset(self, vector3D: 'Vector3D', vector3D2: 'Vector3D') -> None: ... - def revertSelf(self) -> None: ... - def rotate(self, vector3D: 'Vector3D', rotation: 'Rotation') -> 'Plane': ... + def revertSelf(self) -> None: + """ + Revert the plane. + + Replace the instance by a similar plane with opposite orientation. + + The new plane frame is chosen in such a way that a 3D point that had :code:`(x, y)` in-plane coordinates and :code:`z` + offset with respect to the plane and is unaffected by the change will have :code:`(y, x)` in-plane coordinates and + :code:`-z` offset with respect to the new plane. This means that the :code:`u` and :code:`v` vectors returned by the + :meth:`~org.hipparchus.geometry.euclidean.threed.Plane.getU` and + :meth:`~org.hipparchus.geometry.euclidean.threed.Plane.getV` methods are exchanged, and the :code:`w` vector returned by + the :meth:`~org.hipparchus.geometry.euclidean.threed.Plane.getNormal` method is reversed. + + """ + ... + def rotate(self, vector3D: 'Vector3D', rotation: 'Rotation') -> 'Plane': + """ + Rotate the plane around the specified point. + + The instance is not modified, a new instance is created. + + Parameters: + center (:class:`~org.hipparchus.geometry.euclidean.threed.Vector3D`): rotation center + rotation (:class:`~org.hipparchus.geometry.euclidean.threed.Rotation`): vectorial rotation operator + + Returns: + a new plane + + + """ + ... def sameOrientationAs(self, hyperplane: org.hipparchus.geometry.partitioning.Hyperplane[Euclidean3D]) -> bool: ... @typing.overload def toSpace(self, point: org.hipparchus.geometry.Point[org.hipparchus.geometry.euclidean.twod.Euclidean2D]) -> 'Vector3D': ... @@ -449,11 +1955,56 @@ class Plane(org.hipparchus.geometry.partitioning.Hyperplane[Euclidean3D], org.hi def toSubSpace(self, point: org.hipparchus.geometry.Point[Euclidean3D]) -> org.hipparchus.geometry.euclidean.twod.Vector2D: ... @typing.overload def toSubSpace(self, vector: org.hipparchus.geometry.Vector[Euclidean3D, 'Vector3D']) -> org.hipparchus.geometry.euclidean.twod.Vector2D: ... - def translate(self, vector3D: 'Vector3D') -> 'Plane': ... - def wholeHyperplane(self) -> 'SubPlane': ... - def wholeSpace(self) -> 'PolyhedronsSet': ... + def translate(self, vector3D: 'Vector3D') -> 'Plane': + """ + Translate the plane by the specified amount. + + The instance is not modified, a new instance is created. + + Parameters: + translation (:class:`~org.hipparchus.geometry.euclidean.threed.Vector3D`): translation to apply + + Returns: + a new plane + + + """ + ... + def wholeHyperplane(self) -> 'SubPlane': + """ + Build a region covering the whole hyperplane. + + Specified by: + :meth:`~org.hipparchus.geometry.partitioning.Hyperplane.wholeHyperplane` in + interface :class:`~org.hipparchus.geometry.partitioning.Hyperplane` + + Returns: + a region covering the whole hyperplane + + + """ + ... + def wholeSpace(self) -> 'PolyhedronsSet': + """ + Build a region covering the whole space. + + Specified by: + :meth:`~org.hipparchus.geometry.partitioning.Hyperplane.wholeSpace` in + interface :class:`~org.hipparchus.geometry.partitioning.Hyperplane` + + Returns: + a region containing the instance (really a :class:`~org.hipparchus.geometry.euclidean.threed.PolyhedronsSet` instance) + + + """ + ... class PolyhedronsSet(org.hipparchus.geometry.partitioning.AbstractRegion[Euclidean3D, org.hipparchus.geometry.euclidean.twod.Euclidean2D]): + """ + public classPolyhedronsSet extends :class:`~org.hipparchus.geometry.partitioning.AbstractRegion`<:class:`~org.hipparchus.geometry.euclidean.threed.Euclidean3D`,:class:`~org.hipparchus.geometry.euclidean.twod.Euclidean2D`> + + This class represents a 3D region: a set of polyhedrons. + """ @typing.overload def __init__(self, double: float): ... @typing.overload @@ -469,15 +2020,113 @@ class PolyhedronsSet(org.hipparchus.geometry.partitioning.AbstractRegion[Euclide def buildNew(self, bSPTree: org.hipparchus.geometry.partitioning.BSPTree[Euclidean3D]) -> 'PolyhedronsSet': ... def firstIntersection(self, vector3D: 'Vector3D', line: Line) -> org.hipparchus.geometry.partitioning.SubHyperplane[Euclidean3D]: ... def getBRep(self) -> 'PolyhedronsSet.BRep': ... - def rotate(self, vector3D: 'Vector3D', rotation: 'Rotation') -> 'PolyhedronsSet': ... - def translate(self, vector3D: 'Vector3D') -> 'PolyhedronsSet': ... + def rotate(self, vector3D: 'Vector3D', rotation: 'Rotation') -> 'PolyhedronsSet': + """ + Rotate the region around the specified point. + + The instance is not modified, a new instance is created. + + Parameters: + center (:class:`~org.hipparchus.geometry.euclidean.threed.Vector3D`): rotation center + rotation (:class:`~org.hipparchus.geometry.euclidean.threed.Rotation`): vectorial rotation operator + + Returns: + a new instance representing the rotated region + + + """ + ... + def translate(self, vector3D: 'Vector3D') -> 'PolyhedronsSet': + """ + Translate the region by the specified amount. + + The instance is not modified, a new instance is created. + + Parameters: + translation (:class:`~org.hipparchus.geometry.euclidean.threed.Vector3D`): translation to apply + + Returns: + a new instance representing the translated region + + + """ + ... class BRep: def __init__(self, list: java.util.List['Vector3D'], list2: java.util.List[typing.Union[typing.List[int], jpype.JArray]]): ... def getFacets(self) -> java.util.List[typing.MutableSequence[int]]: ... def getVertices(self) -> java.util.List['Vector3D']: ... class Rotation(java.io.Serializable): + """ + public classRotation extends :class:`~org.hipparchus.geometry.euclidean.threed.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.geometry.euclidean.threed.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + This class implements rotations in a three-dimensional space. + + Rotations can be represented by several different mathematical entities (matrices, axe and angle, Cardan or Euler + angles, quaternions). This class presents an higher level abstraction, more user-oriented and hiding this implementation + details. Well, for the curious, we use quaternions for the internal representation. The user can build a rotation from + any of these representations, and any of these representations can be retrieved from a :code:`Rotation` instance (see + the various constructors and getters). In addition, a rotation can also be built implicitly from a set of vectors and + their image. + + This implies that this class can be used to convert from one representation to another one. For example, converting a + rotation matrix into a set of Cardan angles from can be done using the following single line of code: + + .. code-block: java + + double[] angles = new Rotation(matrix, 1.0e-10).getAngles(RotationOrder.XYZ); + + + Focus is oriented on what a rotation *do* rather than on its underlying representation. Once it has been built, and + regardless of its internal representation, a rotation is an *operator* which basically transforms three dimensional + :class:`~org.hipparchus.geometry.euclidean.threed.Vector3D` into other three dimensional + :class:`~org.hipparchus.geometry.euclidean.threed.Vector3D`. Depending on the application, the meaning of these vectors + may vary and the semantics of the rotation also. + + For example in an spacecraft attitude simulation tool, users will often consider the vectors are fixed (say the Earth + direction for example) and the frames change. The rotation transforms the coordinates of the vector in inertial frame + into the coordinates of the same vector in satellite frame. In this case, the rotation implicitly defines the relation + between the two frames. + + Another example could be a telescope control application, where the rotation would transform the sighting direction at + rest into the desired observing direction when the telescope is pointed towards an object of interest. In this case the + rotation transforms the direction at rest in a topocentric frame into the sighting direction in the same topocentric + frame. This implies in this case the frame is fixed and the vector moves. + + In many case, both approaches will be combined. In our telescope example, we will probably also need to transform the + observing direction in the topocentric frame into the observing direction in inertial frame taking into account the + observatory location and the Earth rotation, which would essentially be an application of the first approach. + + These examples show that a rotation is what the user wants it to be. This class does not push the user towards one + specific definition and hence does not provide methods like :code:`projectVectorIntoDestinationFrame` or + :code:`computeTransformedDirection`. It provides simpler and more generic methods: + :meth:`~org.hipparchus.geometry.euclidean.threed.Rotation.applyTo` and + :meth:`~org.hipparchus.geometry.euclidean.threed.Rotation.applyInverseTo`. + + Since a rotation is basically a vectorial operator, several rotations can be composed together and the composite + operation :code:`r = r :sub:`1` o r :sub:`2`` (which means that for each vector :code:`u`, :code:`r(u) = r :sub:`1` (r + :sub:`2` (u))`) is also a rotation. Hence we can consider that in addition to vectors, a rotation can be applied to + other rotations as well (or to itself). With our previous notations, we would say we can apply :code:`r :sub:`1`` to + :code:`r :sub:`2`` and the result we get is :code:`r = r :sub:`1` o r :sub:`2``. For this purpose, the class provides + the methods: :meth:`~org.hipparchus.geometry.euclidean.threed.Rotation.applyTo` and + :meth:`~org.hipparchus.geometry.euclidean.threed.Rotation.applyInverseTo`. + + Rotations are guaranteed to be immutable objects. + + Also see: + + - :class:`~org.hipparchus.geometry.euclidean.threed.Vector3D` + - :class:`~org.hipparchus.geometry.euclidean.threed.RotationOrder` + - :meth:`~serialized` + """ IDENTITY: typing.ClassVar['Rotation'] = ... + """ + public static final :class:`~org.hipparchus.geometry.euclidean.threed.Rotation` IDENTITY + + Identity rotation. + + """ @typing.overload def __init__(self, double: float, double2: float, double3: float, double4: float, boolean: bool): ... @typing.overload @@ -491,32 +2140,301 @@ class Rotation(java.io.Serializable): @typing.overload def __init__(self, vector3D: 'Vector3D', vector3D2: 'Vector3D', vector3D3: 'Vector3D', vector3D4: 'Vector3D'): ... @typing.overload - def applyInverseTo(self, rotation: 'Rotation') -> 'Rotation': ... + def applyInverseTo(self, rotation: 'Rotation') -> 'Rotation': + """ + Apply the inverse of the rotation to a vector. + + Parameters: + u (:class:`~org.hipparchus.geometry.euclidean.threed.Vector3D`): vector to apply the inverse of the rotation to + + Returns: + a new vector which such that u is its image by the rotation + + Apply the inverse of the instance to another rotation. + + Calling this method is equivalent to call :meth:`~org.hipparchus.geometry.euclidean.threed.Rotation.composeInverse`. + + Parameters: + r (:class:`~org.hipparchus.geometry.euclidean.threed.Rotation`): rotation to apply the rotation to + + Returns: + a new rotation which is the composition of r by the inverse of the instance + + + """ + ... @typing.overload def applyInverseTo(self, vector3D: 'Vector3D') -> 'Vector3D': ... @typing.overload - def applyInverseTo(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray]) -> None: ... - @typing.overload - def applyTo(self, rotation: 'Rotation') -> 'Rotation': ... + def applyInverseTo(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray]) -> None: + """ + Apply the inverse of the rotation to a vector stored in an array. + + Parameters: + in (double[]): an array with three items which stores vector to rotate + out (double[]): an array with three items to put result to (it can be the same array as in) + + """ + ... + @typing.overload + def applyTo(self, rotation: 'Rotation') -> 'Rotation': + """ + Apply the rotation to a vector. + + Parameters: + u (:class:`~org.hipparchus.geometry.euclidean.threed.Vector3D`): vector to apply the rotation to + + Returns: + a new vector which is the image of u by the rotation + + Apply the instance to another rotation. + + Calling this method is equivalent to call :meth:`~org.hipparchus.geometry.euclidean.threed.Rotation.compose`. + + Parameters: + r (:class:`~org.hipparchus.geometry.euclidean.threed.Rotation`): rotation to apply the rotation to + + Returns: + a new rotation which is the composition of r by the instance + + + """ + ... @typing.overload def applyTo(self, vector3D: 'Vector3D') -> 'Vector3D': ... @typing.overload - def applyTo(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray]) -> None: ... - def compose(self, rotation: 'Rotation', rotationConvention: 'RotationConvention') -> 'Rotation': ... - def composeInverse(self, rotation: 'Rotation', rotationConvention: 'RotationConvention') -> 'Rotation': ... - @staticmethod - def distance(rotation: 'Rotation', rotation2: 'Rotation') -> float: ... - def getAngle(self) -> float: ... - def getAngles(self, rotationOrder: 'RotationOrder', rotationConvention: 'RotationConvention') -> typing.MutableSequence[float]: ... - def getAxis(self, rotationConvention: 'RotationConvention') -> 'Vector3D': ... - def getMatrix(self) -> typing.MutableSequence[typing.MutableSequence[float]]: ... - def getQ0(self) -> float: ... - def getQ1(self) -> float: ... - def getQ2(self) -> float: ... - def getQ3(self) -> float: ... - def revert(self) -> 'Rotation': ... + def applyTo(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray]) -> None: + """ + Apply the rotation to a vector stored in an array. + + Parameters: + in (double[]): an array with three items which stores vector to rotate + out (double[]): an array with three items to put result to (it can be the same array as in) + + """ + ... + def compose(self, rotation: 'Rotation', rotationConvention: 'RotationConvention') -> 'Rotation': + """ + Compose the instance with another rotation. + + If the semantics of the rotations composition corresponds to a + :meth:`~org.hipparchus.geometry.euclidean.threed.RotationConvention.VECTOR_OPERATOR` convention, applying the instance + to a rotation is computing the composition in an order compliant with the following rule : let :code:`u` be any vector + and :code:`v` its image by :code:`r1` (i.e. :code:`r1.applyTo(u) = v`). Let :code:`w` be the image of :code:`v` by + rotation :code:`r2` (i.e. :code:`r2.applyTo(v) = w`). Then :code:`w = comp.applyTo(u)`, where :code:`comp = + r2.compose(r1, RotationConvention.VECTOR_OPERATOR)`. + + If the semantics of the rotations composition corresponds to a + :meth:`~org.hipparchus.geometry.euclidean.threed.RotationConvention.FRAME_TRANSFORM` convention, the application order + will be reversed. So keeping the exact same meaning of all :code:`r1`, :code:`r2`, :code:`u`, :code:`v`, :code:`w` and + :code:`comp` as above, :code:`comp` could also be computed as :code:`comp = r1.compose(r2, + RotationConvention.FRAME_TRANSFORM)`. + + Parameters: + r (:class:`~org.hipparchus.geometry.euclidean.threed.Rotation`): rotation to apply the rotation to + convention (:class:`~org.hipparchus.geometry.euclidean.threed.RotationConvention`): convention to use for the semantics of the angle + + Returns: + a new rotation which is the composition of r by the instance + + + """ + ... + def composeInverse(self, rotation: 'Rotation', rotationConvention: 'RotationConvention') -> 'Rotation': + """ + Compose the inverse of the instance with another rotation. + + If the semantics of the rotations composition corresponds to a + :meth:`~org.hipparchus.geometry.euclidean.threed.RotationConvention.VECTOR_OPERATOR` convention, applying the inverse of + the instance to a rotation is computing the composition in an order compliant with the following rule : let :code:`u` be + any vector and :code:`v` its image by :code:`r1` (i.e. :code:`r1.applyTo(u) = v`). Let :code:`w` be the inverse image of + :code:`v` by :code:`r2` (i.e. :code:`r2.applyInverseTo(v) = w`). Then :code:`w = comp.applyTo(u)`, where :code:`comp = + r2.composeInverse(r1)`. + + If the semantics of the rotations composition corresponds to a + :meth:`~org.hipparchus.geometry.euclidean.threed.RotationConvention.FRAME_TRANSFORM` convention, the application order + will be reversed, which means it is the *innermost* rotation that will be reversed. So keeping the exact same meaning of + all :code:`r1`, :code:`r2`, :code:`u`, :code:`v`, :code:`w` and :code:`comp` as above, :code:`comp` could also be + computed as :code:`comp = r1.revert().composeInverse(r2.revert(), RotationConvention.FRAME_TRANSFORM)`. + + Parameters: + r (:class:`~org.hipparchus.geometry.euclidean.threed.Rotation`): rotation to apply the rotation to + convention (:class:`~org.hipparchus.geometry.euclidean.threed.RotationConvention`): convention to use for the semantics of the angle + + Returns: + a new rotation which is the composition of r by the inverse of the instance + + + """ + ... + @staticmethod + def distance(rotation: 'Rotation', rotation2: 'Rotation') -> float: + """ + Compute the *distance* between two rotations. + + The *distance* is intended here as a way to check if two rotations are almost similar (i.e. they transform vectors the + same way) or very different. It is mathematically defined as the angle of the rotation r that prepended to one of the + rotations gives the other one: \(r_1(r) = r_2\) + + This distance is an angle between 0 and Ï€. Its value is the smallest possible upper bound of the angle in radians + between r :sub:`1` (v) and r :sub:`2` (v) for all possible vectors v. This upper bound is reached for some v. The + distance is equal to 0 if and only if the two rotations are identical. + + Comparing two rotations should always be done using this value rather than for example comparing the components of the + quaternions. It is much more stable, and has a geometric meaning. Also comparing quaternions components is error prone + since for example quaternions (0.36, 0.48, -0.48, -0.64) and (-0.36, -0.48, 0.48, 0.64) represent exactly the same + rotation despite their components are different (they are exact opposites). + + Parameters: + r1 (:class:`~org.hipparchus.geometry.euclidean.threed.Rotation`): first rotation + r2 (:class:`~org.hipparchus.geometry.euclidean.threed.Rotation`): second rotation + + Returns: + *distance* between r1 and r2 + + + """ + ... + def getAngle(self) -> float: + """ + Get the angle of the rotation. + + Returns: + angle of the rotation (between 0 and Ï€) + + Also see: + + - :meth:`~org.hipparchus.geometry.euclidean.threed.Rotation.%3Cinit%3E` + + + + """ + ... + def getAngles(self, rotationOrder: 'RotationOrder', rotationConvention: 'RotationConvention') -> typing.MutableSequence[float]: + """ + Get the Cardan or Euler angles corresponding to the instance. + + The equations show that each rotation can be defined by two different values of the Cardan or Euler angles set. For + example if Cardan angles are used, the rotation defined by the angles a :sub:`1` , a :sub:`2` and a :sub:`3` is the same + as the rotation defined by the angles Ï€ + a :sub:`1` , Ï€ - a :sub:`2` and Ï€ + a :sub:`3` . This method implements the + following arbitrary choices: + + - for Cardan angles, the chosen set is the one for which the second angle is between -Ï€/2 and Ï€/2 (i.e its cosine is + positive), + - for Euler angles, the chosen set is the one for which the second angle is between 0 and Ï€ (i.e its sine is positive). + + + Cardan and Euler angle have a very disappointing drawback: all of them have singularities. This means that if the + instance is too close to the singularities corresponding to the given rotation order, it will be impossible to retrieve + the angles. For Cardan angles, this is often called gimbal lock. There is *nothing* to do to prevent this, it is an + intrinsic problem with Cardan and Euler representation (but not a problem with the rotation itself, which is perfectly + well defined). For Cardan angles, singularities occur when the second angle is close to -Ï€/2 or +Ï€/2, for Euler angle + singularities occur when the second angle is close to 0 or Ï€, this implies that the identity rotation is always + singular for Euler angles! + + Parameters: + order (:class:`~org.hipparchus.geometry.euclidean.threed.RotationOrder`): rotation order to use + convention (:class:`~org.hipparchus.geometry.euclidean.threed.RotationConvention`): convention to use for the semantics of the angle + + Returns: + an array of three angles, in the order specified by the set + + + """ + ... + def getAxis(self, rotationConvention: 'RotationConvention') -> 'Vector3D': + """ + Get the normalized axis of the rotation. + + Note that as :meth:`~org.hipparchus.geometry.euclidean.threed.Rotation.getAngle` always returns an angle between 0 and + Ï€, changing the convention changes the direction of the axis, not the sign of the angle. + + Parameters: + convention (:class:`~org.hipparchus.geometry.euclidean.threed.RotationConvention`): convention to use for the semantics of the angle + + Returns: + normalized axis of the rotation + + Also see: + + - :meth:`~org.hipparchus.geometry.euclidean.threed.Rotation.%3Cinit%3E` + + + + """ + ... + def getMatrix(self) -> typing.MutableSequence[typing.MutableSequence[float]]: + """ + Get the 3X3 matrix corresponding to the instance + + Returns: + the matrix corresponding to the instance + + + """ + ... + def getQ0(self) -> float: + """ + Get the scalar coordinate of the quaternion. + + Returns: + scalar coordinate of the quaternion + + + """ + ... + def getQ1(self) -> float: + """ + Get the first coordinate of the vectorial part of the quaternion. + + Returns: + first coordinate of the vectorial part of the quaternion + + + """ + ... + def getQ2(self) -> float: + """ + Get the second coordinate of the vectorial part of the quaternion. + + Returns: + second coordinate of the vectorial part of the quaternion + + + """ + ... + def getQ3(self) -> float: + """ + Get the third coordinate of the vectorial part of the quaternion. + + Returns: + third coordinate of the vectorial part of the quaternion + + + """ + ... + def revert(self) -> 'Rotation': + """ + Revert a rotation. Build a rotation which reverse the effect of another rotation. This means that if r(u) = v, then + r.revert(v) = u. The instance is not changed. + + Returns: + a new rotation whose effect is the reverse of the effect of the instance + + + """ + ... class RotationConvention(java.lang.Enum['RotationConvention']): + """ + public enumRotationConvention extends :class:`~org.hipparchus.geometry.euclidean.threed.https:.docs.oracle.com.javase.8.docs.api.java.lang.Enum`<:class:`~org.hipparchus.geometry.euclidean.threed.RotationConvention`> + + This enumerates is used to differentiate the semantics of a rotation. + + Also see: + + - :class:`~org.hipparchus.geometry.euclidean.threed.Rotation` + """ VECTOR_OPERATOR: typing.ClassVar['RotationConvention'] = ... FRAME_TRANSFORM: typing.ClassVar['RotationConvention'] = ... _valueOf_0__T = typing.TypeVar('_valueOf_0__T', bound=java.lang.Enum) # <T> @@ -525,11 +2443,44 @@ class RotationConvention(java.lang.Enum['RotationConvention']): def valueOf(class_: typing.Type[_valueOf_0__T], string: str) -> _valueOf_0__T: ... @typing.overload @staticmethod - def valueOf(string: str) -> 'RotationConvention': ... + def valueOf(string: str) -> 'RotationConvention': + """ + Returns the enum constant of this type with the specified name. The string must match *exactly* an identifier used to + declare an enum constant in this type. (Extraneous whitespace characters are not permitted.) + + Parameters: + name (:class:`~org.hipparchus.geometry.euclidean.threed.https:.docs.oracle.com.javase.8.docs.api.java.lang.String`): the name of the enum constant to be returned. + + Returns: + the enum constant with the specified name + + Raises: + :class:`~org.hipparchus.geometry.euclidean.threed.https:.docs.oracle.com.javase.8.docs.api.java.lang.IllegalArgumentException`: if this enum type has no constant with the specified name + :class:`~org.hipparchus.geometry.euclidean.threed.https:.docs.oracle.com.javase.8.docs.api.java.lang.NullPointerException`: if the argument is null + + + """ + ... @staticmethod - def values() -> typing.MutableSequence['RotationConvention']: ... + def values() -> typing.MutableSequence['RotationConvention']: + """ + Returns an array containing the constants of this enum type, in the order they are declared. + + Returns: + an array containing the constants of this enum type, in the order they are declared + + + """ + ... class RotationOrder(java.lang.Enum['RotationOrder']): + """ + public enumRotationOrder extends :class:`~org.hipparchus.geometry.euclidean.threed.https:.docs.oracle.com.javase.8.docs.api.java.lang.Enum`<:class:`~org.hipparchus.geometry.euclidean.threed.RotationOrder`> + + Enumerate representing a rotation order specification for Cardan or Euler angles. + + Since Hipparchus 1.7 this class is an enumerate class. + """ XYZ: typing.ClassVar['RotationOrder'] = ... XZY: typing.ClassVar['RotationOrder'] = ... YXZ: typing.ClassVar['RotationOrder'] = ... @@ -542,50 +2493,322 @@ class RotationOrder(java.lang.Enum['RotationOrder']): YZY: typing.ClassVar['RotationOrder'] = ... ZXZ: typing.ClassVar['RotationOrder'] = ... ZYZ: typing.ClassVar['RotationOrder'] = ... - def getA1(self) -> 'Vector3D': ... - def getA2(self) -> 'Vector3D': ... - def getA3(self) -> 'Vector3D': ... + def getA1(self) -> 'Vector3D': + """ + Get the axis of the first rotation. + + Returns: + axis of the first rotation + + + """ + ... + def getA2(self) -> 'Vector3D': + """ + Get the axis of the second rotation. + + Returns: + axis of the second rotation + + + """ + ... + def getA3(self) -> 'Vector3D': + """ + Get the axis of the third rotation. + + Returns: + axis of the third rotation + + + """ + ... _getAngles_1__T = typing.TypeVar('_getAngles_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload - def getAngles(self, rotation: Rotation, rotationConvention: RotationConvention) -> typing.MutableSequence[float]: ... - @typing.overload - def getAngles(self, fieldRotation: FieldRotation[_getAngles_1__T], rotationConvention: RotationConvention) -> typing.MutableSequence[_getAngles_1__T]: ... + def getAngles(self, rotation: Rotation, rotationConvention: RotationConvention) -> typing.MutableSequence[float]: + """ + Get the Cardan or Euler angles corresponding to the instance. + + Parameters: + rotation (:class:`~org.hipparchus.geometry.euclidean.threed.Rotation`): rotation from which angles should be extracted + convention (:class:`~org.hipparchus.geometry.euclidean.threed.RotationConvention`): convention to use for the semantics of the angle + + Returns: + an array of three angles, in the order specified by the set + + Since: + 3.1 + + """ + ... + @typing.overload + def getAngles(self, fieldRotation: FieldRotation[_getAngles_1__T], rotationConvention: RotationConvention) -> typing.MutableSequence[_getAngles_1__T]: + """ + Get the Cardan or Euler angles corresponding to the instance. + + Parameters: + rotation (:class:`~org.hipparchus.geometry.euclidean.threed.FieldRotation`<T> rotation): rotation from which angles should be extracted + convention (:class:`~org.hipparchus.geometry.euclidean.threed.RotationConvention`): convention to use for the semantics of the angle + + Returns: + an array of three angles, in the order specified by the set + + Since: + 3.1 + + + """ + ... @staticmethod - def getRotationOrder(string: str) -> 'RotationOrder': ... - def toString(self) -> str: ... + def getRotationOrder(string: str) -> 'RotationOrder': + """ + Get the rotation order corresponding to a string representation. + + Parameters: + value (:class:`~org.hipparchus.geometry.euclidean.threed.https:.docs.oracle.com.javase.8.docs.api.java.lang.String`): name + + Returns: + a rotation order object + + Since: + 1.7 + + + """ + ... + def toString(self) -> str: + """ + Get a string representation of the instance. + + Overrides: + :meth:`~org.hipparchus.geometry.euclidean.threed.https:.docs.oracle.com.javase.8.docs.api.java.lang.Enum.toString` in + class :class:`~org.hipparchus.geometry.euclidean.threed.https:.docs.oracle.com.javase.8.docs.api.java.lang.Enum` + + Returns: + a string representation of the instance (in fact, its name) + + + """ + ... _valueOf_0__T = typing.TypeVar('_valueOf_0__T', bound=java.lang.Enum) # <T> @typing.overload @staticmethod def valueOf(class_: typing.Type[_valueOf_0__T], string: str) -> _valueOf_0__T: ... @typing.overload @staticmethod - def valueOf(string: str) -> 'RotationOrder': ... + def valueOf(string: str) -> 'RotationOrder': + """ + Returns the enum constant of this type with the specified name. The string must match *exactly* an identifier used to + declare an enum constant in this type. (Extraneous whitespace characters are not permitted.) + + Parameters: + name (:class:`~org.hipparchus.geometry.euclidean.threed.https:.docs.oracle.com.javase.8.docs.api.java.lang.String`): the name of the enum constant to be returned. + + Returns: + the enum constant with the specified name + + Raises: + :class:`~org.hipparchus.geometry.euclidean.threed.https:.docs.oracle.com.javase.8.docs.api.java.lang.IllegalArgumentException`: if this enum type has no constant with the specified name + :class:`~org.hipparchus.geometry.euclidean.threed.https:.docs.oracle.com.javase.8.docs.api.java.lang.NullPointerException`: if the argument is null + + + """ + ... @staticmethod - def values() -> typing.MutableSequence['RotationOrder']: ... + def values() -> typing.MutableSequence['RotationOrder']: + """ + Returns an array containing the constants of this enum type, in the order they are declared. + + Returns: + an array containing the constants of this enum type, in the order they are declared + + + """ + ... class Segment: + """ + public classSegment extends :class:`~org.hipparchus.geometry.euclidean.threed.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Simple container for a two-points segment. + """ def __init__(self, vector3D: 'Vector3D', vector3D2: 'Vector3D', line: Line): ... - def getEnd(self) -> 'Vector3D': ... - def getLine(self) -> Line: ... - def getStart(self) -> 'Vector3D': ... + def getEnd(self) -> 'Vector3D': + """ + Get the end point of the segment. + + Returns: + end point of the segment + + + """ + ... + def getLine(self) -> Line: + """ + Get the line containing the segment. + + Returns: + line containing the segment + + + """ + ... + def getStart(self) -> 'Vector3D': + """ + Get the start point of the segment. + + Returns: + start point of the segment + + + """ + ... class SphereGenerator(org.hipparchus.geometry.enclosing.SupportBallGenerator[Euclidean3D, 'Vector3D']): + """ + public classSphereGenerator extends :class:`~org.hipparchus.geometry.euclidean.threed.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.geometry.enclosing.SupportBallGenerator`<:class:`~org.hipparchus.geometry.euclidean.threed.Euclidean3D`,:class:`~org.hipparchus.geometry.euclidean.threed.Vector3D`> + + Class generating an enclosing ball from its support points. + """ def __init__(self): ... def ballOnSupport(self, list: java.util.List['Vector3D']) -> org.hipparchus.geometry.enclosing.EnclosingBall[Euclidean3D, 'Vector3D']: ... class SphericalCoordinates(java.io.Serializable): + """ + public classSphericalCoordinates extends :class:`~org.hipparchus.geometry.euclidean.threed.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.geometry.euclidean.threed.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + This class provides conversions related to `spherical coordinates + <http://mathworld.wolfram.com/SphericalCoordinates.html>`. + + The conventions used here are the mathematical ones, i.e. spherical coordinates are related to Cartesian coordinates as + follows: + + - x = r cos(θ) sin(Φ) + - y = r sin(θ) sin(Φ) + - z = r cos(Φ) + + + - r = √(x :sup:`2` +y :sup:`2` +z :sup:`2` ) + - θ = atan2(y, x) + - Φ = acos(z/r) + + + r is the radius, θ is the azimuthal angle in the x-y plane and Φ is the polar (co-latitude) angle. These conventions + are *different* from the conventions used in physics (and in particular in spherical harmonics) where the meanings of θ + and Φ are reversed. + + This class provides conversion of coordinates and also of gradient and Hessian between spherical and Cartesian + coordinates. + + Also see: + + - :meth:`~serialized` + """ @typing.overload def __init__(self, double: float, double2: float, double3: float): ... @typing.overload def __init__(self, vector3D: 'Vector3D'): ... - def getCartesian(self) -> 'Vector3D': ... - def getPhi(self) -> float: ... - def getR(self) -> float: ... - def getTheta(self) -> float: ... - def toCartesianGradient(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> typing.MutableSequence[float]: ... - def toCartesianHessian(self, doubleArray: typing.Union[typing.List[typing.MutableSequence[float]], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray]) -> typing.MutableSequence[typing.MutableSequence[float]]: ... + def getCartesian(self) -> 'Vector3D': + """ + Get the Cartesian coordinates. + + Returns: + Cartesian coordinates + + + """ + ... + def getPhi(self) -> float: + """ + Get the polar (co-latitude) angle. + + Returns: + polar (co-latitude) angle Φ + + Also see: + + - :meth:`~org.hipparchus.geometry.euclidean.threed.SphericalCoordinates.getR` + - :meth:`~org.hipparchus.geometry.euclidean.threed.SphericalCoordinates.getTheta` + + + + """ + ... + def getR(self) -> float: + """ + Get the radius. + + Returns: + radius r + + Also see: + + - :meth:`~org.hipparchus.geometry.euclidean.threed.SphericalCoordinates.getTheta` + - :meth:`~org.hipparchus.geometry.euclidean.threed.SphericalCoordinates.getPhi` + + + + """ + ... + def getTheta(self) -> float: + """ + Get the azimuthal angle in x-y plane. + + Returns: + azimuthal angle in x-y plane θ + + Also see: + + - :meth:`~org.hipparchus.geometry.euclidean.threed.SphericalCoordinates.getR` + - :meth:`~org.hipparchus.geometry.euclidean.threed.SphericalCoordinates.getPhi` + + + + """ + ... + def toCartesianGradient(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> typing.MutableSequence[float]: + """ + Convert a gradient with respect to spherical coordinates into a gradient with respect to Cartesian coordinates. + + Parameters: + sGradient (double[]): gradient with respect to spherical coordinates {df/dr, df/dθ, df/dΦ} + + Returns: + gradient with respect to Cartesian coordinates {df/dx, df/dy, df/dz} + + + """ + ... + def toCartesianHessian(self, doubleArray: typing.Union[typing.List[typing.MutableSequence[float]], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray]) -> typing.MutableSequence[typing.MutableSequence[float]]: + """ + Convert a Hessian with respect to spherical coordinates into a Hessian with respect to Cartesian coordinates. + + As Hessian are always symmetric, we use only the lower left part of the provided spherical Hessian, so the upper part + may not be initialized. However, we still do fill up the complete array we create, with guaranteed symmetry. + + Parameters: + sHessian (double[][]): Hessian with respect to spherical coordinates {{d :sup:`2` f/dr :sup:`2` , d :sup:`2` f/drdθ, d :sup:`2` f/drdΦ}, {d + :sup:`2` f/drdθ, d :sup:`2` f/dθ :sup:`2` , d :sup:`2` f/dθdΦ}, {d :sup:`2` f/drdΦ, d :sup:`2` f/dθdΦ, d :sup:`2` + f/dΦ :sup:`2` } + sGradient (double[]): gradient with respect to spherical coordinates {df/dr, df/dθ, df/dΦ} + + Returns: + Hessian with respect to Cartesian coordinates {{d :sup:`2` f/dx :sup:`2` , d :sup:`2` f/dxdy, d :sup:`2` f/dxdz}, {d + :sup:`2` f/dxdy, d :sup:`2` f/dy :sup:`2` , d :sup:`2` f/dydz}, {d :sup:`2` f/dxdz, d :sup:`2` f/dydz, d :sup:`2` f/dz + :sup:`2` }} + + + """ + ... class SubLine: + """ + public classSubLine extends :class:`~org.hipparchus.geometry.euclidean.threed.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + This class represents a subset of a :class:`~org.hipparchus.geometry.euclidean.threed.Line`. + """ @typing.overload def __init__(self, line: Line, intervalsSet: org.hipparchus.geometry.euclidean.oned.IntervalsSet): ... @typing.overload @@ -593,23 +2816,119 @@ class SubLine: @typing.overload def __init__(self, vector3D: 'Vector3D', vector3D2: 'Vector3D', double: float): ... def getSegments(self) -> java.util.List[Segment]: ... - def intersection(self, subLine: 'SubLine', boolean: bool) -> 'Vector3D': ... + def intersection(self, subLine: 'SubLine', boolean: bool) -> 'Vector3D': + """ + Get the intersection of the instance and another sub-line. + + This method is related to the :meth:`~org.hipparchus.geometry.euclidean.threed.Line.intersection` method in the + :class:`~org.hipparchus.geometry.euclidean.threed.Line` class, but in addition to compute the point along infinite + lines, it also checks the point lies on both sub-line ranges. + + Parameters: + subLine (:class:`~org.hipparchus.geometry.euclidean.threed.SubLine`): other sub-line which may intersect instance + includeEndPoints (boolean): if true, endpoints are considered to belong to instance (i.e. they are closed sets) and may be returned, otherwise + endpoints are considered to not belong to instance (i.e. they are open sets) and intersection occurring on endpoints + lead to null being returned + + Returns: + the intersection point if there is one, null if the sub-lines don't intersect + + + """ + ... class SubPlane(org.hipparchus.geometry.partitioning.AbstractSubHyperplane[Euclidean3D, org.hipparchus.geometry.euclidean.twod.Euclidean2D]): + """ + public classSubPlane extends :class:`~org.hipparchus.geometry.partitioning.AbstractSubHyperplane`<:class:`~org.hipparchus.geometry.euclidean.threed.Euclidean3D`,:class:`~org.hipparchus.geometry.euclidean.twod.Euclidean2D`> + + This class represents a sub-hyperplane for :class:`~org.hipparchus.geometry.euclidean.threed.Plane`. + """ def __init__(self, hyperplane: org.hipparchus.geometry.partitioning.Hyperplane[Euclidean3D], region: org.hipparchus.geometry.partitioning.Region[org.hipparchus.geometry.euclidean.twod.Euclidean2D]): ... def split(self, hyperplane: org.hipparchus.geometry.partitioning.Hyperplane[Euclidean3D]) -> org.hipparchus.geometry.partitioning.SubHyperplane.SplitSubHyperplane[Euclidean3D]: ... class Vector3D(java.io.Serializable, org.hipparchus.geometry.Vector[Euclidean3D, 'Vector3D']): + """ + public classVector3D extends :class:`~org.hipparchus.geometry.euclidean.threed.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.geometry.euclidean.threed.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable`, :class:`~org.hipparchus.geometry.Vector`<:class:`~org.hipparchus.geometry.euclidean.threed.Euclidean3D`,:class:`~org.hipparchus.geometry.euclidean.threed.Vector3D`> + + This class implements vectors in a three-dimensional space. + + Instance of this class are guaranteed to be immutable. + + Also see: + + - :meth:`~serialized` + """ ZERO: typing.ClassVar['Vector3D'] = ... + """ + public static final :class:`~org.hipparchus.geometry.euclidean.threed.Vector3D` ZERO + + Null vector (coordinates: 0, 0, 0). + + """ PLUS_I: typing.ClassVar['Vector3D'] = ... + """ + public static final :class:`~org.hipparchus.geometry.euclidean.threed.Vector3D` PLUS_I + + First canonical vector (coordinates: 1, 0, 0). + + """ MINUS_I: typing.ClassVar['Vector3D'] = ... + """ + public static final :class:`~org.hipparchus.geometry.euclidean.threed.Vector3D` MINUS_I + + Opposite of the first canonical vector (coordinates: -1, 0, 0). + + """ PLUS_J: typing.ClassVar['Vector3D'] = ... + """ + public static final :class:`~org.hipparchus.geometry.euclidean.threed.Vector3D` PLUS_J + + Second canonical vector (coordinates: 0, 1, 0). + + """ MINUS_J: typing.ClassVar['Vector3D'] = ... + """ + public static final :class:`~org.hipparchus.geometry.euclidean.threed.Vector3D` MINUS_J + + Opposite of the second canonical vector (coordinates: 0, -1, 0). + + """ PLUS_K: typing.ClassVar['Vector3D'] = ... + """ + public static final :class:`~org.hipparchus.geometry.euclidean.threed.Vector3D` PLUS_K + + Third canonical vector (coordinates: 0, 0, 1). + + """ MINUS_K: typing.ClassVar['Vector3D'] = ... + """ + public static final :class:`~org.hipparchus.geometry.euclidean.threed.Vector3D` MINUS_K + + Opposite of the third canonical vector (coordinates: 0, 0, -1). + + """ NaN: typing.ClassVar['Vector3D'] = ... + """ + public static final :class:`~org.hipparchus.geometry.euclidean.threed.Vector3D` NaN + + A vector with all coordinates set to NaN. + + """ POSITIVE_INFINITY: typing.ClassVar['Vector3D'] = ... + """ + public static final :class:`~org.hipparchus.geometry.euclidean.threed.Vector3D` POSITIVE_INFINITY + + A vector with all coordinates set to positive infinity. + + """ NEGATIVE_INFINITY: typing.ClassVar['Vector3D'] = ... + """ + public static final :class:`~org.hipparchus.geometry.euclidean.threed.Vector3D` NEGATIVE_INFINITY + + A vector with all coordinates set to negative infinity. + + """ @typing.overload def __init__(self, double: float, double2: float): ... @typing.overload @@ -631,65 +2950,471 @@ class Vector3D(java.io.Serializable, org.hipparchus.geometry.Vector[Euclidean3D, @staticmethod def angle(vector3D: 'Vector3D', vector3D2: 'Vector3D') -> float: ... @typing.overload - def crossProduct(self, vector: org.hipparchus.geometry.Vector[Euclidean3D, 'Vector3D']) -> 'Vector3D': ... + def crossProduct(self, vector: org.hipparchus.geometry.Vector[Euclidean3D, 'Vector3D']) -> 'Vector3D': + """ + Compute the cross-product of two vectors. + + Parameters: + v1 (:class:`~org.hipparchus.geometry.euclidean.threed.Vector3D`): first vector + v2 (:class:`~org.hipparchus.geometry.euclidean.threed.Vector3D`): second vector + + Returns: + the cross product v1 ^ v2 as a new Vector + + + """ + ... @typing.overload @staticmethod def crossProduct(vector3D: 'Vector3D', vector3D2: 'Vector3D') -> 'Vector3D': ... @typing.overload - def distance(self, point: org.hipparchus.geometry.Point[Euclidean3D]) -> float: ... + def distance(self, point: org.hipparchus.geometry.Point[Euclidean3D]) -> float: + """ + Compute the distance between two vectors according to the L :sub:`2` norm. + + Calling this method is equivalent to calling: :code:`v1.subtract(v2).getNorm()` except that no intermediate vector is + built + + Parameters: + v1 (:class:`~org.hipparchus.geometry.euclidean.threed.Vector3D`): first vector + v2 (:class:`~org.hipparchus.geometry.euclidean.threed.Vector3D`): second vector + + Returns: + the distance between v1 and v2 according to the L :sub:`2` norm + + + """ + ... @typing.overload @staticmethod def distance(vector3D: 'Vector3D', vector3D2: 'Vector3D') -> float: ... @typing.overload - def distance1(self, vector: org.hipparchus.geometry.Vector[Euclidean3D, 'Vector3D']) -> float: ... + def distance1(self, vector: org.hipparchus.geometry.Vector[Euclidean3D, 'Vector3D']) -> float: + """ + Compute the distance between two vectors according to the L :sub:`1` norm. + + Calling this method is equivalent to calling: :code:`v1.subtract(v2).getNorm1()` except that no intermediate vector is + built + + Parameters: + v1 (:class:`~org.hipparchus.geometry.euclidean.threed.Vector3D`): first vector + v2 (:class:`~org.hipparchus.geometry.euclidean.threed.Vector3D`): second vector + + Returns: + the distance between v1 and v2 according to the L :sub:`1` norm + + + """ + ... @typing.overload @staticmethod def distance1(vector3D: 'Vector3D', vector3D2: 'Vector3D') -> float: ... @typing.overload - def distanceInf(self, vector: org.hipparchus.geometry.Vector[Euclidean3D, 'Vector3D']) -> float: ... + def distanceInf(self, vector: org.hipparchus.geometry.Vector[Euclidean3D, 'Vector3D']) -> float: + """ + Compute the distance between two vectors according to the L :sub:`∞` norm. + + Calling this method is equivalent to calling: :code:`v1.subtract(v2).getNormInf()` except that no intermediate vector is + built + + Parameters: + v1 (:class:`~org.hipparchus.geometry.euclidean.threed.Vector3D`): first vector + v2 (:class:`~org.hipparchus.geometry.euclidean.threed.Vector3D`): second vector + + Returns: + the distance between v1 and v2 according to the L :sub:`∞` norm + + + """ + ... @typing.overload @staticmethod def distanceInf(vector3D: 'Vector3D', vector3D2: 'Vector3D') -> float: ... @typing.overload - def distanceSq(self, vector: org.hipparchus.geometry.Vector[Euclidean3D, 'Vector3D']) -> float: ... + def distanceSq(self, vector: org.hipparchus.geometry.Vector[Euclidean3D, 'Vector3D']) -> float: + """ + Compute the square of the distance between two vectors. + + Calling this method is equivalent to calling: :code:`v1.subtract(v2).getNormSq()` except that no intermediate vector is + built + + Parameters: + v1 (:class:`~org.hipparchus.geometry.euclidean.threed.Vector3D`): first vector + v2 (:class:`~org.hipparchus.geometry.euclidean.threed.Vector3D`): second vector + + Returns: + the square of the distance between v1 and v2 + + + """ + ... @typing.overload @staticmethod def distanceSq(vector3D: 'Vector3D', vector3D2: 'Vector3D') -> float: ... @typing.overload - def dotProduct(self, vector: org.hipparchus.geometry.Vector[Euclidean3D, 'Vector3D']) -> float: ... + def dotProduct(self, vector: org.hipparchus.geometry.Vector[Euclidean3D, 'Vector3D']) -> float: + """ + Compute the dot-product of two vectors. + + Parameters: + v1 (:class:`~org.hipparchus.geometry.euclidean.threed.Vector3D`): first vector + v2 (:class:`~org.hipparchus.geometry.euclidean.threed.Vector3D`): second vector + + Returns: + the dot product v1.v2 + + + """ + ... @typing.overload @staticmethod def dotProduct(vector3D: 'Vector3D', vector3D2: 'Vector3D') -> float: ... - def equals(self, object: typing.Any) -> bool: ... - def equalsIeee754(self, object: typing.Any) -> bool: ... - def getAlpha(self) -> float: ... - def getDelta(self) -> float: ... - def getNorm(self) -> float: ... - def getNorm1(self) -> float: ... - def getNormInf(self) -> float: ... - def getNormSq(self) -> float: ... - def getSpace(self) -> org.hipparchus.geometry.Space: ... - def getX(self) -> float: ... - def getY(self) -> float: ... - def getZ(self) -> float: ... - def getZero(self) -> 'Vector3D': ... - def hashCode(self) -> int: ... - def isInfinite(self) -> bool: ... - def isNaN(self) -> bool: ... - def negate(self) -> 'Vector3D': ... + def equals(self, object: typing.Any) -> bool: + """ + Test for the equality of two 3D vectors. + + If all coordinates of two 3D vectors are exactly the same, and none are :code:`Double.NaN`, the two 3D vectors are + considered to be equal. + + :code:`NaN` coordinates are considered to affect globally the vector and be equals to each other - i.e, if either (or + all) coordinates of the 3D vector are equal to :code:`Double.NaN`, the 3D vector is equal to + :meth:`~org.hipparchus.geometry.euclidean.threed.Vector3D.NaN`. + + Overrides: + :meth:`~org.hipparchus.geometry.euclidean.threed.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.equals` in + class :class:`~org.hipparchus.geometry.euclidean.threed.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Parameters: + other (:class:`~org.hipparchus.geometry.euclidean.threed.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object`): Object to test for equality to this + + Returns: + true if two 3D vector objects are equal, false if object is null, not an instance of Vector3D, or not equal to this + Vector3D instance + + + """ + ... + def equalsIeee754(self, object: typing.Any) -> bool: + """ + Test for the equality of two 3D vectors. + + If all coordinates of two 3D vectors are exactly the same, and none are :code:`NaN`, the two 3D vectors are considered + to be equal. + + In compliance with IEEE754 handling, if any coordinates of any of the two vectors are :code:`NaN`, then the vectors are + considered different. This implies that + :meth:`~org.hipparchus.geometry.euclidean.threed.Vector3D.NaN`.equals(:meth:`~org.hipparchus.geometry.euclidean.threed.Vector3D.NaN`) + returns :code:`false` despite the instance is checked against itself. + + Parameters: + other (:class:`~org.hipparchus.geometry.euclidean.threed.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object`): Object to test for equality to this + + Returns: + true if two 3D vector objects are equal, false if object is null, not an instance of Vector3D, or not equal to this + Vector3D instance + + Since: + 2.1 + + + """ + ... + def getAlpha(self) -> float: + """ + Get the azimuth of the vector. + + Returns: + azimuth (α) of the vector, between -Ï€ and +Ï€ + + Also see: + + - :meth:`~org.hipparchus.geometry.euclidean.threed.Vector3D.%3Cinit%3E` + + + + """ + ... + def getDelta(self) -> float: + """ + Get the elevation of the vector. + + Returns: + elevation (δ) of the vector, between -Ï€/2 and +Ï€/2 + + Also see: + + - :meth:`~org.hipparchus.geometry.euclidean.threed.Vector3D.%3Cinit%3E` + + + + """ + ... + def getNorm(self) -> float: + """ + Get the L :sub:`2` norm for the vector. + + Specified by: + :meth:`~org.hipparchus.geometry.Vector.getNorm` in interface :class:`~org.hipparchus.geometry.Vector` + + Returns: + Euclidean norm for the vector + + + """ + ... + def getNorm1(self) -> float: + """ + Get the L :sub:`1` norm for the vector. + + Specified by: + :meth:`~org.hipparchus.geometry.Vector.getNorm1` in interface :class:`~org.hipparchus.geometry.Vector` + + Returns: + L :sub:`1` norm for the vector + + + """ + ... + def getNormInf(self) -> float: + """ + Get the L :sub:`∞` norm for the vector. + + Specified by: + :meth:`~org.hipparchus.geometry.Vector.getNormInf` in interface :class:`~org.hipparchus.geometry.Vector` + + Returns: + L :sub:`∞` norm for the vector + + + """ + ... + def getNormSq(self) -> float: + """ + Get the square of the norm for the vector. + + Specified by: + :meth:`~org.hipparchus.geometry.Vector.getNormSq` in interface :class:`~org.hipparchus.geometry.Vector` + + Returns: + square of the Euclidean norm for the vector + + + """ + ... + def getSpace(self) -> org.hipparchus.geometry.Space: + """ + Get the space to which the point belongs. + + Specified by: + :meth:`~org.hipparchus.geometry.Point.getSpace` in interface :class:`~org.hipparchus.geometry.Point` + + Returns: + containing space + + + """ + ... + def getX(self) -> float: + """ + Get the abscissa of the vector. + + Returns: + abscissa of the vector + + Also see: + + - :meth:`~org.hipparchus.geometry.euclidean.threed.Vector3D.%3Cinit%3E` + + + + """ + ... + def getY(self) -> float: + """ + Get the ordinate of the vector. + + Returns: + ordinate of the vector + + Also see: + + - :meth:`~org.hipparchus.geometry.euclidean.threed.Vector3D.%3Cinit%3E` + + + + """ + ... + def getZ(self) -> float: + """ + Get the height of the vector. + + Returns: + height of the vector + + Also see: + + - :meth:`~org.hipparchus.geometry.euclidean.threed.Vector3D.%3Cinit%3E` + + + + """ + ... + def getZero(self) -> 'Vector3D': + """ + Get the null vector of the vectorial space or origin point of the affine space. + + Specified by: + :meth:`~org.hipparchus.geometry.Vector.getZero` in interface :class:`~org.hipparchus.geometry.Vector` + + Returns: + null vector of the vectorial space or origin point of the affine space + + + """ + ... + def hashCode(self) -> int: + """ + Get a hashCode for the 3D vector. + + All NaN values have the same hash code. + + Overrides: + :meth:`~org.hipparchus.geometry.euclidean.threed.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.hashCode` in + class :class:`~org.hipparchus.geometry.euclidean.threed.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Returns: + a hash code value for this object + + + """ + ... + def isInfinite(self) -> bool: + """ + Returns true if any coordinate of this vector is infinite and none are NaN; false otherwise + + Specified by: + :meth:`~org.hipparchus.geometry.Vector.isInfinite` in interface :class:`~org.hipparchus.geometry.Vector` + + Returns: + true if any coordinate of this vector is infinite and none are NaN; false otherwise + + + """ + ... + def isNaN(self) -> bool: + """ + Returns true if any coordinate of this point is NaN; false otherwise + + Specified by: + :meth:`~org.hipparchus.geometry.Point.isNaN` in interface :class:`~org.hipparchus.geometry.Point` + + Returns: + true if any coordinate of this point is NaN; false otherwise + + + """ + ... + def negate(self) -> 'Vector3D': + """ + Get the opposite of the instance. + + Specified by: + :meth:`~org.hipparchus.geometry.Vector.negate` in interface :class:`~org.hipparchus.geometry.Vector` + + Returns: + a new vector which is opposite to the instance + + + """ + ... def orthogonal(self) -> 'Vector3D': ... - def scalarMultiply(self, double: float) -> 'Vector3D': ... + def scalarMultiply(self, double: float) -> 'Vector3D': + """ + Multiply the instance by a scalar. + + Specified by: + :meth:`~org.hipparchus.geometry.Vector.scalarMultiply` in interface :class:`~org.hipparchus.geometry.Vector` + + Parameters: + a (double): scalar + + Returns: + a new vector + + + """ + ... @typing.overload def subtract(self, double: float, vector: org.hipparchus.geometry.Vector[Euclidean3D, 'Vector3D']) -> 'Vector3D': ... @typing.overload def subtract(self, vector: org.hipparchus.geometry.Vector[Euclidean3D, 'Vector3D']) -> 'Vector3D': ... - def toArray(self) -> typing.MutableSequence[float]: ... - @typing.overload - def toString(self) -> str: ... - @typing.overload - def toString(self, numberFormat: java.text.NumberFormat) -> str: ... + def toArray(self) -> typing.MutableSequence[float]: + """ + Get the vector coordinates as a dimension 3 array. + + Returns: + vector coordinates + + Also see: + + - :meth:`~org.hipparchus.geometry.euclidean.threed.Vector3D.%3Cinit%3E` + + + + """ + ... + @typing.overload + def toString(self) -> str: + """ + Get a string representation of this vector. + + Overrides: + :meth:`~org.hipparchus.geometry.euclidean.threed.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.toString` in + class :class:`~org.hipparchus.geometry.euclidean.threed.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Returns: + a string representation of this vector + + """ + ... + @typing.overload + def toString(self, numberFormat: java.text.NumberFormat) -> str: + """ + Get a string representation of this vector. + + Specified by: + :meth:`~org.hipparchus.geometry.Vector.toString` in interface :class:`~org.hipparchus.geometry.Vector` + + Parameters: + format (:class:`~org.hipparchus.geometry.euclidean.threed.https:.docs.oracle.com.javase.8.docs.api.java.text.NumberFormat`): the custom format for components + + Returns: + a string representation of this vector + + + """ + ... class Vector3DFormat(org.hipparchus.geometry.VectorFormat[Euclidean3D, Vector3D]): + """ + public classVector3DFormat extends :class:`~org.hipparchus.geometry.VectorFormat`<:class:`~org.hipparchus.geometry.euclidean.threed.Euclidean3D`,:class:`~org.hipparchus.geometry.euclidean.threed.Vector3D`> + + Formats a 3D vector in components list format "{x; y; z}". + + The prefix and suffix "{" and "}" and the separator "; " can be replaced by any user-defined strings. The number format + for components can be configured. + + White space is ignored at parse time, even if it is in the prefix, suffix or separator specifications. So even if the + default separator does include a space character that is used at format time, both input string "{1;1;1}" and " { 1 ; 1 + ; 1 } " will be parsed without error and the same vector will be returned. In the second case, however, the parse + position after parsing will be just after the closing curly brace, i.e. just before the trailing space. + + **Note:** using "," as a separator may interfere with the grouping separator of the default + :class:`~org.hipparchus.geometry.euclidean.threed.https:.docs.oracle.com.javase.8.docs.api.java.text.NumberFormat` for + the current locale. Thus it is advised to use a + :class:`~org.hipparchus.geometry.euclidean.threed.https:.docs.oracle.com.javase.8.docs.api.java.text.NumberFormat` + instance with disabled grouping in such a case. + """ @typing.overload def __init__(self): ... @typing.overload @@ -704,12 +3429,54 @@ class Vector3DFormat(org.hipparchus.geometry.VectorFormat[Euclidean3D, Vector3D] def format(self, vector: org.hipparchus.geometry.Vector[Euclidean3D, Vector3D], stringBuffer: java.lang.StringBuffer, fieldPosition: java.text.FieldPosition) -> java.lang.StringBuffer: ... @typing.overload @staticmethod - def getVector3DFormat() -> 'Vector3DFormat': ... + def getVector3DFormat() -> 'Vector3DFormat': + """ + Returns the default 3D vector format for the current locale. + + Returns: + the default 3D vector format. + + Since: + 1.4 + + """ + ... @typing.overload @staticmethod - def getVector3DFormat(locale: java.util.Locale) -> 'Vector3DFormat': ... - @typing.overload - def parse(self, string: str) -> Vector3D: ... + def getVector3DFormat(locale: java.util.Locale) -> 'Vector3DFormat': + """ + Returns the default 3D vector format for the given locale. + + Parameters: + locale (:class:`~org.hipparchus.geometry.euclidean.threed.https:.docs.oracle.com.javase.8.docs.api.java.util.Locale`): the specific locale used by the format. + + Returns: + the 3D vector format specific to the given locale. + + Since: + 1.4 + + + """ + ... + @typing.overload + def parse(self, string: str) -> Vector3D: + """ + Parses a string to produce a :class:`~org.hipparchus.geometry.euclidean.threed.Vector3D` object. + + Specified by: + :meth:`~org.hipparchus.geometry.VectorFormat.parse` in class :class:`~org.hipparchus.geometry.VectorFormat` + + Parameters: + source (:class:`~org.hipparchus.geometry.euclidean.threed.https:.docs.oracle.com.javase.8.docs.api.java.lang.String`): the string to parse + pos (:class:`~org.hipparchus.geometry.euclidean.threed.https:.docs.oracle.com.javase.8.docs.api.java.text.ParsePosition`): input/ouput parsing parameter. + + Returns: + the parsed :class:`~org.hipparchus.geometry.euclidean.threed.Vector3D` object. + + + """ + ... @typing.overload def parse(self, string: str, parsePosition: java.text.ParsePosition) -> Vector3D: ... diff --git a/org-stubs/hipparchus/geometry/euclidean/twod/__init__.pyi b/org-stubs/hipparchus/geometry/euclidean/twod/__init__.pyi index 1d16ba8..c3a293b 100644 --- a/org-stubs/hipparchus/geometry/euclidean/twod/__init__.pyi +++ b/org-stubs/hipparchus/geometry/euclidean/twod/__init__.pyi @@ -21,17 +21,82 @@ import typing class DiskGenerator(org.hipparchus.geometry.enclosing.SupportBallGenerator['Euclidean2D', 'Vector2D']): + """ + public classDiskGenerator extends :class:`~org.hipparchus.geometry.euclidean.twod.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.geometry.enclosing.SupportBallGenerator`<:class:`~org.hipparchus.geometry.euclidean.twod.Euclidean2D`,:class:`~org.hipparchus.geometry.euclidean.twod.Vector2D`> + + Class generating an enclosing ball from its support points. + """ def __init__(self): ... def ballOnSupport(self, list: java.util.List['Vector2D']) -> org.hipparchus.geometry.enclosing.EnclosingBall['Euclidean2D', 'Vector2D']: ... class Euclidean2D(java.io.Serializable, org.hipparchus.geometry.Space): - def getDimension(self) -> int: ... + """ + public classEuclidean2D extends :class:`~org.hipparchus.geometry.euclidean.twod.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.geometry.euclidean.twod.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable`, :class:`~org.hipparchus.geometry.Space` + + This class implements a two-dimensional space. + + Also see: + + - :meth:`~serialized` + """ + def getDimension(self) -> int: + """ + Get the dimension of the space. + + Specified by: + :meth:`~org.hipparchus.geometry.Space.getDimension` in interface :class:`~org.hipparchus.geometry.Space` + + Returns: + dimension of the space + + + """ + ... @staticmethod - def getInstance() -> 'Euclidean2D': ... - def getSubSpace(self) -> org.hipparchus.geometry.euclidean.oned.Euclidean1D: ... + def getInstance() -> 'Euclidean2D': + """ + Get the unique instance. + + Returns: + the unique instance + + + """ + ... + def getSubSpace(self) -> org.hipparchus.geometry.euclidean.oned.Euclidean1D: + """ + Get the n-1 dimension subspace of this space. + + Specified by: + :meth:`~org.hipparchus.geometry.Space.getSubSpace` in interface :class:`~org.hipparchus.geometry.Space` + + Returns: + n-1 dimension sub-space of this space + + Also see: + + - :meth:`~org.hipparchus.geometry.Space.getDimension` + + + + """ + ... _FieldVector2D__T = typing.TypeVar('_FieldVector2D__T', bound=org.hipparchus.CalculusFieldElement) # <T> class FieldVector2D(typing.Generic[_FieldVector2D__T]): + """ + public classFieldVector2D<T extends :class:`~org.hipparchus.geometry.euclidean.twod.https:.www.hipparchus.org.hipparchus`<T>> extends :class:`~org.hipparchus.geometry.euclidean.twod.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + This class is a re-implementation of :class:`~org.hipparchus.geometry.euclidean.twod.Vector2D` using + :class:`~org.hipparchus.geometry.euclidean.twod.https:.www.hipparchus.org.hipparchus`. + + Instance of this class are guaranteed to be immutable. + + Since: + 1.6 + """ @typing.overload def __init__(self, double: float, fieldVector2D: 'FieldVector2D'[_FieldVector2D__T]): ... @typing.overload @@ -87,19 +152,97 @@ class FieldVector2D(typing.Generic[_FieldVector2D__T]): @staticmethod def angle(vector2D: 'Vector2D', fieldVector2D: 'FieldVector2D'[_angle_2__T]) -> _angle_2__T: ... @typing.overload - def crossProduct(self, fieldVector2D: 'FieldVector2D'[_FieldVector2D__T], fieldVector2D2: 'FieldVector2D'[_FieldVector2D__T]) -> _FieldVector2D__T: ... + def crossProduct(self, fieldVector2D: 'FieldVector2D'[_FieldVector2D__T], fieldVector2D2: 'FieldVector2D'[_FieldVector2D__T]) -> _FieldVector2D__T: + """ + Compute the cross-product of the instance and the given points. + + The cross product can be used to determine the location of a point with regard to the line formed by (p1, p2) and is + calculated as: \[ P = (x_2 - x_1)(y_3 - y_1) - (y_2 - y_1)(x_3 - x_1) \] with \(p3 = (x_3, y_3)\) being this instance. + + If the result is 0, the points are collinear, i.e. lie on a single straight line L; if it is positive, this point lies + to the left, otherwise to the right of the line formed by (p1, p2). + + Parameters: + p1 (:class:`~org.hipparchus.geometry.euclidean.twod.Vector2D`): first point of the line + p2 (:class:`~org.hipparchus.geometry.euclidean.twod.Vector2D`): second point of the line + + Returns: + the cross-product + + Also see: + + - `Cross product (Wikipedia) <http://en.wikipedia.org/wiki/Cross_product>` + + + + """ + ... @typing.overload def crossProduct(self, vector2D: 'Vector2D', vector2D2: 'Vector2D') -> _FieldVector2D__T: ... _distance_2__T = typing.TypeVar('_distance_2__T', bound=org.hipparchus.CalculusFieldElement) # <T> _distance_3__T = typing.TypeVar('_distance_3__T', bound=org.hipparchus.CalculusFieldElement) # <T> _distance_4__T = typing.TypeVar('_distance_4__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload - def distance(self, fieldVector2D: 'FieldVector2D'[_FieldVector2D__T]) -> _FieldVector2D__T: ... + def distance(self, fieldVector2D: 'FieldVector2D'[_FieldVector2D__T]) -> _FieldVector2D__T: + """ + Compute the distance between the instance and another vector according to the L :sub:`2` norm. + + Calling this method is equivalent to calling: :code:`q.subtract(p).getNorm()` except that no intermediate vector is + built + + Parameters: + v (:class:`~org.hipparchus.geometry.euclidean.twod.Vector2D`): second vector + + Returns: + the distance between the instance and p according to the L :sub:`2` norm + + """ + ... @typing.overload def distance(self, vector2D: 'Vector2D') -> _FieldVector2D__T: ... @typing.overload @staticmethod - def distance(fieldVector2D: 'FieldVector2D'[_distance_2__T], fieldVector2D2: 'FieldVector2D'[_distance_2__T]) -> _distance_2__T: ... + def distance(fieldVector2D: 'FieldVector2D'[_distance_2__T], fieldVector2D2: 'FieldVector2D'[_distance_2__T]) -> _distance_2__T: + """ + Compute the distance between two vectors according to the L :sub:`2` norm. + + Calling this method is equivalent to calling: :code:`p1.subtract(p2).getNorm()` except that no intermediate vector is + built + + Parameters: + p1 (:class:`~org.hipparchus.geometry.euclidean.twod.FieldVector2D`<T> p1): first vector + p2 (:class:`~org.hipparchus.geometry.euclidean.twod.FieldVector2D`<T> p2): second vector + + Returns: + the distance between p1 and p2 according to the L :sub:`2` norm + + Compute the distance between two vectors according to the L :sub:`2` norm. + + Calling this method is equivalent to calling: :code:`p1.subtract(p2).getNorm()` except that no intermediate vector is + built + + Parameters: + p1 (:class:`~org.hipparchus.geometry.euclidean.twod.FieldVector2D`<T> p1): first vector + p2 (:class:`~org.hipparchus.geometry.euclidean.twod.Vector2D`): second vector + + Returns: + the distance between p1 and p2 according to the L :sub:`2` norm + + Compute the distance between two vectors according to the L :sub:`2` norm. + + Calling this method is equivalent to calling: :code:`p1.subtract(p2).getNorm()` except that no intermediate vector is + built + + Parameters: + p1 (:class:`~org.hipparchus.geometry.euclidean.twod.Vector2D`): first vector + p2 (:class:`~org.hipparchus.geometry.euclidean.twod.FieldVector2D`<T> p2): second vector + + Returns: + the distance between p1 and p2 according to the L :sub:`2` norm + + + """ + ... @typing.overload @staticmethod def distance(fieldVector2D: 'FieldVector2D'[_distance_3__T], vector2D: 'Vector2D') -> _distance_3__T: ... @@ -110,12 +253,66 @@ class FieldVector2D(typing.Generic[_FieldVector2D__T]): _distance1_3__T = typing.TypeVar('_distance1_3__T', bound=org.hipparchus.CalculusFieldElement) # <T> _distance1_4__T = typing.TypeVar('_distance1_4__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload - def distance1(self, fieldVector2D: 'FieldVector2D'[_FieldVector2D__T]) -> _FieldVector2D__T: ... + def distance1(self, fieldVector2D: 'FieldVector2D'[_FieldVector2D__T]) -> _FieldVector2D__T: + """ + Compute the distance between the instance and another vector according to the L :sub:`1` norm. + + Calling this method is equivalent to calling: :code:`q.subtract(p).getNorm1()` except that no intermediate vector is + built + + Parameters: + v (:class:`~org.hipparchus.geometry.euclidean.twod.Vector2D`): second vector + + Returns: + the distance between the instance and p according to the L :sub:`1` norm + + """ + ... @typing.overload def distance1(self, vector2D: 'Vector2D') -> _FieldVector2D__T: ... @typing.overload @staticmethod - def distance1(fieldVector2D: 'FieldVector2D'[_distance1_2__T], fieldVector2D2: 'FieldVector2D'[_distance1_2__T]) -> _distance1_2__T: ... + def distance1(fieldVector2D: 'FieldVector2D'[_distance1_2__T], fieldVector2D2: 'FieldVector2D'[_distance1_2__T]) -> _distance1_2__T: + """ + Compute the distance between two vectors according to the L :sub:`2` norm. + + Calling this method is equivalent to calling: :code:`p1.subtract(p2).getNorm()` except that no intermediate vector is + built + + Parameters: + p1 (:class:`~org.hipparchus.geometry.euclidean.twod.FieldVector2D`<T> p1): first vector + p2 (:class:`~org.hipparchus.geometry.euclidean.twod.FieldVector2D`<T> p2): second vector + + Returns: + the distance between p1 and p2 according to the L :sub:`2` norm + + Compute the distance between two vectors according to the L :sub:`2` norm. + + Calling this method is equivalent to calling: :code:`p1.subtract(p2).getNorm()` except that no intermediate vector is + built + + Parameters: + p1 (:class:`~org.hipparchus.geometry.euclidean.twod.FieldVector2D`<T> p1): first vector + p2 (:class:`~org.hipparchus.geometry.euclidean.twod.Vector2D`): second vector + + Returns: + the distance between p1 and p2 according to the L :sub:`2` norm + + Compute the distance between two vectors according to the L :sub:`2` norm. + + Calling this method is equivalent to calling: :code:`p1.subtract(p2).getNorm()` except that no intermediate vector is + built + + Parameters: + p1 (:class:`~org.hipparchus.geometry.euclidean.twod.Vector2D`): first vector + p2 (:class:`~org.hipparchus.geometry.euclidean.twod.FieldVector2D`<T> p2): second vector + + Returns: + the distance between p1 and p2 according to the L :sub:`2` norm + + + """ + ... @typing.overload @staticmethod def distance1(fieldVector2D: 'FieldVector2D'[_distance1_3__T], vector2D: 'Vector2D') -> _distance1_3__T: ... @@ -126,12 +323,66 @@ class FieldVector2D(typing.Generic[_FieldVector2D__T]): _distanceInf_3__T = typing.TypeVar('_distanceInf_3__T', bound=org.hipparchus.CalculusFieldElement) # <T> _distanceInf_4__T = typing.TypeVar('_distanceInf_4__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload - def distanceInf(self, fieldVector2D: 'FieldVector2D'[_FieldVector2D__T]) -> _FieldVector2D__T: ... + def distanceInf(self, fieldVector2D: 'FieldVector2D'[_FieldVector2D__T]) -> _FieldVector2D__T: + """ + Compute the distance between the instance and another vector according to the L :sub:`∞` norm. + + Calling this method is equivalent to calling: :code:`q.subtract(p).getNormInf()` except that no intermediate vector is + built + + Parameters: + v (:class:`~org.hipparchus.geometry.euclidean.twod.Vector2D`): second vector + + Returns: + the distance between the instance and p according to the L :sub:`∞` norm + + """ + ... @typing.overload def distanceInf(self, vector2D: 'Vector2D') -> _FieldVector2D__T: ... @typing.overload @staticmethod - def distanceInf(fieldVector2D: 'FieldVector2D'[_distanceInf_2__T], fieldVector2D2: 'FieldVector2D'[_distanceInf_2__T]) -> _distanceInf_2__T: ... + def distanceInf(fieldVector2D: 'FieldVector2D'[_distanceInf_2__T], fieldVector2D2: 'FieldVector2D'[_distanceInf_2__T]) -> _distanceInf_2__T: + """ + Compute the distance between two vectors according to the L :sub:`∞` norm. + + Calling this method is equivalent to calling: :code:`p1.subtract(p2).getNormInf()` except that no intermediate vector is + built + + Parameters: + p1 (:class:`~org.hipparchus.geometry.euclidean.twod.FieldVector2D`<T> p1): first vector + p2 (:class:`~org.hipparchus.geometry.euclidean.twod.FieldVector2D`<T> p2): second vector + + Returns: + the distance between p1 and p2 according to the L :sub:`∞` norm + + Compute the distance between two vectors according to the L :sub:`∞` norm. + + Calling this method is equivalent to calling: :code:`p1.subtract(p2).getNormInf()` except that no intermediate vector is + built + + Parameters: + p1 (:class:`~org.hipparchus.geometry.euclidean.twod.FieldVector2D`<T> p1): first vector + p2 (:class:`~org.hipparchus.geometry.euclidean.twod.Vector2D`): second vector + + Returns: + the distance between p1 and p2 according to the L :sub:`∞` norm + + Compute the distance between two vectors according to the L :sub:`∞` norm. + + Calling this method is equivalent to calling: :code:`p1.subtract(p2).getNormInf()` except that no intermediate vector is + built + + Parameters: + p1 (:class:`~org.hipparchus.geometry.euclidean.twod.Vector2D`): first vector + p2 (:class:`~org.hipparchus.geometry.euclidean.twod.FieldVector2D`<T> p2): second vector + + Returns: + the distance between p1 and p2 according to the L :sub:`∞` norm + + + """ + ... @typing.overload @staticmethod def distanceInf(fieldVector2D: 'FieldVector2D'[_distanceInf_3__T], vector2D: 'Vector2D') -> _distanceInf_3__T: ... @@ -142,12 +393,66 @@ class FieldVector2D(typing.Generic[_FieldVector2D__T]): _distanceSq_3__T = typing.TypeVar('_distanceSq_3__T', bound=org.hipparchus.CalculusFieldElement) # <T> _distanceSq_4__T = typing.TypeVar('_distanceSq_4__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload - def distanceSq(self, fieldVector2D: 'FieldVector2D'[_FieldVector2D__T]) -> _FieldVector2D__T: ... + def distanceSq(self, fieldVector2D: 'FieldVector2D'[_FieldVector2D__T]) -> _FieldVector2D__T: + """ + Compute the square of the distance between the instance and another vector. + + Calling this method is equivalent to calling: :code:`q.subtract(p).getNormSq()` except that no intermediate vector is + built + + Parameters: + v (:class:`~org.hipparchus.geometry.euclidean.twod.Vector2D`): second vector + + Returns: + the square of the distance between the instance and p + + """ + ... @typing.overload def distanceSq(self, vector2D: 'Vector2D') -> _FieldVector2D__T: ... @typing.overload @staticmethod - def distanceSq(fieldVector2D: 'FieldVector2D'[_distanceSq_2__T], fieldVector2D2: 'FieldVector2D'[_distanceSq_2__T]) -> _distanceSq_2__T: ... + def distanceSq(fieldVector2D: 'FieldVector2D'[_distanceSq_2__T], fieldVector2D2: 'FieldVector2D'[_distanceSq_2__T]) -> _distanceSq_2__T: + """ + Compute the square of the distance between two vectors. + + Calling this method is equivalent to calling: :code:`p1.subtract(p2).getNormSq()` except that no intermediate vector is + built + + Parameters: + p1 (:class:`~org.hipparchus.geometry.euclidean.twod.FieldVector2D`<T> p1): first vector + p2 (:class:`~org.hipparchus.geometry.euclidean.twod.FieldVector2D`<T> p2): second vector + + Returns: + the square of the distance between p1 and p2 + + Compute the square of the distance between two vectors. + + Calling this method is equivalent to calling: :code:`p1.subtract(p2).getNormSq()` except that no intermediate vector is + built + + Parameters: + p1 (:class:`~org.hipparchus.geometry.euclidean.twod.FieldVector2D`<T> p1): first vector + p2 (:class:`~org.hipparchus.geometry.euclidean.twod.Vector2D`): second vector + + Returns: + the square of the distance between p1 and p2 + + Compute the square of the distance between two vectors. + + Calling this method is equivalent to calling: :code:`p1.subtract(p2).getNormSq()` except that no intermediate vector is + built + + Parameters: + p1 (:class:`~org.hipparchus.geometry.euclidean.twod.Vector2D`): first vector + p2 (:class:`~org.hipparchus.geometry.euclidean.twod.FieldVector2D`<T> p2): second vector + + Returns: + the square of the distance between p1 and p2 + + + """ + ... @typing.overload @staticmethod def distanceSq(fieldVector2D: 'FieldVector2D'[_distanceSq_3__T], vector2D: 'Vector2D') -> _distanceSq_3__T: ... @@ -155,48 +460,303 @@ class FieldVector2D(typing.Generic[_FieldVector2D__T]): @staticmethod def distanceSq(vector2D: 'Vector2D', fieldVector2D: 'FieldVector2D'[_distanceSq_4__T]) -> _distanceSq_4__T: ... @typing.overload - def dotProduct(self, fieldVector2D: 'FieldVector2D'[_FieldVector2D__T]) -> _FieldVector2D__T: ... + def dotProduct(self, fieldVector2D: 'FieldVector2D'[_FieldVector2D__T]) -> _FieldVector2D__T: + """ + Compute the dot-product of the instance and another vector. + + The implementation uses specific multiplication and addition algorithms to preserve accuracy and reduce cancellation + effects. It should be very accurate even for nearly orthogonal vectors. + + Parameters: + v (:class:`~org.hipparchus.geometry.euclidean.twod.Vector2D`): second vector + + Returns: + the dot product this.v + + Also see: + + - :meth:`~org.hipparchus.geometry.euclidean.twod.https:.www.hipparchus.org.hipparchus` + + + + """ + ... @typing.overload def dotProduct(self, vector2D: 'Vector2D') -> _FieldVector2D__T: ... - def equals(self, object: typing.Any) -> bool: ... + def equals(self, object: typing.Any) -> bool: + """ + Test for the equality of two 2D vectors. + + If all coordinates of two 2D vectors are exactly the same, and none of their + :meth:`~org.hipparchus.geometry.euclidean.twod.https:.www.hipparchus.org.hipparchus` are :code:`NaN`, the two 2D vectors + are considered to be equal. + + :code:`NaN` coordinates are considered to affect globally the vector and be equals to each other - i.e, if either (or + all) real part of the coordinates of the 3D vector are :code:`NaN`, the 2D vector is :code:`NaN`. + + Overrides: + :meth:`~org.hipparchus.geometry.euclidean.twod.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.equals` in + class :class:`~org.hipparchus.geometry.euclidean.twod.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Parameters: + other (:class:`~org.hipparchus.geometry.euclidean.twod.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object`): Object to test for equality to this + + Returns: + true if two 2D vector objects are equal, false if object is null, not an instance of FieldVector2D, or not equal to this + FieldVector2D instance + + + """ + ... _getMinusI__T = typing.TypeVar('_getMinusI__T', bound=org.hipparchus.CalculusFieldElement) # <T> @staticmethod - def getMinusI(field: org.hipparchus.Field[_getMinusI__T]) -> 'FieldVector2D'[_getMinusI__T]: ... + def getMinusI(field: org.hipparchus.Field[_getMinusI__T]) -> 'FieldVector2D'[_getMinusI__T]: + """ + Get opposite of the first canonical vector (coordinates: -1). + + Parameters: + field (:class:`~org.hipparchus.geometry.euclidean.twod.https:.www.hipparchus.org.hipparchus`<T> field): field for the components + + Returns: + a new vector + + + """ + ... _getMinusJ__T = typing.TypeVar('_getMinusJ__T', bound=org.hipparchus.CalculusFieldElement) # <T> @staticmethod - def getMinusJ(field: org.hipparchus.Field[_getMinusJ__T]) -> 'FieldVector2D'[_getMinusJ__T]: ... + def getMinusJ(field: org.hipparchus.Field[_getMinusJ__T]) -> 'FieldVector2D'[_getMinusJ__T]: + """ + Get opposite of the second canonical vector (coordinates: 0, -1). + + Parameters: + field (:class:`~org.hipparchus.geometry.euclidean.twod.https:.www.hipparchus.org.hipparchus`<T> field): field for the components + + Returns: + a new vector + + + """ + ... _getNaN__T = typing.TypeVar('_getNaN__T', bound=org.hipparchus.CalculusFieldElement) # <T> @staticmethod - def getNaN(field: org.hipparchus.Field[_getNaN__T]) -> 'FieldVector2D'[_getNaN__T]: ... + def getNaN(field: org.hipparchus.Field[_getNaN__T]) -> 'FieldVector2D'[_getNaN__T]: + """ + Get a vector with all coordinates set to NaN. + + Parameters: + field (:class:`~org.hipparchus.geometry.euclidean.twod.https:.www.hipparchus.org.hipparchus`<T> field): field for the components + + Returns: + a new vector + + + """ + ... _getNegativeInfinity__T = typing.TypeVar('_getNegativeInfinity__T', bound=org.hipparchus.CalculusFieldElement) # <T> @staticmethod - def getNegativeInfinity(field: org.hipparchus.Field[_getNegativeInfinity__T]) -> 'FieldVector2D'[_getNegativeInfinity__T]: ... - def getNorm(self) -> _FieldVector2D__T: ... - def getNorm1(self) -> _FieldVector2D__T: ... - def getNormInf(self) -> _FieldVector2D__T: ... - def getNormSq(self) -> _FieldVector2D__T: ... + def getNegativeInfinity(field: org.hipparchus.Field[_getNegativeInfinity__T]) -> 'FieldVector2D'[_getNegativeInfinity__T]: + """ + Get a vector with all coordinates set to negative infinity. + + Parameters: + field (:class:`~org.hipparchus.geometry.euclidean.twod.https:.www.hipparchus.org.hipparchus`<T> field): field for the components + + Returns: + a new vector + + + """ + ... + def getNorm(self) -> _FieldVector2D__T: + """ + Get the L :sub:`2` norm for the vector. + + Returns: + Euclidean norm for the vector + + + """ + ... + def getNorm1(self) -> _FieldVector2D__T: + """ + Get the L :sub:`1` norm for the vector. + + Returns: + L :sub:`1` norm for the vector + + + """ + ... + def getNormInf(self) -> _FieldVector2D__T: + """ + Get the L :sub:`∞` norm for the vector. + + Returns: + L :sub:`∞` norm for the vector + + + """ + ... + def getNormSq(self) -> _FieldVector2D__T: + """ + Get the square of the norm for the vector. + + Returns: + square of the Euclidean norm for the vector + + + """ + ... _getPlusI__T = typing.TypeVar('_getPlusI__T', bound=org.hipparchus.CalculusFieldElement) # <T> @staticmethod - def getPlusI(field: org.hipparchus.Field[_getPlusI__T]) -> 'FieldVector2D'[_getPlusI__T]: ... + def getPlusI(field: org.hipparchus.Field[_getPlusI__T]) -> 'FieldVector2D'[_getPlusI__T]: + """ + Get first canonical vector (coordinates: 1, 0). + + Parameters: + field (:class:`~org.hipparchus.geometry.euclidean.twod.https:.www.hipparchus.org.hipparchus`<T> field): field for the components + + Returns: + a new vector + + + """ + ... _getPlusJ__T = typing.TypeVar('_getPlusJ__T', bound=org.hipparchus.CalculusFieldElement) # <T> @staticmethod - def getPlusJ(field: org.hipparchus.Field[_getPlusJ__T]) -> 'FieldVector2D'[_getPlusJ__T]: ... + def getPlusJ(field: org.hipparchus.Field[_getPlusJ__T]) -> 'FieldVector2D'[_getPlusJ__T]: + """ + Get second canonical vector (coordinates: 0, 1). + + Parameters: + field (:class:`~org.hipparchus.geometry.euclidean.twod.https:.www.hipparchus.org.hipparchus`<T> field): field for the components + + Returns: + a new vector + + + """ + ... _getPositiveInfinity__T = typing.TypeVar('_getPositiveInfinity__T', bound=org.hipparchus.CalculusFieldElement) # <T> @staticmethod - def getPositiveInfinity(field: org.hipparchus.Field[_getPositiveInfinity__T]) -> 'FieldVector2D'[_getPositiveInfinity__T]: ... - def getX(self) -> _FieldVector2D__T: ... - def getY(self) -> _FieldVector2D__T: ... + def getPositiveInfinity(field: org.hipparchus.Field[_getPositiveInfinity__T]) -> 'FieldVector2D'[_getPositiveInfinity__T]: + """ + Get a vector with all coordinates set to positive infinity. + + Parameters: + field (:class:`~org.hipparchus.geometry.euclidean.twod.https:.www.hipparchus.org.hipparchus`<T> field): field for the components + + Returns: + a new vector + + + """ + ... + def getX(self) -> _FieldVector2D__T: + """ + Get the abscissa of the vector. + + Returns: + abscissa of the vector + + Also see: + + - :meth:`~org.hipparchus.geometry.euclidean.twod.FieldVector2D.%3Cinit%3E` + + + + """ + ... + def getY(self) -> _FieldVector2D__T: + """ + Get the ordinate of the vector. + + Returns: + ordinate of the vector + + Also see: + + - :meth:`~org.hipparchus.geometry.euclidean.twod.FieldVector2D.%3Cinit%3E` + + + + """ + ... _getZero__T = typing.TypeVar('_getZero__T', bound=org.hipparchus.CalculusFieldElement) # <T> @staticmethod - def getZero(field: org.hipparchus.Field[_getZero__T]) -> 'FieldVector2D'[_getZero__T]: ... - def hashCode(self) -> int: ... - def isInfinite(self) -> bool: ... - def isNaN(self) -> bool: ... + def getZero(field: org.hipparchus.Field[_getZero__T]) -> 'FieldVector2D'[_getZero__T]: + """ + Get null vector (coordinates: 0, 0). + + Parameters: + field (:class:`~org.hipparchus.geometry.euclidean.twod.https:.www.hipparchus.org.hipparchus`<T> field): field for the components + + Returns: + a new vector + + + """ + ... + def hashCode(self) -> int: + """ + Get a hashCode for the 3D vector. + + All NaN values have the same hash code. + + Overrides: + :meth:`~org.hipparchus.geometry.euclidean.twod.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.hashCode` in + class :class:`~org.hipparchus.geometry.euclidean.twod.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Returns: + a hash code value for this object + + + """ + ... + def isInfinite(self) -> bool: + """ + Returns true if any coordinate of this vector is infinite and none are NaN; false otherwise + + Returns: + true if any coordinate of this vector is infinite and none are NaN; false otherwise + + + """ + ... + def isNaN(self) -> bool: + """ + Returns true if any coordinate of this vector is NaN; false otherwise + + Returns: + true if any coordinate of this vector is NaN; false otherwise + + + """ + ... def negate(self) -> 'FieldVector2D'[_FieldVector2D__T]: ... def normalize(self) -> 'FieldVector2D'[_FieldVector2D__T]: ... _orientation__T = typing.TypeVar('_orientation__T', bound=org.hipparchus.CalculusFieldElement) # <T> @staticmethod - def orientation(fieldVector2D: 'FieldVector2D'[_orientation__T], fieldVector2D2: 'FieldVector2D'[_orientation__T], fieldVector2D3: 'FieldVector2D'[_orientation__T]) -> _orientation__T: ... + def orientation(fieldVector2D: 'FieldVector2D'[_orientation__T], fieldVector2D2: 'FieldVector2D'[_orientation__T], fieldVector2D3: 'FieldVector2D'[_orientation__T]) -> _orientation__T: + """ + Compute the orientation of a triplet of points. + + Parameters: + p (:class:`~org.hipparchus.geometry.euclidean.twod.FieldVector2D`<T> p): first vector of the triplet + q (:class:`~org.hipparchus.geometry.euclidean.twod.FieldVector2D`<T> q): second vector of the triplet + r (:class:`~org.hipparchus.geometry.euclidean.twod.FieldVector2D`<T> r): third vector of the triplet + + Returns: + a positive value if (p, q, r) defines a counterclockwise oriented triangle, a negative value if (p, q, r) defines a + clockwise oriented triangle, and 0 if (p, q, r) are collinear or some points are equal + + Since: + 1.2 + + + """ + ... @typing.overload def scalarMultiply(self, double: float) -> 'FieldVector2D'[_FieldVector2D__T]: ... @typing.overload @@ -213,48 +773,343 @@ class FieldVector2D(typing.Generic[_FieldVector2D__T]): def subtract(self, fieldVector2D: 'FieldVector2D'[_FieldVector2D__T]) -> 'FieldVector2D'[_FieldVector2D__T]: ... @typing.overload def subtract(self, vector2D: 'Vector2D') -> 'FieldVector2D'[_FieldVector2D__T]: ... - def toArray(self) -> typing.MutableSequence[_FieldVector2D__T]: ... - @typing.overload - def toString(self) -> str: ... - @typing.overload - def toString(self, numberFormat: java.text.NumberFormat) -> str: ... - def toVector2D(self) -> 'Vector2D': ... + def toArray(self) -> typing.MutableSequence[_FieldVector2D__T]: + """ + Get the vector coordinates as a dimension 2 array. + + Returns: + vector coordinates + + Also see: + + - :meth:`~org.hipparchus.geometry.euclidean.twod.FieldVector2D.%3Cinit%3E` + + + + """ + ... + @typing.overload + def toString(self) -> str: + """ + Get a string representation of this vector. + + Overrides: + :meth:`~org.hipparchus.geometry.euclidean.twod.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.toString` in + class :class:`~org.hipparchus.geometry.euclidean.twod.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Returns: + a string representation of this vector + + """ + ... + @typing.overload + def toString(self, numberFormat: java.text.NumberFormat) -> str: + """ + Get a string representation of this vector. + + Parameters: + format (:class:`~org.hipparchus.geometry.euclidean.twod.https:.docs.oracle.com.javase.8.docs.api.java.text.NumberFormat`): the custom format for components + + Returns: + a string representation of this vector + + + """ + ... + def toVector2D(self) -> 'Vector2D': + """ + Convert to a constant vector without extra field parts. + + Returns: + a constant vector + + + """ + ... class Line(org.hipparchus.geometry.partitioning.Hyperplane[Euclidean2D], org.hipparchus.geometry.partitioning.Embedding[Euclidean2D, org.hipparchus.geometry.euclidean.oned.Euclidean1D]): + """ + public classLine extends :class:`~org.hipparchus.geometry.euclidean.twod.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.geometry.partitioning.Hyperplane`<:class:`~org.hipparchus.geometry.euclidean.twod.Euclidean2D`>, :class:`~org.hipparchus.geometry.partitioning.Embedding`<:class:`~org.hipparchus.geometry.euclidean.twod.Euclidean2D`,:class:`~org.hipparchus.geometry.euclidean.oned.Euclidean1D`> + + This class represents an oriented line in the 2D plane. + + An oriented line can be defined either by prolongating a line segment between two points past these points, or by one + point and an angular direction (in trigonometric orientation). + + Since it is oriented the two half planes at its two sides are unambiguously identified as a left half plane and a right + half plane. This can be used to identify the interior and the exterior in a simple way by local properties only when + part of a line is used to define part of a polygon boundary. + + A line can also be used to completely define a reference frame in the plane. It is sufficient to select one specific + point in the line (the orthogonal projection of the original reference frame on the line) and to use the unit vector in + the line direction and the orthogonal vector oriented from left half plane to right half plane. We define two + coordinates by the process, the *abscissa* along the line, and the *offset* across the line. All points of the plane are + uniquely identified by these two coordinates. The line is the set of points at zero offset, the left half plane is the + set of points with negative offsets and the right half plane is the set of points with positive offsets. + """ @typing.overload def __init__(self, line: 'Line'): ... @typing.overload def __init__(self, vector2D: 'Vector2D', double: float, double2: float): ... @typing.overload def __init__(self, vector2D: 'Vector2D', vector2D2: 'Vector2D', double: float): ... - def contains(self, vector2D: 'Vector2D') -> bool: ... - def copySelf(self) -> 'Line': ... - def distance(self, vector2D: 'Vector2D') -> float: ... - def emptyHyperplane(self) -> 'SubLine': ... - def getAngle(self) -> float: ... - @typing.overload - def getOffset(self, point: org.hipparchus.geometry.Point[Euclidean2D]) -> float: ... + def contains(self, vector2D: 'Vector2D') -> bool: + """ + Check if the line contains a point. + + Parameters: + p (:class:`~org.hipparchus.geometry.euclidean.twod.Vector2D`): point to check + + Returns: + true if p belongs to the line + + + """ + ... + def copySelf(self) -> 'Line': + """ + Copy the instance. + + The instance created is completely independant of the original one. A deep copy is used, none of the underlying objects + are shared (except for immutable objects). + + Specified by: + :meth:`~org.hipparchus.geometry.partitioning.Hyperplane.copySelf` in + interface :class:`~org.hipparchus.geometry.partitioning.Hyperplane` + + Returns: + a new hyperplane, copy of the instance + + + """ + ... + def distance(self, vector2D: 'Vector2D') -> float: + """ + Compute the distance between the instance and a point. + + This is a shortcut for invoking FastMath.abs(getOffset(p)), and provides consistency with what is in the + org.hipparchus.geometry.euclidean.threed.Line class. + + Parameters: + p (:class:`~org.hipparchus.geometry.euclidean.twod.Vector2D`): to check + + Returns: + distance between the instance and the point + + + """ + ... + def emptyHyperplane(self) -> 'SubLine': + """ + Build a sub-hyperplane covering nothing. + + Specified by: + :meth:`~org.hipparchus.geometry.partitioning.Hyperplane.emptyHyperplane` in + interface :class:`~org.hipparchus.geometry.partitioning.Hyperplane` + + Returns: + a sub-hyperplane covering nothing + + + """ + ... + def getAngle(self) -> float: + """ + Get the angle of the line. + + Returns: + the angle of the line with respect to the abscissa axis + + + """ + ... + @typing.overload + def getOffset(self, point: org.hipparchus.geometry.Point[Euclidean2D]) -> float: + """ + Get the offset (oriented distance) of a parallel line. + + This method should be called only for parallel lines otherwise the result is not meaningful. + + The offset is 0 if both lines are the same, it is positive if the line is on the right side of the instance and negative + if it is on the left side, according to its natural orientation. + + Parameters: + line (:class:`~org.hipparchus.geometry.euclidean.twod.Line`): line to check + + Returns: + offset of the line + + public double getOffset(:class:`~org.hipparchus.geometry.Vector`<:class:`~org.hipparchus.geometry.euclidean.twod.Euclidean2D`,:class:`~org.hipparchus.geometry.euclidean.twod.Vector2D`> vector) + + Get the offset (oriented distance) of a vector. + + Parameters: + vector (:class:`~org.hipparchus.geometry.Vector`<:class:`~org.hipparchus.geometry.euclidean.twod.Euclidean2D`,:class:`~org.hipparchus.geometry.euclidean.twod.Vector2D`> vector): vector to check + + Returns: + offset of the vector + + public double getOffset(:class:`~org.hipparchus.geometry.Point`<:class:`~org.hipparchus.geometry.euclidean.twod.Euclidean2D`> point) + + Get the offset (oriented distance) of a point. + + The offset is 0 if the point is on the underlying hyperplane, it is positive if the point is on one particular side of + the hyperplane, and it is negative if the point is on the other side, according to the hyperplane natural orientation. + + Specified by: + :meth:`~org.hipparchus.geometry.partitioning.Hyperplane.getOffset` in + interface :class:`~org.hipparchus.geometry.partitioning.Hyperplane` + + Parameters: + point (:class:`~org.hipparchus.geometry.Point`<:class:`~org.hipparchus.geometry.euclidean.twod.Euclidean2D`> point): point to check + + Returns: + offset of the point + + + """ + ... @typing.overload def getOffset(self, vector: org.hipparchus.geometry.Vector[Euclidean2D, 'Vector2D']) -> float: ... @typing.overload def getOffset(self, line: 'Line') -> float: ... - def getOriginOffset(self) -> float: ... - def getPointAt(self, vector1D: org.hipparchus.geometry.euclidean.oned.Vector1D, double: float) -> 'Vector2D': ... - def getReverse(self) -> 'Line': ... - def getTolerance(self) -> float: ... + def getOriginOffset(self) -> float: + """ + Get the offset of the origin. + + Returns: + the offset of the origin + + + """ + ... + def getPointAt(self, vector1D: org.hipparchus.geometry.euclidean.oned.Vector1D, double: float) -> 'Vector2D': + """ + Get one point from the plane. + + Parameters: + abscissa (:class:`~org.hipparchus.geometry.euclidean.oned.Vector1D`): desired abscissa for the point + offset (double): desired offset for the point + + Returns: + one point in the plane, with given abscissa and offset relative to the line + + + """ + ... + def getReverse(self) -> 'Line': + """ + Get the reverse of the instance. + + Get a line with reversed orientation with respect to the instance. + + As long as neither the instance nor its reverse are modified (i.e. as long as none of the + :meth:`~org.hipparchus.geometry.euclidean.twod.Line.reset`, :meth:`~org.hipparchus.geometry.euclidean.twod.Line.reset`, + :meth:`~org.hipparchus.geometry.euclidean.twod.Line.revertSelf`, + :meth:`~org.hipparchus.geometry.euclidean.twod.Line.setAngle` or + :meth:`~org.hipparchus.geometry.euclidean.twod.Line.setOriginOffset` methods are called), then the line and its reverse + remain linked together so that :code:`line.getReverse().getReverse() == line`. When one of the line is modified, the + link is deleted as both instance becomes independent. + + Returns: + a new line, with orientation opposite to the instance orientation + + + """ + ... + def getTolerance(self) -> float: + """ + Get the tolerance below which points are considered to belong to the hyperplane. + + Specified by: + :meth:`~org.hipparchus.geometry.partitioning.Hyperplane.getTolerance` in + interface :class:`~org.hipparchus.geometry.partitioning.Hyperplane` + + Returns: + tolerance below which points are considered to belong to the hyperplane + + + """ + ... @staticmethod def getTransform(double: float, double2: float, double3: float, double4: float, double5: float, double6: float) -> org.hipparchus.geometry.partitioning.Transform[Euclidean2D, org.hipparchus.geometry.euclidean.oned.Euclidean1D]: ... - def intersection(self, line: 'Line') -> 'Vector2D': ... - def isParallelTo(self, line: 'Line') -> bool: ... + def intersection(self, line: 'Line') -> 'Vector2D': + """ + Get the intersection point of the instance and another line. + + Parameters: + other (:class:`~org.hipparchus.geometry.euclidean.twod.Line`): other line + + Returns: + intersection point of the instance and the other line or null if there are no intersection points + + + """ + ... + def isParallelTo(self, line: 'Line') -> bool: + """ + Check the instance is parallel to another line. + + Parameters: + line (:class:`~org.hipparchus.geometry.euclidean.twod.Line`): other line to check + + Returns: + true if the instance is parallel to the other line (they can have either the same or opposite orientations) + + + """ + ... def project(self, point: org.hipparchus.geometry.Point[Euclidean2D]) -> org.hipparchus.geometry.Point[Euclidean2D]: ... @typing.overload - def reset(self, vector2D: 'Vector2D', double: float) -> None: ... + def reset(self, vector2D: 'Vector2D', double: float) -> None: + """ + Reset the instance as if built from two points. + + The line is oriented from p1 to p2 + + Parameters: + p1 (:class:`~org.hipparchus.geometry.euclidean.twod.Vector2D`): first point + p2 (:class:`~org.hipparchus.geometry.euclidean.twod.Vector2D`): second point + + Reset the instance as if built from a line and an angle. + + Parameters: + p (:class:`~org.hipparchus.geometry.euclidean.twod.Vector2D`): point belonging to the line + alpha (double): angle of the line with respect to abscissa axis + + + """ + ... @typing.overload def reset(self, vector2D: 'Vector2D', vector2D2: 'Vector2D') -> None: ... - def revertSelf(self) -> None: ... + def revertSelf(self) -> None: + """ + Revert the instance. + + """ + ... def sameOrientationAs(self, hyperplane: org.hipparchus.geometry.partitioning.Hyperplane[Euclidean2D]) -> bool: ... - def setAngle(self, double: float) -> None: ... - def setOriginOffset(self, double: float) -> None: ... + def setAngle(self, double: float) -> None: + """ + Set the angle of the line. + + Parameters: + angle (double): new angle of the line with respect to the abscissa axis + + + """ + ... + def setOriginOffset(self, double: float) -> None: + """ + Set the offset of the origin. + + Parameters: + offset (double): offset of the origin + + + """ + ... @typing.overload def toSpace(self, point: org.hipparchus.geometry.Point[org.hipparchus.geometry.euclidean.oned.Euclidean1D]) -> 'Vector2D': ... @typing.overload @@ -263,11 +1118,51 @@ class Line(org.hipparchus.geometry.partitioning.Hyperplane[Euclidean2D], org.hip def toSubSpace(self, point: org.hipparchus.geometry.Point[Euclidean2D]) -> org.hipparchus.geometry.euclidean.oned.Vector1D: ... @typing.overload def toSubSpace(self, vector: org.hipparchus.geometry.Vector[Euclidean2D, 'Vector2D']) -> org.hipparchus.geometry.euclidean.oned.Vector1D: ... - def translateToPoint(self, vector2D: 'Vector2D') -> None: ... - def wholeHyperplane(self) -> 'SubLine': ... - def wholeSpace(self) -> 'PolygonsSet': ... + def translateToPoint(self, vector2D: 'Vector2D') -> None: + """ + Translate the line to force it passing by a point. + + Parameters: + p (:class:`~org.hipparchus.geometry.euclidean.twod.Vector2D`): point by which the line should pass + + + """ + ... + def wholeHyperplane(self) -> 'SubLine': + """ + Build a sub-hyperplane covering the whole hyperplane. + + Specified by: + :meth:`~org.hipparchus.geometry.partitioning.Hyperplane.wholeHyperplane` in + interface :class:`~org.hipparchus.geometry.partitioning.Hyperplane` + + Returns: + a sub-hyperplane covering the whole hyperplane + + + """ + ... + def wholeSpace(self) -> 'PolygonsSet': + """ + Build a region covering the whole space. + + Specified by: + :meth:`~org.hipparchus.geometry.partitioning.Hyperplane.wholeSpace` in + interface :class:`~org.hipparchus.geometry.partitioning.Hyperplane` + + Returns: + a region containing the instance (really a :class:`~org.hipparchus.geometry.euclidean.twod.PolygonsSet` instance) + + + """ + ... class PolygonsSet(org.hipparchus.geometry.partitioning.AbstractRegion[Euclidean2D, org.hipparchus.geometry.euclidean.oned.Euclidean1D]): + """ + public classPolygonsSet extends :class:`~org.hipparchus.geometry.partitioning.AbstractRegion`<:class:`~org.hipparchus.geometry.euclidean.twod.Euclidean2D`,:class:`~org.hipparchus.geometry.euclidean.oned.Euclidean1D`> + + This class represents a 2D region: a set of polygons. + """ @typing.overload def __init__(self, double: float): ... @typing.overload @@ -279,20 +1174,107 @@ class PolygonsSet(org.hipparchus.geometry.partitioning.AbstractRegion[Euclidean2 @typing.overload def __init__(self, bSPTree: org.hipparchus.geometry.partitioning.BSPTree[Euclidean2D], double: float): ... def buildNew(self, bSPTree: org.hipparchus.geometry.partitioning.BSPTree[Euclidean2D]) -> 'PolygonsSet': ... - def getVertices(self) -> typing.MutableSequence[typing.MutableSequence['Vector2D']]: ... + def getVertices(self) -> typing.MutableSequence[typing.MutableSequence['Vector2D']]: + """ + Get the vertices of the polygon. + + The polygon boundary can be represented as an array of loops, each loop being itself an array of vertices. + + In order to identify open loops which start and end by infinite edges, the open loops arrays start with a null point. In + this case, the first non null point and the last point of the array do not represent real vertices, they are dummy + points intended only to get the direction of the first and last edge. An open loop consisting of a single infinite line + will therefore be represented by a three elements array with one null point followed by two dummy points. The open loops + are always the first ones in the loops array. + + If the polygon has no boundary at all, a zero length loop array will be returned. + + All line segments in the various loops have the inside of the region on their left side and the outside on their right + side when moving in the underlying line direction. This means that closed loops surrounding finite areas obey the direct + trigonometric orientation. + + Returns: + vertices of the polygon, organized as oriented boundary loops with the open loops first (the returned value is + guaranteed to be non-null) + + + """ + ... class Segment: + """ + public classSegment extends :class:`~org.hipparchus.geometry.euclidean.twod.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Simple container for a two-points segment. + """ @typing.overload def __init__(self, vector2D: 'Vector2D', vector2D2: 'Vector2D', double: float): ... @typing.overload def __init__(self, vector2D: 'Vector2D', vector2D2: 'Vector2D', line: Line): ... - def distance(self, vector2D: 'Vector2D') -> float: ... - def getEnd(self) -> 'Vector2D': ... - def getLength(self) -> float: ... - def getLine(self) -> Line: ... - def getStart(self) -> 'Vector2D': ... + def distance(self, vector2D: 'Vector2D') -> float: + """ + Calculates the shortest distance from a point to this line segment. + + If the perpendicular extension from the point to the line does not cross in the bounds of the line segment, the shortest + distance to the two end points will be returned. + Algorithm adapted from: ` Thread @ Codeguru + <http://www.codeguru.com/forum/printthread.php?s=cc8cf0596231f9a7dba4da6e77c29db3&t=194400&pp=15&page=1>` + + Parameters: + p (:class:`~org.hipparchus.geometry.euclidean.twod.Vector2D`): to check + + Returns: + distance between the instance and the point + + + """ + ... + def getEnd(self) -> 'Vector2D': + """ + Get the end point of the segment. + + Returns: + end point of the segment + + + """ + ... + def getLength(self) -> float: + """ + Get the length of the line segment. + + Returns: + line segment length. + + + """ + ... + def getLine(self) -> Line: + """ + Get the line containing the segment. + + Returns: + line containing the segment + + + """ + ... + def getStart(self) -> 'Vector2D': + """ + Get the start point of the segment. + + Returns: + start point of the segment + + + """ + ... class SubLine(org.hipparchus.geometry.partitioning.AbstractSubHyperplane[Euclidean2D, org.hipparchus.geometry.euclidean.oned.Euclidean1D]): + """ + public classSubLine extends :class:`~org.hipparchus.geometry.partitioning.AbstractSubHyperplane`<:class:`~org.hipparchus.geometry.euclidean.twod.Euclidean2D`,:class:`~org.hipparchus.geometry.euclidean.oned.Euclidean1D`> + + This class represents a sub-hyperplane for :class:`~org.hipparchus.geometry.euclidean.twod.Line`. + """ @typing.overload def __init__(self, segment: Segment): ... @typing.overload @@ -300,18 +1282,113 @@ class SubLine(org.hipparchus.geometry.partitioning.AbstractSubHyperplane[Euclide @typing.overload def __init__(self, hyperplane: org.hipparchus.geometry.partitioning.Hyperplane[Euclidean2D], region: org.hipparchus.geometry.partitioning.Region[org.hipparchus.geometry.euclidean.oned.Euclidean1D]): ... def getSegments(self) -> java.util.List[Segment]: ... - def intersection(self, subLine: 'SubLine', boolean: bool) -> 'Vector2D': ... + def intersection(self, subLine: 'SubLine', boolean: bool) -> 'Vector2D': + """ + Get the intersection of the instance and another sub-line. + + This method is related to the :meth:`~org.hipparchus.geometry.euclidean.twod.Line.intersection` method in the + :class:`~org.hipparchus.geometry.euclidean.twod.Line` class, but in addition to compute the point along infinite lines, + it also checks the point lies on both sub-line ranges. + + Parameters: + subLine (:class:`~org.hipparchus.geometry.euclidean.twod.SubLine`): other sub-line which may intersect instance + includeEndPoints (boolean): if true, endpoints are considered to belong to instance (i.e. they are closed sets) and may be returned, otherwise + endpoints are considered to not belong to instance (i.e. they are open sets) and intersection occurring on endpoints + lead to null being returned + + Returns: + the intersection point if there is one, null if the sub-lines don't intersect + + + """ + ... def split(self, hyperplane: org.hipparchus.geometry.partitioning.Hyperplane[Euclidean2D]) -> org.hipparchus.geometry.partitioning.SubHyperplane.SplitSubHyperplane[Euclidean2D]: ... class Vector2D(org.hipparchus.geometry.Vector[Euclidean2D, 'Vector2D']): + """ + public classVector2D extends :class:`~org.hipparchus.geometry.euclidean.twod.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.geometry.Vector`<:class:`~org.hipparchus.geometry.euclidean.twod.Euclidean2D`,:class:`~org.hipparchus.geometry.euclidean.twod.Vector2D`> + + This class represents a 2D vector. + + Instances of this class are guaranteed to be immutable. + + Also see: + + - :meth:`~serialized` + """ ZERO: typing.ClassVar['Vector2D'] = ... + """ + public static final :class:`~org.hipparchus.geometry.euclidean.twod.Vector2D` ZERO + + Origin (coordinates: 0, 0). + + """ PLUS_I: typing.ClassVar['Vector2D'] = ... + """ + public static final :class:`~org.hipparchus.geometry.euclidean.twod.Vector2D` PLUS_I + + First canonical vector (coordinates: 1, 0). + + Since: + 1.6 + + + """ MINUS_I: typing.ClassVar['Vector2D'] = ... + """ + public static final :class:`~org.hipparchus.geometry.euclidean.twod.Vector2D` MINUS_I + + Opposite of the first canonical vector (coordinates: -1, 0). + + Since: + 1.6 + + + """ PLUS_J: typing.ClassVar['Vector2D'] = ... + """ + public static final :class:`~org.hipparchus.geometry.euclidean.twod.Vector2D` PLUS_J + + Second canonical vector (coordinates: 0, 1). + + Since: + 1.6 + + + """ MINUS_J: typing.ClassVar['Vector2D'] = ... + """ + public static final :class:`~org.hipparchus.geometry.euclidean.twod.Vector2D` MINUS_J + + Opposite of the second canonical vector (coordinates: 0, -1). + + Since: + 1.6 + + + """ NaN: typing.ClassVar['Vector2D'] = ... + """ + public static final :class:`~org.hipparchus.geometry.euclidean.twod.Vector2D` NaN + + A vector with all coordinates set to NaN. + + """ POSITIVE_INFINITY: typing.ClassVar['Vector2D'] = ... + """ + public static final :class:`~org.hipparchus.geometry.euclidean.twod.Vector2D` POSITIVE_INFINITY + + A vector with all coordinates set to positive infinity. + + """ NEGATIVE_INFINITY: typing.ClassVar['Vector2D'] = ... + """ + public static final :class:`~org.hipparchus.geometry.euclidean.twod.Vector2D` NEGATIVE_INFINITY + + A vector with all coordinates set to negative infinity. + + """ @typing.overload def __init__(self, double: float, double2: float): ... @typing.overload @@ -330,56 +1407,439 @@ class Vector2D(org.hipparchus.geometry.Vector[Euclidean2D, 'Vector2D']): def add(self, vector: org.hipparchus.geometry.Vector[Euclidean2D, 'Vector2D']) -> 'Vector2D': ... @staticmethod def angle(vector2D: 'Vector2D', vector2D2: 'Vector2D') -> float: ... - def crossProduct(self, vector2D: 'Vector2D', vector2D2: 'Vector2D') -> float: ... - @typing.overload - def distance(self, point: org.hipparchus.geometry.Point[Euclidean2D]) -> float: ... + def crossProduct(self, vector2D: 'Vector2D', vector2D2: 'Vector2D') -> float: + """ + Compute the cross-product of the instance and the given points. + + The cross product can be used to determine the location of a point with regard to the line formed by (p1, p2) and is + calculated as: \[ P = (x_2 - x_1)(y_3 - y_1) - (y_2 - y_1)(x_3 - x_1) \] with \(p3 = (x_3, y_3)\) being this instance. + + If the result is 0, the points are collinear, i.e. lie on a single straight line L; if it is positive, this point lies + to the left, otherwise to the right of the line formed by (p1, p2). + + Parameters: + p1 (:class:`~org.hipparchus.geometry.euclidean.twod.Vector2D`): first point of the line + p2 (:class:`~org.hipparchus.geometry.euclidean.twod.Vector2D`): second point of the line + + Returns: + the cross-product + + Also see: + + - `Cross product (Wikipedia) <http://en.wikipedia.org/wiki/Cross_product>` + + + + """ + ... + @typing.overload + def distance(self, point: org.hipparchus.geometry.Point[Euclidean2D]) -> float: + """ + Compute the distance between two vectors according to the L :sub:`2` norm. + + Calling this method is equivalent to calling: :code:`p1.subtract(p2).getNorm()` except that no intermediate vector is + built + + Parameters: + p1 (:class:`~org.hipparchus.geometry.euclidean.twod.Vector2D`): first vector + p2 (:class:`~org.hipparchus.geometry.euclidean.twod.Vector2D`): second vector + + Returns: + the distance between p1 and p2 according to the L :sub:`2` norm + + + """ + ... @typing.overload @staticmethod def distance(vector2D: 'Vector2D', vector2D2: 'Vector2D') -> float: ... @typing.overload - def distance1(self, vector: org.hipparchus.geometry.Vector[Euclidean2D, 'Vector2D']) -> float: ... + def distance1(self, vector: org.hipparchus.geometry.Vector[Euclidean2D, 'Vector2D']) -> float: + """ + Compute the distance between two vectors according to the L :sub:`1` norm. + + Calling this method is equivalent to calling: :code:`p1.subtract(p2).getNorm1()` except that no intermediate vector is + built + + Parameters: + p1 (:class:`~org.hipparchus.geometry.euclidean.twod.Vector2D`): first vector + p2 (:class:`~org.hipparchus.geometry.euclidean.twod.Vector2D`): second vector + + Returns: + the distance between p1 and p2 according to the L :sub:`1` norm + + Since: + 1.6 + + + """ + ... @typing.overload @staticmethod def distance1(vector2D: 'Vector2D', vector2D2: 'Vector2D') -> float: ... @typing.overload - def distanceInf(self, vector: org.hipparchus.geometry.Vector[Euclidean2D, 'Vector2D']) -> float: ... + def distanceInf(self, vector: org.hipparchus.geometry.Vector[Euclidean2D, 'Vector2D']) -> float: + """ + Compute the distance between two vectors according to the L :sub:`∞` norm. + + Calling this method is equivalent to calling: :code:`p1.subtract(p2).getNormInf()` except that no intermediate vector is + built + + Parameters: + p1 (:class:`~org.hipparchus.geometry.euclidean.twod.Vector2D`): first vector + p2 (:class:`~org.hipparchus.geometry.euclidean.twod.Vector2D`): second vector + + Returns: + the distance between p1 and p2 according to the L :sub:`∞` norm + + + """ + ... @typing.overload @staticmethod def distanceInf(vector2D: 'Vector2D', vector2D2: 'Vector2D') -> float: ... @typing.overload - def distanceSq(self, vector: org.hipparchus.geometry.Vector[Euclidean2D, 'Vector2D']) -> float: ... + def distanceSq(self, vector: org.hipparchus.geometry.Vector[Euclidean2D, 'Vector2D']) -> float: + """ + Compute the square of the distance between two vectors. + + Calling this method is equivalent to calling: :code:`p1.subtract(p2).getNormSq()` except that no intermediate vector is + built + + Parameters: + p1 (:class:`~org.hipparchus.geometry.euclidean.twod.Vector2D`): first vector + p2 (:class:`~org.hipparchus.geometry.euclidean.twod.Vector2D`): second vector + + Returns: + the square of the distance between p1 and p2 + + + """ + ... @typing.overload @staticmethod def distanceSq(vector2D: 'Vector2D', vector2D2: 'Vector2D') -> float: ... def dotProduct(self, vector: org.hipparchus.geometry.Vector[Euclidean2D, 'Vector2D']) -> float: ... - def equals(self, object: typing.Any) -> bool: ... - def equalsIeee754(self, object: typing.Any) -> bool: ... - def getNorm(self) -> float: ... - def getNorm1(self) -> float: ... - def getNormInf(self) -> float: ... - def getNormSq(self) -> float: ... - def getSpace(self) -> org.hipparchus.geometry.Space: ... - def getX(self) -> float: ... - def getY(self) -> float: ... - def getZero(self) -> 'Vector2D': ... - def hashCode(self) -> int: ... - def isInfinite(self) -> bool: ... - def isNaN(self) -> bool: ... - def negate(self) -> 'Vector2D': ... - @staticmethod - def orientation(vector2D: 'Vector2D', vector2D2: 'Vector2D', vector2D3: 'Vector2D') -> float: ... - def scalarMultiply(self, double: float) -> 'Vector2D': ... + def equals(self, object: typing.Any) -> bool: + """ + Test for the equality of two 2D vectors. + + If all coordinates of two 2D vectors are exactly the same, and none are :code:`Double.NaN`, the two 2D vectors are + considered to be equal. + + :code:`NaN` coordinates are considered to affect globally the vector and be equals to each other - i.e, if either (or + all) coordinates of the 2D vector are equal to :code:`Double.NaN`, the 2D vector is equal to + :meth:`~org.hipparchus.geometry.euclidean.twod.Vector2D.NaN`. + + Overrides: + :meth:`~org.hipparchus.geometry.euclidean.twod.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.equals` in + class :class:`~org.hipparchus.geometry.euclidean.twod.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Parameters: + other (:class:`~org.hipparchus.geometry.euclidean.twod.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object`): Object to test for equality to this + + Returns: + true if two 2D vector objects are equal, false if object is null, not an instance of Vector2D, or not equal to this + Vector2D instance + + + """ + ... + def equalsIeee754(self, object: typing.Any) -> bool: + """ + Test for the equality of two 2D vectors. + + If all coordinates of two 2D vectors are exactly the same, and none are :code:`NaN`, the two 2D vectors are considered + to be equal. + + In compliance with IEEE754 handling, if any coordinates of any of the two vectors are :code:`NaN`, then the vectors are + considered different. This implies that + :meth:`~org.hipparchus.geometry.euclidean.twod.Vector2D.NaN`.equals(:meth:`~org.hipparchus.geometry.euclidean.twod.Vector2D.NaN`) + returns :code:`false` despite the instance is checked against itself. + + Parameters: + other (:class:`~org.hipparchus.geometry.euclidean.twod.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object`): Object to test for equality to this + + Returns: + true if two 2D vector objects are equal, false if object is null, not an instance of Vector2D, or not equal to this + Vector2D instance + + Since: + 2.1 + + + """ + ... + def getNorm(self) -> float: + """ + Get the L :sub:`2` norm for the vector. + + Specified by: + :meth:`~org.hipparchus.geometry.Vector.getNorm` in interface :class:`~org.hipparchus.geometry.Vector` + + Returns: + Euclidean norm for the vector + + + """ + ... + def getNorm1(self) -> float: + """ + Get the L :sub:`1` norm for the vector. + + Specified by: + :meth:`~org.hipparchus.geometry.Vector.getNorm1` in interface :class:`~org.hipparchus.geometry.Vector` + + Returns: + L :sub:`1` norm for the vector + + + """ + ... + def getNormInf(self) -> float: + """ + Get the L :sub:`∞` norm for the vector. + + Specified by: + :meth:`~org.hipparchus.geometry.Vector.getNormInf` in interface :class:`~org.hipparchus.geometry.Vector` + + Returns: + L :sub:`∞` norm for the vector + + + """ + ... + def getNormSq(self) -> float: + """ + Get the square of the norm for the vector. + + Specified by: + :meth:`~org.hipparchus.geometry.Vector.getNormSq` in interface :class:`~org.hipparchus.geometry.Vector` + + Returns: + square of the Euclidean norm for the vector + + + """ + ... + def getSpace(self) -> org.hipparchus.geometry.Space: + """ + Get the space to which the point belongs. + + Specified by: + :meth:`~org.hipparchus.geometry.Point.getSpace` in interface :class:`~org.hipparchus.geometry.Point` + + Returns: + containing space + + + """ + ... + def getX(self) -> float: + """ + Get the abscissa of the vector. + + Returns: + abscissa of the vector + + Also see: + + - :meth:`~org.hipparchus.geometry.euclidean.twod.Vector2D.%3Cinit%3E` + + + + """ + ... + def getY(self) -> float: + """ + Get the ordinate of the vector. + + Returns: + ordinate of the vector + + Also see: + + - :meth:`~org.hipparchus.geometry.euclidean.twod.Vector2D.%3Cinit%3E` + + + + """ + ... + def getZero(self) -> 'Vector2D': + """ + Get the null vector of the vectorial space or origin point of the affine space. + + Specified by: + :meth:`~org.hipparchus.geometry.Vector.getZero` in interface :class:`~org.hipparchus.geometry.Vector` + + Returns: + null vector of the vectorial space or origin point of the affine space + + + """ + ... + def hashCode(self) -> int: + """ + Get a hashCode for the 2D vector. + + All NaN values have the same hash code. + + Overrides: + :meth:`~org.hipparchus.geometry.euclidean.twod.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.hashCode` in + class :class:`~org.hipparchus.geometry.euclidean.twod.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Returns: + a hash code value for this object + + + """ + ... + def isInfinite(self) -> bool: + """ + Returns true if any coordinate of this vector is infinite and none are NaN; false otherwise + + Specified by: + :meth:`~org.hipparchus.geometry.Vector.isInfinite` in interface :class:`~org.hipparchus.geometry.Vector` + + Returns: + true if any coordinate of this vector is infinite and none are NaN; false otherwise + + + """ + ... + def isNaN(self) -> bool: + """ + Returns true if any coordinate of this point is NaN; false otherwise + + Specified by: + :meth:`~org.hipparchus.geometry.Point.isNaN` in interface :class:`~org.hipparchus.geometry.Point` + + Returns: + true if any coordinate of this point is NaN; false otherwise + + + """ + ... + def negate(self) -> 'Vector2D': + """ + Get the opposite of the instance. + + Specified by: + :meth:`~org.hipparchus.geometry.Vector.negate` in interface :class:`~org.hipparchus.geometry.Vector` + + Returns: + a new vector which is opposite to the instance + + + """ + ... + @staticmethod + def orientation(vector2D: 'Vector2D', vector2D2: 'Vector2D', vector2D3: 'Vector2D') -> float: + """ + Compute the orientation of a triplet of points. + + Parameters: + p (:class:`~org.hipparchus.geometry.euclidean.twod.Vector2D`): first vector of the triplet + q (:class:`~org.hipparchus.geometry.euclidean.twod.Vector2D`): second vector of the triplet + r (:class:`~org.hipparchus.geometry.euclidean.twod.Vector2D`): third vector of the triplet + + Returns: + a positive value if (p, q, r) defines a counterclockwise oriented triangle, a negative value if (p, q, r) defines a + clockwise oriented triangle, and 0 if (p, q, r) are collinear or some points are equal + + Since: + 1.2 + + + """ + ... + def scalarMultiply(self, double: float) -> 'Vector2D': + """ + Multiply the instance by a scalar. + + Specified by: + :meth:`~org.hipparchus.geometry.Vector.scalarMultiply` in interface :class:`~org.hipparchus.geometry.Vector` + + Parameters: + a (double): scalar + + Returns: + a new vector + + + """ + ... @typing.overload def subtract(self, double: float, vector: org.hipparchus.geometry.Vector[Euclidean2D, 'Vector2D']) -> 'Vector2D': ... @typing.overload def subtract(self, vector: org.hipparchus.geometry.Vector[Euclidean2D, 'Vector2D']) -> 'Vector2D': ... - def toArray(self) -> typing.MutableSequence[float]: ... - @typing.overload - def toString(self) -> str: ... - @typing.overload - def toString(self, numberFormat: java.text.NumberFormat) -> str: ... + def toArray(self) -> typing.MutableSequence[float]: + """ + Get the vector coordinates as a dimension 2 array. + + Returns: + vector coordinates + + Also see: + + - :meth:`~org.hipparchus.geometry.euclidean.twod.Vector2D.%3Cinit%3E` + + + + """ + ... + @typing.overload + def toString(self) -> str: + """ + Get a string representation of this vector. + + Overrides: + :meth:`~org.hipparchus.geometry.euclidean.twod.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.toString` in + class :class:`~org.hipparchus.geometry.euclidean.twod.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Returns: + a string representation of this vector + + """ + ... + @typing.overload + def toString(self, numberFormat: java.text.NumberFormat) -> str: + """ + Get a string representation of this vector. + + Specified by: + :meth:`~org.hipparchus.geometry.Vector.toString` in interface :class:`~org.hipparchus.geometry.Vector` + + Parameters: + format (:class:`~org.hipparchus.geometry.euclidean.twod.https:.docs.oracle.com.javase.8.docs.api.java.text.NumberFormat`): the custom format for components + + Returns: + a string representation of this vector + + + """ + ... class Vector2DFormat(org.hipparchus.geometry.VectorFormat[Euclidean2D, Vector2D]): + """ + public classVector2DFormat extends :class:`~org.hipparchus.geometry.VectorFormat`<:class:`~org.hipparchus.geometry.euclidean.twod.Euclidean2D`,:class:`~org.hipparchus.geometry.euclidean.twod.Vector2D`> + + Formats a 2D vector in components list format "{x; y}". + + The prefix and suffix "{" and "}" and the separator "; " can be replaced by any user-defined strings. The number format + for components can be configured. + + White space is ignored at parse time, even if it is in the prefix, suffix or separator specifications. So even if the + default separator does include a space character that is used at format time, both input string "{1;1}" and " { 1 ; 1 } + " will be parsed without error and the same vector will be returned. In the second case, however, the parse position + after parsing will be just after the closing curly brace, i.e. just before the trailing space. + + **Note:** using "," as a separator may interfere with the grouping separator of the default + :class:`~org.hipparchus.geometry.euclidean.twod.https:.docs.oracle.com.javase.8.docs.api.java.text.NumberFormat` for the + current locale. Thus it is advised to use a + :class:`~org.hipparchus.geometry.euclidean.twod.https:.docs.oracle.com.javase.8.docs.api.java.text.NumberFormat` + instance with disabled grouping in such a case. + """ @typing.overload def __init__(self): ... @typing.overload @@ -394,12 +1854,54 @@ class Vector2DFormat(org.hipparchus.geometry.VectorFormat[Euclidean2D, Vector2D] def format(self, vector: org.hipparchus.geometry.Vector[Euclidean2D, Vector2D], stringBuffer: java.lang.StringBuffer, fieldPosition: java.text.FieldPosition) -> java.lang.StringBuffer: ... @typing.overload @staticmethod - def getVector2DFormat() -> 'Vector2DFormat': ... + def getVector2DFormat() -> 'Vector2DFormat': + """ + Returns the default 2D vector format for the current locale. + + Returns: + the default 2D vector format. + + Since: + 1.4 + + """ + ... @typing.overload @staticmethod - def getVector2DFormat(locale: java.util.Locale) -> 'Vector2DFormat': ... - @typing.overload - def parse(self, string: str) -> Vector2D: ... + def getVector2DFormat(locale: java.util.Locale) -> 'Vector2DFormat': + """ + Returns the default 2D vector format for the given locale. + + Parameters: + locale (:class:`~org.hipparchus.geometry.euclidean.twod.https:.docs.oracle.com.javase.8.docs.api.java.util.Locale`): the specific locale used by the format. + + Returns: + the 2D vector format specific to the given locale. + + Since: + 1.4 + + + """ + ... + @typing.overload + def parse(self, string: str) -> Vector2D: + """ + Parses a string to produce a :class:`~org.hipparchus.geometry.Vector` object. + + Specified by: + :meth:`~org.hipparchus.geometry.VectorFormat.parse` in class :class:`~org.hipparchus.geometry.VectorFormat` + + Parameters: + source (:class:`~org.hipparchus.geometry.euclidean.twod.https:.docs.oracle.com.javase.8.docs.api.java.lang.String`): the string to parse + pos (:class:`~org.hipparchus.geometry.euclidean.twod.https:.docs.oracle.com.javase.8.docs.api.java.text.ParsePosition`): input/output parsing parameter. + + Returns: + the parsed :class:`~org.hipparchus.geometry.Vector` object. + + + """ + ... @typing.overload def parse(self, string: str, parsePosition: java.text.ParsePosition) -> Vector2D: ... diff --git a/org-stubs/hipparchus/geometry/euclidean/twod/hull/__init__.pyi b/org-stubs/hipparchus/geometry/euclidean/twod/hull/__init__.pyi index 3e4d7d9..c6d438d 100644 --- a/org-stubs/hipparchus/geometry/euclidean/twod/hull/__init__.pyi +++ b/org-stubs/hipparchus/geometry/euclidean/twod/hull/__init__.pyi @@ -17,19 +17,94 @@ import typing class AklToussaintHeuristic: + """ + public final classAklToussaintHeuristic extends :class:`~org.hipparchus.geometry.euclidean.twod.hull.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + A simple heuristic to improve the performance of convex hull algorithms. + + The heuristic is based on the idea of a convex quadrilateral, which is formed by four points with the lowest and highest + x / y coordinates. Any point that lies inside this quadrilateral can not be part of the convex hull and can thus be + safely discarded before generating the convex hull itself. + + The complexity of the operation is O(n), and may greatly improve the time it takes to construct the convex hull + afterwards, depending on the point distribution. + + Also see: + + - ` Akl-Toussaint heuristic (Wikipedia) <http://en.wikipedia.org/wiki/Convex_hull_algorithms#Akl-Toussaint_heuristic>` + """ @staticmethod def reducePoints(collection: typing.Union[java.util.Collection[org.hipparchus.geometry.euclidean.twod.Vector2D], typing.Sequence[org.hipparchus.geometry.euclidean.twod.Vector2D], typing.Set[org.hipparchus.geometry.euclidean.twod.Vector2D]]) -> java.util.Collection[org.hipparchus.geometry.euclidean.twod.Vector2D]: ... class ConvexHull2D(org.hipparchus.geometry.hull.ConvexHull[org.hipparchus.geometry.euclidean.twod.Euclidean2D, org.hipparchus.geometry.euclidean.twod.Vector2D], java.io.Serializable): + """ + public classConvexHull2D extends :class:`~org.hipparchus.geometry.euclidean.twod.hull.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.geometry.hull.ConvexHull`<:class:`~org.hipparchus.geometry.euclidean.twod.Euclidean2D`,:class:`~org.hipparchus.geometry.euclidean.twod.Vector2D`>, :class:`~org.hipparchus.geometry.euclidean.twod.hull.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + This class represents a convex hull in an two-dimensional euclidean space. + + Also see: + + - :meth:`~serialized` + """ def __init__(self, vector2DArray: typing.Union[typing.List[org.hipparchus.geometry.euclidean.twod.Vector2D], jpype.JArray], double: float): ... def createRegion(self) -> org.hipparchus.geometry.partitioning.Region[org.hipparchus.geometry.euclidean.twod.Euclidean2D]: ... - def getLineSegments(self) -> typing.MutableSequence[org.hipparchus.geometry.euclidean.twod.Segment]: ... - def getVertices(self) -> typing.MutableSequence[org.hipparchus.geometry.euclidean.twod.Vector2D]: ... + def getLineSegments(self) -> typing.MutableSequence[org.hipparchus.geometry.euclidean.twod.Segment]: + """ + Get the line segments of the convex hull, ordered. + + Returns: + the line segments of the convex hull + + + """ + ... + def getVertices(self) -> typing.MutableSequence[org.hipparchus.geometry.euclidean.twod.Vector2D]: + """ + Get the vertices of the convex hull. + + Specified by: + :meth:`~org.hipparchus.geometry.hull.ConvexHull.getVertices` in + interface :class:`~org.hipparchus.geometry.hull.ConvexHull` + + Returns: + vertices of the convex hull + + + """ + ... class ConvexHullGenerator2D(org.hipparchus.geometry.hull.ConvexHullGenerator[org.hipparchus.geometry.euclidean.twod.Euclidean2D, org.hipparchus.geometry.euclidean.twod.Vector2D]): + """ + public interfaceConvexHullGenerator2Dextends :class:`~org.hipparchus.geometry.hull.ConvexHullGenerator`<:class:`~org.hipparchus.geometry.euclidean.twod.Euclidean2D`,:class:`~org.hipparchus.geometry.euclidean.twod.Vector2D`> + + Interface for convex hull generators in the two-dimensional euclidean space. + """ def generate(self, collection: typing.Union[java.util.Collection[org.hipparchus.geometry.euclidean.twod.Vector2D], typing.Sequence[org.hipparchus.geometry.euclidean.twod.Vector2D], typing.Set[org.hipparchus.geometry.euclidean.twod.Vector2D]]) -> ConvexHull2D: ... class MonotoneChain(org.hipparchus.geometry.euclidean.twod.hull.AbstractConvexHullGenerator2D): + """ + public classMonotoneChain extends :class:`~org.hipparchus.geometry.euclidean.twod.hull.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Implements Andrew's monotone chain method to generate the convex hull of a finite set of points in the two-dimensional + euclidean space. + + The runtime complexity is O(n log n), with n being the number of input points. If the point set is already sorted (by + x-coordinate), the runtime complexity is O(n). + + The implementation is not sensitive to collinear points on the hull. The parameter :code:`includeCollinearPoints` allows + to control the behavior with regard to collinear points. If :code:`true`, all points on the boundary of the hull will be + added to the hull vertices, otherwise only the extreme points will be present. By default, collinear points are not + added as hull vertices. + + The :code:`tolerance` parameter (default: 1e-10) is used as epsilon criteria to determine identical and collinear + points. + + Also see: + + - ` Andrew's monotone chain algorithm (Wikibooks) + <http://en.wikibooks.org/wiki/Algorithm_Implementation/Geometry/Convex_hull/Monotone_chain>` + """ @typing.overload def __init__(self): ... @typing.overload diff --git a/org-stubs/hipparchus/geometry/hull/__init__.pyi b/org-stubs/hipparchus/geometry/hull/__init__.pyi index 1b84359..354f103 100644 --- a/org-stubs/hipparchus/geometry/hull/__init__.pyi +++ b/org-stubs/hipparchus/geometry/hull/__init__.pyi @@ -16,12 +16,36 @@ import typing _ConvexHull__S = typing.TypeVar('_ConvexHull__S', bound=org.hipparchus.geometry.Space) # <S> _ConvexHull__P = typing.TypeVar('_ConvexHull__P', bound=org.hipparchus.geometry.Point) # <P> class ConvexHull(java.io.Serializable, typing.Generic[_ConvexHull__S, _ConvexHull__P]): + """ + public interfaceConvexHull<S extends :class:`~org.hipparchus.geometry.Space`,P extends :class:`~org.hipparchus.geometry.Point`<S>>extends :class:`~org.hipparchus.geometry.hull.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + This class represents a convex hull. + """ def createRegion(self) -> org.hipparchus.geometry.partitioning.Region[_ConvexHull__S]: ... - def getVertices(self) -> typing.MutableSequence[_ConvexHull__P]: ... + def getVertices(self) -> typing.MutableSequence[_ConvexHull__P]: + """ + Get the vertices of the convex hull. + + Returns: + vertices of the convex hull + + + """ + ... _ConvexHullGenerator__S = typing.TypeVar('_ConvexHullGenerator__S', bound=org.hipparchus.geometry.Space) # <S> _ConvexHullGenerator__P = typing.TypeVar('_ConvexHullGenerator__P', bound=org.hipparchus.geometry.Point) # <P> class ConvexHullGenerator(typing.Generic[_ConvexHullGenerator__S, _ConvexHullGenerator__P]): + """ + public interfaceConvexHullGenerator<S extends :class:`~org.hipparchus.geometry.Space`,P extends :class:`~org.hipparchus.geometry.Point`<S>> + + Interface for convex hull generators. + + Also see: + + - `Convex Hull (Wikipedia) <http://en.wikipedia.org/wiki/Convex_hull>` + - `Convex Hull (MathWorld) <http://mathworld.wolfram.com/ConvexHull.html>` + """ def generate(self, collection: typing.Union[java.util.Collection[_ConvexHullGenerator__P], typing.Sequence[_ConvexHullGenerator__P], typing.Set[_ConvexHullGenerator__P]]) -> ConvexHull[_ConvexHullGenerator__S, _ConvexHullGenerator__P]: ... diff --git a/org-stubs/hipparchus/geometry/partitioning/__init__.pyi b/org-stubs/hipparchus/geometry/partitioning/__init__.pyi index 6947c47..81219bb 100644 --- a/org-stubs/hipparchus/geometry/partitioning/__init__.pyi +++ b/org-stubs/hipparchus/geometry/partitioning/__init__.pyi @@ -17,6 +17,32 @@ _BSPTree__LeafMerger__S = typing.TypeVar('_BSPTree__LeafMerger__S', bound=org.hi _BSPTree__VanishingCutHandler__S = typing.TypeVar('_BSPTree__VanishingCutHandler__S', bound=org.hipparchus.geometry.Space) # <S> _BSPTree__S = typing.TypeVar('_BSPTree__S', bound=org.hipparchus.geometry.Space) # <S> class BSPTree(typing.Generic[_BSPTree__S]): + """ + public classBSPTree<S extends :class:`~org.hipparchus.geometry.Space`> extends :class:`~org.hipparchus.geometry.partitioning.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + This class represent a Binary Space Partition tree. + + BSP trees are an efficient way to represent space partitions and to associate attributes with each cell. Each node in a + BSP tree represents a convex region which is partitioned in two convex sub-regions at each side of a cut hyperplane. The + root tree contains the complete space. + + The main use of such partitions is to use a boolean attribute to define an inside/outside property, hence representing + arbitrary polytopes (line segments in 1D, polygons in 2D and polyhedrons in 3D) and to operate on them. + + Another example would be to represent Voronoi tesselations, the attribute of each cell holding the defining point of the + cell. + + The application-defined attributes are shared among copied instances and propagated to split parts. These attributes are + not used by the BSP-tree algorithms themselves, so the application can use them for any purpose. Since the tree visiting + method holds internal and leaf nodes differently, it is possible to use different classes for internal nodes attributes + and leaf nodes attributes. This should be used with care, though, because if the tree is modified in any way after + attributes have been set, some internal nodes may become leaf nodes and some leaf nodes may become internal nodes. + + One of the main sources for the development of this package was Bruce Naylor, John Amanatides and William Thibault paper + `Merging BSP Trees Yields Polyhedral Set Operations <http://www.cs.yorku.ca/~amana/research/bsptSetOp.pdf>` Proc. + Siggraph '90, Computer Graphics 24(4), August 1990, pp 115-124, published by the Association for Computing Machinery + (ACM). + """ @typing.overload def __init__(self): ... @typing.overload @@ -24,7 +50,22 @@ class BSPTree(typing.Generic[_BSPTree__S]): @typing.overload def __init__(self, subHyperplane: 'SubHyperplane'[_BSPTree__S], bSPTree: 'BSPTree'[_BSPTree__S], bSPTree2: 'BSPTree'[_BSPTree__S], object: typing.Any): ... def copySelf(self) -> 'BSPTree'[_BSPTree__S]: ... - def getAttribute(self) -> typing.Any: ... + def getAttribute(self) -> typing.Any: + """ + Get the attribute associated with the instance. + + Returns: + attribute associated with the node or null if no attribute has been explicitly set using the + :meth:`~org.hipparchus.geometry.partitioning.BSPTree.setAttribute` method + + Also see: + + - :meth:`~org.hipparchus.geometry.partitioning.BSPTree.setAttribute` + + + + """ + ... def getCell(self, point: org.hipparchus.geometry.Point[_BSPTree__S], double: float) -> 'BSPTree'[_BSPTree__S]: ... def getCloseCuts(self, point: org.hipparchus.geometry.Point[_BSPTree__S], double: float) -> java.util.List['BSPTree'[_BSPTree__S]]: ... def getCut(self) -> 'SubHyperplane'[_BSPTree__S]: ... @@ -35,7 +76,21 @@ class BSPTree(typing.Generic[_BSPTree__S]): def insertInTree(self, bSPTree: 'BSPTree'[_BSPTree__S], boolean: bool, vanishingCutHandler: typing.Union['BSPTree.VanishingCutHandler'[_BSPTree__S], typing.Callable[['BSPTree'[org.hipparchus.geometry.Space]], 'BSPTree'[org.hipparchus.geometry.Space]]]) -> None: ... def merge(self, bSPTree: 'BSPTree'[_BSPTree__S], leafMerger: typing.Union['BSPTree.LeafMerger'[_BSPTree__S], typing.Callable[['BSPTree'[org.hipparchus.geometry.Space], 'BSPTree'[org.hipparchus.geometry.Space], 'BSPTree'[org.hipparchus.geometry.Space], bool, bool], 'BSPTree'[org.hipparchus.geometry.Space]]]) -> 'BSPTree'[_BSPTree__S]: ... def pruneAroundConvexCell(self, object: typing.Any, object2: typing.Any, object3: typing.Any) -> 'BSPTree'[_BSPTree__S]: ... - def setAttribute(self, object: typing.Any) -> None: ... + def setAttribute(self, object: typing.Any) -> None: + """ + Associate an attribute with the instance. + + Parameters: + attribute (:class:`~org.hipparchus.geometry.partitioning.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object`): attribute to associate with the node + + Also see: + + - :meth:`~org.hipparchus.geometry.partitioning.BSPTree.getAttribute` + + + + """ + ... def split(self, subHyperplane: 'SubHyperplane'[_BSPTree__S]) -> 'BSPTree'[_BSPTree__S]: ... def visit(self, bSPTreeVisitor: 'BSPTreeVisitor'[_BSPTree__S]) -> None: ... class LeafMerger(typing.Generic[_BSPTree__LeafMerger__S]): @@ -45,6 +100,29 @@ class BSPTree(typing.Generic[_BSPTree__S]): _BSPTreeVisitor__S = typing.TypeVar('_BSPTreeVisitor__S', bound=org.hipparchus.geometry.Space) # <S> class BSPTreeVisitor(typing.Generic[_BSPTreeVisitor__S]): + """ + public interfaceBSPTreeVisitor<S extends :class:`~org.hipparchus.geometry.Space`> + + This interface is used to visit :class:`~org.hipparchus.geometry.partitioning.BSPTree` nodes. + + Navigation through :class:`~org.hipparchus.geometry.partitioning.BSPTree` can be done using two different point of + views: + + - the first one is in a node-oriented way using the :meth:`~org.hipparchus.geometry.partitioning.BSPTree.getPlus`, + :meth:`~org.hipparchus.geometry.partitioning.BSPTree.getMinus` and + :meth:`~org.hipparchus.geometry.partitioning.BSPTree.getParent` methods. Terminal nodes without associated + :class:`~org.hipparchus.geometry.partitioning.SubHyperplane` can be visited this way, there is no constraint in the + visit order, and it is possible to visit either all nodes or only a subset of the nodes + - the second one is in a sub-hyperplane-oriented way using classes implementing this interface which obeys the visitor + design pattern. The visit order is provided by the visitor as each node is first encountered. Each node is visited + exactly once. + + + Also see: + + - :class:`~org.hipparchus.geometry.partitioning.BSPTree` + - :class:`~org.hipparchus.geometry.partitioning.SubHyperplane` + """ def visitInternalNode(self, bSPTree: BSPTree[_BSPTreeVisitor__S]) -> None: ... def visitLeafNode(self, bSPTree: BSPTree[_BSPTreeVisitor__S]) -> None: ... def visitOrder(self, bSPTree: BSPTree[_BSPTreeVisitor__S]) -> 'BSPTreeVisitor.Order': ... @@ -67,29 +145,120 @@ class BSPTreeVisitor(typing.Generic[_BSPTreeVisitor__S]): _BoundaryAttribute__S = typing.TypeVar('_BoundaryAttribute__S', bound=org.hipparchus.geometry.Space) # <S> class BoundaryAttribute(typing.Generic[_BoundaryAttribute__S]): + """ + public classBoundaryAttribute<S extends :class:`~org.hipparchus.geometry.Space`> extends :class:`~org.hipparchus.geometry.partitioning.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Class holding boundary attributes. + + This class is used for the attributes associated with the nodes of region boundary shell trees returned by the + :meth:`~org.hipparchus.geometry.partitioning.Region.getTree` when the boolean :code:`includeBoundaryAttributes` + parameter is set to :code:`true`. It contains the parts of the node cut sub-hyperplane that belong to the boundary. + + This class is a simple placeholder, it does not provide any processing methods. + + Also see: + + - :meth:`~org.hipparchus.geometry.partitioning.Region.getTree` + """ def getPlusInside(self) -> 'SubHyperplane'[_BoundaryAttribute__S]: ... def getPlusOutside(self) -> 'SubHyperplane'[_BoundaryAttribute__S]: ... def getSplitters(self) -> 'NodesSet'[_BoundaryAttribute__S]: ... _BoundaryProjection__S = typing.TypeVar('_BoundaryProjection__S', bound=org.hipparchus.geometry.Space) # <S> class BoundaryProjection(typing.Generic[_BoundaryProjection__S]): + """ + public classBoundaryProjection<S extends :class:`~org.hipparchus.geometry.Space`> extends :class:`~org.hipparchus.geometry.partitioning.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Class holding the result of point projection on region boundary. + + This class is a simple placeholder, it does not provide any processing methods. + + Instances of this class are guaranteed to be immutable + + Also see: + + - :meth:`~org.hipparchus.geometry.partitioning.AbstractRegion.projectToBoundary` + """ def __init__(self, point: org.hipparchus.geometry.Point[_BoundaryProjection__S], point2: org.hipparchus.geometry.Point[_BoundaryProjection__S], double: float): ... - def getOffset(self) -> float: ... + def getOffset(self) -> float: + """ + Offset of the point with respect to the boundary it is projected on. + + The offset with respect to the boundary is negative if the + :meth:`~org.hipparchus.geometry.partitioning.BoundaryProjection.getOriginal` is inside the region, and positive + otherwise. + + If there are no boundary, the value is set to either :code:`Double.POSITIVE_INFINITY` if the region is empty (i.e. all + points are outside of the region) or :code:`Double.NEGATIVE_INFINITY` if the region covers the whole space (i.e. all + points are inside of the region). + + Returns: + offset of the point with respect to the boundary it is projected on + + + """ + ... def getOriginal(self) -> org.hipparchus.geometry.Point[_BoundaryProjection__S]: ... def getProjected(self) -> org.hipparchus.geometry.Point[_BoundaryProjection__S]: ... _Embedding__S = typing.TypeVar('_Embedding__S', bound=org.hipparchus.geometry.Space) # <S> _Embedding__T = typing.TypeVar('_Embedding__T', bound=org.hipparchus.geometry.Space) # <T> class Embedding(typing.Generic[_Embedding__S, _Embedding__T]): + """ + public interfaceEmbedding<S extends :class:`~org.hipparchus.geometry.Space`,T extends :class:`~org.hipparchus.geometry.Space`> + + This interface defines mappers between a space and one of its sub-spaces. + + Sub-spaces are the lower dimensions subsets of a n-dimensions space. The (n-1)-dimension sub-spaces are specific + sub-spaces known as :class:`~org.hipparchus.geometry.partitioning.Hyperplane`. This interface can be used regardless of + the dimensions differences. As an example, :class:`~org.hipparchus.geometry.euclidean.threed.Line` in 3D implements + Embedding< :class:`~org.hipparchus.geometry.euclidean.threed.Vector3D`, + :class:`~org.hipparchus.geometry.euclidean.oned.Vector1D`>, i.e. it maps directly dimensions 3 and 1. + + In the 3D euclidean space, hyperplanes are 2D planes, and the 1D sub-spaces are lines. + + Note that this interface is *not* intended to be implemented by Hipparchus users, it is only intended to be implemented + within the library itself. New methods may be added even for minor versions, which breaks compatibility for external + implementations. + + Also see: + + - :class:`~org.hipparchus.geometry.partitioning.Hyperplane` + """ def toSpace(self, point: org.hipparchus.geometry.Point[_Embedding__T]) -> org.hipparchus.geometry.Point[_Embedding__S]: ... def toSubSpace(self, point: org.hipparchus.geometry.Point[_Embedding__S]) -> org.hipparchus.geometry.Point[_Embedding__T]: ... _Hyperplane__S = typing.TypeVar('_Hyperplane__S', bound=org.hipparchus.geometry.Space) # <S> class Hyperplane(typing.Generic[_Hyperplane__S]): + """ + public interfaceHyperplane<S extends :class:`~org.hipparchus.geometry.Space`> + + This interface represents an hyperplane of a space. + + The most prominent place where hyperplane appears in space partitioning is as cutters. Each partitioning node in a + :class:`~org.hipparchus.geometry.partitioning.BSPTree` has a cut + :class:`~org.hipparchus.geometry.partitioning.SubHyperplane` which is either an hyperplane or a part of an hyperplane. + In an n-dimensions euclidean space, an hyperplane is an (n-1)-dimensions hyperplane (for example a traditional plane in + the 3D euclidean space). They can be more exotic objects in specific fields, for example a circle on the surface of the + unit sphere. + + Note that this interface is *not* intended to be implemented by Hipparchus users, it is only intended to be implemented + within the library itself. New methods may be added even for minor versions, which breaks compatibility for external + implementations. + """ def copySelf(self) -> 'Hyperplane'[_Hyperplane__S]: ... def emptyHyperplane(self) -> 'SubHyperplane'[_Hyperplane__S]: ... def getOffset(self, point: org.hipparchus.geometry.Point[_Hyperplane__S]) -> float: ... - def getTolerance(self) -> float: ... + def getTolerance(self) -> float: + """ + Get the tolerance below which points are considered to belong to the hyperplane. + + Returns: + tolerance below which points are considered to belong to the hyperplane + + + """ + ... def project(self, point: org.hipparchus.geometry.Point[_Hyperplane__S]) -> org.hipparchus.geometry.Point[_Hyperplane__S]: ... def sameOrientationAs(self, hyperplane: 'Hyperplane'[_Hyperplane__S]) -> bool: ... def wholeHyperplane(self) -> 'SubHyperplane'[_Hyperplane__S]: ... @@ -97,6 +266,16 @@ class Hyperplane(typing.Generic[_Hyperplane__S]): _NodesSet__S = typing.TypeVar('_NodesSet__S', bound=org.hipparchus.geometry.Space) # <S> class NodesSet(java.lang.Iterable[BSPTree[_NodesSet__S]], typing.Generic[_NodesSet__S]): + """ + public classNodesSet<S extends :class:`~org.hipparchus.geometry.Space`> extends :class:`~org.hipparchus.geometry.partitioning.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.geometry.partitioning.https:.docs.oracle.com.javase.8.docs.api.java.lang.Iterable`<:class:`~org.hipparchus.geometry.partitioning.BSPTree`<S>> + + Set of :class:`~org.hipparchus.geometry.partitioning.BSPTree` nodes. + + Also see: + + - :class:`~org.hipparchus.geometry.partitioning.BoundaryAttribute` + """ def __init__(self): ... def add(self, bSPTree: BSPTree[_NodesSet__S]) -> None: ... def addAll(self, iterable: typing.Union[java.lang.Iterable[BSPTree[_NodesSet__S]], typing.Sequence[BSPTree[_NodesSet__S]], typing.Set[BSPTree[_NodesSet__S]], typing.Callable[[], java.util.Iterator[typing.Any]]]) -> None: ... @@ -104,21 +283,99 @@ class NodesSet(java.lang.Iterable[BSPTree[_NodesSet__S]], typing.Generic[_NodesS _Region__S = typing.TypeVar('_Region__S', bound=org.hipparchus.geometry.Space) # <S> class Region(typing.Generic[_Region__S]): + """ + public interfaceRegion<S extends :class:`~org.hipparchus.geometry.Space`> + + This interface represents a region of a space as a partition. + + Region are subsets of a space, they can be infinite (whole space, half space, infinite stripe ...) or finite (polygons + in 2D, polyhedrons in 3D ...). Their main characteristic is to separate points that are considered to be *inside* the + region from points considered to be *outside* of it. In between, there may be points on the *boundary* of the region. + + This implementation is limited to regions for which the boundary is composed of several + :class:`~org.hipparchus.geometry.partitioning.SubHyperplane`, including regions with no boundary at all: the whole space + and the empty region. They are not necessarily finite and not necessarily path-connected. They can contain holes. + + Regions can be combined using the traditional sets operations : union, intersection, difference and symetric difference + (exclusive or) for the binary operations, complement for the unary operation. + + Note that this interface is *not* intended to be implemented by Hipparchus users, it is only intended to be implemented + within the library itself. New methods may be added even for minor versions, which breaks compatibility for external + implementations. + """ def buildNew(self, bSPTree: BSPTree[_Region__S]) -> 'Region'[_Region__S]: ... def checkPoint(self, point: org.hipparchus.geometry.Point[_Region__S]) -> 'Region.Location': ... def contains(self, region: 'Region'[_Region__S]) -> bool: ... def copySelf(self) -> 'Region'[_Region__S]: ... def getBarycenter(self) -> org.hipparchus.geometry.Point[_Region__S]: ... - def getBoundarySize(self) -> float: ... - def getSize(self) -> float: ... + def getBoundarySize(self) -> float: + """ + Get the size of the boundary. + + Returns: + the size of the boundary (this is 0 in 1D, a length in 2D, an area in 3D ...) + + + """ + ... + def getSize(self) -> float: + """ + Get the size of the instance. + + Returns: + the size of the instance (this is a length in 1D, an area in 2D, a volume in 3D ...) + + + """ + ... def getTree(self, boolean: bool) -> BSPTree[_Region__S]: ... def intersection(self, subHyperplane: 'SubHyperplane'[_Region__S]) -> 'SubHyperplane'[_Region__S]: ... @typing.overload - def isEmpty(self) -> bool: ... + def isEmpty(self) -> bool: + """ + Check if the instance is empty. + + Returns: + true if the instance is empty + + boolean isEmpty(:class:`~org.hipparchus.geometry.partitioning.BSPTree`<:class:`~org.hipparchus.geometry.partitioning.Region`> node) + + Check if the sub-tree starting at a given node is empty. + + Parameters: + node (:class:`~org.hipparchus.geometry.partitioning.BSPTree`<:class:`~org.hipparchus.geometry.partitioning.Region`> node): root node of the sub-tree (*must* have :class:`~org.hipparchus.geometry.partitioning.Region` tree semantics, i.e. the + leaf nodes must have :code:`Boolean` attributes representing an inside/outside property) + + Returns: + true if the sub-tree starting at the given node is empty + + + """ + ... @typing.overload def isEmpty(self, bSPTree: BSPTree[_Region__S]) -> bool: ... @typing.overload - def isFull(self) -> bool: ... + def isFull(self) -> bool: + """ + Check if the instance covers the full space. + + Returns: + true if the instance covers the full space + + boolean isFull(:class:`~org.hipparchus.geometry.partitioning.BSPTree`<:class:`~org.hipparchus.geometry.partitioning.Region`> node) + + Check if the sub-tree starting at a given node covers the full space. + + Parameters: + node (:class:`~org.hipparchus.geometry.partitioning.BSPTree`<:class:`~org.hipparchus.geometry.partitioning.Region`> node): root node of the sub-tree (*must* have :class:`~org.hipparchus.geometry.partitioning.Region` tree semantics, i.e. the + leaf nodes must have :code:`Boolean` attributes representing an inside/outside property) + + Returns: + true if the sub-tree starting at the given node covers the full space + + + """ + ... @typing.overload def isFull(self, bSPTree: BSPTree[_Region__S]) -> bool: ... def projectToBoundary(self, point: org.hipparchus.geometry.Point[_Region__S]) -> BoundaryProjection[_Region__S]: ... @@ -138,6 +395,11 @@ class Region(typing.Generic[_Region__S]): _RegionFactory__S = typing.TypeVar('_RegionFactory__S', bound=org.hipparchus.geometry.Space) # <S> class RegionFactory(typing.Generic[_RegionFactory__S]): + """ + public classRegionFactory<S extends :class:`~org.hipparchus.geometry.Space`> extends :class:`~org.hipparchus.geometry.partitioning.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + This class is a factory for :class:`~org.hipparchus.geometry.partitioning.Region`. + """ def __init__(self): ... def buildConvex(self, *hyperplane: Hyperplane[_RegionFactory__S]) -> Region[_RegionFactory__S]: ... def difference(self, region: Region[_RegionFactory__S], region2: Region[_RegionFactory__S]) -> Region[_RegionFactory__S]: ... @@ -147,6 +409,12 @@ class RegionFactory(typing.Generic[_RegionFactory__S]): def xor(self, region: Region[_RegionFactory__S], region2: Region[_RegionFactory__S]) -> Region[_RegionFactory__S]: ... class Side(java.lang.Enum['Side']): + """ + public enumSide extends :class:`~org.hipparchus.geometry.partitioning.https:.docs.oracle.com.javase.8.docs.api.java.lang.Enum`<:class:`~org.hipparchus.geometry.partitioning.Side`> + + Enumerate representing the location of an element with respect to an + :class:`~org.hipparchus.geometry.partitioning.Hyperplane` of a space. + """ PLUS: typing.ClassVar['Side'] = ... MINUS: typing.ClassVar['Side'] = ... BOTH: typing.ClassVar['Side'] = ... @@ -157,17 +425,75 @@ class Side(java.lang.Enum['Side']): def valueOf(class_: typing.Type[_valueOf_0__T], string: str) -> _valueOf_0__T: ... @typing.overload @staticmethod - def valueOf(string: str) -> 'Side': ... + def valueOf(string: str) -> 'Side': + """ + Returns the enum constant of this type with the specified name. The string must match *exactly* an identifier used to + declare an enum constant in this type. (Extraneous whitespace characters are not permitted.) + + Parameters: + name (:class:`~org.hipparchus.geometry.partitioning.https:.docs.oracle.com.javase.8.docs.api.java.lang.String`): the name of the enum constant to be returned. + + Returns: + the enum constant with the specified name + + Raises: + :class:`~org.hipparchus.geometry.partitioning.https:.docs.oracle.com.javase.8.docs.api.java.lang.IllegalArgumentException`: if this enum type has no constant with the specified name + :class:`~org.hipparchus.geometry.partitioning.https:.docs.oracle.com.javase.8.docs.api.java.lang.NullPointerException`: if the argument is null + + + """ + ... @staticmethod - def values() -> typing.MutableSequence['Side']: ... + def values() -> typing.MutableSequence['Side']: + """ + Returns an array containing the constants of this enum type, in the order they are declared. + + Returns: + an array containing the constants of this enum type, in the order they are declared + + + """ + ... _SubHyperplane__SplitSubHyperplane__U = typing.TypeVar('_SubHyperplane__SplitSubHyperplane__U', bound=org.hipparchus.geometry.Space) # <U> _SubHyperplane__S = typing.TypeVar('_SubHyperplane__S', bound=org.hipparchus.geometry.Space) # <S> class SubHyperplane(typing.Generic[_SubHyperplane__S]): + """ + public interfaceSubHyperplane<S extends :class:`~org.hipparchus.geometry.Space`> + + This interface represents the remaining parts of an hyperplane after other parts have been chopped off. + + sub-hyperplanes are obtained when parts of an :class:`~org.hipparchus.geometry.partitioning.Hyperplane` are chopped off + by other hyperplanes that intersect it. The remaining part is a convex region. Such objects appear in + :class:`~org.hipparchus.geometry.partitioning.BSPTree` as the intersection of a cut hyperplane with the convex region + which it splits, the chopping hyperplanes are the cut hyperplanes closer to the tree root. + + Note that this interface is *not* intended to be implemented by Hipparchus users, it is only intended to be implemented + within the library itself. New methods may be added even for minor versions, which breaks compatibility for external + implementations. + """ def copySelf(self) -> 'SubHyperplane'[_SubHyperplane__S]: ... def getHyperplane(self) -> Hyperplane[_SubHyperplane__S]: ... - def getSize(self) -> float: ... - def isEmpty(self) -> bool: ... + def getSize(self) -> float: + """ + Get the size of the instance. + + Returns: + the size of the instance (this is a length in 1D, an area in 2D, a volume in 3D ...) + + + """ + ... + def isEmpty(self) -> bool: + """ + Check if the instance is empty. + + Returns: + true if the instance is empty + + + """ + ... def reunite(self, subHyperplane: 'SubHyperplane'[_SubHyperplane__S]) -> 'SubHyperplane'[_SubHyperplane__S]: ... def split(self, hyperplane: Hyperplane[_SubHyperplane__S]) -> 'SubHyperplane.SplitSubHyperplane'[_SubHyperplane__S]: ... class SplitSubHyperplane(typing.Generic[_SubHyperplane__SplitSubHyperplane__U]): @@ -179,6 +505,23 @@ class SubHyperplane(typing.Generic[_SubHyperplane__S]): _Transform__S = typing.TypeVar('_Transform__S', bound=org.hipparchus.geometry.Space) # <S> _Transform__T = typing.TypeVar('_Transform__T', bound=org.hipparchus.geometry.Space) # <T> class Transform(typing.Generic[_Transform__S, _Transform__T]): + """ + public interfaceTransform<S extends :class:`~org.hipparchus.geometry.Space`,T extends :class:`~org.hipparchus.geometry.Space`> + + This interface represents an inversible affine transform in a space. + + Inversible affine transform include for example scalings, translations, rotations. + + Transforms are dimension-specific. The consistency rules between the three :code:`apply` methods are the following ones + for a transformed defined for dimension D: + + - the transform can be applied to a point in the D-dimension space using its + :meth:`~org.hipparchus.geometry.partitioning.Transform.apply` method + - the transform can be applied to a (D-1)-dimension hyperplane in the D-dimension space using its + :meth:`~org.hipparchus.geometry.partitioning.Transform.apply` method + - the transform can be applied to a (D-2)-dimension sub-hyperplane in a (D-1)-dimension hyperplane using its + :meth:`~org.hipparchus.geometry.partitioning.Transform.apply` method + """ @typing.overload def apply(self, point: org.hipparchus.geometry.Point[_Transform__S]) -> org.hipparchus.geometry.Point[_Transform__S]: ... @typing.overload @@ -189,6 +532,12 @@ class Transform(typing.Generic[_Transform__S, _Transform__T]): _AbstractRegion__S = typing.TypeVar('_AbstractRegion__S', bound=org.hipparchus.geometry.Space) # <S> _AbstractRegion__T = typing.TypeVar('_AbstractRegion__T', bound=org.hipparchus.geometry.Space) # <T> class AbstractRegion(Region[_AbstractRegion__S], typing.Generic[_AbstractRegion__S, _AbstractRegion__T]): + """ + public abstract classAbstractRegion<S extends :class:`~org.hipparchus.geometry.Space`,T extends :class:`~org.hipparchus.geometry.Space`> extends :class:`~org.hipparchus.geometry.partitioning.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.geometry.partitioning.Region`<S> + + Abstract class for all regions, independently of geometry type or dimension. + """ def __init__(self, hyperplaneArray: typing.Union[typing.List[Hyperplane[_AbstractRegion__S]], jpype.JArray], double: float): ... def applyTransform(self, transform: Transform[_AbstractRegion__S, _AbstractRegion__T]) -> 'AbstractRegion'[_AbstractRegion__S, _AbstractRegion__T]: ... def buildNew(self, bSPTree: BSPTree[_AbstractRegion__S]) -> 'AbstractRegion'[_AbstractRegion__S, _AbstractRegion__T]: ... @@ -200,17 +549,108 @@ class AbstractRegion(Region[_AbstractRegion__S], typing.Generic[_AbstractRegion_ def contains(self, region: Region[_AbstractRegion__S]) -> bool: ... def copySelf(self) -> 'AbstractRegion'[_AbstractRegion__S, _AbstractRegion__T]: ... def getBarycenter(self) -> org.hipparchus.geometry.Point[_AbstractRegion__S]: ... - def getBoundarySize(self) -> float: ... - def getSize(self) -> float: ... - def getTolerance(self) -> float: ... + def getBoundarySize(self) -> float: + """ + Get the size of the boundary. + + Specified by: + :meth:`~org.hipparchus.geometry.partitioning.Region.getBoundarySize` in + interface :class:`~org.hipparchus.geometry.partitioning.Region` + + Returns: + the size of the boundary (this is 0 in 1D, a length in 2D, an area in 3D ...) + + + """ + ... + def getSize(self) -> float: + """ + Get the size of the instance. + + Specified by: + :meth:`~org.hipparchus.geometry.partitioning.Region.getSize` in + interface :class:`~org.hipparchus.geometry.partitioning.Region` + + Returns: + the size of the instance (this is a length in 1D, an area in 2D, a volume in 3D ...) + + + """ + ... + def getTolerance(self) -> float: + """ + Get the tolerance below which points are considered to belong to hyperplanes. + + Returns: + tolerance below which points are considered to belong to hyperplanes + + + """ + ... def getTree(self, boolean: bool) -> BSPTree[_AbstractRegion__S]: ... def intersection(self, subHyperplane: SubHyperplane[_AbstractRegion__S]) -> SubHyperplane[_AbstractRegion__S]: ... @typing.overload - def isEmpty(self) -> bool: ... + def isEmpty(self) -> bool: + """ + Check if the instance is empty. + + Specified by: + :meth:`~org.hipparchus.geometry.partitioning.Region.isEmpty` in + interface :class:`~org.hipparchus.geometry.partitioning.Region` + + Returns: + true if the instance is empty + + public boolean isEmpty(:class:`~org.hipparchus.geometry.partitioning.BSPTree`<:class:`~org.hipparchus.geometry.partitioning.AbstractRegion`> node) + + Check if the sub-tree starting at a given node is empty. + + Specified by: + :meth:`~org.hipparchus.geometry.partitioning.Region.isEmpty` in + interface :class:`~org.hipparchus.geometry.partitioning.Region` + + Parameters: + node (:class:`~org.hipparchus.geometry.partitioning.BSPTree`<:class:`~org.hipparchus.geometry.partitioning.AbstractRegion`> node): root node of the sub-tree (*must* have :class:`~org.hipparchus.geometry.partitioning.Region` tree semantics, i.e. the + leaf nodes must have :code:`Boolean` attributes representing an inside/outside property) + + Returns: + true if the sub-tree starting at the given node is empty + + + """ + ... @typing.overload def isEmpty(self, bSPTree: BSPTree[_AbstractRegion__S]) -> bool: ... @typing.overload - def isFull(self) -> bool: ... + def isFull(self) -> bool: + """ + Check if the instance covers the full space. + + Specified by: + :meth:`~org.hipparchus.geometry.partitioning.Region.isFull` in + interface :class:`~org.hipparchus.geometry.partitioning.Region` + + Returns: + true if the instance covers the full space + + public boolean isFull(:class:`~org.hipparchus.geometry.partitioning.BSPTree`<:class:`~org.hipparchus.geometry.partitioning.AbstractRegion`> node) + + Check if the sub-tree starting at a given node covers the full space. + + Specified by: + :meth:`~org.hipparchus.geometry.partitioning.Region.isFull` in + interface :class:`~org.hipparchus.geometry.partitioning.Region` + + Parameters: + node (:class:`~org.hipparchus.geometry.partitioning.BSPTree`<:class:`~org.hipparchus.geometry.partitioning.AbstractRegion`> node): root node of the sub-tree (*must* have :class:`~org.hipparchus.geometry.partitioning.Region` tree semantics, i.e. the + leaf nodes must have :code:`Boolean` attributes representing an inside/outside property) + + Returns: + true if the sub-tree starting at the given node covers the full space + + + """ + ... @typing.overload def isFull(self, bSPTree: BSPTree[_AbstractRegion__S]) -> bool: ... def projectToBoundary(self, point: org.hipparchus.geometry.Point[_AbstractRegion__S]) -> BoundaryProjection[_AbstractRegion__S]: ... @@ -218,12 +658,49 @@ class AbstractRegion(Region[_AbstractRegion__S], typing.Generic[_AbstractRegion_ _AbstractSubHyperplane__S = typing.TypeVar('_AbstractSubHyperplane__S', bound=org.hipparchus.geometry.Space) # <S> _AbstractSubHyperplane__T = typing.TypeVar('_AbstractSubHyperplane__T', bound=org.hipparchus.geometry.Space) # <T> class AbstractSubHyperplane(SubHyperplane[_AbstractSubHyperplane__S], typing.Generic[_AbstractSubHyperplane__S, _AbstractSubHyperplane__T]): + """ + public abstract classAbstractSubHyperplane<S extends :class:`~org.hipparchus.geometry.Space`,T extends :class:`~org.hipparchus.geometry.Space`> extends :class:`~org.hipparchus.geometry.partitioning.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.geometry.partitioning.SubHyperplane`<S> + + This class implements the dimension-independent parts of :class:`~org.hipparchus.geometry.partitioning.SubHyperplane`. + + sub-hyperplanes are obtained when parts of an :class:`~org.hipparchus.geometry.partitioning.Hyperplane` are chopped off + by other hyperplanes that intersect it. The remaining part is a convex region. Such objects appear in + :class:`~org.hipparchus.geometry.partitioning.BSPTree` as the intersection of a cut hyperplane with the convex region + which it splits, the chopping hyperplanes are the cut hyperplanes closer to the tree root. + """ def applyTransform(self, transform: Transform[_AbstractSubHyperplane__S, _AbstractSubHyperplane__T]) -> 'AbstractSubHyperplane'[_AbstractSubHyperplane__S, _AbstractSubHyperplane__T]: ... def copySelf(self) -> 'AbstractSubHyperplane'[_AbstractSubHyperplane__S, _AbstractSubHyperplane__T]: ... def getHyperplane(self) -> Hyperplane[_AbstractSubHyperplane__S]: ... def getRemainingRegion(self) -> Region[_AbstractSubHyperplane__T]: ... - def getSize(self) -> float: ... - def isEmpty(self) -> bool: ... + def getSize(self) -> float: + """ + Get the size of the instance. + + Specified by: + :meth:`~org.hipparchus.geometry.partitioning.SubHyperplane.getSize` in + interface :class:`~org.hipparchus.geometry.partitioning.SubHyperplane` + + Returns: + the size of the instance (this is a length in 1D, an area in 2D, a volume in 3D ...) + + + """ + ... + def isEmpty(self) -> bool: + """ + Check if the instance is empty. + + Specified by: + :meth:`~org.hipparchus.geometry.partitioning.SubHyperplane.isEmpty` in + interface :class:`~org.hipparchus.geometry.partitioning.SubHyperplane` + + Returns: + true if the instance is empty + + + """ + ... def reunite(self, subHyperplane: SubHyperplane[_AbstractSubHyperplane__S]) -> 'AbstractSubHyperplane'[_AbstractSubHyperplane__S, _AbstractSubHyperplane__T]: ... def split(self, hyperplane: Hyperplane[_AbstractSubHyperplane__S]) -> SubHyperplane.SplitSubHyperplane[_AbstractSubHyperplane__S]: ... diff --git a/org-stubs/hipparchus/geometry/spherical/oned/__init__.pyi b/org-stubs/hipparchus/geometry/spherical/oned/__init__.pyi index e0f26a2..60e8a23 100644 --- a/org-stubs/hipparchus/geometry/spherical/oned/__init__.pyi +++ b/org-stubs/hipparchus/geometry/spherical/oned/__init__.pyi @@ -17,19 +17,125 @@ import typing class Arc: + """ + public classArc extends :class:`~org.hipparchus.geometry.spherical.oned.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + This class represents an arc on a circle. + + Also see: + + - :class:`~org.hipparchus.geometry.spherical.oned.ArcsSet` + """ def __init__(self, double: float, double2: float, double3: float): ... - def checkPoint(self, double: float) -> org.hipparchus.geometry.partitioning.Region.Location: ... - def getBarycenter(self) -> float: ... - def getInf(self) -> float: ... + def checkPoint(self, double: float) -> org.hipparchus.geometry.partitioning.Region.Location: + """ + Check a point with respect to the arc. + + Parameters: + point (double): point to check + + Returns: + a code representing the point status: either :meth:`~org.hipparchus.geometry.partitioning.Region.Location.INSIDE`, + :meth:`~org.hipparchus.geometry.partitioning.Region.Location.OUTSIDE` or + :meth:`~org.hipparchus.geometry.partitioning.Region.Location.BOUNDARY` + + + """ + ... + def getBarycenter(self) -> float: + """ + Get the barycenter of the arc. + + Returns: + barycenter of the arc + + + """ + ... + def getInf(self) -> float: + """ + Get the lower angular bound of the arc. + + Returns: + lower angular bound of the arc, always between 0 and \( 2 \pi \) + + + """ + ... @typing.overload - def getOffset(self, double: float) -> float: ... + def getOffset(self, double: float) -> float: + """ + Get the distance (arc length) from a point to the edge of the arc. + + This method does not use :meth:`~org.hipparchus.geometry.spherical.oned.Arc.getTolerance`. + + Parameters: + point (double): to test. + + Returns: + offset, negative if the point is inside the arc, positive if it is outside the arc, or zero if :code:`point` is + :meth:`~org.hipparchus.geometry.spherical.oned.Arc.getInf` or + :meth:`~org.hipparchus.geometry.spherical.oned.Arc.getSup`. + + Get the distance (arc length) from a point to the edge of the arc. + + This method does not use :meth:`~org.hipparchus.geometry.spherical.oned.Arc.getTolerance`. + + Parameters: + point (:class:`~org.hipparchus.geometry.spherical.oned.S1Point`): to test. + + Returns: + offset, negative if the point is inside the arc, positive if it is outside the arc, or zero if :code:`point` is + :meth:`~org.hipparchus.geometry.spherical.oned.Arc.getInf` or + :meth:`~org.hipparchus.geometry.spherical.oned.Arc.getSup`. + + + """ + ... @typing.overload def getOffset(self, s1Point: 'S1Point') -> float: ... - def getSize(self) -> float: ... - def getSup(self) -> float: ... - def getTolerance(self) -> float: ... + def getSize(self) -> float: + """ + Get the angular size of the arc. + + Returns: + angular size of the arc + + + """ + ... + def getSup(self) -> float: + """ + Get the upper angular bound of the arc. + + Returns: + upper angular bound of the arc, always between :meth:`~org.hipparchus.geometry.spherical.oned.Arc.getInf` and + :meth:`~org.hipparchus.geometry.spherical.oned.Arc.getInf` \( + 2 \pi \) + + + """ + ... + def getTolerance(self) -> float: + """ + Get the tolerance below which angles are considered identical. + + Returns: + tolerance below which angles are considered identical + + + """ + ... class ArcsSet(org.hipparchus.geometry.partitioning.AbstractRegion['Sphere1D', 'Sphere1D'], java.lang.Iterable[typing.MutableSequence[float]]): + """ + public classArcsSet extends :class:`~org.hipparchus.geometry.partitioning.AbstractRegion`<:class:`~org.hipparchus.geometry.spherical.oned.Sphere1D`,:class:`~org.hipparchus.geometry.spherical.oned.Sphere1D`> + implements :class:`~org.hipparchus.geometry.spherical.oned.https:.docs.oracle.com.javase.8.docs.api.java.lang.Iterable`<double[]> + + This class represents a region of a circle: a set of arcs. + + Note that due to the wrapping around \(2 \pi\), barycenter is ill-defined here. It was defined only in order to fulfill + the requirements of the :class:`~org.hipparchus.geometry.partitioning.Region` interface, but its use is discouraged. + """ @typing.overload def __init__(self, double: float): ... @typing.overload @@ -40,9 +146,35 @@ class ArcsSet(org.hipparchus.geometry.partitioning.AbstractRegion['Sphere1D', 'S def __init__(self, bSPTree: org.hipparchus.geometry.partitioning.BSPTree['Sphere1D'], double: float): ... def asList(self) -> java.util.List[Arc]: ... def buildNew(self, bSPTree: org.hipparchus.geometry.partitioning.BSPTree['Sphere1D']) -> 'ArcsSet': ... - def iterator(self) -> java.util.Iterator[typing.MutableSequence[float]]: ... + def iterator(self) -> java.util.Iterator[typing.MutableSequence[float]]: + """ + + The iterator returns the limit angles pairs of sub-arcs in trigonometric order. + + The iterator does *not* support the optional :code:`remove` operation. + + Specified by: + :meth:`~org.hipparchus.geometry.spherical.oned.https:.docs.oracle.com.javase.8.docs.api.java.lang.Iterable.iterator` in + interface :class:`~org.hipparchus.geometry.spherical.oned.https:.docs.oracle.com.javase.8.docs.api.java.lang.Iterable` + + + """ + ... def projectToBoundary(self, point: org.hipparchus.geometry.Point['Sphere1D']) -> org.hipparchus.geometry.partitioning.BoundaryProjection['Sphere1D']: ... - def split(self, arc: Arc) -> 'ArcsSet.Split': ... + def split(self, arc: Arc) -> 'ArcsSet.Split': + """ + Split the instance in two parts by an arc. + + Parameters: + arc (:class:`~org.hipparchus.geometry.spherical.oned.Arc`): splitting arc + + Returns: + an object containing both the part of the instance on the plus side of the arc and the part of the instance on the minus + side of the arc + + + """ + ... class InconsistentStateAt2PiWrapping(org.hipparchus.exception.MathIllegalArgumentException): def __init__(self): ... class Split: @@ -51,50 +183,395 @@ class ArcsSet(org.hipparchus.geometry.partitioning.AbstractRegion['Sphere1D', 'S def getSide(self) -> org.hipparchus.geometry.partitioning.Side: ... class LimitAngle(org.hipparchus.geometry.partitioning.Hyperplane['Sphere1D']): + """ + public classLimitAngle extends :class:`~org.hipparchus.geometry.spherical.oned.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.geometry.partitioning.Hyperplane`<:class:`~org.hipparchus.geometry.spherical.oned.Sphere1D`> + + This class represents a 1D oriented hyperplane on the circle. + + An hyperplane on the 1-sphere is an angle with an orientation. + + Instances of this class are guaranteed to be immutable. + """ def __init__(self, s1Point: 'S1Point', boolean: bool, double: float): ... - def copySelf(self) -> 'LimitAngle': ... - def emptyHyperplane(self) -> 'SubLimitAngle': ... - def getLocation(self) -> 'S1Point': ... + def copySelf(self) -> 'LimitAngle': + """ + Copy the instance. + + Since instances are immutable, this method directly returns the instance. + + Specified by: + :meth:`~org.hipparchus.geometry.partitioning.Hyperplane.copySelf` in + interface :class:`~org.hipparchus.geometry.partitioning.Hyperplane` + + Returns: + the instance itself + + + """ + ... + def emptyHyperplane(self) -> 'SubLimitAngle': + """ + Build a sub-hyperplane covering nothing. + + Since this class represent zero dimension spaces which does not have lower dimension sub-spaces, this method returns a + dummy implementation of a :class:`~org.hipparchus.geometry.partitioning.SubHyperplane`. This implementation is only used + to allow the :class:`~org.hipparchus.geometry.partitioning.SubHyperplane` class implementation to work properly, it + should *not* be used otherwise. + + Specified by: + :meth:`~org.hipparchus.geometry.partitioning.Hyperplane.emptyHyperplane` in + interface :class:`~org.hipparchus.geometry.partitioning.Hyperplane` + + Returns: + a sub-hyperplane covering nothing + + + """ + ... + def getLocation(self) -> 'S1Point': + """ + Get the hyperplane location on the circle. + + Returns: + the hyperplane location + + + """ + ... def getOffset(self, point: org.hipparchus.geometry.Point['Sphere1D']) -> float: ... - def getReverse(self) -> 'LimitAngle': ... - def getTolerance(self) -> float: ... - def isDirect(self) -> bool: ... + def getReverse(self) -> 'LimitAngle': + """ + Get the reverse of the instance. + + Get a limit angle with reversed orientation with respect to the instance. A new object is built, the instance is + untouched. + + Returns: + a new limit angle, with orientation opposite to the instance orientation + + + """ + ... + def getTolerance(self) -> float: + """ + Get the tolerance below which points are considered to belong to the hyperplane. + + Specified by: + :meth:`~org.hipparchus.geometry.partitioning.Hyperplane.getTolerance` in + interface :class:`~org.hipparchus.geometry.partitioning.Hyperplane` + + Returns: + tolerance below which points are considered to belong to the hyperplane + + + """ + ... + def isDirect(self) -> bool: + """ + Check if the hyperplane orientation is direct. + + Returns: + true if the plus side of the hyperplane is towards angles greater than hyperplane location + + + """ + ... def project(self, point: org.hipparchus.geometry.Point['Sphere1D']) -> org.hipparchus.geometry.Point['Sphere1D']: ... def sameOrientationAs(self, hyperplane: org.hipparchus.geometry.partitioning.Hyperplane['Sphere1D']) -> bool: ... - def wholeHyperplane(self) -> 'SubLimitAngle': ... - def wholeSpace(self) -> ArcsSet: ... + def wholeHyperplane(self) -> 'SubLimitAngle': + """ + Build a region covering the whole hyperplane. + + Since this class represent zero dimension spaces which does not have lower dimension sub-spaces, this method returns a + dummy implementation of a :class:`~org.hipparchus.geometry.partitioning.SubHyperplane`. This implementation is only used + to allow the :class:`~org.hipparchus.geometry.partitioning.SubHyperplane` class implementation to work properly, it + should *not* be used otherwise. + + Specified by: + :meth:`~org.hipparchus.geometry.partitioning.Hyperplane.wholeHyperplane` in + interface :class:`~org.hipparchus.geometry.partitioning.Hyperplane` + + Returns: + a dummy sub hyperplane + + + """ + ... + def wholeSpace(self) -> ArcsSet: + """ + Build a region covering the whole space. + + Specified by: + :meth:`~org.hipparchus.geometry.partitioning.Hyperplane.wholeSpace` in + interface :class:`~org.hipparchus.geometry.partitioning.Hyperplane` + + Returns: + a region containing the instance (really an :class:`~org.hipparchus.geometry.spherical.oned.ArcsSet` instance) + + + """ + ... class S1Point(org.hipparchus.geometry.Point['Sphere1D']): + """ + public classS1Point extends :class:`~org.hipparchus.geometry.spherical.oned.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.geometry.Point`<:class:`~org.hipparchus.geometry.spherical.oned.Sphere1D`> + + This class represents a point on the 1-sphere. + + Instances of this class are guaranteed to be immutable. + + Also see: + + - :meth:`~serialized` + """ NaN: typing.ClassVar['S1Point'] = ... + """ + public static final :class:`~org.hipparchus.geometry.spherical.oned.S1Point` NaN + + A vector with all coordinates set to NaN. + + """ def __init__(self, double: float): ... @typing.overload - def distance(self, point: org.hipparchus.geometry.Point['Sphere1D']) -> float: ... + def distance(self, point: org.hipparchus.geometry.Point['Sphere1D']) -> float: + """ + Compute the distance (angular separation) between two points. + + Parameters: + p1 (:class:`~org.hipparchus.geometry.spherical.oned.S1Point`): first vector + p2 (:class:`~org.hipparchus.geometry.spherical.oned.S1Point`): second vector + + Returns: + the angular separation between p1 and p2 + + + """ + ... @typing.overload @staticmethod def distance(s1Point: 'S1Point', s1Point2: 'S1Point') -> float: ... - def equals(self, object: typing.Any) -> bool: ... - def equalsIeee754(self, object: typing.Any) -> bool: ... - def getAlpha(self) -> float: ... - def getSpace(self) -> org.hipparchus.geometry.Space: ... - def getVector(self) -> org.hipparchus.geometry.euclidean.twod.Vector2D: ... - def hashCode(self) -> int: ... - def isNaN(self) -> bool: ... + def equals(self, object: typing.Any) -> bool: + """ + Test for the equality of two points on the 1-sphere. + + If all coordinates of two points are exactly the same, and none are :code:`Double.NaN`, the two points are considered to + be equal. + + :code:`NaN` coordinates are considered to affect globally the point and be equals to each other - i.e, if either (or + all) coordinates of the point are equal to :code:`Double.NaN`, the point is equal to + :meth:`~org.hipparchus.geometry.spherical.oned.S1Point.NaN`. + + Overrides: + :meth:`~org.hipparchus.geometry.spherical.oned.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.equals` in + class :class:`~org.hipparchus.geometry.spherical.oned.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Parameters: + other (:class:`~org.hipparchus.geometry.spherical.oned.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object`): Object to test for equality to this + + Returns: + true if two points on the 1-sphere objects are equal, false if object is null, not an instance of S1Point, or not equal + to this S1Point instance + + + """ + ... + def equalsIeee754(self, object: typing.Any) -> bool: + """ + Test for the equality of two points on the 1-sphere. + + If all coordinates of two points are exactly the same, and none are :code:`Double.NaN`, the two points are considered to + be equal. + + In compliance with IEEE754 handling, if any coordinates of any of the two points are :code:`NaN`, then the points are + considered different. This implies that + :meth:`~org.hipparchus.geometry.spherical.oned.S1Point.NaN`.equals(:meth:`~org.hipparchus.geometry.spherical.oned.S1Point.NaN`) + returns :code:`false` despite the instance is checked against itself. + + Parameters: + other (:class:`~org.hipparchus.geometry.spherical.oned.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object`): Object to test for equality to this + + Returns: + true if two points objects are equal, false if object is null, not an instance of S1Point, or not equal to this S1Point + instance + + Since: + 2.1 + + + """ + ... + def getAlpha(self) -> float: + """ + Get the azimuthal angle \( \alpha \). + + Returns: + azimuthal angle \( \alpha \) + + Also see: + + - :meth:`~org.hipparchus.geometry.spherical.oned.S1Point.%3Cinit%3E` + + + + """ + ... + def getSpace(self) -> org.hipparchus.geometry.Space: + """ + Get the space to which the point belongs. + + Specified by: + :meth:`~org.hipparchus.geometry.Point.getSpace` in interface :class:`~org.hipparchus.geometry.Point` + + Returns: + containing space + + + """ + ... + def getVector(self) -> org.hipparchus.geometry.euclidean.twod.Vector2D: + """ + Get the corresponding normalized vector in the 2D euclidean space. + + Returns: + normalized vector + + + """ + ... + def hashCode(self) -> int: + """ + Get a hashCode for the point. + + All NaN values have the same hash code. + + Overrides: + :meth:`~org.hipparchus.geometry.spherical.oned.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.hashCode` in + class :class:`~org.hipparchus.geometry.spherical.oned.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Returns: + a hash code value for this object + + + """ + ... + def isNaN(self) -> bool: + """ + Returns true if any coordinate of this point is NaN; false otherwise + + Specified by: + :meth:`~org.hipparchus.geometry.Point.isNaN` in interface :class:`~org.hipparchus.geometry.Point` + + Returns: + true if any coordinate of this point is NaN; false otherwise + + + """ + ... class Sphere1D(java.io.Serializable, org.hipparchus.geometry.Space): + """ + public classSphere1D extends :class:`~org.hipparchus.geometry.spherical.oned.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.geometry.spherical.oned.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable`, :class:`~org.hipparchus.geometry.Space` + + This class implements a one-dimensional sphere (i.e. a circle). + + We use here the topologists definition of the 1-sphere (see `Sphere <http://mathworld.wolfram.com/Sphere.html>` on + MathWorld), i.e. the 1-sphere is the one-dimensional closed curve defined in 2D as x :sup:`2` +y :sup:`2` =1. + + Also see: + + - :meth:`~serialized` + """ SMALLEST_TOLERANCE: typing.ClassVar[float] = ... + """ + public static final double SMALLEST_TOLERANCE + + Smallest tolerance that can be managed. + + Tolerances smaller than this value will generate exceptions. + + Since: + 1.4 + + + """ @staticmethod def checkTolerance(double: float) -> None: ... - def getDimension(self) -> int: ... + def getDimension(self) -> int: + """ + Get the dimension of the space. + + Specified by: + :meth:`~org.hipparchus.geometry.Space.getDimension` in interface :class:`~org.hipparchus.geometry.Space` + + Returns: + dimension of the space + + + """ + ... @staticmethod - def getInstance() -> 'Sphere1D': ... + def getInstance() -> 'Sphere1D': + """ + Get the unique instance. + + Returns: + the unique instance + + + """ + ... def getSubSpace(self) -> org.hipparchus.geometry.Space: ... class NoSubSpaceException(org.hipparchus.exception.MathRuntimeException): def __init__(self): ... class SubLimitAngle(org.hipparchus.geometry.partitioning.AbstractSubHyperplane[Sphere1D, Sphere1D]): + """ + public classSubLimitAngle extends :class:`~org.hipparchus.geometry.partitioning.AbstractSubHyperplane`<:class:`~org.hipparchus.geometry.spherical.oned.Sphere1D`,:class:`~org.hipparchus.geometry.spherical.oned.Sphere1D`> + + This class represents sub-hyperplane for :class:`~org.hipparchus.geometry.spherical.oned.LimitAngle`. + + Instances of this class are guaranteed to be immutable. + """ def __init__(self, hyperplane: org.hipparchus.geometry.partitioning.Hyperplane[Sphere1D], region: org.hipparchus.geometry.partitioning.Region[Sphere1D]): ... - def getSize(self) -> float: ... - def isEmpty(self) -> bool: ... + def getSize(self) -> float: + """ + Get the size of the instance. + + Specified by: + :meth:`~org.hipparchus.geometry.partitioning.SubHyperplane.getSize` in + interface :class:`~org.hipparchus.geometry.partitioning.SubHyperplane` + + Overrides: + :meth:`~org.hipparchus.geometry.partitioning.AbstractSubHyperplane.getSize` in + class :class:`~org.hipparchus.geometry.partitioning.AbstractSubHyperplane` + + Returns: + the size of the instance (this is a length in 1D, an area in 2D, a volume in 3D ...) + + + """ + ... + def isEmpty(self) -> bool: + """ + Check if the instance is empty. + + Specified by: + :meth:`~org.hipparchus.geometry.partitioning.SubHyperplane.isEmpty` in + interface :class:`~org.hipparchus.geometry.partitioning.SubHyperplane` + + Overrides: + :meth:`~org.hipparchus.geometry.partitioning.AbstractSubHyperplane.isEmpty` in + class :class:`~org.hipparchus.geometry.partitioning.AbstractSubHyperplane` + + Returns: + true if the instance is empty + + + """ + ... def split(self, hyperplane: org.hipparchus.geometry.partitioning.Hyperplane[Sphere1D]) -> org.hipparchus.geometry.partitioning.SubHyperplane.SplitSubHyperplane[Sphere1D]: ... diff --git a/org-stubs/hipparchus/geometry/spherical/twod/__init__.pyi b/org-stubs/hipparchus/geometry/spherical/twod/__init__.pyi index 8b1cd60..fb8ce78 100644 --- a/org-stubs/hipparchus/geometry/spherical/twod/__init__.pyi +++ b/org-stubs/hipparchus/geometry/spherical/twod/__init__.pyi @@ -17,83 +17,676 @@ import typing class Circle(org.hipparchus.geometry.partitioning.Hyperplane['Sphere2D'], org.hipparchus.geometry.partitioning.Embedding['Sphere2D', org.hipparchus.geometry.spherical.oned.Sphere1D]): + """ + public classCircle extends :class:`~org.hipparchus.geometry.spherical.twod.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.geometry.partitioning.Hyperplane`<:class:`~org.hipparchus.geometry.spherical.twod.Sphere2D`>, :class:`~org.hipparchus.geometry.partitioning.Embedding`<:class:`~org.hipparchus.geometry.spherical.twod.Sphere2D`,:class:`~org.hipparchus.geometry.spherical.oned.Sphere1D`> + + This class represents an oriented great circle on the 2-sphere. + + An oriented circle can be defined by a center point. The circle is the the set of points that are in the normal plan the + center. + + Since it is oriented the two spherical caps at its two sides are unambiguously identified as a left cap and a right cap. + This can be used to identify the interior and the exterior in a simple way by local properties only when part of a line + is used to define part of a spherical polygon boundary. + """ @typing.overload def __init__(self, vector3D: org.hipparchus.geometry.euclidean.threed.Vector3D, double: float): ... @typing.overload def __init__(self, circle: 'Circle'): ... @typing.overload def __init__(self, s2Point: 'S2Point', s2Point2: 'S2Point', double: float): ... - def copySelf(self) -> 'Circle': ... - def emptyHyperplane(self) -> 'SubCircle': ... - def getArc(self, s2Point: 'S2Point', s2Point2: 'S2Point') -> org.hipparchus.geometry.spherical.oned.Arc: ... - def getInsideArc(self, circle: 'Circle') -> org.hipparchus.geometry.spherical.oned.Arc: ... + def copySelf(self) -> 'Circle': + """ + Copy the instance. + + The instance created is completely independant of the original one. A deep copy is used, none of the underlying objects + are shared (except for immutable objects). + + Specified by: + :meth:`~org.hipparchus.geometry.partitioning.Hyperplane.copySelf` in + interface :class:`~org.hipparchus.geometry.partitioning.Hyperplane` + + Returns: + a new hyperplane, copy of the instance + + + """ + ... + def emptyHyperplane(self) -> 'SubCircle': + """ + Build a sub-hyperplane covering nothing. + + Specified by: + :meth:`~org.hipparchus.geometry.partitioning.Hyperplane.emptyHyperplane` in + interface :class:`~org.hipparchus.geometry.partitioning.Hyperplane` + + Returns: + a sub-hyperplane covering nothing + + + """ + ... + def getArc(self, s2Point: 'S2Point', s2Point2: 'S2Point') -> org.hipparchus.geometry.spherical.oned.Arc: + """ + Get the arc on this circle between two defining points. Only the point's projection on the circle matters, which is + computed using :meth:`~org.hipparchus.geometry.spherical.twod.Circle.getPhase`. + + Parameters: + a (:class:`~org.hipparchus.geometry.spherical.twod.S2Point`): first point. + b (:class:`~org.hipparchus.geometry.spherical.twod.S2Point`): second point. + + Returns: + an arc of the circle. + + + """ + ... + def getInsideArc(self, circle: 'Circle') -> org.hipparchus.geometry.spherical.oned.Arc: + """ + Get the arc of the instance that lies inside the other circle. + + Parameters: + other (:class:`~org.hipparchus.geometry.spherical.twod.Circle`): other circle + + Returns: + arc of the instance that lies inside the other circle + + + """ + ... @typing.overload - def getOffset(self, point: org.hipparchus.geometry.Point['Sphere2D']) -> float: ... + def getOffset(self, point: org.hipparchus.geometry.Point['Sphere2D']) -> float: + """ + Get the offset (oriented distance) of a direction. + + The offset is defined as the angular distance between the circle center and the direction minus the circle radius. It is + therefore 0 on the circle, positive for directions outside of the cone delimited by the circle, and negative inside the + cone. + + Parameters: + direction (:class:`~org.hipparchus.geometry.euclidean.threed.Vector3D`): direction to check + + Returns: + offset of the direction + + Also see: + + - :meth:`~org.hipparchus.geometry.spherical.twod.Circle.getOffset` + + + + """ + ... @typing.overload def getOffset(self, vector3D: org.hipparchus.geometry.euclidean.threed.Vector3D) -> float: ... - def getPhase(self, vector3D: org.hipparchus.geometry.euclidean.threed.Vector3D) -> float: ... - def getPointAt(self, double: float) -> org.hipparchus.geometry.euclidean.threed.Vector3D: ... - def getPole(self) -> org.hipparchus.geometry.euclidean.threed.Vector3D: ... - def getReverse(self) -> 'Circle': ... - def getTolerance(self) -> float: ... + def getPhase(self, vector3D: org.hipparchus.geometry.euclidean.threed.Vector3D) -> float: + """ + Get the phase angle of a direction. + + The direction may not belong to the circle as the phase is computed for the meridian plane between the circle pole and + the direction. + + Parameters: + direction (:class:`~org.hipparchus.geometry.euclidean.threed.Vector3D`): direction for which phase is requested + + Returns: + phase angle of the direction around the circle + + Also see: + + - :meth:`~org.hipparchus.geometry.spherical.twod.Circle.toSubSpace` + + + + """ + ... + def getPointAt(self, double: float) -> org.hipparchus.geometry.euclidean.threed.Vector3D: + """ + Get a circle point from its phase around the circle. + + Parameters: + alpha (double): phase around the circle + + Returns: + circle point on the sphere + + Also see: + + - :meth:`~org.hipparchus.geometry.spherical.twod.Circle.toSpace` + - :meth:`~org.hipparchus.geometry.spherical.twod.Circle.getXAxis` + - :meth:`~org.hipparchus.geometry.spherical.twod.Circle.getYAxis` + + + + """ + ... + def getPole(self) -> org.hipparchus.geometry.euclidean.threed.Vector3D: + """ + Get the pole of the circle. + + As the circle is a great circle, the pole does *not* belong to it. + + Returns: + pole of the circle + + Also see: + + - :meth:`~org.hipparchus.geometry.spherical.twod.Circle.getXAxis` + - :meth:`~org.hipparchus.geometry.spherical.twod.Circle.getYAxis` + + + + """ + ... + def getReverse(self) -> 'Circle': + """ + Get the reverse of the instance. + + Get a circle with reversed orientation with respect to the instance. A new object is built, the instance is untouched. + + Returns: + a new circle, with orientation opposite to the instance orientation + + + """ + ... + def getTolerance(self) -> float: + """ + Get the tolerance below which points are considered to belong to the hyperplane. + + Specified by: + :meth:`~org.hipparchus.geometry.partitioning.Hyperplane.getTolerance` in + interface :class:`~org.hipparchus.geometry.partitioning.Hyperplane` + + Returns: + tolerance below which points are considered to belong to the hyperplane + + + """ + ... @staticmethod def getTransform(rotation: org.hipparchus.geometry.euclidean.threed.Rotation) -> org.hipparchus.geometry.partitioning.Transform['Sphere2D', org.hipparchus.geometry.spherical.oned.Sphere1D]: ... - def getXAxis(self) -> org.hipparchus.geometry.euclidean.threed.Vector3D: ... - def getYAxis(self) -> org.hipparchus.geometry.euclidean.threed.Vector3D: ... + def getXAxis(self) -> org.hipparchus.geometry.euclidean.threed.Vector3D: + """ + Get the X axis of the circle. + + This method returns the same value as :meth:`~org.hipparchus.geometry.spherical.twod.Circle.getPointAt` but it does not + do any computation and always return the same instance. + + Returns: + an arbitrary x axis on the circle + + Also see: + + - :meth:`~org.hipparchus.geometry.spherical.twod.Circle.getPointAt` + - :meth:`~org.hipparchus.geometry.spherical.twod.Circle.getYAxis` + - :meth:`~org.hipparchus.geometry.spherical.twod.Circle.getPole` + + + + """ + ... + def getYAxis(self) -> org.hipparchus.geometry.euclidean.threed.Vector3D: + """ + Get the Y axis of the circle. + + This method returns the same value as :meth:`~org.hipparchus.geometry.spherical.twod.Circle.getPointAt` but it does not + do any computation and always return the same instance. + + Returns: + an arbitrary y axis point on the circle + + Also see: + + - :meth:`~org.hipparchus.geometry.spherical.twod.Circle.getPointAt` + - :meth:`~org.hipparchus.geometry.spherical.twod.Circle.getXAxis` + - :meth:`~org.hipparchus.geometry.spherical.twod.Circle.getPole` + + + + """ + ... def project(self, point: org.hipparchus.geometry.Point['Sphere2D']) -> org.hipparchus.geometry.Point['Sphere2D']: ... - def reset(self, vector3D: org.hipparchus.geometry.euclidean.threed.Vector3D) -> None: ... - def revertSelf(self) -> None: ... + def reset(self, vector3D: org.hipparchus.geometry.euclidean.threed.Vector3D) -> None: + """ + Reset the instance as if built from a pole. + + The circle is oriented in the trigonometric direction around pole. + + Parameters: + newPole (:class:`~org.hipparchus.geometry.euclidean.threed.Vector3D`): circle pole + + + """ + ... + def revertSelf(self) -> None: + """ + Revert the instance. + + """ + ... def sameOrientationAs(self, hyperplane: org.hipparchus.geometry.partitioning.Hyperplane['Sphere2D']) -> bool: ... def toSpace(self, point: org.hipparchus.geometry.Point[org.hipparchus.geometry.spherical.oned.Sphere1D]) -> 'S2Point': ... def toSubSpace(self, point: org.hipparchus.geometry.Point['Sphere2D']) -> org.hipparchus.geometry.spherical.oned.S1Point: ... - def wholeHyperplane(self) -> 'SubCircle': ... - def wholeSpace(self) -> 'SphericalPolygonsSet': ... + def wholeHyperplane(self) -> 'SubCircle': + """ + Build a sub-hyperplane covering the whole hyperplane. + + Specified by: + :meth:`~org.hipparchus.geometry.partitioning.Hyperplane.wholeHyperplane` in + interface :class:`~org.hipparchus.geometry.partitioning.Hyperplane` + + Returns: + a sub-hyperplane covering the whole hyperplane + + + """ + ... + def wholeSpace(self) -> 'SphericalPolygonsSet': + """ + Build a region covering the whole space. + + Specified by: + :meth:`~org.hipparchus.geometry.partitioning.Hyperplane.wholeSpace` in + interface :class:`~org.hipparchus.geometry.partitioning.Hyperplane` + + Returns: + a region containing the instance (really a :class:`~org.hipparchus.geometry.spherical.twod.SphericalPolygonsSet` + instance) + + + """ + ... class Edge: - def getCircle(self) -> Circle: ... - def getEnd(self) -> 'Vertex': ... - def getLength(self) -> float: ... - def getPointAt(self, double: float) -> org.hipparchus.geometry.euclidean.threed.Vector3D: ... - def getStart(self) -> 'Vertex': ... + """ + public classEdge extends :class:`~org.hipparchus.geometry.spherical.twod.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Spherical polygons boundary edge. + + Also see: + + - :meth:`~org.hipparchus.geometry.spherical.twod.SphericalPolygonsSet.getBoundaryLoops` + - :class:`~org.hipparchus.geometry.spherical.twod.Vertex` + """ + def getCircle(self) -> Circle: + """ + Get the circle supporting this edge. + + Returns: + circle supporting this edge + + + """ + ... + def getEnd(self) -> 'Vertex': + """ + Get end vertex. + + Returns: + end vertex + + + """ + ... + def getLength(self) -> float: + """ + Get the length of the arc. + + Returns: + length of the arc (can be greater than \( \pi \)) + + + """ + ... + def getPointAt(self, double: float) -> org.hipparchus.geometry.euclidean.threed.Vector3D: + """ + Get an intermediate point. + + The angle along the edge should normally be between 0 and :meth:`~org.hipparchus.geometry.spherical.twod.Edge.getLength` + in order to remain within edge limits. However, there are no checks on the value of the angle, so user can rebuild the + full circle on which an edge is defined if they want. + + Parameters: + alpha (double): angle along the edge, counted from :meth:`~org.hipparchus.geometry.spherical.twod.Edge.getStart` + + Returns: + an intermediate point + + + """ + ... + def getStart(self) -> 'Vertex': + """ + Get start vertex. + + Returns: + start vertex + + + """ + ... class S2Point(org.hipparchus.geometry.Point['Sphere2D']): + """ + public classS2Point extends :class:`~org.hipparchus.geometry.spherical.twod.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.geometry.Point`<:class:`~org.hipparchus.geometry.spherical.twod.Sphere2D`> + + This class represents a point on the 2-sphere. + + We use the mathematical convention to use the azimuthal angle \( \theta \) in the x-y plane as the first coordinate, and + the polar angle \( \varphi \) as the second coordinate (see `Spherical Coordinates + <http://mathworld.wolfram.com/SphericalCoordinates.html>` in MathWorld). + + Instances of this class are guaranteed to be immutable. + + Also see: + + - :meth:`~serialized` + """ PLUS_I: typing.ClassVar['S2Point'] = ... + """ + public static final :class:`~org.hipparchus.geometry.spherical.twod.S2Point` PLUS_I + + +I (coordinates: \( \theta = 0, \varphi = \pi/2 \)). + + """ PLUS_J: typing.ClassVar['S2Point'] = ... + """ + public static final :class:`~org.hipparchus.geometry.spherical.twod.S2Point` PLUS_J + + +J (coordinates: \( \theta = \pi/2, \varphi = \pi/2 \))). + + """ PLUS_K: typing.ClassVar['S2Point'] = ... + """ + public static final :class:`~org.hipparchus.geometry.spherical.twod.S2Point` PLUS_K + + +K (coordinates: \( \theta = any angle, \varphi = 0 \)). + + """ MINUS_I: typing.ClassVar['S2Point'] = ... + """ + public static final :class:`~org.hipparchus.geometry.spherical.twod.S2Point` MINUS_I + + -I (coordinates: \( \theta = \pi, \varphi = \pi/2 \)). + + """ MINUS_J: typing.ClassVar['S2Point'] = ... + """ + public static final :class:`~org.hipparchus.geometry.spherical.twod.S2Point` MINUS_J + + -J (coordinates: \( \theta = 3\pi/2, \varphi = \pi/2 \)). + + """ MINUS_K: typing.ClassVar['S2Point'] = ... + """ + public static final :class:`~org.hipparchus.geometry.spherical.twod.S2Point` MINUS_K + + -K (coordinates: \( \theta = any angle, \varphi = \pi \)). + + """ NaN: typing.ClassVar['S2Point'] = ... + """ + public static final :class:`~org.hipparchus.geometry.spherical.twod.S2Point` NaN + + A vector with all coordinates set to NaN. + + """ @typing.overload def __init__(self, double: float, double2: float): ... @typing.overload def __init__(self, vector3D: org.hipparchus.geometry.euclidean.threed.Vector3D): ... @typing.overload - def distance(self, point: org.hipparchus.geometry.Point['Sphere2D']) -> float: ... + def distance(self, point: org.hipparchus.geometry.Point['Sphere2D']) -> float: + """ + Compute the distance (angular separation) between two points. + + Parameters: + p1 (:class:`~org.hipparchus.geometry.spherical.twod.S2Point`): first vector + p2 (:class:`~org.hipparchus.geometry.spherical.twod.S2Point`): second vector + + Returns: + the angular separation between p1 and p2 + + + """ + ... @typing.overload @staticmethod def distance(s2Point: 'S2Point', s2Point2: 'S2Point') -> float: ... - def equals(self, object: typing.Any) -> bool: ... - def equalsIeee754(self, object: typing.Any) -> bool: ... - def getPhi(self) -> float: ... - def getSpace(self) -> org.hipparchus.geometry.Space: ... - def getTheta(self) -> float: ... - def getVector(self) -> org.hipparchus.geometry.euclidean.threed.Vector3D: ... - def hashCode(self) -> int: ... - def isNaN(self) -> bool: ... - def negate(self) -> 'S2Point': ... - def toString(self) -> str: ... + def equals(self, object: typing.Any) -> bool: + """ + Test for the equality of two points on the 2-sphere. + + If all coordinates of two points are exactly the same, and none are :code:`Double.NaN`, the two points are considered to + be equal. + + :code:`NaN` coordinates are considered to affect globally the point and be equals to each other - i.e, if either (or + all) coordinates of the point are equal to :code:`Double.NaN`, the point is equal to + :meth:`~org.hipparchus.geometry.spherical.twod.S2Point.NaN`. + + Overrides: + :meth:`~org.hipparchus.geometry.spherical.twod.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.equals` in + class :class:`~org.hipparchus.geometry.spherical.twod.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Parameters: + other (:class:`~org.hipparchus.geometry.spherical.twod.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object`): Object to test for equality to this + + Returns: + true if two points on the 2-sphere objects are equal, false if object is null, not an instance of S2Point, or not equal + to this S2Point instance + + + """ + ... + def equalsIeee754(self, object: typing.Any) -> bool: + """ + Test for the equality of two points on the 2-sphere. + + If all coordinates of two points are exactly the same, and none are :code:`Double.NaN`, the two points are considered to + be equal. + + In compliance with IEEE754 handling, if any coordinates of any of the two points are :code:`NaN`, then the points are + considered different. This implies that + :meth:`~org.hipparchus.geometry.spherical.twod.S2Point.NaN`.equals(:meth:`~org.hipparchus.geometry.spherical.twod.S2Point.NaN`) + returns :code:`false` despite the instance is checked against itself. + + Parameters: + other (:class:`~org.hipparchus.geometry.spherical.twod.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object`): Object to test for equality to this + + Returns: + true if two points objects are equal, false if object is null, not an instance of S2Point, or not equal to this S2Point + instance + + Since: + 2.1 + + + """ + ... + def getPhi(self) -> float: + """ + Get the polar angle \( \varphi \). + + Returns: + polar angle \( \varphi \) + + Also see: + + - :meth:`~org.hipparchus.geometry.spherical.twod.S2Point.%3Cinit%3E` + + + + """ + ... + def getSpace(self) -> org.hipparchus.geometry.Space: + """ + Get the space to which the point belongs. + + Specified by: + :meth:`~org.hipparchus.geometry.Point.getSpace` in interface :class:`~org.hipparchus.geometry.Point` + + Returns: + containing space + + + """ + ... + def getTheta(self) -> float: + """ + Get the azimuthal angle \( \theta \) in the x-y plane. + + Returns: + azimuthal angle \( \theta \) in the x-y plane + + Also see: + + - :meth:`~org.hipparchus.geometry.spherical.twod.S2Point.%3Cinit%3E` + + + + """ + ... + def getVector(self) -> org.hipparchus.geometry.euclidean.threed.Vector3D: + """ + Get the corresponding normalized vector in the 3D euclidean space. + + Returns: + normalized vector + + + """ + ... + def hashCode(self) -> int: + """ + Get a hashCode for the point. + + All NaN values have the same hash code. + + Overrides: + :meth:`~org.hipparchus.geometry.spherical.twod.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.hashCode` in + class :class:`~org.hipparchus.geometry.spherical.twod.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Returns: + a hash code value for this object + + + """ + ... + def isNaN(self) -> bool: + """ + Returns true if any coordinate of this point is NaN; false otherwise + + Specified by: + :meth:`~org.hipparchus.geometry.Point.isNaN` in interface :class:`~org.hipparchus.geometry.Point` + + Returns: + true if any coordinate of this point is NaN; false otherwise + + + """ + ... + def negate(self) -> 'S2Point': + """ + Get the opposite of the instance. + + Returns: + a new vector which is opposite to the instance + + + """ + ... + def toString(self) -> str: + """ + + Overrides: + :meth:`~org.hipparchus.geometry.spherical.twod.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.toString` in + class :class:`~org.hipparchus.geometry.spherical.twod.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + + """ + ... class Sphere2D(java.io.Serializable, org.hipparchus.geometry.Space): + """ + public classSphere2D extends :class:`~org.hipparchus.geometry.spherical.twod.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.geometry.spherical.twod.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable`, :class:`~org.hipparchus.geometry.Space` + + This class implements a two-dimensional sphere (i.e. the regular sphere). + + We use here the topologists definition of the 2-sphere (see `Sphere <http://mathworld.wolfram.com/Sphere.html>` on + MathWorld), i.e. the 2-sphere is the two-dimensional surface defined in 3D as x :sup:`2` +y :sup:`2` +z :sup:`2` =1. + + Also see: + + - :meth:`~serialized` + """ SMALLEST_TOLERANCE: typing.ClassVar[float] = ... + """ + public static final double SMALLEST_TOLERANCE + + Smallest tolerance that can be managed. + + Tolerances smaller than this value will generate exceptions. + + Since: + 1.4 + + + """ @staticmethod def checkTolerance(double: float) -> None: ... - def getDimension(self) -> int: ... + def getDimension(self) -> int: + """ + Get the dimension of the space. + + Specified by: + :meth:`~org.hipparchus.geometry.Space.getDimension` in interface :class:`~org.hipparchus.geometry.Space` + + Returns: + dimension of the space + + + """ + ... @staticmethod - def getInstance() -> 'Sphere2D': ... - def getSubSpace(self) -> org.hipparchus.geometry.spherical.oned.Sphere1D: ... + def getInstance() -> 'Sphere2D': + """ + Get the unique instance. + + Returns: + the unique instance + + + """ + ... + def getSubSpace(self) -> org.hipparchus.geometry.spherical.oned.Sphere1D: + """ + Get the n-1 dimension subspace of this space. + + Specified by: + :meth:`~org.hipparchus.geometry.Space.getSubSpace` in interface :class:`~org.hipparchus.geometry.Space` + + Returns: + n-1 dimension sub-space of this space + + Also see: + + - :meth:`~org.hipparchus.geometry.Space.getDimension` + + + + """ + ... class SphericalPolygonsSet(org.hipparchus.geometry.partitioning.AbstractRegion[Sphere2D, org.hipparchus.geometry.spherical.oned.Sphere1D]): + """ + public classSphericalPolygonsSet extends :class:`~org.hipparchus.geometry.partitioning.AbstractRegion`<:class:`~org.hipparchus.geometry.spherical.twod.Sphere2D`,:class:`~org.hipparchus.geometry.spherical.oned.Sphere1D`> + + This class represents a region on the 2-sphere: a set of spherical polygons. + """ @typing.overload def __init__(self, double: float): ... @typing.overload @@ -111,13 +704,55 @@ class SphericalPolygonsSet(org.hipparchus.geometry.partitioning.AbstractRegion[S def getEnclosingCap(self) -> org.hipparchus.geometry.enclosing.EnclosingBall[Sphere2D, S2Point]: ... class SubCircle(org.hipparchus.geometry.partitioning.AbstractSubHyperplane[Sphere2D, org.hipparchus.geometry.spherical.oned.Sphere1D]): + """ + public classSubCircle extends :class:`~org.hipparchus.geometry.partitioning.AbstractSubHyperplane`<:class:`~org.hipparchus.geometry.spherical.twod.Sphere2D`,:class:`~org.hipparchus.geometry.spherical.oned.Sphere1D`> + + This class represents a sub-hyperplane for :class:`~org.hipparchus.geometry.spherical.twod.Circle`. + """ def __init__(self, hyperplane: org.hipparchus.geometry.partitioning.Hyperplane[Sphere2D], region: org.hipparchus.geometry.partitioning.Region[org.hipparchus.geometry.spherical.oned.Sphere1D]): ... def split(self, hyperplane: org.hipparchus.geometry.partitioning.Hyperplane[Sphere2D]) -> org.hipparchus.geometry.partitioning.SubHyperplane.SplitSubHyperplane[Sphere2D]: ... class Vertex: - def getIncoming(self) -> Edge: ... - def getLocation(self) -> S2Point: ... - def getOutgoing(self) -> Edge: ... + """ + public classVertex extends :class:`~org.hipparchus.geometry.spherical.twod.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Spherical polygons boundary vertex. + + Also see: + + - :meth:`~org.hipparchus.geometry.spherical.twod.SphericalPolygonsSet.getBoundaryLoops` + - :class:`~org.hipparchus.geometry.spherical.twod.Edge` + """ + def getIncoming(self) -> Edge: + """ + Get incoming edge. + + Returns: + incoming edge + + + """ + ... + def getLocation(self) -> S2Point: + """ + Get Vertex location. + + Returns: + vertex location + + + """ + ... + def getOutgoing(self) -> Edge: + """ + Get outgoing edge. + + Returns: + outgoing edge + + + """ + ... class __module_protocol__(Protocol): diff --git a/org-stubs/hipparchus/linear/__init__.pyi b/org-stubs/hipparchus/linear/__init__.pyi index d44826e..ac50321 100644 --- a/org-stubs/hipparchus/linear/__init__.pyi +++ b/org-stubs/hipparchus/linear/__init__.pyi @@ -21,49 +21,316 @@ import typing class AnyMatrix: - def getColumnDimension(self) -> int: ... - def getRowDimension(self) -> int: ... - def isSquare(self) -> bool: ... + """ + public interfaceAnyMatrix + + Interface defining very basic matrix operations. + """ + def getColumnDimension(self) -> int: + """ + Returns the number of columns in the matrix. + + Returns: + columnDimension + + + """ + ... + def getRowDimension(self) -> int: + """ + Returns the number of rows in the matrix. + + Returns: + rowDimension + + + """ + ... + def isSquare(self) -> bool: + """ + Is this a square matrix? + + Returns: + true if the matrix is square (rowDimension = columnDimension) + + + """ + ... class CholeskyDecomposition: + """ + public classCholeskyDecomposition extends :class:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Calculates the Cholesky decomposition of a matrix. + + The Cholesky decomposition of a real symmetric positive-definite matrix A consists of a lower triangular matrix L with + same size such that: A = LL :sup:`T` . In a sense, this is the square root of A. + + This class is based on the class with similar name from the `JAMA <http://math.nist.gov/javanumerics/jama/>` library, + with the following changes: + + - a :meth:`~org.hipparchus.linear.CholeskyDecomposition.getLT` method has been added, + - the :code:`isspd` method has been removed, since the constructor of this class throws a + :class:`~org.hipparchus.exception.MathIllegalArgumentException` when a matrix cannot be decomposed, + - a :meth:`~org.hipparchus.linear.CholeskyDecomposition.getDeterminant` method has been added, + - the :code:`solve` method has been replaced by a :meth:`~org.hipparchus.linear.CholeskyDecomposition.getSolver` method + and the equivalent method provided by the returned :class:`~org.hipparchus.linear.DecompositionSolver`. + + + Also see: + + - `MathWorld <http://mathworld.wolfram.com/CholeskyDecomposition.html>` + - `Wikipedia <http://en.wikipedia.org/wiki/Cholesky_decomposition>` + """ DEFAULT_RELATIVE_SYMMETRY_THRESHOLD: typing.ClassVar[float] = ... + """ + public static final double DEFAULT_RELATIVE_SYMMETRY_THRESHOLD + + Default threshold above which off-diagonal elements are considered too different and matrix not symmetric. + + Also see: + + - :meth:`~constant` + + + + """ DEFAULT_ABSOLUTE_POSITIVITY_THRESHOLD: typing.ClassVar[float] = ... + """ + public static final double DEFAULT_ABSOLUTE_POSITIVITY_THRESHOLD + + Default threshold below which diagonal elements are considered null and matrix not positive definite. + + Also see: + + - :meth:`~constant` + + + + """ @typing.overload def __init__(self, realMatrix: 'RealMatrix'): ... @typing.overload def __init__(self, realMatrix: 'RealMatrix', double: float, double2: float): ... - def getDeterminant(self) -> float: ... - def getL(self) -> 'RealMatrix': ... - def getLT(self) -> 'RealMatrix': ... - def getSolver(self) -> 'DecompositionSolver': ... + def getDeterminant(self) -> float: + """ + Return the determinant of the matrix + + Returns: + determinant of the matrix + + + """ + ... + def getL(self) -> 'RealMatrix': + """ + Returns the matrix L of the decomposition. + + L is an lower-triangular matrix + + Returns: + the L matrix + + + """ + ... + def getLT(self) -> 'RealMatrix': + """ + Returns the transpose of the matrix L of the decomposition. + + L :sup:`T` is an upper-triangular matrix + + Returns: + the transpose of the matrix L of the decomposition + + + """ + ... + def getSolver(self) -> 'DecompositionSolver': + """ + Get a solver for finding the A × X = B solution in least square sense. + + Returns: + a solver + + + """ + ... class ComplexEigenDecomposition: + """ + public classComplexEigenDecomposition extends :class:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Given a matrix A, it computes a complex eigen decomposition AV = VD. + + Complex Eigen Decomposition differs from the :class:`~org.hipparchus.linear.EigenDecompositionSymmetric` since it + computes the eigen vectors as complex eigen vectors (if applicable). + + Beware that in the complex case, you do not always have \(V \times V^{T} = I\) or even a diagonal matrix, even if the + eigenvectors that form the columns of the V matrix are independent. On example is the square matrix \[ A = + \left(\begin{matrix} 3 & -2\\ 4 & -1 \end{matrix}\right) \] which has two conjugate eigenvalues \(\lambda_1=1+2i\) and + \(\lambda_2=1-2i\) with associated eigenvectors \(v_1^T = (1, 1-i)\) and \(v_2^T = (1, 1+i)\). \[ V\timesV^T = + \left(\begin{matrix} 2 & 2\\ 2 & 0 \end{matrix}\right) \] which is not the identity matrix. Therefore, despite \(A + \times V = V \times D\), \(A \ne V \times D \time V^T\), which would hold for real eigendecomposition. + + Also note that for consistency with Wolfram langage + :class:`~org.hipparchus.linear.https:.reference.wolfram.com.language.ref.Eigenvectors`, we add zero vectors when the + geometric multiplicity of the eigenvalue is smaller than its algebraic multiplicity (hence the regular eigenvector + matrix should be non-square). With these additional null vectors, the eigenvectors matrix becomes square. This happens + for example with the square matrix \[ A = \left(\begin{matrix} 1 & 0 & 0\\ -2 & 1 & 0\\ 0 & 0 & 1 \end{matrix}\right) \] + Its characteristic polynomial is \((1-\lambda)^3\), hence is has one eigen value \(\lambda=1\) with algebraic + multiplicity 3. However, this eigenvalue leads to only two eigenvectors \(v_1=(0, 1, 0)\) and \(v_2=(0, 0, 1)\), hence + its geometric multiplicity is only 2, not 3. So we add a third zero vector \(v_3=(0, 0, 0)\), in the same way Wolfram + language does. + Compute complex eigen values from the Schur transform. Compute complex eigen vectors based on eigen values and the + inverse iteration method. see: :class:`~org.hipparchus.linear.https:.en.wikipedia.org.wiki.Inverse_iteration` + :class:`~org.hipparchus.linear.https:.en.wikiversity.org.wiki.Shifted_inverse_iteration` + :class:`~org.hipparchus.linear.https:.www.robots.ox.ac.uk.~sjrob.Teaching.EngComp.ecl4.pdf` + """ DEFAULT_EIGENVECTORS_EQUALITY: typing.ClassVar[float] = ... + """ + public static final double DEFAULT_EIGENVECTORS_EQUALITY + + Default threshold below which eigenvectors are considered equal. + + Also see: + + - :meth:`~constant` + + + + """ DEFAULT_EPSILON: typing.ClassVar[float] = ... + """ + public static final double DEFAULT_EPSILON + + Default value to use for internal epsilon. + + Also see: + + - :meth:`~constant` + + + + """ DEFAULT_EPSILON_AV_VD_CHECK: typing.ClassVar[float] = ... + """ + public static final double DEFAULT_EPSILON_AV_VD_CHECK + + Internally used epsilon criteria for final AV=VD check. + + Also see: + + - :meth:`~constant` + + + + """ @typing.overload def __init__(self, realMatrix: 'RealMatrix'): ... @typing.overload def __init__(self, realMatrix: 'RealMatrix', double: float, double2: float, double3: float): ... def getD(self) -> 'FieldMatrix'[org.hipparchus.complex.Complex]: ... - def getDeterminant(self) -> float: ... - def getEigenvalues(self) -> typing.MutableSequence[org.hipparchus.complex.Complex]: ... + def getDeterminant(self) -> float: + """ + Computes the determinant. + + Returns: + the determinant. + + + """ + ... + def getEigenvalues(self) -> typing.MutableSequence[org.hipparchus.complex.Complex]: + """ + Getter of the eigen values. + + Returns: + eigen values. + + + """ + ... def getEigenvector(self, int: int) -> 'FieldVector'[org.hipparchus.complex.Complex]: ... def getV(self) -> 'FieldMatrix'[org.hipparchus.complex.Complex]: ... def getVT(self) -> 'FieldMatrix'[org.hipparchus.complex.Complex]: ... - def hasComplexEigenvalues(self) -> bool: ... + def hasComplexEigenvalues(self) -> bool: + """ + Confirm if there are complex eigen values. + + Returns: + true if there are complex eigen values. + + + """ + ... class DecompositionSolver: - def getColumnDimension(self) -> int: ... + """ + public interfaceDecompositionSolver + + Interface handling decomposition algorithms that can solve A × X = B. + + Decomposition algorithms decompose an A matrix as a product of several specific matrices from which they can solve A × + X = B in least squares sense: they find X such that ||A × X - B|| is minimal. + + Some solvers like :class:`~org.hipparchus.linear.LUDecomposition` can only find the solution for square matrices and + when the solution is an exact linear solution, i.e. when ||A × X - B|| is exactly 0. Other solvers can also find + solutions with non-square matrix A and with non-null minimal norm. If an exact linear solution exists it is also the + minimal norm solution. + """ + def getColumnDimension(self) -> int: + """ + Returns the number of columns in the matrix. + + Returns: + columnDimension + + Since: + 2.0 + + + """ + ... def getInverse(self) -> 'RealMatrix': ... - def getRowDimension(self) -> int: ... - def isNonSingular(self) -> bool: ... + def getRowDimension(self) -> int: + """ + Returns the number of rows in the matrix. + + Returns: + rowDimension + + Since: + 2.0 + + + """ + ... + def isNonSingular(self) -> bool: + """ + Check if the decomposed matrix is non-singular. + + Returns: + true if the decomposed matrix is non-singular. + + + """ + ... @typing.overload def solve(self, realMatrix: 'RealMatrix') -> 'RealMatrix': ... @typing.overload def solve(self, realVector: 'RealVector') -> 'RealVector': ... class DependentVectorsHandler(java.lang.Enum['DependentVectorsHandler']): + """ + public enumDependentVectorsHandler extends :class:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.Enum`<:class:`~org.hipparchus.linear.DependentVectorsHandler`> + + Enumerate to specify how dependent vectors should be handled in + :meth:`~org.hipparchus.linear.MatrixUtils.orthonormalize` and :meth:`~org.hipparchus.linear.MatrixUtils.orthonormalize`. + + Since: + 2.1 + """ GENERATE_EXCEPTION: typing.ClassVar['DependentVectorsHandler'] = ... ADD_ZERO_VECTOR: typing.ClassVar['DependentVectorsHandler'] = ... REDUCE_BASE_TO_SPAN: typing.ClassVar['DependentVectorsHandler'] = ... @@ -78,27 +345,234 @@ class DependentVectorsHandler(java.lang.Enum['DependentVectorsHandler']): def valueOf(class_: typing.Type[_valueOf_0__T], string: str) -> _valueOf_0__T: ... @typing.overload @staticmethod - def valueOf(string: str) -> 'DependentVectorsHandler': ... + def valueOf(string: str) -> 'DependentVectorsHandler': + """ + Returns the enum constant of this type with the specified name. The string must match *exactly* an identifier used to + declare an enum constant in this type. (Extraneous whitespace characters are not permitted.) + + Parameters: + name (:class:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.String`): the name of the enum constant to be returned. + + Returns: + the enum constant with the specified name + + Raises: + :class:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.IllegalArgumentException`: if this enum type has no constant with the specified name + :class:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.NullPointerException`: if the argument is null + + + """ + ... @staticmethod - def values() -> typing.MutableSequence['DependentVectorsHandler']: ... + def values() -> typing.MutableSequence['DependentVectorsHandler']: + """ + Returns an array containing the constants of this enum type, in the order they are declared. + + Returns: + an array containing the constants of this enum type, in the order they are declared + + + """ + ... class EigenDecompositionNonSymmetric: + """ + public classEigenDecompositionNonSymmetric extends :class:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Calculates the eigen decomposition of a non-symmetric real matrix. + + The eigen decomposition of matrix A is a set of two matrices: \(V\) and \(D\) such that \(A V = V D\) where $\(A\), + \(V\) and \(D\) are all \(m \times m\) matrices. + + This class is similar in spirit to the :code:`EigenvalueDecomposition` class from the `JAMA + <http://math.nist.gov/javanumerics/jama/>` library, with the following changes: + + - a :meth:`~org.hipparchus.linear.EigenDecompositionNonSymmetric.getVInv` method has been added, + - z :meth:`~org.hipparchus.linear.EigenDecompositionNonSymmetric.getEigenvalue` method to pick up a single eigenvalue has + been added, + - a :meth:`~org.hipparchus.linear.EigenDecompositionNonSymmetric.getEigenvector` method to pick up a single eigenvector + has been added, + - a :meth:`~org.hipparchus.linear.EigenDecompositionNonSymmetric.getDeterminant` method has been added. + + + This class supports non-symmetric matrices, which have complex eigenvalues. Support for symmetric matrices is provided + by :class:`~org.hipparchus.linear.EigenDecompositionSymmetric`. + + As \(A\) is not symmetric, then the eigenvalue matrix \(D\) is block diagonal with the real eigenvalues in 1-by-1 blocks + and any complex eigenvalues, \(\lambda \pm i \mu\), in 2-by-2 blocks: + + \[ \begin{bmatrix} \lambda & \mu\\ -\mu & \lambda \end{bmatrix} \] + + The columns of \(V\) represent the eigenvectors in the sense that \(A V = V D\), i.e. :code:`A.multiply(V)` equals + :code:`V.multiply(D)`. The matrix \(V\) may be badly conditioned, or even singular, so the validity of the equation \(A + = V D V^{-1}\) depends upon the condition of \(V\). + + This implementation is based on the paper by A. Drubrulle, R.S. Martin and J.H. Wilkinson "The Implicit QL Algorithm" in + Wilksinson and Reinsch (1971) Handbook for automatic computation, vol. 2, Linear algebra, Springer-Verlag, New-York. + + Since: + 3.0 + + Also see: + + - `MathWorld <http://mathworld.wolfram.com/EigenDecomposition.html>` + - `Wikipedia <http://en.wikipedia.org/wiki/Eigendecomposition_of_a_matrix>` + """ DEFAULT_EPSILON: typing.ClassVar[float] = ... + """ + public static final double DEFAULT_EPSILON + + Default epsilon value to use for internal epsilon + + Also see: + + - :meth:`~constant` + + + + """ @typing.overload def __init__(self, realMatrix: 'RealMatrix'): ... @typing.overload def __init__(self, realMatrix: 'RealMatrix', double: float): ... - def getD(self) -> 'RealMatrix': ... - def getDeterminant(self) -> org.hipparchus.complex.Complex: ... - def getEigenvalue(self, int: int) -> org.hipparchus.complex.Complex: ... - def getEigenvalues(self) -> typing.MutableSequence[org.hipparchus.complex.Complex]: ... + def getD(self) -> 'RealMatrix': + """ + Gets the block diagonal matrix D of the decomposition. D is a block diagonal matrix. Real eigenvalues are on the + diagonal while complex values are on 2x2 blocks { {real +imaginary}, {-imaginary, real} }. + + Returns: + the D matrix. + + + """ + ... + def getDeterminant(self) -> org.hipparchus.complex.Complex: + """ + Computes the determinant of the matrix. + + Returns: + the determinant of the matrix. + + + """ + ... + def getEigenvalue(self, int: int) -> org.hipparchus.complex.Complex: + """ + Returns the i :sup:`th` eigenvalue of the original matrix. + + Parameters: + i (int): index of the eigenvalue (counting from 0) + + Returns: + i :sup:`th` eigenvalue of the original matrix. + + Also see: + + - :meth:`~org.hipparchus.linear.EigenDecompositionNonSymmetric.getD` + - :meth:`~org.hipparchus.linear.EigenDecompositionNonSymmetric.getEigenvalues` + + + + """ + ... + def getEigenvalues(self) -> typing.MutableSequence[org.hipparchus.complex.Complex]: + """ + Gets a copy of the eigenvalues of the original matrix. + + Returns: + a copy of the eigenvalues of the original matrix. + + Also see: + + - :meth:`~org.hipparchus.linear.EigenDecompositionNonSymmetric.getD` + - :meth:`~org.hipparchus.linear.EigenDecompositionNonSymmetric.getEigenvalue` + + + + """ + ... def getEigenvector(self, int: int) -> 'FieldVector'[org.hipparchus.complex.Complex]: ... - def getEpsilon(self) -> float: ... - def getV(self) -> 'RealMatrix': ... - def getVInv(self) -> 'RealMatrix': ... + def getEpsilon(self) -> float: + """ + Get's the value for epsilon which is used for internal tests (e.g. is singular, eigenvalue ratio, etc.) + + Returns: + the epsilon value. + + + """ + ... + def getV(self) -> 'RealMatrix': + """ + Gets the matrix V of the decomposition. V is a matrix whose columns hold either the real or the imaginary part of + eigenvectors. + + Returns: + the V matrix. + + + """ + ... + def getVInv(self) -> 'RealMatrix': + """ + Gets the inverse of the matrix V of the decomposition. + + Returns: + the inverse of the V matrix. + + + """ + ... class EigenDecompositionSymmetric: + """ + public classEigenDecompositionSymmetric extends :class:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Calculates the eigen decomposition of a symmetric real matrix. + + The eigen decomposition of matrix A is a set of two matrices: \(V\) and \(D\) such that \(A V = V D\) where $\(A\), + \(V\) and \(D\) are all \(m \times m\) matrices. + + This class is similar in spirit to the :code:`EigenvalueDecomposition` class from the `JAMA + <http://math.nist.gov/javanumerics/jama/>` library, with the following changes: + + - a :meth:`~org.hipparchus.linear.EigenDecompositionSymmetric.getVT` method has been added, + - a :meth:`~org.hipparchus.linear.EigenDecompositionSymmetric.getEigenvalue` method to pick up a single eigenvalue has + been added, + - a :meth:`~org.hipparchus.linear.EigenDecompositionSymmetric.getEigenvector` method to pick up a single eigenvector has + been added, + - a :meth:`~org.hipparchus.linear.EigenDecompositionSymmetric.getDeterminant` method has been added. + - a :meth:`~org.hipparchus.linear.EigenDecompositionSymmetric.getSolver` method has been added. + + + As \(A\) is symmetric, then \(A = V D V^T\) where the eigenvalue matrix \(D\) is diagonal and the eigenvector matrix + \(V\) is orthogonal, i.e. :code:`A = V.multiply(D.multiply(V.transpose()))` and :code:`V.multiply(V.transpose())` equals + the identity matrix. + + The columns of \(V\) represent the eigenvectors in the sense that \(A V = V D\), i.e. :code:`A.multiply(V)` equals + :code:`V.multiply(D)`. The matrix \(V\) may be badly conditioned, or even singular, so the validity of the equation \(A + = V D V^{-1}\) depends upon the condition of \(V\). + This implementation is based on the paper by A. Drubrulle, R.S. Martin and J.H. Wilkinson "The Implicit QL Algorithm" in + Wilksinson and Reinsch (1971) Handbook for automatic computation, vol. 2, Linear algebra, Springer-Verlag, New-York. + + Also see: + + - `MathWorld <http://mathworld.wolfram.com/EigenDecomposition.html>` + - `Wikipedia <http://en.wikipedia.org/wiki/Eigendecomposition_of_a_matrix>` + """ DEFAULT_EPSILON: typing.ClassVar[float] = ... + """ + public static final double DEFAULT_EPSILON + + Default epsilon value to use for internal epsilon + + Also see: + + - :meth:`~constant` + + + + """ @typing.overload def __init__(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray]): ... @typing.overload @@ -107,23 +581,196 @@ class EigenDecompositionSymmetric: def __init__(self, realMatrix: 'RealMatrix'): ... @typing.overload def __init__(self, realMatrix: 'RealMatrix', double: float, boolean: bool): ... - def getD(self) -> 'DiagonalMatrix': ... - def getDeterminant(self) -> float: ... - def getEigenvalue(self, int: int) -> float: ... - def getEigenvalues(self) -> typing.MutableSequence[float]: ... - def getEigenvector(self, int: int) -> 'RealVector': ... - def getEpsilon(self) -> float: ... - def getSolver(self) -> DecompositionSolver: ... - def getSquareRoot(self) -> 'RealMatrix': ... - def getV(self) -> 'RealMatrix': ... - def getVT(self) -> 'RealMatrix': ... + def getD(self) -> 'DiagonalMatrix': + """ + Gets the diagonal matrix D of the decomposition. D is a diagonal matrix. + + Returns: + the D matrix. + + Also see: + + - :meth:`~org.hipparchus.linear.EigenDecompositionSymmetric.getEigenvalues` + + + + """ + ... + def getDeterminant(self) -> float: + """ + Computes the determinant of the matrix. + + Returns: + the determinant of the matrix. + + + """ + ... + def getEigenvalue(self, int: int) -> float: + """ + Returns the i :sup:`th` eigenvalue of the original matrix. + + Parameters: + i (int): index of the eigenvalue (counting from 0) + + Returns: + real part of the i :sup:`th` eigenvalue of the original matrix. + + Also see: + + - :meth:`~org.hipparchus.linear.EigenDecompositionSymmetric.getD` + - :meth:`~org.hipparchus.linear.EigenDecompositionSymmetric.getEigenvalues` + + + + """ + ... + def getEigenvalues(self) -> typing.MutableSequence[float]: + """ + Gets a copy of the eigenvalues of the original matrix. + + Returns: + a copy of the eigenvalues of the original matrix. + + Also see: + + - :meth:`~org.hipparchus.linear.EigenDecompositionSymmetric.getD` + - :meth:`~org.hipparchus.linear.EigenDecompositionSymmetric.getEigenvalue` + + + + """ + ... + def getEigenvector(self, int: int) -> 'RealVector': + """ + Gets a copy of the i :sup:`th` eigenvector of the original matrix. + + Note that if the the i :sup:`th` is complex this method will throw an exception. + + Parameters: + i (int): Index of the eigenvector (counting from 0). + + Returns: + a copy of the i :sup:`th` eigenvector of the original matrix. + + Also see: + + - :meth:`~org.hipparchus.linear.EigenDecompositionSymmetric.getD` + + + + """ + ... + def getEpsilon(self) -> float: + """ + Get's the value for epsilon which is used for internal tests (e.g. is singular, eigenvalue ratio, etc.) + + Returns: + the epsilon value. + + + """ + ... + def getSolver(self) -> DecompositionSolver: + """ + Gets a solver for finding the \(A \times X = B\) solution in exact linear sense. + + Returns: + a solver + + + """ + ... + def getSquareRoot(self) -> 'RealMatrix': + """ + Computes the square-root of the matrix. This implementation assumes that the matrix is positive definite. + + Returns: + the square-root of the matrix. + + Raises: + :class:`~org.hipparchus.exception.MathRuntimeException`: if the matrix is not symmetric or not positive definite. + + + """ + ... + def getV(self) -> 'RealMatrix': + """ + Gets the matrix V of the decomposition. V is an orthogonal matrix, i.e. its transpose is also its inverse. The columns + of V are the eigenvectors of the original matrix. No assumption is made about the orientation of the system axes formed + by the columns of V (e.g. in a 3-dimension space, V can form a left- or right-handed system). + + Returns: + the V matrix. + + + """ + ... + def getVT(self) -> 'RealMatrix': + """ + Gets the transpose of the matrix V of the decomposition. V is an orthogonal matrix, i.e. its transpose is also its + inverse. The columns of V are the eigenvectors of the original matrix. No assumption is made about the orientation of + the system axes formed by the columns of V (e.g. in a 3-dimension space, V can form a left- or right-handed system). + + Returns: + the transpose of the V matrix. + + + """ + ... _FieldDecompositionSolver__T = typing.TypeVar('_FieldDecompositionSolver__T', bound=org.hipparchus.FieldElement) # <T> class FieldDecompositionSolver(typing.Generic[_FieldDecompositionSolver__T]): - def getColumnDimension(self) -> int: ... + """ + public interfaceFieldDecompositionSolver<T extends :class:`~org.hipparchus.FieldElement`<T>> + + Interface handling decomposition algorithms that can solve A × X = B. + + Decomposition algorithms decompose an A matrix has a product of several specific matrices from which they can solve A × + X = B in least squares sense: they find X such that ||A × X - B|| is minimal. + + Some solvers like :class:`~org.hipparchus.linear.FieldLUDecomposition` can only find the solution for square matrices + and when the solution is an exact linear solution, i.e. when ||A × X - B|| is exactly 0. Other solvers can also find + solutions with non-square matrix A and with non-null minimal norm. If an exact linear solution exists it is also the + minimal norm solution. + """ + def getColumnDimension(self) -> int: + """ + Returns the number of columns in the matrix. + + Returns: + columnDimension + + Since: + 2.0 + + + """ + ... def getInverse(self) -> 'FieldMatrix'[_FieldDecompositionSolver__T]: ... - def getRowDimension(self) -> int: ... - def isNonSingular(self) -> bool: ... + def getRowDimension(self) -> int: + """ + Returns the number of rows in the matrix. + + Returns: + rowDimension + + Since: + 2.0 + + + """ + ... + def isNonSingular(self) -> bool: + """ + Check if the decomposed matrix is non-singular. + + Returns: + true if the decomposed matrix is non-singular + + + """ + ... @typing.overload def solve(self, fieldMatrix: 'FieldMatrix'[_FieldDecompositionSolver__T]) -> 'FieldMatrix'[_FieldDecompositionSolver__T]: ... @typing.overload @@ -131,37 +778,201 @@ class FieldDecompositionSolver(typing.Generic[_FieldDecompositionSolver__T]): _FieldLUDecomposition__T = typing.TypeVar('_FieldLUDecomposition__T', bound=org.hipparchus.FieldElement) # <T> class FieldLUDecomposition(typing.Generic[_FieldLUDecomposition__T]): + """ + public classFieldLUDecomposition<T extends :class:`~org.hipparchus.FieldElement`<T>> extends :class:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Calculates the LUP-decomposition of a square matrix. + + The LUP-decomposition of a matrix A consists of three matrices L, U and P that satisfy: PA = LU, L is lower triangular, + and U is upper triangular and P is a permutation matrix. All matrices are m×m. + + This class is based on the class with similar name from the `JAMA <http://math.nist.gov/javanumerics/jama/>` library. + + - a :meth:`~org.hipparchus.linear.FieldLUDecomposition.getP` method has been added, + - the :code:`det` method has been renamed as :meth:`~org.hipparchus.linear.FieldLUDecomposition.getDeterminant`, + - the :code:`getDoublePivot` method has been removed (but the int based + :meth:`~org.hipparchus.linear.FieldLUDecomposition.getPivot` method has been kept), + - the :code:`solve` and :code:`isNonSingular` methods have been replaced by a + :meth:`~org.hipparchus.linear.FieldLUDecomposition.getSolver` method and the equivalent methods provided by the returned + :class:`~org.hipparchus.linear.DecompositionSolver`. + + + Also see: + + - `MathWorld <http://mathworld.wolfram.com/LUDecomposition.html>` + - `Wikipedia <http://en.wikipedia.org/wiki/LU_decomposition>` + """ @typing.overload def __init__(self, fieldMatrix: 'FieldMatrix'[_FieldLUDecomposition__T]): ... @typing.overload def __init__(self, fieldMatrix: 'FieldMatrix'[_FieldLUDecomposition__T], predicate: typing.Union[java.util.function.Predicate[_FieldLUDecomposition__T], typing.Callable[[_FieldLUDecomposition__T], bool]]): ... @typing.overload def __init__(self, fieldMatrix: 'FieldMatrix'[_FieldLUDecomposition__T], predicate: typing.Union[java.util.function.Predicate[_FieldLUDecomposition__T], typing.Callable[[_FieldLUDecomposition__T], bool]], boolean: bool): ... - def getDeterminant(self) -> _FieldLUDecomposition__T: ... + def getDeterminant(self) -> _FieldLUDecomposition__T: + """ + Return the determinant of the matrix. + + Returns: + determinant of the matrix + + + """ + ... def getL(self) -> 'FieldMatrix'[_FieldLUDecomposition__T]: ... def getP(self) -> 'FieldMatrix'[_FieldLUDecomposition__T]: ... - def getPivot(self) -> typing.MutableSequence[int]: ... + def getPivot(self) -> typing.MutableSequence[int]: + """ + Returns the pivot permutation vector. + + Returns: + the pivot permutation vector + + Also see: + + - :meth:`~org.hipparchus.linear.FieldLUDecomposition.getP` + + + + """ + ... def getSolver(self) -> FieldDecompositionSolver[_FieldLUDecomposition__T]: ... def getU(self) -> 'FieldMatrix'[_FieldLUDecomposition__T]: ... _FieldMatrixChangingVisitor__T = typing.TypeVar('_FieldMatrixChangingVisitor__T', bound=org.hipparchus.FieldElement) # <T> class FieldMatrixChangingVisitor(typing.Generic[_FieldMatrixChangingVisitor__T]): - def end(self) -> _FieldMatrixChangingVisitor__T: ... - def start(self, int: int, int2: int, int3: int, int4: int, int5: int, int6: int) -> None: ... - def visit(self, int: int, int2: int, t: _FieldMatrixChangingVisitor__T) -> _FieldMatrixChangingVisitor__T: ... + """ + public interfaceFieldMatrixChangingVisitor<T extends :class:`~org.hipparchus.FieldElement`<?>> + + Interface defining a visitor for matrix entries. + """ + def end(self) -> _FieldMatrixChangingVisitor__T: + """ + End visiting a matrix. + + This method is called once after all entries of the matrix have been visited. + + Returns: + the value that the :code:`walkInXxxOrder` must return + + + """ + ... + def start(self, int: int, int2: int, int3: int, int4: int, int5: int, int6: int) -> None: + """ + Start visiting a matrix. + + This method is called once before any entry of the matrix is visited. + + Parameters: + rows (int): number of rows of the matrix + columns (int): number of columns of the matrix + startRow (int): Initial row index + endRow (int): Final row index (inclusive) + startColumn (int): Initial column index + endColumn (int): Final column index (inclusive) + + + """ + ... + def visit(self, int: int, int2: int, t: _FieldMatrixChangingVisitor__T) -> _FieldMatrixChangingVisitor__T: + """ + Visit one matrix entry. + + Parameters: + row (int): row index of the entry + column (int): column index of the entry + value (:class:`~org.hipparchus.linear.FieldMatrixChangingVisitor`): current value of the entry + + Returns: + the new value to be set for the entry + + + """ + ... _FieldMatrixDecomposer__T = typing.TypeVar('_FieldMatrixDecomposer__T', bound=org.hipparchus.FieldElement) # <T> class FieldMatrixDecomposer(typing.Generic[_FieldMatrixDecomposer__T]): + """ + public interfaceFieldMatrixDecomposer<T extends :class:`~org.hipparchus.FieldElement`<T>> + + Interface for all algorithms providing matrix decomposition. + + Since: + 2.2 + """ def decompose(self, fieldMatrix: 'FieldMatrix'[_FieldMatrixDecomposer__T]) -> FieldDecompositionSolver[_FieldMatrixDecomposer__T]: ... _FieldMatrixPreservingVisitor__T = typing.TypeVar('_FieldMatrixPreservingVisitor__T', bound=org.hipparchus.FieldElement) # <T> class FieldMatrixPreservingVisitor(typing.Generic[_FieldMatrixPreservingVisitor__T]): - def end(self) -> _FieldMatrixPreservingVisitor__T: ... - def start(self, int: int, int2: int, int3: int, int4: int, int5: int, int6: int) -> None: ... - def visit(self, int: int, int2: int, t: _FieldMatrixPreservingVisitor__T) -> None: ... + """ + public interfaceFieldMatrixPreservingVisitor<T extends :class:`~org.hipparchus.FieldElement`<?>> + + Interface defining a visitor for matrix entries. + """ + def end(self) -> _FieldMatrixPreservingVisitor__T: + """ + End visiting a matrix. + + This method is called once after all entries of the matrix have been visited. + + Returns: + the value that the :code:`walkInXxxOrder` must return + + + """ + ... + def start(self, int: int, int2: int, int3: int, int4: int, int5: int, int6: int) -> None: + """ + Start visiting a matrix. + + This method is called once before any entry of the matrix is visited. + + Parameters: + rows (int): number of rows of the matrix + columns (int): number of columns of the matrix + startRow (int): Initial row index + endRow (int): Final row index (inclusive) + startColumn (int): Initial column index + endColumn (int): Final column index (inclusive) + + + """ + ... + def visit(self, int: int, int2: int, t: _FieldMatrixPreservingVisitor__T) -> None: + """ + Visit one matrix entry. + + Parameters: + row (int): row index of the entry + column (int): column index of the entry + value (:class:`~org.hipparchus.linear.FieldMatrixPreservingVisitor`): current value of the entry + + + """ + ... _FieldQRDecomposition__T = typing.TypeVar('_FieldQRDecomposition__T', bound=org.hipparchus.CalculusFieldElement) # <T> class FieldQRDecomposition(typing.Generic[_FieldQRDecomposition__T]): + """ + public classFieldQRDecomposition<T extends :class:`~org.hipparchus.CalculusFieldElement`<T>> extends :class:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Calculates the QR-decomposition of a field matrix. + + The QR-decomposition of a matrix A consists of two matrices Q and R that satisfy: A = QR, Q is orthogonal (Q :sup:`T` Q + = I), and R is upper triangular. If A is m×n, Q is m×m and R m×n. + + This class compute the decomposition using Householder reflectors. + + For efficiency purposes, the decomposition in packed form is transposed. This allows inner loop to iterate inside rows, + which is much more cache-efficient in Java. + + This class is based on the class :class:`~org.hipparchus.linear.QRDecomposition`. + + Also see: + + - `MathWorld <http://mathworld.wolfram.com/QRDecomposition.html>` + - `Wikipedia <http://en.wikipedia.org/wiki/QR_decomposition>` + """ @typing.overload def __init__(self, fieldMatrix: 'FieldMatrix'[_FieldQRDecomposition__T]): ... @typing.overload @@ -176,6 +987,29 @@ class FieldQRDecomposition(typing.Generic[_FieldQRDecomposition__T]): _FieldVector__T = typing.TypeVar('_FieldVector__T', bound=org.hipparchus.FieldElement) # <T> class FieldVector(typing.Generic[_FieldVector__T]): + """ + public interfaceFieldVector<T extends :class:`~org.hipparchus.FieldElement`<T>> + + Interface defining a field-valued vector with basic algebraic operations. + + vector element indexing is 0-based -- e.g., :code:`getEntry(0)` returns the first element of the vector. + + The various :code:`mapXxx` and :code:`mapXxxToSelf` methods operate on vectors element-wise, i.e. they perform the same + operation (adding a scalar, applying a function ...) on each element in turn. The :code:`mapXxx` versions create a new + vector to hold the result and do not change the instance. The :code:`mapXxxToSelf` versions use the instance itself to + store the results, so the instance is changed by these methods. In both cases, the result vector is returned by the + methods, this allows to use the *fluent API* style, like this: + + .. code-block: java + + RealVector result = v.mapAddToSelf(3.0).mapTanToSelf().mapSquareToSelf(); + + + Note that as almost all operations on :class:`~org.hipparchus.FieldElement` throw + :class:`~org.hipparchus.exception.NullArgumentException` when operating on a null element, it is the responsibility of + :code:`FieldVector` implementations to make sure no null elements are inserted into the vector. This must be done in all + constructors and all setters. + """ def add(self, fieldVector: 'FieldVector'[_FieldVector__T]) -> 'FieldVector'[_FieldVector__T]: ... @typing.overload def append(self, t: _FieldVector__T) -> 'FieldVector'[_FieldVector__T]: ... @@ -185,7 +1019,16 @@ class FieldVector(typing.Generic[_FieldVector__T]): def dotProduct(self, fieldVector: 'FieldVector'[_FieldVector__T]) -> _FieldVector__T: ... def ebeDivide(self, fieldVector: 'FieldVector'[_FieldVector__T]) -> 'FieldVector'[_FieldVector__T]: ... def ebeMultiply(self, fieldVector: 'FieldVector'[_FieldVector__T]) -> 'FieldVector'[_FieldVector__T]: ... - def getDimension(self) -> int: ... + def getDimension(self) -> int: + """ + Returns the size of the vector. + + Returns: + size + + + """ + ... def getEntry(self, int: int) -> _FieldVector__T: ... def getField(self) -> org.hipparchus.Field[_FieldVector__T]: ... def getSubVector(self, int: int, int2: int) -> 'FieldVector'[_FieldVector__T]: ... @@ -201,36 +1044,199 @@ class FieldVector(typing.Generic[_FieldVector__T]): def mapSubtractToSelf(self, t: _FieldVector__T) -> 'FieldVector'[_FieldVector__T]: ... def outerProduct(self, fieldVector: 'FieldVector'[_FieldVector__T]) -> 'FieldMatrix'[_FieldVector__T]: ... def projection(self, fieldVector: 'FieldVector'[_FieldVector__T]) -> 'FieldVector'[_FieldVector__T]: ... - def set(self, t: _FieldVector__T) -> None: ... + def set(self, t: _FieldVector__T) -> None: + """ + Set all elements to a single value. + + Parameters: + value (:class:`~org.hipparchus.linear.FieldVector`): single value to set for all elements + + + """ + ... def setEntry(self, int: int, t: _FieldVector__T) -> None: ... def setSubVector(self, int: int, fieldVector: 'FieldVector'[_FieldVector__T]) -> None: ... def subtract(self, fieldVector: 'FieldVector'[_FieldVector__T]) -> 'FieldVector'[_FieldVector__T]: ... - def toArray(self) -> typing.MutableSequence[_FieldVector__T]: ... + def toArray(self) -> typing.MutableSequence[_FieldVector__T]: + """ + Convert the vector to a T array. + + The array is independent from vector data, it's elements are copied. + + Returns: + array containing a copy of vector elements + + + """ + ... _FieldVectorChangingVisitor__T = typing.TypeVar('_FieldVectorChangingVisitor__T', bound=org.hipparchus.FieldElement) # <T> class FieldVectorChangingVisitor(typing.Generic[_FieldVectorChangingVisitor__T]): - def end(self) -> _FieldVectorChangingVisitor__T: ... - def start(self, int: int, int2: int, int3: int) -> None: ... - def visit(self, int: int, t: _FieldVectorChangingVisitor__T) -> _FieldVectorChangingVisitor__T: ... + """ + public interfaceFieldVectorChangingVisitor<T extends :class:`~org.hipparchus.FieldElement`<?>> + + This interface defines a visitor for the entries of a vector. Visitors implementing this interface may alter the entries + of the vector being visited. + """ + def end(self) -> _FieldVectorChangingVisitor__T: + """ + End visiting a vector. This method is called once, after all entries of the vector have been visited. + + Returns: + the value returned after visiting all entries + + + """ + ... + def start(self, int: int, int2: int, int3: int) -> None: + """ + Start visiting a vector. This method is called once, before any entry of the vector is visited. + + Parameters: + dimension (int): the size of the vector + start (int): the index of the first entry to be visited + end (int): the index of the last entry to be visited (inclusive) + + + """ + ... + def visit(self, int: int, t: _FieldVectorChangingVisitor__T) -> _FieldVectorChangingVisitor__T: + """ + Visit one entry of the vector. + + Parameters: + index (int): the index of the entry being visited + value (:class:`~org.hipparchus.linear.FieldVectorChangingVisitor`): the value of the entry being visited + + Returns: + the new value of the entry being visited + + + """ + ... _FieldVectorPreservingVisitor__T = typing.TypeVar('_FieldVectorPreservingVisitor__T', bound=org.hipparchus.FieldElement) # <T> class FieldVectorPreservingVisitor(typing.Generic[_FieldVectorPreservingVisitor__T]): - def end(self) -> _FieldVectorPreservingVisitor__T: ... - def start(self, int: int, int2: int, int3: int) -> None: ... - def visit(self, int: int, t: _FieldVectorPreservingVisitor__T) -> None: ... + """ + public interfaceFieldVectorPreservingVisitor<T extends :class:`~org.hipparchus.FieldElement`<?>> + + This interface defines a visitor for the entries of a vector. Visitors implementing this interface do not alter the + entries of the vector being visited. + """ + def end(self) -> _FieldVectorPreservingVisitor__T: + """ + End visiting a vector. This method is called once, after all entries of the vector have been visited. + + Returns: + the value returned after visiting all entries + + + """ + ... + def start(self, int: int, int2: int, int3: int) -> None: + """ + Start visiting a vector. This method is called once, before any entry of the vector is visited. + + Parameters: + dimension (int): the size of the vector + start (int): the index of the first entry to be visited + end (int): the index of the last entry to be visited (inclusive) + + + """ + ... + def visit(self, int: int, t: _FieldVectorPreservingVisitor__T) -> None: + """ + Visit one entry of the vector. + + Parameters: + index (int): the index of the entry being visited + value (:class:`~org.hipparchus.linear.FieldVectorPreservingVisitor`): the value of the entry being visited + + + """ + ... class HessenbergTransformer: + """ + public classHessenbergTransformer extends :class:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Class transforming a general real matrix to Hessenberg form. + + A m × m matrix A can be written as the product of three matrices: A = P × H × P :sup:`T` with P an orthogonal matrix + and H a Hessenberg matrix. Both P and H are m × m matrices. + + Transformation to Hessenberg form is often not a goal by itself, but it is an intermediate step in more general + decomposition algorithms like :class:`~org.hipparchus.linear.EigenDecompositionSymmetric`. This class is therefore + intended for internal use by the library and is not public. As a consequence of this explicitly limited scope, many + methods directly returns references to internal arrays, not copies. + + This class is based on the method orthes in class EigenvalueDecomposition from the `JAMA + <http://math.nist.gov/javanumerics/jama/>` library. + + Also see: + + - `MathWorld <http://mathworld.wolfram.com/HessenbergDecomposition.html>` + - `Householder Transformations <http://en.wikipedia.org/wiki/Householder_transformation>` + """ def __init__(self, realMatrix: 'RealMatrix'): ... - def getH(self) -> 'RealMatrix': ... - def getP(self) -> 'RealMatrix': ... - def getPT(self) -> 'RealMatrix': ... + def getH(self) -> 'RealMatrix': + """ + Returns the Hessenberg matrix H of the transform. + + Returns: + the H matrix + + + """ + ... + def getP(self) -> 'RealMatrix': + """ + Returns the matrix P of the transform. + + P is an orthogonal matrix, i.e. its inverse is also its transpose. + + Returns: + the P matrix + + + """ + ... + def getPT(self) -> 'RealMatrix': + """ + Returns the transpose of the matrix P of the transform. + + P is an orthogonal matrix, i.e. its inverse is also its transpose. + + Returns: + the transpose of the P matrix + + + """ + ... class IterativeLinearSolver: + """ + public abstract classIterativeLinearSolver extends :class:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + This abstract class defines an iterative solver for the linear system A · x = b. In what follows, the *residual* r is + defined as r = b - A · x, where A is the linear operator of the linear system, b is the right-hand side vector, and x + the current estimate of the solution. + """ @typing.overload def __init__(self, int: int): ... @typing.overload def __init__(self, iterationManager: org.hipparchus.util.IterationManager): ... - def getIterationManager(self) -> org.hipparchus.util.IterationManager: ... + def getIterationManager(self) -> org.hipparchus.util.IterationManager: + """ + Returns the iteration manager attached to this solver. + + Returns: + the manager + + + """ + ... @typing.overload def solve(self, realLinearOperator: 'RealLinearOperator', realVector: 'RealVector') -> 'RealVector': ... @typing.overload @@ -238,35 +1244,252 @@ class IterativeLinearSolver: def solveInPlace(self, realLinearOperator: 'RealLinearOperator', realVector: 'RealVector', realVector2: 'RealVector') -> 'RealVector': ... class IterativeLinearSolverEvent(org.hipparchus.util.IterationEvent): + """ + public abstract classIterativeLinearSolverEvent extends :class:`~org.hipparchus.util.IterationEvent` + + This is the base class for all events occurring during the iterations of a + :class:`~org.hipparchus.linear.IterativeLinearSolver`. + + Also see: + + - :meth:`~serialized` + """ def __init__(self, object: typing.Any, int: int): ... - def getNormOfResidual(self) -> float: ... - def getResidual(self) -> 'RealVector': ... - def getRightHandSideVector(self) -> 'RealVector': ... - def getSolution(self) -> 'RealVector': ... - def providesResidual(self) -> bool: ... + def getNormOfResidual(self) -> float: + """ + Returns the norm of the residual. The returned value is not required to be *exact*. Instead, the norm of the so-called + *updated* residual (if available) should be returned. For example, the :class:`~org.hipparchus.linear.ConjugateGradient` + method computes a sequence of residuals, the norm of which is cheap to compute. However, due to accumulation of + round-off errors, this residual might differ from the true residual after some iterations. See e.g. A. Greenbaum and Z. + Strakos, *Predicting the Behavior of Finite Precision Lanzos and Conjugate Gradient Computations*, Technical Report 538, + Department of Computer Science, New York University, 1991 (available `here + <http://www.archive.org/details/predictingbehavi00gree>`). + + Returns: + the norm of the residual, ||r|| + + + """ + ... + def getResidual(self) -> 'RealVector': + """ + + Returns the residual. This is an optional operation, as all iterative linear solvers do not provide cheap estimate of + the updated residual vector, in which case + + - this method should throw a :class:`~org.hipparchus.exception.MathRuntimeException`, + - :meth:`~org.hipparchus.linear.IterativeLinearSolverEvent.providesResidual` returns :code:`false`. + + + The default implementation throws a :class:`~org.hipparchus.exception.MathRuntimeException`. If this method is + overriden, then :meth:`~org.hipparchus.linear.IterativeLinearSolverEvent.providesResidual` should be overriden as well. + + Returns: + the updated residual, r + + + """ + ... + def getRightHandSideVector(self) -> 'RealVector': + """ + Returns the current right-hand side of the linear system to be solved. This method should return an unmodifiable view, + or a deep copy of the actual right-hand side vector, in order not to compromise subsequent iterations of the source + :class:`~org.hipparchus.linear.IterativeLinearSolver`. + + Returns: + the right-hand side vector, b + + + """ + ... + def getSolution(self) -> 'RealVector': + """ + Returns the current estimate of the solution to the linear system to be solved. This method should return an + unmodifiable view, or a deep copy of the actual current solution, in order not to compromise subsequent iterations of + the source :class:`~org.hipparchus.linear.IterativeLinearSolver`. + + Returns: + the solution, x + + + """ + ... + def providesResidual(self) -> bool: + """ + Returns :code:`true` if :meth:`~org.hipparchus.linear.IterativeLinearSolverEvent.getResidual` is supported. The default + implementation returns :code:`false`. + + Returns: + :code:`false` if :meth:`~org.hipparchus.linear.IterativeLinearSolverEvent.getResidual` throws a + :class:`~org.hipparchus.exception.MathRuntimeException` + + + """ + ... class LUDecomposition: + """ + public classLUDecomposition extends :class:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Calculates the LUP-decomposition of a square matrix. + + The LUP-decomposition of a matrix A consists of three matrices L, U and P that satisfy: P×A = L×U. L is lower + triangular (with unit diagonal terms), U is upper triangular and P is a permutation matrix. All matrices are m×m. + + As shown by the presence of the P matrix, this decomposition is implemented using partial pivoting. + + This class is based on the class with similar name from the `JAMA <http://math.nist.gov/javanumerics/jama/>` library. + + - a :meth:`~org.hipparchus.linear.LUDecomposition.getP` method has been added, + - the :code:`det` method has been renamed as :meth:`~org.hipparchus.linear.LUDecomposition.getDeterminant`, + - the :code:`getDoublePivot` method has been removed (but the int based + :meth:`~org.hipparchus.linear.LUDecomposition.getPivot` method has been kept), + - the :code:`solve` and :code:`isNonSingular` methods have been replaced by a + :meth:`~org.hipparchus.linear.LUDecomposition.getSolver` method and the equivalent methods provided by the returned + :class:`~org.hipparchus.linear.DecompositionSolver`. + + + Also see: + + - `MathWorld <http://mathworld.wolfram.com/LUDecomposition.html>` + - `Wikipedia <http://en.wikipedia.org/wiki/LU_decomposition>` + """ @typing.overload def __init__(self, realMatrix: 'RealMatrix'): ... @typing.overload def __init__(self, realMatrix: 'RealMatrix', double: float): ... - def getDeterminant(self) -> float: ... - def getL(self) -> 'RealMatrix': ... - def getP(self) -> 'RealMatrix': ... - def getPivot(self) -> typing.MutableSequence[int]: ... - def getSolver(self) -> DecompositionSolver: ... - def getU(self) -> 'RealMatrix': ... + def getDeterminant(self) -> float: + """ + Return the determinant of the matrix + + Returns: + determinant of the matrix + + + """ + ... + def getL(self) -> 'RealMatrix': + """ + Returns the matrix L of the decomposition. + + L is a lower-triangular matrix + + Returns: + the L matrix (or null if decomposed matrix is singular) + + + """ + ... + def getP(self) -> 'RealMatrix': + """ + Returns the P rows permutation matrix. + + P is a sparse matrix with exactly one element set to 1.0 in each row and each column, all other elements being set to + 0.0. + + The positions of the 1 elements are given by the :meth:`~org.hipparchus.linear.LUDecomposition.getPivot`. + + Returns: + the P rows permutation matrix (or null if decomposed matrix is singular) + + Also see: + + - :meth:`~org.hipparchus.linear.LUDecomposition.getPivot` + + + + """ + ... + def getPivot(self) -> typing.MutableSequence[int]: + """ + Returns the pivot permutation vector. + + Returns: + the pivot permutation vector + + Also see: + + - :meth:`~org.hipparchus.linear.LUDecomposition.getP` + + + + """ + ... + def getSolver(self) -> DecompositionSolver: + """ + Get a solver for finding the A × X = B solution in exact linear sense. + + Returns: + a solver + + + """ + ... + def getU(self) -> 'RealMatrix': + """ + Returns the matrix U of the decomposition. + + U is an upper-triangular matrix + + Returns: + the U matrix (or null if decomposed matrix is singular) + + + """ + ... class MatrixDecomposer: + """ + public interfaceMatrixDecomposer + + Interface for all algorithms providing matrix decomposition. + + Since: + 1.3 + """ def decompose(self, realMatrix: 'RealMatrix') -> DecompositionSolver: ... class MatrixUtils: + """ + public classMatrixUtils extends :class:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + A collection of static methods that operate on or return matrices. + """ DEFAULT_FORMAT: typing.ClassVar['RealMatrixFormat'] = ... + """ + public static final :class:`~org.hipparchus.linear.RealMatrixFormat` DEFAULT_FORMAT + + The default format for :class:`~org.hipparchus.linear.RealMatrix` objects. + + """ OCTAVE_FORMAT: typing.ClassVar['RealMatrixFormat'] = ... + """ + public static final :class:`~org.hipparchus.linear.RealMatrixFormat` OCTAVE_FORMAT + + A format for :class:`~org.hipparchus.linear.RealMatrix` objects compatible with octave. + + """ @staticmethod def bigFractionMatrixToRealMatrix(fieldMatrix: 'FieldMatrix'[org.hipparchus.fraction.BigFraction]) -> 'Array2DRowRealMatrix': ... @staticmethod - def blockInverse(realMatrix: 'RealMatrix', int: int) -> 'RealMatrix': ... + def blockInverse(realMatrix: 'RealMatrix', int: int) -> 'RealMatrix': + """ + Computes the inverse of the given matrix by splitting it into 4 sub-matrices. + + Parameters: + m (:class:`~org.hipparchus.linear.RealMatrix`): Matrix whose inverse must be computed. + splitIndex (int): Index that determines the "split" line and column. The element corresponding to this index will part of the upper-left + sub-matrix. + + Returns: + the inverse of :code:`m`. + + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if :code:`m` is not square. + + + """ + ... @staticmethod def checkAdditionCompatible(anyMatrix: AnyMatrix, anyMatrix2: AnyMatrix) -> None: ... @staticmethod @@ -290,7 +1513,21 @@ class MatrixUtils: @staticmethod def checkSubtractionCompatible(anyMatrix: AnyMatrix, anyMatrix2: AnyMatrix) -> None: ... @staticmethod - def checkSymmetric(realMatrix: 'RealMatrix', double: float) -> None: ... + def checkSymmetric(realMatrix: 'RealMatrix', double: float) -> None: + """ + Checks whether a matrix is symmetric. + + Parameters: + matrix (:class:`~org.hipparchus.linear.RealMatrix`): Matrix to check. + eps (double): Relative tolerance. + + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if the matrix is not square. + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if the matrix is not symmetric. + + + """ + ... _createColumnFieldMatrix__T = typing.TypeVar('_createColumnFieldMatrix__T', bound=org.hipparchus.FieldElement) # <T> @staticmethod def createColumnFieldMatrix(tArray: typing.Union[typing.List[_createColumnFieldMatrix__T], jpype.JArray]) -> 'FieldMatrix'[_createColumnFieldMatrix__T]: ... @@ -298,15 +1535,94 @@ class MatrixUtils: def createColumnRealMatrix(doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> 'RealMatrix': ... _createFieldDiagonalMatrix__T = typing.TypeVar('_createFieldDiagonalMatrix__T', bound=org.hipparchus.FieldElement) # <T> @staticmethod - def createFieldDiagonalMatrix(tArray: typing.Union[typing.List[_createFieldDiagonalMatrix__T], jpype.JArray]) -> 'FieldMatrix'[_createFieldDiagonalMatrix__T]: ... + def createFieldDiagonalMatrix(tArray: typing.Union[typing.List[_createFieldDiagonalMatrix__T], jpype.JArray]) -> 'FieldMatrix'[_createFieldDiagonalMatrix__T]: + """ + Returns a diagonal matrix with specified elements. + + Parameters: + diagonal (T[]): diagonal elements of the matrix (the array elements will be copied) + + Returns: + diagonal matrix + + + """ + ... _createFieldIdentityMatrix__T = typing.TypeVar('_createFieldIdentityMatrix__T', bound=org.hipparchus.FieldElement) # <T> @staticmethod - def createFieldIdentityMatrix(field: org.hipparchus.Field[_createFieldIdentityMatrix__T], int: int) -> 'FieldMatrix'[_createFieldIdentityMatrix__T]: ... + def createFieldIdentityMatrix(field: org.hipparchus.Field[_createFieldIdentityMatrix__T], int: int) -> 'FieldMatrix'[_createFieldIdentityMatrix__T]: + """ + Returns :code:`dimension x dimension` identity matrix. + + Parameters: + field (:class:`~org.hipparchus.Field`<T> field): field to which the elements belong + dimension (int): dimension of identity matrix to generate + + Returns: + identity matrix + + Raises: + :class:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.IllegalArgumentException`: if dimension is not positive + + + """ + ... _createFieldMatrix_0__T = typing.TypeVar('_createFieldMatrix_0__T', bound=org.hipparchus.FieldElement) # <T> _createFieldMatrix_1__T = typing.TypeVar('_createFieldMatrix_1__T', bound=org.hipparchus.FieldElement) # <T> @typing.overload @staticmethod - def createFieldMatrix(field: org.hipparchus.Field[_createFieldMatrix_0__T], int: int, int2: int) -> 'FieldMatrix'[_createFieldMatrix_0__T]: ... + def createFieldMatrix(field: org.hipparchus.Field[_createFieldMatrix_0__T], int: int, int2: int) -> 'FieldMatrix'[_createFieldMatrix_0__T]: + """ + Returns a :class:`~org.hipparchus.linear.FieldMatrix` with specified dimensions. + + The type of matrix returned depends on the dimension. Below 2 :sup:`12` elements (i.e. 4096 elements or 64×64 for a + square matrix), a :class:`~org.hipparchus.linear.FieldMatrix` instance is built. Above this threshold a + :class:`~org.hipparchus.linear.BlockFieldMatrix` instance is built. + + The matrix elements are all set to field.getZero(). + + Parameters: + field (:class:`~org.hipparchus.Field`<T> field): field to which the matrix elements belong + rows (int): number of rows of the matrix + columns (int): number of columns of the matrix + + Returns: + FieldMatrix with specified dimensions + + Also see: + + - :meth:`~org.hipparchus.linear.MatrixUtils.createFieldMatrix` + + + public static <T extends :class:`~org.hipparchus.FieldElement`<T>> :class:`~org.hipparchus.linear.FieldMatrix`<T> createFieldMatrix(T[][] data) throws :class:`~org.hipparchus.exception.MathIllegalArgumentException`, :class:`~org.hipparchus.exception.NullArgumentException` + + Returns a :class:`~org.hipparchus.linear.FieldMatrix` whose entries are the the values in the the input array. + + The type of matrix returned depends on the dimension. Below 2 :sup:`12` elements (i.e. 4096 elements or 64×64 for a + square matrix), a :class:`~org.hipparchus.linear.FieldMatrix` instance is built. Above this threshold a + :class:`~org.hipparchus.linear.BlockFieldMatrix` instance is built. + + The input array is copied, not referenced. + + Parameters: + data (T[][]): input array + + Returns: + a matrix containing the values of the array. + + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if :code:`data` is not rectangular (not all rows have the same length). + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if a row or column is empty. + :class:`~org.hipparchus.exception.NullArgumentException`: if either :code:`data` or :code:`data[0]` is :code:`null`. + + Also see: + + - :meth:`~org.hipparchus.linear.MatrixUtils.createFieldMatrix` + + + + """ + ... @typing.overload @staticmethod def createFieldMatrix(tArray: typing.Union[typing.List[typing.MutableSequence[_createFieldMatrix_1__T]], jpype.JArray]) -> 'FieldMatrix'[_createFieldMatrix_1__T]: ... @@ -314,23 +1630,132 @@ class MatrixUtils: _createFieldVector_1__T = typing.TypeVar('_createFieldVector_1__T', bound=org.hipparchus.FieldElement) # <T> @typing.overload @staticmethod - def createFieldVector(field: org.hipparchus.Field[_createFieldVector_0__T], int: int) -> FieldVector[_createFieldVector_0__T]: ... + def createFieldVector(field: org.hipparchus.Field[_createFieldVector_0__T], int: int) -> FieldVector[_createFieldVector_0__T]: + """ + Creates a :class:`~org.hipparchus.linear.FieldVector` with specified dimensions. + + Parameters: + field (:class:`~org.hipparchus.Field`<T> field): field to which array elements belong + dimension (int): dimension of the vector + + Returns: + a new vector + + Since: + 1.3 + + + """ + ... @typing.overload @staticmethod def createFieldVector(tArray: typing.Union[typing.List[_createFieldVector_1__T], jpype.JArray]) -> FieldVector[_createFieldVector_1__T]: ... @staticmethod - def createRealDiagonalMatrix(doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> 'RealMatrix': ... + def createRealDiagonalMatrix(doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> 'RealMatrix': + """ + Returns a diagonal matrix with specified elements. + + Parameters: + diagonal (double[]): diagonal elements of the matrix (the array elements will be copied) + + Returns: + diagonal matrix + + + """ + ... @staticmethod - def createRealIdentityMatrix(int: int) -> 'RealMatrix': ... + def createRealIdentityMatrix(int: int) -> 'RealMatrix': + """ + Returns :code:`dimension x dimension` identity matrix. + + Parameters: + dimension (int): dimension of identity matrix to generate + + Returns: + identity matrix + + Raises: + :class:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.IllegalArgumentException`: if dimension is not positive + + + """ + ... @typing.overload @staticmethod - def createRealMatrix(doubleArray: typing.Union[typing.List[typing.MutableSequence[float]], jpype.JArray]) -> 'RealMatrix': ... + def createRealMatrix(doubleArray: typing.Union[typing.List[typing.MutableSequence[float]], jpype.JArray]) -> 'RealMatrix': + """ + Returns a :class:`~org.hipparchus.linear.RealMatrix` with specified dimensions. + + The type of matrix returned depends on the dimension. Below 2 :sup:`12` elements (i.e. 4096 elements or 64×64 for a + square matrix) which can be stored in a 32kB array, a :class:`~org.hipparchus.linear.Array2DRowRealMatrix` instance is + built. Above this threshold a :class:`~org.hipparchus.linear.BlockRealMatrix` instance is built. + + The matrix elements are all set to 0.0. + + Parameters: + rows (int): number of rows of the matrix + columns (int): number of columns of the matrix + + Returns: + RealMatrix with specified dimensions + + Also see: + + - :meth:`~org.hipparchus.linear.MatrixUtils.createRealMatrix` + + + public static :class:`~org.hipparchus.linear.RealMatrix` createRealMatrix(double[][] data) throws :class:`~org.hipparchus.exception.MathIllegalArgumentException`, :class:`~org.hipparchus.exception.NullArgumentException` + + Returns a :class:`~org.hipparchus.linear.RealMatrix` whose entries are the the values in the the input array. + + The type of matrix returned depends on the dimension. Below 2 :sup:`12` elements (i.e. 4096 elements or 64×64 for a + square matrix) which can be stored in a 32kB array, a :class:`~org.hipparchus.linear.Array2DRowRealMatrix` instance is + built. Above this threshold a :class:`~org.hipparchus.linear.BlockRealMatrix` instance is built. + + The input array is copied, not referenced. + + Parameters: + data (double[][]): input array + + Returns: + RealMatrix containing the values of the array + + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if :code:`data` is not rectangular (not all rows have the same length). + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if a row or column is empty. + :class:`~org.hipparchus.exception.NullArgumentException`: if either :code:`data` or :code:`data[0]` is :code:`null`. + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if :code:`data` is not rectangular. + + Also see: + + - :meth:`~org.hipparchus.linear.MatrixUtils.createRealMatrix` + + + + """ + ... @typing.overload @staticmethod def createRealMatrix(int: int, int2: int) -> 'RealMatrix': ... @typing.overload @staticmethod - def createRealVector(doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> 'RealVector': ... + def createRealVector(doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> 'RealVector': + """ + Creates a :class:`~org.hipparchus.linear.RealVector` with specified dimensions. + + Parameters: + dimension (int): dimension of the vector + + Returns: + a new vector + + Since: + 1.3 + + + """ + ... @typing.overload @staticmethod def createRealVector(int: int) -> 'RealVector': ... @@ -348,9 +1773,41 @@ class MatrixUtils: @staticmethod def inverse(realMatrix: 'RealMatrix', double: float) -> 'RealMatrix': ... @staticmethod - def isSymmetric(realMatrix: 'RealMatrix', double: float) -> bool: ... + def isSymmetric(realMatrix: 'RealMatrix', double: float) -> bool: + """ + Checks whether a matrix is symmetric. + + Parameters: + matrix (:class:`~org.hipparchus.linear.RealMatrix`): Matrix to check. + eps (double): Relative tolerance. + + Returns: + :code:`true` if :code:`matrix` is symmetric. + + + """ + ... @staticmethod - def matrixExponential(realMatrix: 'RealMatrix') -> 'RealMatrix': ... + def matrixExponential(realMatrix: 'RealMatrix') -> 'RealMatrix': + """ + Computes the :class:`~org.hipparchus.linear.https:.mathworld.wolfram.com.MatrixExponential` of the given matrix. The + algorithm implementation follows the Pade approximant method of + + Higham, Nicholas J. “The Scaling and Squaring Method for the Matrix Exponential Revisited.†SIAM Journal on Matrix + Analysis and Applications 26, no. 4 (January 2005): 1179–93. + + Parameters: + rm (:class:`~org.hipparchus.linear.RealMatrix`): RealMatrix whose inverse shall be computed + + Returns: + The inverse of :code:`rm` + + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if matrix is not square + + + """ + ... _orthonormalize_1__T = typing.TypeVar('_orthonormalize_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload @staticmethod @@ -364,29 +1821,232 @@ class MatrixUtils: def solveUpperTriangularSystem(realMatrix: 'RealMatrix', realVector: 'RealVector') -> None: ... class QRDecomposition: + """ + public classQRDecomposition extends :class:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Calculates the QR-decomposition of a matrix. + + The QR-decomposition of a matrix A consists of two matrices Q and R that satisfy: A = QR, Q is orthogonal (Q :sup:`T` Q + = I), and R is upper triangular. If A is m×n, Q is m×m and R m×n. + + This class compute the decomposition using Householder reflectors. + + For efficiency purposes, the decomposition in packed form is transposed. This allows inner loop to iterate inside rows, + which is much more cache-efficient in Java. + + This class is based on the class with similar name from the `JAMA <http://math.nist.gov/javanumerics/jama/>` library, + with the following changes: + + - a :meth:`~org.hipparchus.linear.QRDecomposition.getQT` method has been added, + - the :code:`solve` and :code:`isFullRank` methods have been replaced by a + :meth:`~org.hipparchus.linear.QRDecomposition.getSolver` method and the equivalent methods provided by the returned + :class:`~org.hipparchus.linear.DecompositionSolver`. + + + Also see: + + - `MathWorld <http://mathworld.wolfram.com/QRDecomposition.html>` + - `Wikipedia <http://en.wikipedia.org/wiki/QR_decomposition>` + """ @typing.overload def __init__(self, realMatrix: 'RealMatrix'): ... @typing.overload def __init__(self, realMatrix: 'RealMatrix', double: float): ... - def getH(self) -> 'RealMatrix': ... - def getQ(self) -> 'RealMatrix': ... - def getQT(self) -> 'RealMatrix': ... - def getR(self) -> 'RealMatrix': ... - def getSolver(self) -> DecompositionSolver: ... + def getH(self) -> 'RealMatrix': + """ + Returns the Householder reflector vectors. + + H is a lower trapezoidal matrix whose columns represent each successive Householder reflector vector. This matrix is + used to compute Q. + + Returns: + a matrix containing the Householder reflector vectors + + + """ + ... + def getQ(self) -> 'RealMatrix': + """ + Returns the matrix Q of the decomposition. + + Q is an orthogonal matrix + + Returns: + the Q matrix + + + """ + ... + def getQT(self) -> 'RealMatrix': + """ + Returns the transpose of the matrix Q of the decomposition. + + Q is an orthogonal matrix + + Returns: + the transpose of the Q matrix, Q :sup:`T` + + + """ + ... + def getR(self) -> 'RealMatrix': + """ + Returns the matrix R of the decomposition. + + R is an upper-triangular matrix + + Returns: + the R matrix + + + """ + ... + def getSolver(self) -> DecompositionSolver: + """ + Get a solver for finding the A × X = B solution in least square sense. + + Least Square sense means a solver can be computed for an overdetermined system, (i.e. a system with more equations than + unknowns, which corresponds to a tall A matrix with more rows than columns). In any case, if the matrix is singular + within the tolerance set at :meth:`~org.hipparchus.linear.QRDecomposition.%3Cinit%3E`, an error will be triggered when + the :meth:`~org.hipparchus.linear.DecompositionSolver.solve` method will be called. + + Returns: + a solver + + + """ + ... class RealLinearOperator: - def getColumnDimension(self) -> int: ... - def getRowDimension(self) -> int: ... - def isTransposable(self) -> bool: ... + """ + public interfaceRealLinearOperator + + This class defines a linear operator operating on real (:code:`double`) vector spaces. No direct access to the + coefficients of the underlying matrix is provided. + + The motivation for such an interface is well stated by :meth:`~org.hipparchus.linear.RealLinearOperator.BARR1994`: + We restrict ourselves to iterative methods, which work by repeatedly improving an approximate solution until it is + accurate enough. These methods access the coefficient matrix A of the linear system only via the matrix-vector product y + = A · x (and perhaps z = A :sup:`T` · x). Thus the user need only supply a subroutine for computing y (and perhaps z) + given x, which permits full exploitation of the sparsity or other special structure of A. + + Barret et al. (1994) + R. Barrett, M. Berry, T. F. Chan, J. Demmel, J. M. Donato, J. Dongarra, V. Eijkhout, R. Pozo, C. Romine and H. Van der + Vorst, *Templates for the Solution of Linear Systems: Building Blocks for Iterative Methods*, SIAM + """ + def getColumnDimension(self) -> int: + """ + Returns the dimension of the domain of this operator. + + Returns: + the number of columns of the underlying matrix + + + """ + ... + def getRowDimension(self) -> int: + """ + Returns the dimension of the codomain of this operator. + + Returns: + the number of rows of the underlying matrix + + + """ + ... + def isTransposable(self) -> bool: + """ + Returns :code:`true` if this operator supports :meth:`~org.hipparchus.linear.RealLinearOperator.operateTranspose`. + + If :code:`true` is returned, :meth:`~org.hipparchus.linear.RealLinearOperator.operateTranspose` should not throw + :code:`UnsupportedOperationException`. + + The default implementation returns :code:`false`. + + Returns: + :code:`false` + + + """ + ... def operate(self, realVector: 'RealVector') -> 'RealVector': ... def operateTranspose(self, realVector: 'RealVector') -> 'RealVector': ... class RealMatrixChangingVisitor: - def end(self) -> float: ... - def start(self, int: int, int2: int, int3: int, int4: int, int5: int, int6: int) -> None: ... - def visit(self, int: int, int2: int, double: float) -> float: ... + """ + public interfaceRealMatrixChangingVisitor + + Interface defining a visitor for matrix entries. + + Also see: + + - :class:`~org.hipparchus.linear.DefaultRealMatrixChangingVisitor` + """ + def end(self) -> float: + """ + End visiting a matrix. + + This method is called once after all entries of the matrix have been visited. + + Returns: + the value that the :code:`walkInXxxOrder` must return + + + """ + ... + def start(self, int: int, int2: int, int3: int, int4: int, int5: int, int6: int) -> None: + """ + Start visiting a matrix. + + This method is called once before any entry of the matrix is visited. + + Parameters: + rows (int): number of rows of the matrix + columns (int): number of columns of the matrix + startRow (int): Initial row index + endRow (int): Final row index (inclusive) + startColumn (int): Initial column index + endColumn (int): Final column index (inclusive) + + + """ + ... + def visit(self, int: int, int2: int, double: float) -> float: + """ + Visit one matrix entry. + + Parameters: + row (int): row index of the entry + column (int): column index of the entry + value (double): current value of the entry + + Returns: + the new value to be set for the entry + + + """ + ... class RealMatrixFormat: + """ + public classRealMatrixFormat extends :class:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Formats a :code:`nxm` matrix in components list format "{{a :sub:`0` :sub:`0` ,a :sub:`0` :sub:`1` , ..., a :sub:`0` + :sub:`m-1` },{a :sub:`1` :sub:`0` , a :sub:`1` :sub:`1` , ..., a :sub:`1` :sub:`m-1` },{...},{ a :sub:`n-1` :sub:`0` , a + :sub:`n-1` :sub:`1` , ..., a :sub:`n-1` :sub:`m-1` }}". + + The prefix and suffix "{" and "}", the row prefix and suffix "{" and "}", the row separator "," and the column separator + "," can be replaced by any user-defined strings. The number format for components can be configured. + + White space is ignored at parse time, even if it is in the prefix, suffix or separator specifications. So even if the + default separator does include a space character that is used at format time, both input string "{{1,1,1}}" and " { { 1 + , 1 , 1 } } " will be parsed without error and the same matrix will be returned. In the second case, however, the parse + position after parsing will be just after the closing curly brace, i.e. just before the trailing space. + + **Note:** the grouping functionality of the used + :class:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.text.NumberFormat` is disabled to prevent + problems when parsing (e.g. 1,345.34 would be a valid number but conflicts with the default column separator). + """ @typing.overload def __init__(self): ... @typing.overload @@ -396,91 +2056,690 @@ class RealMatrixFormat: @typing.overload def __init__(self, numberFormat: java.text.NumberFormat): ... @typing.overload - def format(self, realMatrix: 'RealMatrix') -> str: ... + def format(self, realMatrix: 'RealMatrix') -> str: + """ + This method calls :meth:`~org.hipparchus.linear.RealMatrixFormat.format`. + + Parameters: + m (:class:`~org.hipparchus.linear.RealMatrix`): RealMatrix object to format. + + Returns: + a formatted matrix. + + Formats a :class:`~org.hipparchus.linear.RealMatrix` object to produce a string. + + Parameters: + matrix (:class:`~org.hipparchus.linear.RealMatrix`): the object to format. + toAppendTo (:class:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.StringBuffer`): where the text is to be appended + pos (:class:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.text.FieldPosition`): On input: an alignment field, if desired. On output: the offsets of the alignment field + + Returns: + the value passed in as toAppendTo. + + + """ + ... @typing.overload def format(self, realMatrix: 'RealMatrix', stringBuffer: java.lang.StringBuffer, fieldPosition: java.text.FieldPosition) -> java.lang.StringBuffer: ... @staticmethod - def getAvailableLocales() -> typing.MutableSequence[java.util.Locale]: ... - def getColumnSeparator(self) -> str: ... - def getFormat(self) -> java.text.NumberFormat: ... - def getPrefix(self) -> str: ... + def getAvailableLocales() -> typing.MutableSequence[java.util.Locale]: + """ + Get the set of locales for which real vectors formats are available. + + This is the same set as the + :class:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.text.NumberFormat` set. + + Returns: + available real vector format locales. + + + """ + ... + def getColumnSeparator(self) -> str: + """ + Get the format separator between components. + + Returns: + format separator between components. + + + """ + ... + def getFormat(self) -> java.text.NumberFormat: + """ + Get the components format. + + Returns: + components format. + + + """ + ... + def getPrefix(self) -> str: + """ + Get the format prefix. + + Returns: + format prefix. + + + """ + ... @typing.overload @staticmethod - def getRealMatrixFormat() -> 'RealMatrixFormat': ... + def getRealMatrixFormat() -> 'RealMatrixFormat': + """ + Returns the default real vector format for the current locale. + + Returns: + the default real vector format. + + Since: + 1.4 + + """ + ... @typing.overload @staticmethod - def getRealMatrixFormat(locale: java.util.Locale) -> 'RealMatrixFormat': ... - def getRowPrefix(self) -> str: ... - def getRowSeparator(self) -> str: ... - def getRowSuffix(self) -> str: ... - def getSuffix(self) -> str: ... - @typing.overload - def parse(self, string: str) -> 'RealMatrix': ... + def getRealMatrixFormat(locale: java.util.Locale) -> 'RealMatrixFormat': + """ + Returns the default real vector format for the given locale. + + Parameters: + locale (:class:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.util.Locale`): the specific locale used by the format. + + Returns: + the real vector format specific to the given locale. + + Since: + 1.4 + + + """ + ... + def getRowPrefix(self) -> str: + """ + Get the format prefix. + + Returns: + format prefix. + + + """ + ... + def getRowSeparator(self) -> str: + """ + Get the format separator between rows of the matrix. + + Returns: + format separator for rows. + + + """ + ... + def getRowSuffix(self) -> str: + """ + Get the format suffix. + + Returns: + format suffix. + + + """ + ... + def getSuffix(self) -> str: + """ + Get the format suffix. + + Returns: + format suffix. + + + """ + ... + @typing.overload + def parse(self, string: str) -> 'RealMatrix': + """ + Parse a string to produce a :class:`~org.hipparchus.linear.RealMatrix` object. + + Parameters: + source (:class:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.String`): String to parse. + + Returns: + the parsed :class:`~org.hipparchus.linear.RealMatrix` object. + + Raises: + :class:`~org.hipparchus.exception.MathIllegalStateException`: if the beginning of the specified string cannot be parsed. + + Parse a string to produce a :class:`~org.hipparchus.linear.RealMatrix` object. + + Parameters: + source (:class:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.String`): String to parse. + pos (:class:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.text.ParsePosition`): input/ouput parsing parameter. + + Returns: + the parsed :class:`~org.hipparchus.linear.RealMatrix` object. + + + """ + ... @typing.overload def parse(self, string: str, parsePosition: java.text.ParsePosition) -> 'RealMatrix': ... class RealMatrixPreservingVisitor: - def end(self) -> float: ... - def start(self, int: int, int2: int, int3: int, int4: int, int5: int, int6: int) -> None: ... - def visit(self, int: int, int2: int, double: float) -> None: ... + """ + public interfaceRealMatrixPreservingVisitor + + Interface defining a visitor for matrix entries. + + Also see: + + - :class:`~org.hipparchus.linear.DefaultRealMatrixPreservingVisitor` + """ + def end(self) -> float: + """ + End visiting a matrix. + + This method is called once after all entries of the matrix have been visited. + + Returns: + the value that the :code:`walkInXxxOrder` must return + + + """ + ... + def start(self, int: int, int2: int, int3: int, int4: int, int5: int, int6: int) -> None: + """ + Start visiting a matrix. + + This method is called once before any entry of the matrix is visited. + + Parameters: + rows (int): number of rows of the matrix + columns (int): number of columns of the matrix + startRow (int): Initial row index + endRow (int): Final row index (inclusive) + startColumn (int): Initial column index + endColumn (int): Final column index (inclusive) + + + """ + ... + def visit(self, int: int, int2: int, double: float) -> None: + """ + Visit one matrix entry. + + Parameters: + row (int): row index of the entry + column (int): column index of the entry + value (double): current value of the entry + + + """ + ... class RealVector: + """ + public abstract classRealVector extends :class:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Class defining a real-valued vector with basic algebraic operations. + + vector element indexing is 0-based -- e.g., :code:`getEntry(0)` returns the first element of the vector. + + The :code:`code map` and :code:`mapToSelf` methods operate on vectors element-wise, i.e. they perform the same operation + (adding a scalar, applying a function ...) on each element in turn. The :code:`map` versions create a new vector to hold + the result and do not change the instance. The :code:`mapToSelf` version uses the instance itself to store the results, + so the instance is changed by this method. In all cases, the result vector is returned by the methods, allowing the + *fluent API* style, like this: + + .. code-block: java + + RealVector result = v.mapAddToSelf(3.4).mapToSelf(new Tan()).mapToSelf(new Power(2.3)); + """ def __init__(self): ... def add(self, realVector: 'RealVector') -> 'RealVector': ... def addToEntry(self, int: int, double: float) -> None: ... @typing.overload - def append(self, double: float) -> 'RealVector': ... + def append(self, double: float) -> 'RealVector': + """ + Construct a new vector by appending a vector to this vector. + + Parameters: + v (:class:`~org.hipparchus.linear.RealVector`): vector to append to this one. + + Returns: + a new vector. + + Construct a new vector by appending a double to this vector. + + Parameters: + d (double): double to append. + + Returns: + a new vector. + + + """ + ... @typing.overload def append(self, realVector: 'RealVector') -> 'RealVector': ... def combine(self, double: float, double2: float, realVector: 'RealVector') -> 'RealVector': ... def combineToSelf(self, double: float, double2: float, realVector: 'RealVector') -> 'RealVector': ... - def copy(self) -> 'RealVector': ... + def copy(self) -> 'RealVector': + """ + Returns a (deep) copy of this vector. + + Returns: + a vector copy. + + + """ + ... def cosine(self, realVector: 'RealVector') -> float: ... def dotProduct(self, realVector: 'RealVector') -> float: ... def ebeDivide(self, realVector: 'RealVector') -> 'RealVector': ... def ebeMultiply(self, realVector: 'RealVector') -> 'RealVector': ... def equals(self, object: typing.Any) -> bool: ... - def getDimension(self) -> int: ... + def getDimension(self) -> int: + """ + Returns the size of the vector. + + Returns: + the size of this vector. + + + """ + ... def getDistance(self, realVector: 'RealVector') -> float: ... def getEntry(self, int: int) -> float: ... def getL1Distance(self, realVector: 'RealVector') -> float: ... - def getL1Norm(self) -> float: ... + def getL1Norm(self) -> float: + """ + Returns the L :sub:`1` norm of the vector. + + The L :sub:`1` norm is the sum of the absolute values of the elements. + + Returns: + the norm. + + Also see: + + - :meth:`~org.hipparchus.linear.RealVector.getNorm` + - :meth:`~org.hipparchus.linear.RealVector.getLInfNorm` + - :meth:`~org.hipparchus.linear.RealVector.getL1Distance` + + + + """ + ... def getLInfDistance(self, realVector: 'RealVector') -> float: ... - def getLInfNorm(self) -> float: ... - def getMaxIndex(self) -> int: ... - def getMaxValue(self) -> float: ... - def getMinIndex(self) -> int: ... - def getMinValue(self) -> float: ... - def getNorm(self) -> float: ... + def getLInfNorm(self) -> float: + """ + Returns the L :sub:`∞` norm of the vector. + + The L :sub:`∞` norm is the max of the absolute values of the elements. + + Returns: + the norm. + + Also see: + + - :meth:`~org.hipparchus.linear.RealVector.getNorm` + - :meth:`~org.hipparchus.linear.RealVector.getL1Norm` + - :meth:`~org.hipparchus.linear.RealVector.getLInfDistance` + + + + """ + ... + def getMaxIndex(self) -> int: + """ + Get the index of the maximum entry. + + Returns: + the index of the maximum entry or -1 if vector length is 0 or all entries are :code:`NaN` + + + """ + ... + def getMaxValue(self) -> float: + """ + Get the value of the maximum entry. + + Returns: + the value of the maximum entry or :code:`NaN` if all entries are :code:`NaN`. + + + """ + ... + def getMinIndex(self) -> int: + """ + Get the index of the minimum entry. + + Returns: + the index of the minimum entry or -1 if vector length is 0 or all entries are :code:`NaN`. + + + """ + ... + def getMinValue(self) -> float: + """ + Get the value of the minimum entry. + + Returns: + the value of the minimum entry or :code:`NaN` if all entries are :code:`NaN`. + + + """ + ... + def getNorm(self) -> float: + """ + Returns the L :sub:`2` norm of the vector. + + The L :sub:`2` norm is the root of the sum of the squared elements. + + Returns: + the norm. + + Also see: + + - :meth:`~org.hipparchus.linear.RealVector.getL1Norm` + - :meth:`~org.hipparchus.linear.RealVector.getLInfNorm` + - :meth:`~org.hipparchus.linear.RealVector.getDistance` + + + + """ + ... def getSubVector(self, int: int, int2: int) -> 'RealVector': ... def hashCode(self) -> int: ... - def isInfinite(self) -> bool: ... - def isNaN(self) -> bool: ... + def isInfinite(self) -> bool: + """ + Check whether any coordinate of this vector is infinite and none are :code:`NaN`. + + Returns: + :code:`true` if any coordinate of this vector is infinite and none are :code:`NaN`, :code:`false` otherwise. + + + """ + ... + def isNaN(self) -> bool: + """ + Check whether any coordinate of this vector is :code:`NaN`. + + Returns: + :code:`true` if any coordinate of this vector is :code:`NaN`, :code:`false` otherwise. + + + """ + ... def iterator(self) -> java.util.Iterator['RealVector.Entry']: ... - def map(self, univariateFunction: typing.Union[org.hipparchus.analysis.UnivariateFunction, typing.Callable]) -> 'RealVector': ... - def mapAdd(self, double: float) -> 'RealVector': ... - def mapAddToSelf(self, double: float) -> 'RealVector': ... - def mapDivide(self, double: float) -> 'RealVector': ... - def mapDivideToSelf(self, double: float) -> 'RealVector': ... - def mapMultiply(self, double: float) -> 'RealVector': ... - def mapMultiplyToSelf(self, double: float) -> 'RealVector': ... - def mapSubtract(self, double: float) -> 'RealVector': ... - def mapSubtractToSelf(self, double: float) -> 'RealVector': ... - def mapToSelf(self, univariateFunction: typing.Union[org.hipparchus.analysis.UnivariateFunction, typing.Callable]) -> 'RealVector': ... - def outerProduct(self, realVector: 'RealVector') -> 'RealMatrix': ... + def map(self, univariateFunction: typing.Union[org.hipparchus.analysis.UnivariateFunction, typing.Callable]) -> 'RealVector': + """ + Acts as if implemented as: + + .. code-block: java + + return copy().mapToSelf(function); + + Returns a new vector. Does not change instance data. + + Parameters: + function (:class:`~org.hipparchus.analysis.UnivariateFunction`): Function to apply to each entry. + + Returns: + a new vector. + + + """ + ... + def mapAdd(self, double: float) -> 'RealVector': + """ + Add a value to each entry. Returns a new vector. Does not change instance data. + + Parameters: + d (double): Value to be added to each entry. + + Returns: + :code:`this` + :code:`d`. + + + """ + ... + def mapAddToSelf(self, double: float) -> 'RealVector': + """ + Add a value to each entry. The instance is changed in-place. + + Parameters: + d (double): Value to be added to each entry. + + Returns: + :code:`this`. + + + """ + ... + def mapDivide(self, double: float) -> 'RealVector': + """ + Divide each entry by the argument. Returns a new vector. Does not change instance data. + + Parameters: + d (double): Value to divide by. + + Returns: + :code:`this` / :code:`d`. + + + """ + ... + def mapDivideToSelf(self, double: float) -> 'RealVector': + """ + Divide each entry by the argument. The instance is changed in-place. + + Parameters: + d (double): Value to divide by. + + Returns: + :code:`this`. + + + """ + ... + def mapMultiply(self, double: float) -> 'RealVector': + """ + Multiply each entry by the argument. Returns a new vector. Does not change instance data. + + Parameters: + d (double): Multiplication factor. + + Returns: + :code:`this` * :code:`d`. + + + """ + ... + def mapMultiplyToSelf(self, double: float) -> 'RealVector': + """ + Multiply each entry. The instance is changed in-place. + + Parameters: + d (double): Multiplication factor. + + Returns: + :code:`this`. + + + """ + ... + def mapSubtract(self, double: float) -> 'RealVector': + """ + Subtract a value from each entry. Returns a new vector. Does not change instance data. + + Parameters: + d (double): Value to be subtracted. + + Returns: + :code:`this` - :code:`d`. + + + """ + ... + def mapSubtractToSelf(self, double: float) -> 'RealVector': + """ + Subtract a value from each entry. The instance is changed in-place. + + Parameters: + d (double): Value to be subtracted. + + Returns: + :code:`this`. + + + """ + ... + def mapToSelf(self, univariateFunction: typing.Union[org.hipparchus.analysis.UnivariateFunction, typing.Callable]) -> 'RealVector': + """ + Acts as if it is implemented as: + + .. code-block: java + + Entry e = null; + for(Iterator<Entry> it = iterator(); it.hasNext(); e = it.next()) { + e.setValue(function.value(e.getValue())); + } + + Entries of this vector are modified in-place by this method. + + Parameters: + function (:class:`~org.hipparchus.analysis.UnivariateFunction`): Function to apply to each entry. + + Returns: + a reference to this vector. + + + """ + ... + def outerProduct(self, realVector: 'RealVector') -> 'RealMatrix': + """ + Compute the outer product. + + Parameters: + v (:class:`~org.hipparchus.linear.RealVector`): Vector with which outer product should be computed. + + Returns: + the matrix outer product between this instance and :code:`v`. + + + """ + ... def projection(self, realVector: 'RealVector') -> 'RealVector': ... - def set(self, double: float) -> None: ... + def set(self, double: float) -> None: + """ + Set all elements to a single value. + + Parameters: + value (double): Single value to set for all elements. + + + """ + ... def setEntry(self, int: int, double: float) -> None: ... def setSubVector(self, int: int, realVector: 'RealVector') -> None: ... def sparseIterator(self) -> java.util.Iterator['RealVector.Entry']: ... def subtract(self, realVector: 'RealVector') -> 'RealVector': ... - def toArray(self) -> typing.MutableSequence[float]: ... + def toArray(self) -> typing.MutableSequence[float]: + """ + Convert the vector to an array of :code:`double`s. The array is independent from this vector data: the elements are + copied. + + Returns: + an array containing a copy of the vector elements. + + + """ + ... def unitVector(self) -> 'RealVector': ... def unitize(self) -> None: ... @staticmethod - def unmodifiableRealVector(realVector: 'RealVector') -> 'RealVector': ... - @typing.overload - def walkInDefaultOrder(self, realVectorChangingVisitor: 'RealVectorChangingVisitor') -> float: ... + def unmodifiableRealVector(realVector: 'RealVector') -> 'RealVector': + """ + Returns an unmodifiable view of the specified vector. The returned vector has read-only access. An attempt to modify it + will result in a :class:`~org.hipparchus.exception.MathRuntimeException`. However, the returned vector is *not* + immutable, since any modification of :code:`v` will also change the returned view. For example, in the following piece + of code + + .. code-block: java + + RealVector v = new ArrayRealVector(2); + RealVector w = RealVector.unmodifiableRealVector(v); + v.setEntry(0, 1.2); + v.setEntry(1, -3.4); + + the changes will be seen in the :code:`w` view of :code:`v`. + + Parameters: + v (:class:`~org.hipparchus.linear.RealVector`): Vector for which an unmodifiable view is to be returned. + + Returns: + an unmodifiable view of :code:`v`. + + + """ + ... + @typing.overload + def walkInDefaultOrder(self, realVectorChangingVisitor: 'RealVectorChangingVisitor') -> float: + """ + Visits (but does not alter) all entries of this vector in default order (increasing index). + + Parameters: + visitor (:class:`~org.hipparchus.linear.RealVectorPreservingVisitor`): the visitor to be used to process the entries of this vector + + Returns: + the value returned by :meth:`~org.hipparchus.linear.RealVectorPreservingVisitor.end` at the end of the walk + + public double walkInDefaultOrder(:class:`~org.hipparchus.linear.RealVectorPreservingVisitor` visitor, int start, int end) throws :class:`~org.hipparchus.exception.MathIllegalArgumentException` + + Visits (but does not alter) some entries of this vector in default order (increasing index). + + Parameters: + visitor (:class:`~org.hipparchus.linear.RealVectorPreservingVisitor`): visitor to be used to process the entries of this vector + start (int): the index of the first entry to be visited + end (int): the index of the last entry to be visited (inclusive) + + Returns: + the value returned by :meth:`~org.hipparchus.linear.RealVectorPreservingVisitor.end` at the end of the walk + + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if :code:`end < start`. + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if the indices are not valid. + + Visits (and possibly alters) all entries of this vector in default order (increasing index). + + Parameters: + visitor (:class:`~org.hipparchus.linear.RealVectorChangingVisitor`): the visitor to be used to process and modify the entries of this vector + + Returns: + the value returned by :meth:`~org.hipparchus.linear.RealVectorChangingVisitor.end` at the end of the walk + + public double walkInDefaultOrder(:class:`~org.hipparchus.linear.RealVectorChangingVisitor` visitor, int start, int end) throws :class:`~org.hipparchus.exception.MathIllegalArgumentException` + + Visits (and possibly alters) some entries of this vector in default order (increasing index). + + Parameters: + visitor (:class:`~org.hipparchus.linear.RealVectorChangingVisitor`): visitor to be used to process the entries of this vector + start (int): the index of the first entry to be visited + end (int): the index of the last entry to be visited (inclusive) + + Returns: + the value returned by :meth:`~org.hipparchus.linear.RealVectorChangingVisitor.end` at the end of the walk + + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if :code:`end < start`. + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if the indices are not valid. + + + """ + ... @typing.overload def walkInDefaultOrder(self, realVectorChangingVisitor: 'RealVectorChangingVisitor', int: int, int2: int) -> float: ... @typing.overload @@ -488,7 +2747,67 @@ class RealVector: @typing.overload def walkInDefaultOrder(self, realVectorPreservingVisitor: 'RealVectorPreservingVisitor', int: int, int2: int) -> float: ... @typing.overload - def walkInOptimizedOrder(self, realVectorChangingVisitor: 'RealVectorChangingVisitor') -> float: ... + def walkInOptimizedOrder(self, realVectorChangingVisitor: 'RealVectorChangingVisitor') -> float: + """ + Visits (but does not alter) all entries of this vector in optimized order. The order in which the entries are visited is + selected so as to lead to the most efficient implementation; it might depend on the concrete implementation of this + abstract class. + + Parameters: + visitor (:class:`~org.hipparchus.linear.RealVectorPreservingVisitor`): the visitor to be used to process the entries of this vector + + Returns: + the value returned by :meth:`~org.hipparchus.linear.RealVectorPreservingVisitor.end` at the end of the walk + + public double walkInOptimizedOrder(:class:`~org.hipparchus.linear.RealVectorPreservingVisitor` visitor, int start, int end) throws :class:`~org.hipparchus.exception.MathIllegalArgumentException` + + Visits (but does not alter) some entries of this vector in optimized order. The order in which the entries are visited + is selected so as to lead to the most efficient implementation; it might depend on the concrete implementation of this + abstract class. + + Parameters: + visitor (:class:`~org.hipparchus.linear.RealVectorPreservingVisitor`): visitor to be used to process the entries of this vector + start (int): the index of the first entry to be visited + end (int): the index of the last entry to be visited (inclusive) + + Returns: + the value returned by :meth:`~org.hipparchus.linear.RealVectorPreservingVisitor.end` at the end of the walk + + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if :code:`end < start`. + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if the indices are not valid. + + Visits (and possibly alters) all entries of this vector in optimized order. The order in which the entries are visited + is selected so as to lead to the most efficient implementation; it might depend on the concrete implementation of this + abstract class. + + Parameters: + visitor (:class:`~org.hipparchus.linear.RealVectorChangingVisitor`): the visitor to be used to process the entries of this vector + + Returns: + the value returned by :meth:`~org.hipparchus.linear.RealVectorChangingVisitor.end` at the end of the walk + + public double walkInOptimizedOrder(:class:`~org.hipparchus.linear.RealVectorChangingVisitor` visitor, int start, int end) throws :class:`~org.hipparchus.exception.MathIllegalArgumentException` + + Visits (and possibly change) some entries of this vector in optimized order. The order in which the entries are visited + is selected so as to lead to the most efficient implementation; it might depend on the concrete implementation of this + abstract class. + + Parameters: + visitor (:class:`~org.hipparchus.linear.RealVectorChangingVisitor`): visitor to be used to process the entries of this vector + start (int): the index of the first entry to be visited + end (int): the index of the last entry to be visited (inclusive) + + Returns: + the value returned by :meth:`~org.hipparchus.linear.RealVectorChangingVisitor.end` at the end of the walk + + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if :code:`end < start`. + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if the indices are not valid. + + + """ + ... @typing.overload def walkInOptimizedOrder(self, realVectorChangingVisitor: 'RealVectorChangingVisitor', int: int, int2: int) -> float: ... @typing.overload @@ -503,11 +2822,66 @@ class RealVector: def setValue(self, double: float) -> None: ... class RealVectorChangingVisitor: - def end(self) -> float: ... - def start(self, int: int, int2: int, int3: int) -> None: ... - def visit(self, int: int, double: float) -> float: ... + """ + public interfaceRealVectorChangingVisitor + + This interface defines a visitor for the entries of a vector. Visitors implementing this interface may alter the entries + of the vector being visited. + """ + def end(self) -> float: + """ + End visiting a vector. This method is called once, after all entries of the vector have been visited. + + Returns: + the value returned by :meth:`~org.hipparchus.linear.RealVector.walkInDefaultOrder`, + :meth:`~org.hipparchus.linear.RealVector.walkInDefaultOrder`, + :meth:`~org.hipparchus.linear.RealVector.walkInOptimizedOrder` or + :meth:`~org.hipparchus.linear.RealVector.walkInOptimizedOrder` + + + """ + ... + def start(self, int: int, int2: int, int3: int) -> None: + """ + Start visiting a vector. This method is called once, before any entry of the vector is visited. + + Parameters: + dimension (int): the size of the vector + start (int): the index of the first entry to be visited + end (int): the index of the last entry to be visited (inclusive) + + + """ + ... + def visit(self, int: int, double: float) -> float: + """ + Visit one entry of the vector. + + Parameters: + index (int): the index of the entry being visited + value (double): the value of the entry being visited + + Returns: + the new value of the entry being visited + + + """ + ... class RealVectorFormat: + """ + public classRealVectorFormat extends :class:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Formats a vector in components list format "{v0; v1; ...; vk-1}". + + The prefix and suffix "{" and "}" and the separator "; " can be replaced by any user-defined strings. The number format + for components can be configured. + + White space is ignored at parse time, even if it is in the prefix, suffix or separator specifications. So even if the + default separator does include a space character that is used at format time, both input string "{1;1;1}" and " { 1 ; 1 + ; 1 } " will be parsed without error and the same vector will be returned. In the second case, however, the parse + position after parsing will be just after the closing curly brace, i.e. just before the trailing space. + """ @typing.overload def __init__(self): ... @typing.overload @@ -517,78 +2891,615 @@ class RealVectorFormat: @typing.overload def __init__(self, numberFormat: java.text.NumberFormat): ... @typing.overload - def format(self, realVector: RealVector) -> str: ... + def format(self, realVector: RealVector) -> str: + """ + This method calls :meth:`~org.hipparchus.linear.RealVectorFormat.format`. + + Parameters: + v (:class:`~org.hipparchus.linear.RealVector`): RealVector object to format. + + Returns: + a formatted vector. + + Formats a :class:`~org.hipparchus.linear.RealVector` object to produce a string. + + Parameters: + vector (:class:`~org.hipparchus.linear.RealVector`): the object to format. + toAppendTo (:class:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.StringBuffer`): where the text is to be appended + pos (:class:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.text.FieldPosition`): On input: an alignment field, if desired. On output: the offsets of the alignment field + + Returns: + the value passed in as toAppendTo. + + + """ + ... @typing.overload def format(self, realVector: RealVector, stringBuffer: java.lang.StringBuffer, fieldPosition: java.text.FieldPosition) -> java.lang.StringBuffer: ... @staticmethod - def getAvailableLocales() -> typing.MutableSequence[java.util.Locale]: ... - def getFormat(self) -> java.text.NumberFormat: ... - def getPrefix(self) -> str: ... + def getAvailableLocales() -> typing.MutableSequence[java.util.Locale]: + """ + Get the set of locales for which real vectors formats are available. + + This is the same set as the + :class:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.text.NumberFormat` set. + + Returns: + available real vector format locales. + + + """ + ... + def getFormat(self) -> java.text.NumberFormat: + """ + Get the components format. + + Returns: + components format. + + + """ + ... + def getPrefix(self) -> str: + """ + Get the format prefix. + + Returns: + format prefix. + + + """ + ... @typing.overload @staticmethod - def getRealVectorFormat() -> 'RealVectorFormat': ... + def getRealVectorFormat() -> 'RealVectorFormat': + """ + Returns the default real vector format for the current locale. + + Returns: + the default real vector format. + + Since: + 1.4 + + """ + ... @typing.overload @staticmethod - def getRealVectorFormat(locale: java.util.Locale) -> 'RealVectorFormat': ... - def getSeparator(self) -> str: ... - def getSuffix(self) -> str: ... - @typing.overload - def parse(self, string: str) -> 'ArrayRealVector': ... + def getRealVectorFormat(locale: java.util.Locale) -> 'RealVectorFormat': + """ + Returns the default real vector format for the given locale. + + Parameters: + locale (:class:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.util.Locale`): the specific locale used by the format. + + Returns: + the real vector format specific to the given locale. + + Since: + 1.4 + + + """ + ... + def getSeparator(self) -> str: + """ + Get the format separator between components. + + Returns: + format separator. + + + """ + ... + def getSuffix(self) -> str: + """ + Get the format suffix. + + Returns: + format suffix. + + + """ + ... + @typing.overload + def parse(self, string: str) -> 'ArrayRealVector': + """ + Parse a string to produce a :class:`~org.hipparchus.linear.RealVector` object. + + Parameters: + source (:class:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.String`): String to parse. + + Returns: + the parsed :class:`~org.hipparchus.linear.RealVector` object. + + Raises: + :class:`~org.hipparchus.exception.MathIllegalStateException`: if the beginning of the specified string cannot be parsed. + + Parse a string to produce a :class:`~org.hipparchus.linear.RealVector` object. + + Parameters: + source (:class:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.String`): String to parse. + pos (:class:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.text.ParsePosition`): input/ouput parsing parameter. + + Returns: + the parsed :class:`~org.hipparchus.linear.RealVector` object. + + + """ + ... @typing.overload def parse(self, string: str, parsePosition: java.text.ParsePosition) -> 'ArrayRealVector': ... class RealVectorPreservingVisitor: - def end(self) -> float: ... - def start(self, int: int, int2: int, int3: int) -> None: ... - def visit(self, int: int, double: float) -> None: ... + """ + public interfaceRealVectorPreservingVisitor + + This interface defines a visitor for the entries of a vector. Visitors implementing this interface do not alter the + entries of the vector being visited. + """ + def end(self) -> float: + """ + End visiting a vector. This method is called once, after all entries of the vector have been visited. + + Returns: + the value returned by :meth:`~org.hipparchus.linear.RealVector.walkInDefaultOrder`, + :meth:`~org.hipparchus.linear.RealVector.walkInDefaultOrder`, + :meth:`~org.hipparchus.linear.RealVector.walkInOptimizedOrder` or + :meth:`~org.hipparchus.linear.RealVector.walkInOptimizedOrder` + + + """ + ... + def start(self, int: int, int2: int, int3: int) -> None: + """ + Start visiting a vector. This method is called once, before any entry of the vector is visited. + + Parameters: + dimension (int): the size of the vector + start (int): the index of the first entry to be visited + end (int): the index of the last entry to be visited (inclusive) + + + """ + ... + def visit(self, int: int, double: float) -> None: + """ + Visit one entry of the vector. + + Parameters: + index (int): the index of the entry being visited + value (double): the value of the entry being visited + + + """ + ... class RectangularCholeskyDecomposition: + """ + public classRectangularCholeskyDecomposition extends :class:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Calculates the rectangular Cholesky decomposition of a matrix. + + The rectangular Cholesky decomposition of a real symmetric positive semidefinite matrix A consists of a rectangular + matrix B with the same number of rows such that: A is almost equal to BB :sup:`T` , depending on a user-defined + tolerance. In a sense, this is the square root of A. + + The difference with respect to the regular :class:`~org.hipparchus.linear.CholeskyDecomposition` is that rows/columns + may be permuted (hence the rectangular shape instead of the traditional triangular shape) and there is a threshold to + ignore small diagonal elements. This is used for example to generate + :class:`~org.hipparchus.random.CorrelatedRandomVectorGenerator` in a p-dimension subspace (p < n). In other words, it + allows generating random vectors from a covariance matrix that is only positive semidefinite, and not positive definite. + + Rectangular Cholesky decomposition is *not* suited for solving linear systems, so it does not provide any + :class:`~org.hipparchus.linear.DecompositionSolver`. + + Also see: + + - `MathWorld <http://mathworld.wolfram.com/CholeskyDecomposition.html>` + - `Wikipedia <http://en.wikipedia.org/wiki/Cholesky_decomposition>` + """ @typing.overload def __init__(self, realMatrix: 'RealMatrix'): ... @typing.overload def __init__(self, realMatrix: 'RealMatrix', double: float): ... - def getRank(self) -> int: ... - def getRootMatrix(self) -> 'RealMatrix': ... + def getRank(self) -> int: + """ + Get the rank of the symmetric positive semidefinite matrix. The r is the number of independent rows in the symmetric + positive semidefinite matrix, it is also the number of columns of the rectangular matrix of the decomposition. + + Returns: + r of the square matrix. + + Also see: + + - :meth:`~org.hipparchus.linear.RectangularCholeskyDecomposition.getRootMatrix` + + + + """ + ... + def getRootMatrix(self) -> 'RealMatrix': + """ + Get the root of the covariance matrix. The root is the rectangular matrix :code:`B` such that the covariance matrix is + equal to :code:`B.B :sup:`T`` + + Returns: + root of the square matrix + + Also see: + + - :meth:`~org.hipparchus.linear.RectangularCholeskyDecomposition.getRank` + + + + """ + ... class RiccatiEquationSolver: - def getK(self) -> 'RealMatrix': ... - def getP(self) -> 'RealMatrix': ... + """ + public interfaceRiccatiEquationSolver + + An algebraic Riccati equation is a type of nonlinear equation that arises in the context of infinite-horizon optimal + control problems in continuous time or discrete time. The continuous time algebraic Riccati equation (CARE): \[ + A^{T}X+XA-XBR^{-1}B^{T}X+Q=0 \} And the respective linear controller is: \[ K = R^{-1}B^{T}P \] A solver receives A, B, + Q and R and computes P and K. + """ + def getK(self) -> 'RealMatrix': + """ + Get the linear controller k. + + Returns: + the linear controller k + + + """ + ... + def getP(self) -> 'RealMatrix': + """ + Get the solution. + + Returns: + the p + + + """ + ... class SchurTransformer: + """ + public classSchurTransformer extends :class:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Class transforming a general real matrix to Schur form. + + A m × m matrix A can be written as the product of three matrices: A = P × T × P :sup:`T` with P an orthogonal matrix + and T an quasi-triangular matrix. Both P and T are m × m matrices. + + Transformation to Schur form is often not a goal by itself, but it is an intermediate step in more general decomposition + algorithms like :class:`~org.hipparchus.linear.EigenDecompositionSymmetric`. This class is therefore intended for expert + use. As a consequence of this explicitly limited scope, many methods directly returns references to internal arrays, not + copies. + + This class is based on the method hqr2 in class EigenvalueDecomposition from the `JAMA + <http://math.nist.gov/javanumerics/jama/>` library. + + Also see: + + - `Schur Decomposition - MathWorld <http://mathworld.wolfram.com/SchurDecomposition.html>` + - `Schur Decomposition - Wikipedia <http://en.wikipedia.org/wiki/Schur_decomposition>` + - `Householder Transformations <http://en.wikipedia.org/wiki/Householder_transformation>` + """ @typing.overload def __init__(self, realMatrix: 'RealMatrix'): ... @typing.overload def __init__(self, realMatrix: 'RealMatrix', double: float): ... - def getP(self) -> 'RealMatrix': ... - def getPT(self) -> 'RealMatrix': ... - def getT(self) -> 'RealMatrix': ... + def getP(self) -> 'RealMatrix': + """ + Returns the matrix P of the transform. + + P is an orthogonal matrix, i.e. its inverse is also its transpose. + + Returns: + the P matrix + + + """ + ... + def getPT(self) -> 'RealMatrix': + """ + Returns the transpose of the matrix P of the transform. + + P is an orthogonal matrix, i.e. its inverse is also its transpose. + + Returns: + the transpose of the P matrix + + + """ + ... + def getT(self) -> 'RealMatrix': + """ + Returns the quasi-triangular Schur matrix T of the transform. + + Returns: + the T matrix + + + """ + ... class SemiDefinitePositiveCholeskyDecomposition: + """ + public classSemiDefinitePositiveCholeskyDecomposition extends :class:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Calculates the Cholesky decomposition of a positive semidefinite matrix. + + The classic Cholesky decomposition (:class:`~org.hipparchus.linear.CholeskyDecomposition`) applies to real symmetric + positive-definite matrix. This class extends the Cholesky decomposition to positive semidefinite matrix. The main + application is for estimation based on the Unscented Kalman Filter. + + Since: + 2.2 + + Also see: + + - "J. Hartikainen, A. Solin, and S. Särkkä. Optimal ï¬ltering with Kalman ï¬lters and smoothers, Dept. of Biomedica + Engineering and Computational Sciences, Aalto University School of Science, Aug. 2011." + """ POSITIVITY_THRESHOLD: typing.ClassVar[float] = ... + """ + public static final double POSITIVITY_THRESHOLD + + Default threshold below which elements are not considered positive. + + Also see: + + - :meth:`~constant` + + + + """ @typing.overload def __init__(self, realMatrix: 'RealMatrix'): ... @typing.overload def __init__(self, realMatrix: 'RealMatrix', double: float): ... - def getL(self) -> 'RealMatrix': ... - def getLT(self) -> 'RealMatrix': ... + def getL(self) -> 'RealMatrix': + """ + Returns the matrix L of the decomposition. + + L is an lower-triangular matrix + + Returns: + the L matrix + + + """ + ... + def getLT(self) -> 'RealMatrix': + """ + Returns the transpose of the matrix L of the decomposition. + + L :sup:`T` is an upper-triangular matrix + + Returns: + the transpose of the matrix L of the decomposition + + + """ + ... class SingularValueDecomposition: + """ + public classSingularValueDecomposition extends :class:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Calculates the compact Singular Value Decomposition of a matrix. + + The Singular Value Decomposition of matrix A is a set of three matrices: U, Σ and V such that A = U × Σ × V :sup:`T` + . Let A be a m × n matrix, then U is a m × p orthogonal matrix, Σ is a p × p diagonal matrix with positive or null + elements, V is a p × n orthogonal matrix (hence V :sup:`T` is also orthogonal) where p=min(m,n). + + This class is similar to the class with similar name from the `JAMA <http://math.nist.gov/javanumerics/jama/>` library, + with the following changes: + + - the :code:`norm2` method which has been renamed as :meth:`~org.hipparchus.linear.SingularValueDecomposition.getNorm`, + - the :code:`cond` method which has been renamed as + :meth:`~org.hipparchus.linear.SingularValueDecomposition.getConditionNumber`, + - the :code:`rank` method which has been renamed as :meth:`~org.hipparchus.linear.SingularValueDecomposition.getRank`, + - a :meth:`~org.hipparchus.linear.SingularValueDecomposition.getUT` method has been added, + - a :meth:`~org.hipparchus.linear.SingularValueDecomposition.getVT` method has been added, + - a :meth:`~org.hipparchus.linear.SingularValueDecomposition.getSolver` method has been added, + - a :meth:`~org.hipparchus.linear.SingularValueDecomposition.getCovariance` method has been added. + + + Also see: + + - `MathWorld <http://mathworld.wolfram.com/SingularValueDecomposition.html>` + - `Wikipedia <http://en.wikipedia.org/wiki/Singular_value_decomposition>` + """ def __init__(self, realMatrix: 'RealMatrix'): ... - def getConditionNumber(self) -> float: ... - def getCovariance(self, double: float) -> 'RealMatrix': ... - def getInverseConditionNumber(self) -> float: ... - def getNorm(self) -> float: ... - def getRank(self) -> int: ... - def getS(self) -> 'RealMatrix': ... - def getSingularValues(self) -> typing.MutableSequence[float]: ... - def getSolver(self) -> DecompositionSolver: ... - def getU(self) -> 'RealMatrix': ... - def getUT(self) -> 'RealMatrix': ... - def getV(self) -> 'RealMatrix': ... - def getVT(self) -> 'RealMatrix': ... + def getConditionNumber(self) -> float: + """ + Return the condition number of the matrix. + + Returns: + condition number of the matrix + + + """ + ... + def getCovariance(self, double: float) -> 'RealMatrix': + """ + Returns the n × n covariance matrix. + + The covariance matrix is V × J × V :sup:`T` where J is the diagonal matrix of the inverse of the squares of the + singular values. + + Parameters: + minSingularValue (double): value below which singular values are ignored (a 0 or negative value implies all singular value will be used) + + Returns: + covariance matrix + + Raises: + :class:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.IllegalArgumentException`: if minSingularValue is larger than the largest singular value, meaning all singular values are ignored + + + """ + ... + def getInverseConditionNumber(self) -> float: + """ + Computes the inverse of the condition number. In cases of rank deficiency, the + :meth:`~org.hipparchus.linear.SingularValueDecomposition.getConditionNumber` will become undefined. + + Returns: + the inverse of the condition number. + + + """ + ... + def getNorm(self) -> float: + """ + Returns the L :sub:`2` norm of the matrix. + + The L :sub:`2` norm is max(|A × u| :sub:`2` / |u| :sub:`2` ), where |.| :sub:`2` denotes the vectorial 2-norm (i.e. the + traditional euclidian norm). + + Returns: + norm + + + """ + ... + def getRank(self) -> int: + """ + Return the effective numerical matrix rank. + + The effective numerical rank is the number of non-negligible singular values. The threshold used to identify + non-negligible terms is max(m,n) × ulp(s :sub:`1` ) where ulp(s :sub:`1` ) is the least significant bit of the largest + singular value. + + Returns: + effective numerical matrix rank + + + """ + ... + def getS(self) -> 'RealMatrix': + """ + Returns the diagonal matrix Σ of the decomposition. + + Σ is a diagonal matrix. The singular values are provided in non-increasing order, for compatibility with Jama. + + Returns: + the Σ matrix + + + """ + ... + def getSingularValues(self) -> typing.MutableSequence[float]: + """ + Returns the diagonal elements of the matrix Σ of the decomposition. + + The singular values are provided in non-increasing order, for compatibility with Jama. + + Returns: + the diagonal elements of the Σ matrix + + + """ + ... + def getSolver(self) -> DecompositionSolver: + """ + Get a solver for finding the A × X = B solution in least square sense. + + Returns: + a solver + + + """ + ... + def getU(self) -> 'RealMatrix': + """ + Returns the matrix U of the decomposition. + + U is an orthogonal matrix, i.e. its transpose is also its inverse. + + Returns: + the U matrix + + Also see: + + - :meth:`~org.hipparchus.linear.SingularValueDecomposition.getUT` + + + + """ + ... + def getUT(self) -> 'RealMatrix': + """ + Returns the transpose of the matrix U of the decomposition. + + U is an orthogonal matrix, i.e. its transpose is also its inverse. + + Returns: + the U matrix (or null if decomposed matrix is singular) + + Also see: + + - :meth:`~org.hipparchus.linear.SingularValueDecomposition.getU` + + + + """ + ... + def getV(self) -> 'RealMatrix': + """ + Returns the matrix V of the decomposition. + + V is an orthogonal matrix, i.e. its transpose is also its inverse. + + Returns: + the V matrix (or null if decomposed matrix is singular) + + Also see: + + - :meth:`~org.hipparchus.linear.SingularValueDecomposition.getVT` + + + + """ + ... + def getVT(self) -> 'RealMatrix': + """ + Returns the transpose of the matrix V of the decomposition. + + V is an orthogonal matrix, i.e. its transpose is also its inverse. + + Returns: + the V matrix (or null if decomposed matrix is singular) + + Also see: + + - :meth:`~org.hipparchus.linear.SingularValueDecomposition.getV` + + + + """ + ... _ArrayFieldVector__T = typing.TypeVar('_ArrayFieldVector__T', bound=org.hipparchus.FieldElement) # <T> class ArrayFieldVector(FieldVector[_ArrayFieldVector__T], java.io.Serializable, typing.Generic[_ArrayFieldVector__T]): + """ + public classArrayFieldVector<T extends :class:`~org.hipparchus.FieldElement`<T>> extends :class:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.linear.FieldVector`<T>, :class:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + This class implements the :class:`~org.hipparchus.linear.FieldVector` interface with a + :class:`~org.hipparchus.FieldElement` array. + + Also see: + + - :meth:`~serialized` + """ @typing.overload def __init__(self, int: int, t: _ArrayFieldVector__T): ... @typing.overload @@ -646,13 +3557,87 @@ class ArrayFieldVector(FieldVector[_ArrayFieldVector__T], java.io.Serializable, def ebeMultiply(self, arrayFieldVector: 'ArrayFieldVector'[_ArrayFieldVector__T]) -> 'ArrayFieldVector'[_ArrayFieldVector__T]: ... @typing.overload def ebeMultiply(self, fieldVector: FieldVector[_ArrayFieldVector__T]) -> FieldVector[_ArrayFieldVector__T]: ... - def equals(self, object: typing.Any) -> bool: ... - def getDataRef(self) -> typing.MutableSequence[_ArrayFieldVector__T]: ... - def getDimension(self) -> int: ... - def getEntry(self, int: int) -> _ArrayFieldVector__T: ... + def equals(self, object: typing.Any) -> bool: + """ + Test for the equality of two vectors. + + Overrides: + :meth:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.equals` in + class :class:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Parameters: + other (:class:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object`): Object to test for equality. + + Returns: + :code:`true` if two vector objects are equal, :code:`false` otherwise. + + + """ + ... + def getDataRef(self) -> typing.MutableSequence[_ArrayFieldVector__T]: + """ + Returns a reference to the underlying data array. + + Does not make a fresh copy of the underlying data. + + Returns: + array of entries + + + """ + ... + def getDimension(self) -> int: + """ + Returns the size of the vector. + + Specified by: + :meth:`~org.hipparchus.linear.FieldVector.getDimension` in interface :class:`~org.hipparchus.linear.FieldVector` + + Returns: + size + + + """ + ... + def getEntry(self, int: int) -> _ArrayFieldVector__T: + """ + Returns the entry in the specified index. + + Specified by: + :meth:`~org.hipparchus.linear.FieldVector.getEntry` in interface :class:`~org.hipparchus.linear.FieldVector` + + Parameters: + index (int): Index location of entry to be fetched. + + Returns: + the vector entry at :code:`index`. + + Also see: + + - :meth:`~org.hipparchus.linear.FieldVector.setEntry` + + + + """ + ... def getField(self) -> org.hipparchus.Field[_ArrayFieldVector__T]: ... def getSubVector(self, int: int, int2: int) -> FieldVector[_ArrayFieldVector__T]: ... - def hashCode(self) -> int: ... + def hashCode(self) -> int: + """ + Get a hashCode for the real vector. + + All NaN values have the same hash code. + + Overrides: + :meth:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.hashCode` in + class :class:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Returns: + a hash code value for this object + + + """ + ... def mapAdd(self, t: _ArrayFieldVector__T) -> FieldVector[_ArrayFieldVector__T]: ... def mapAddToSelf(self, t: _ArrayFieldVector__T) -> FieldVector[_ArrayFieldVector__T]: ... def mapDivide(self, t: _ArrayFieldVector__T) -> FieldVector[_ArrayFieldVector__T]: ... @@ -674,15 +3659,71 @@ class ArrayFieldVector(FieldVector[_ArrayFieldVector__T], java.io.Serializable, @typing.overload def set(self, int: int, arrayFieldVector: 'ArrayFieldVector'[_ArrayFieldVector__T]) -> None: ... @typing.overload - def set(self, t: _ArrayFieldVector__T) -> None: ... - def setEntry(self, int: int, t: _ArrayFieldVector__T) -> None: ... + def set(self, t: _ArrayFieldVector__T) -> None: + """ + Set all elements to a single value. + + Specified by: + :meth:`~org.hipparchus.linear.FieldVector.set` in interface :class:`~org.hipparchus.linear.FieldVector` + + Parameters: + value (:class:`~org.hipparchus.linear.ArrayFieldVector`): single value to set for all elements + + + """ + ... + def setEntry(self, int: int, t: _ArrayFieldVector__T) -> None: + """ + Set a single element. + + Specified by: + :meth:`~org.hipparchus.linear.FieldVector.setEntry` in interface :class:`~org.hipparchus.linear.FieldVector` + + Parameters: + index (int): element index. + value (:class:`~org.hipparchus.linear.ArrayFieldVector`): new value for the element. + + Also see: + + - :meth:`~org.hipparchus.linear.FieldVector.getEntry` + + + + """ + ... def setSubVector(self, int: int, fieldVector: FieldVector[_ArrayFieldVector__T]) -> None: ... @typing.overload def subtract(self, arrayFieldVector: 'ArrayFieldVector'[_ArrayFieldVector__T]) -> 'ArrayFieldVector'[_ArrayFieldVector__T]: ... @typing.overload def subtract(self, fieldVector: FieldVector[_ArrayFieldVector__T]) -> FieldVector[_ArrayFieldVector__T]: ... - def toArray(self) -> typing.MutableSequence[_ArrayFieldVector__T]: ... - def toString(self) -> str: ... + def toArray(self) -> typing.MutableSequence[_ArrayFieldVector__T]: + """ + Convert the vector to a T array. + + The array is independent from vector data, it's elements are copied. + + Specified by: + :meth:`~org.hipparchus.linear.FieldVector.toArray` in interface :class:`~org.hipparchus.linear.FieldVector` + + Returns: + array containing a copy of vector elements + + + """ + ... + def toString(self) -> str: + """ + + Overrides: + :meth:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.toString` in + class :class:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Since: + 2.0 + + + """ + ... @typing.overload def walkInDefaultOrder(self, fieldVectorChangingVisitor: FieldVectorChangingVisitor[_ArrayFieldVector__T]) -> _ArrayFieldVector__T: ... @typing.overload @@ -701,6 +3742,16 @@ class ArrayFieldVector(FieldVector[_ArrayFieldVector__T], java.io.Serializable, def walkInOptimizedOrder(self, fieldVectorPreservingVisitor: FieldVectorPreservingVisitor[_ArrayFieldVector__T], int: int, int2: int) -> _ArrayFieldVector__T: ... class ArrayRealVector(RealVector, java.io.Serializable): + """ + public classArrayRealVector extends :class:`~org.hipparchus.linear.RealVector` + implements :class:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + This class implements the :class:`~org.hipparchus.linear.RealVector` interface with a double array. + + Also see: + + - :meth:`~serialized` + """ @typing.overload def __init__(self): ... @typing.overload @@ -738,49 +3789,452 @@ class ArrayRealVector(RealVector, java.io.Serializable): def add(self, realVector: RealVector) -> 'ArrayRealVector': ... def addToEntry(self, int: int, double: float) -> None: ... @typing.overload - def append(self, arrayRealVector: 'ArrayRealVector') -> 'ArrayRealVector': ... + def append(self, arrayRealVector: 'ArrayRealVector') -> 'ArrayRealVector': + """ + Construct a new vector by appending a vector to this vector. + + Specified by: + :meth:`~org.hipparchus.linear.RealVector.append` in class :class:`~org.hipparchus.linear.RealVector` + + Parameters: + v (:class:`~org.hipparchus.linear.RealVector`): vector to append to this one. + + Returns: + a new vector. + + Construct a vector by appending a vector to this vector. + + Parameters: + v (:class:`~org.hipparchus.linear.ArrayRealVector`): Vector to append to this one. + + Returns: + a new vector. + + Construct a new vector by appending a double to this vector. + + Specified by: + :meth:`~org.hipparchus.linear.RealVector.append` in class :class:`~org.hipparchus.linear.RealVector` + + Parameters: + in (double): double to append. + + Returns: + a new vector. + + + """ + ... @typing.overload def append(self, double: float) -> RealVector: ... @typing.overload def append(self, realVector: RealVector) -> RealVector: ... def combine(self, double: float, double2: float, realVector: RealVector) -> 'ArrayRealVector': ... def combineToSelf(self, double: float, double2: float, realVector: RealVector) -> 'ArrayRealVector': ... - def copy(self) -> 'ArrayRealVector': ... + def copy(self) -> 'ArrayRealVector': + """ + Returns a (deep) copy of this vector. + + Specified by: + :meth:`~org.hipparchus.linear.RealVector.copy` in class :class:`~org.hipparchus.linear.RealVector` + + Returns: + a vector copy. + + + """ + ... def dotProduct(self, realVector: RealVector) -> float: ... def ebeDivide(self, realVector: RealVector) -> 'ArrayRealVector': ... def ebeMultiply(self, realVector: RealVector) -> 'ArrayRealVector': ... - def equals(self, object: typing.Any) -> bool: ... - def getDataRef(self) -> typing.MutableSequence[float]: ... - def getDimension(self) -> int: ... + def equals(self, object: typing.Any) -> bool: + """ + + Test for the equality of two real vectors. If all coordinates of two real vectors are exactly the same, and none are + :code:`NaN`, the two real vectors are considered to be equal. :code:`NaN` coordinates are considered to affect globally + the vector and be equals to each other - i.e, if either (or all) coordinates of the real vector are equal to + :code:`NaN`, the real vector is equal to a vector with all :code:`NaN` coordinates. + + This method *must* be overriden by concrete subclasses of :class:`~org.hipparchus.linear.RealVector` (the current + implementation throws an exception). + + Overrides: + :meth:`~org.hipparchus.linear.RealVector.equals` in class :class:`~org.hipparchus.linear.RealVector` + + Parameters: + other (:class:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object`): Object to test for equality. + + Returns: + :code:`true` if two vector objects are equal, :code:`false` if :code:`other` is null, not an instance of + :code:`RealVector`, or not equal to this :code:`RealVector` instance. + + + """ + ... + def getDataRef(self) -> typing.MutableSequence[float]: + """ + Get a reference to the underlying data array. This method does not make a fresh copy of the underlying data. + + Returns: + the array of entries. + + + """ + ... + def getDimension(self) -> int: + """ + Returns the size of the vector. + + Specified by: + :meth:`~org.hipparchus.linear.RealVector.getDimension` in class :class:`~org.hipparchus.linear.RealVector` + + Returns: + the size of this vector. + + + """ + ... def getDistance(self, realVector: RealVector) -> float: ... def getEntry(self, int: int) -> float: ... def getL1Distance(self, realVector: RealVector) -> float: ... - def getL1Norm(self) -> float: ... + def getL1Norm(self) -> float: + """ + Returns the L :sub:`1` norm of the vector. + + The L :sub:`1` norm is the sum of the absolute values of the elements. + + Overrides: + :meth:`~org.hipparchus.linear.RealVector.getL1Norm` in class :class:`~org.hipparchus.linear.RealVector` + + Returns: + the norm. + + Also see: + + - :meth:`~org.hipparchus.linear.RealVector.getNorm` + - :meth:`~org.hipparchus.linear.RealVector.getLInfNorm` + - :meth:`~org.hipparchus.linear.RealVector.getL1Distance` + + + + """ + ... def getLInfDistance(self, realVector: RealVector) -> float: ... - def getLInfNorm(self) -> float: ... - def getNorm(self) -> float: ... + def getLInfNorm(self) -> float: + """ + Returns the L :sub:`∞` norm of the vector. + + The L :sub:`∞` norm is the max of the absolute values of the elements. + + Overrides: + :meth:`~org.hipparchus.linear.RealVector.getLInfNorm` in class :class:`~org.hipparchus.linear.RealVector` + + Returns: + the norm. + + Also see: + + - :meth:`~org.hipparchus.linear.RealVector.getNorm` + - :meth:`~org.hipparchus.linear.RealVector.getL1Norm` + - :meth:`~org.hipparchus.linear.RealVector.getLInfDistance` + + + + """ + ... + def getNorm(self) -> float: + """ + Returns the L :sub:`2` norm of the vector. + + The L :sub:`2` norm is the root of the sum of the squared elements. + + Overrides: + :meth:`~org.hipparchus.linear.RealVector.getNorm` in class :class:`~org.hipparchus.linear.RealVector` + + Returns: + the norm. + + Also see: + + - :meth:`~org.hipparchus.linear.RealVector.getL1Norm` + - :meth:`~org.hipparchus.linear.RealVector.getLInfNorm` + - :meth:`~org.hipparchus.linear.RealVector.getDistance` + + + + """ + ... def getSubVector(self, int: int, int2: int) -> RealVector: ... - def hashCode(self) -> int: ... - def isInfinite(self) -> bool: ... - def isNaN(self) -> bool: ... - def map(self, univariateFunction: typing.Union[org.hipparchus.analysis.UnivariateFunction, typing.Callable]) -> 'ArrayRealVector': ... - def mapAddToSelf(self, double: float) -> RealVector: ... - def mapDivideToSelf(self, double: float) -> RealVector: ... - def mapMultiplyToSelf(self, double: float) -> RealVector: ... - def mapSubtractToSelf(self, double: float) -> RealVector: ... - def mapToSelf(self, univariateFunction: typing.Union[org.hipparchus.analysis.UnivariateFunction, typing.Callable]) -> 'ArrayRealVector': ... - def outerProduct(self, realVector: RealVector) -> 'RealMatrix': ... - def set(self, double: float) -> None: ... + def hashCode(self) -> int: + """ + . This method *must* be overriden by concrete subclasses of :class:`~org.hipparchus.linear.RealVector` (current + implementation throws an exception). All :code:`NaN` values have the same hash code. + + Overrides: + :meth:`~org.hipparchus.linear.RealVector.hashCode` in class :class:`~org.hipparchus.linear.RealVector` + + + """ + ... + def isInfinite(self) -> bool: + """ + Check whether any coordinate of this vector is infinite and none are :code:`NaN`. + + Specified by: + :meth:`~org.hipparchus.linear.RealVector.isInfinite` in class :class:`~org.hipparchus.linear.RealVector` + + Returns: + :code:`true` if any coordinate of this vector is infinite and none are :code:`NaN`, :code:`false` otherwise. + + + """ + ... + def isNaN(self) -> bool: + """ + Check if any coordinate of this vector is :code:`NaN`. + + Specified by: + :meth:`~org.hipparchus.linear.RealVector.isNaN` in class :class:`~org.hipparchus.linear.RealVector` + + Returns: + :code:`true` if any coordinate of this vector is :code:`NaN`, :code:`false` otherwise. + + + """ + ... + def map(self, univariateFunction: typing.Union[org.hipparchus.analysis.UnivariateFunction, typing.Callable]) -> 'ArrayRealVector': + """ + Acts as if implemented as: + + .. code-block: java + + return copy().mapToSelf(function); + + Returns a new vector. Does not change instance data. + + Overrides: + :meth:`~org.hipparchus.linear.RealVector.map` in class :class:`~org.hipparchus.linear.RealVector` + + Parameters: + function (:class:`~org.hipparchus.analysis.UnivariateFunction`): Function to apply to each entry. + + Returns: + a new vector. + + + """ + ... + def mapAddToSelf(self, double: float) -> RealVector: + """ + Add a value to each entry. The instance is changed in-place. + + Overrides: + :meth:`~org.hipparchus.linear.RealVector.mapAddToSelf` in class :class:`~org.hipparchus.linear.RealVector` + + Parameters: + d (double): Value to be added to each entry. + + Returns: + :code:`this`. + + + """ + ... + def mapDivideToSelf(self, double: float) -> RealVector: + """ + Divide each entry by the argument. The instance is changed in-place. + + Overrides: + :meth:`~org.hipparchus.linear.RealVector.mapDivideToSelf` in class :class:`~org.hipparchus.linear.RealVector` + + Parameters: + d (double): Value to divide by. + + Returns: + :code:`this`. + + + """ + ... + def mapMultiplyToSelf(self, double: float) -> RealVector: + """ + Multiply each entry. The instance is changed in-place. + + Overrides: + :meth:`~org.hipparchus.linear.RealVector.mapMultiplyToSelf` in class :class:`~org.hipparchus.linear.RealVector` + + Parameters: + d (double): Multiplication factor. + + Returns: + :code:`this`. + + + """ + ... + def mapSubtractToSelf(self, double: float) -> RealVector: + """ + Subtract a value from each entry. The instance is changed in-place. + + Overrides: + :meth:`~org.hipparchus.linear.RealVector.mapSubtractToSelf` in class :class:`~org.hipparchus.linear.RealVector` + + Parameters: + d (double): Value to be subtracted. + + Returns: + :code:`this`. + + + """ + ... + def mapToSelf(self, univariateFunction: typing.Union[org.hipparchus.analysis.UnivariateFunction, typing.Callable]) -> 'ArrayRealVector': + """ + Acts as if it is implemented as: + + .. code-block: java + + Entry e = null; + for(Iterator<Entry> it = iterator(); it.hasNext(); e = it.next()) { + e.setValue(function.value(e.getValue())); + } + + Entries of this vector are modified in-place by this method. + + Overrides: + :meth:`~org.hipparchus.linear.RealVector.mapToSelf` in class :class:`~org.hipparchus.linear.RealVector` + + Parameters: + function (:class:`~org.hipparchus.analysis.UnivariateFunction`): Function to apply to each entry. + + Returns: + a reference to this vector. + + + """ + ... + def outerProduct(self, realVector: RealVector) -> 'RealMatrix': + """ + Compute the outer product. + + Overrides: + :meth:`~org.hipparchus.linear.RealVector.outerProduct` in class :class:`~org.hipparchus.linear.RealVector` + + Parameters: + v (:class:`~org.hipparchus.linear.RealVector`): Vector with which outer product should be computed. + + Returns: + the matrix outer product between this instance and :code:`v`. + + + """ + ... + def set(self, double: float) -> None: + """ + Set all elements to a single value. + + Overrides: + :meth:`~org.hipparchus.linear.RealVector.set` in class :class:`~org.hipparchus.linear.RealVector` + + Parameters: + value (double): Single value to set for all elements. + + + """ + ... def setEntry(self, int: int, double: float) -> None: ... @typing.overload def setSubVector(self, int: int, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> None: ... @typing.overload def setSubVector(self, int: int, realVector: RealVector) -> None: ... def subtract(self, realVector: RealVector) -> 'ArrayRealVector': ... - def toArray(self) -> typing.MutableSequence[float]: ... - def toString(self) -> str: ... - @typing.overload - def walkInDefaultOrder(self, realVectorChangingVisitor: RealVectorChangingVisitor) -> float: ... + def toArray(self) -> typing.MutableSequence[float]: + """ + Convert the vector to an array of :code:`double`s. The array is independent from this vector data: the elements are + copied. + + Overrides: + :meth:`~org.hipparchus.linear.RealVector.toArray` in class :class:`~org.hipparchus.linear.RealVector` + + Returns: + an array containing a copy of the vector elements. + + + """ + ... + def toString(self) -> str: + """ + + Overrides: + :meth:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.toString` in + class :class:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + + """ + ... + @typing.overload + def walkInDefaultOrder(self, realVectorChangingVisitor: RealVectorChangingVisitor) -> float: + """ + Visits (but does not alter) all entries of this vector in default order (increasing index). + + Overrides: + :meth:`~org.hipparchus.linear.RealVector.walkInDefaultOrder` in class :class:`~org.hipparchus.linear.RealVector` + + Parameters: + visitor (:class:`~org.hipparchus.linear.RealVectorPreservingVisitor`): the visitor to be used to process the entries of this vector + + Returns: + the value returned by :meth:`~org.hipparchus.linear.RealVectorPreservingVisitor.end` at the end of the walk + + public double walkInDefaultOrder(:class:`~org.hipparchus.linear.RealVectorPreservingVisitor` visitor, int start, int end) throws :class:`~org.hipparchus.exception.MathIllegalArgumentException` + + Visits (but does not alter) some entries of this vector in default order (increasing index). + + Overrides: + :meth:`~org.hipparchus.linear.RealVector.walkInDefaultOrder` in class :class:`~org.hipparchus.linear.RealVector` + + Parameters: + visitor (:class:`~org.hipparchus.linear.RealVectorPreservingVisitor`): visitor to be used to process the entries of this vector + start (int): the index of the first entry to be visited + end (int): the index of the last entry to be visited (inclusive) + + Returns: + the value returned by :meth:`~org.hipparchus.linear.RealVectorPreservingVisitor.end` at the end of the walk + + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if :code:`end < start`. + + Visits (and possibly alters) all entries of this vector in default order (increasing index). + + Overrides: + :meth:`~org.hipparchus.linear.RealVector.walkInDefaultOrder` in class :class:`~org.hipparchus.linear.RealVector` + + Parameters: + visitor (:class:`~org.hipparchus.linear.RealVectorChangingVisitor`): the visitor to be used to process and modify the entries of this vector + + Returns: + the value returned by :meth:`~org.hipparchus.linear.RealVectorChangingVisitor.end` at the end of the walk + + public double walkInDefaultOrder(:class:`~org.hipparchus.linear.RealVectorChangingVisitor` visitor, int start, int end) throws :class:`~org.hipparchus.exception.MathIllegalArgumentException` + + Visits (and possibly alters) some entries of this vector in default order (increasing index). + + Overrides: + :meth:`~org.hipparchus.linear.RealVector.walkInDefaultOrder` in class :class:`~org.hipparchus.linear.RealVector` + + Parameters: + visitor (:class:`~org.hipparchus.linear.RealVectorChangingVisitor`): visitor to be used to process the entries of this vector + start (int): the index of the first entry to be visited + end (int): the index of the last entry to be visited (inclusive) + + Returns: + the value returned by :meth:`~org.hipparchus.linear.RealVectorChangingVisitor.end` at the end of the walk + + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if :code:`end < start`. + + + """ + ... @typing.overload def walkInDefaultOrder(self, realVectorChangingVisitor: RealVectorChangingVisitor, int: int, int2: int) -> float: ... @typing.overload @@ -788,7 +4242,77 @@ class ArrayRealVector(RealVector, java.io.Serializable): @typing.overload def walkInDefaultOrder(self, realVectorPreservingVisitor: RealVectorPreservingVisitor, int: int, int2: int) -> float: ... @typing.overload - def walkInOptimizedOrder(self, realVectorChangingVisitor: RealVectorChangingVisitor) -> float: ... + def walkInOptimizedOrder(self, realVectorChangingVisitor: RealVectorChangingVisitor) -> float: + """ + Visits (but does not alter) all entries of this vector in optimized order. The order in which the entries are visited is + selected so as to lead to the most efficient implementation; it might depend on the concrete implementation of this + abstract class. In this implementation, the optimized order is the default order. + + Overrides: + :meth:`~org.hipparchus.linear.RealVector.walkInOptimizedOrder` in class :class:`~org.hipparchus.linear.RealVector` + + Parameters: + visitor (:class:`~org.hipparchus.linear.RealVectorPreservingVisitor`): the visitor to be used to process the entries of this vector + + Returns: + the value returned by :meth:`~org.hipparchus.linear.RealVectorPreservingVisitor.end` at the end of the walk + + public double walkInOptimizedOrder(:class:`~org.hipparchus.linear.RealVectorPreservingVisitor` visitor, int start, int end) throws :class:`~org.hipparchus.exception.MathIllegalArgumentException` + + Visits (but does not alter) some entries of this vector in optimized order. The order in which the entries are visited + is selected so as to lead to the most efficient implementation; it might depend on the concrete implementation of this + abstract class. In this implementation, the optimized order is the default order. + + Overrides: + :meth:`~org.hipparchus.linear.RealVector.walkInOptimizedOrder` in class :class:`~org.hipparchus.linear.RealVector` + + Parameters: + visitor (:class:`~org.hipparchus.linear.RealVectorPreservingVisitor`): visitor to be used to process the entries of this vector + start (int): the index of the first entry to be visited + end (int): the index of the last entry to be visited (inclusive) + + Returns: + the value returned by :meth:`~org.hipparchus.linear.RealVectorPreservingVisitor.end` at the end of the walk + + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if :code:`end < start`. + + Visits (and possibly alters) all entries of this vector in optimized order. The order in which the entries are visited + is selected so as to lead to the most efficient implementation; it might depend on the concrete implementation of this + abstract class. In this implementation, the optimized order is the default order. + + Overrides: + :meth:`~org.hipparchus.linear.RealVector.walkInOptimizedOrder` in class :class:`~org.hipparchus.linear.RealVector` + + Parameters: + visitor (:class:`~org.hipparchus.linear.RealVectorChangingVisitor`): the visitor to be used to process the entries of this vector + + Returns: + the value returned by :meth:`~org.hipparchus.linear.RealVectorChangingVisitor.end` at the end of the walk + + public double walkInOptimizedOrder(:class:`~org.hipparchus.linear.RealVectorChangingVisitor` visitor, int start, int end) throws :class:`~org.hipparchus.exception.MathIllegalArgumentException` + + Visits (and possibly change) some entries of this vector in optimized order. The order in which the entries are visited + is selected so as to lead to the most efficient implementation; it might depend on the concrete implementation of this + abstract class. In this implementation, the optimized order is the default order. + + Overrides: + :meth:`~org.hipparchus.linear.RealVector.walkInOptimizedOrder` in class :class:`~org.hipparchus.linear.RealVector` + + Parameters: + visitor (:class:`~org.hipparchus.linear.RealVectorChangingVisitor`): visitor to be used to process the entries of this vector + start (int): the index of the first entry to be visited + end (int): the index of the last entry to be visited (inclusive) + + Returns: + the value returned by :meth:`~org.hipparchus.linear.RealVectorChangingVisitor.end` at the end of the walk + + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if :code:`end < start`. + + + """ + ... @typing.overload def walkInOptimizedOrder(self, realVectorChangingVisitor: RealVectorChangingVisitor, int: int, int2: int) -> float: ... @typing.overload @@ -797,53 +4321,433 @@ class ArrayRealVector(RealVector, java.io.Serializable): def walkInOptimizedOrder(self, realVectorPreservingVisitor: RealVectorPreservingVisitor, int: int, int2: int) -> float: ... class CholeskyDecomposer(MatrixDecomposer): + """ + public classCholeskyDecomposer extends :class:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.linear.MatrixDecomposer` + + Matrix decomposer using Cholseky decomposition. + + Since: + 1.3 + """ def __init__(self, double: float, double2: float): ... - def decompose(self, realMatrix: 'RealMatrix') -> DecompositionSolver: ... + def decompose(self, realMatrix: 'RealMatrix') -> DecompositionSolver: + """ + Get a solver for finding the A × X = B solution in least square sense. + + Specified by: + :meth:`~org.hipparchus.linear.MatrixDecomposer.decompose` in interface :class:`~org.hipparchus.linear.MatrixDecomposer` + + Parameters: + a (:class:`~org.hipparchus.linear.RealMatrix`): coefficient matrix A to decompose + + Returns: + a solver + + + """ + ... _DefaultFieldMatrixChangingVisitor__T = typing.TypeVar('_DefaultFieldMatrixChangingVisitor__T', bound=org.hipparchus.FieldElement) # <T> class DefaultFieldMatrixChangingVisitor(FieldMatrixChangingVisitor[_DefaultFieldMatrixChangingVisitor__T], typing.Generic[_DefaultFieldMatrixChangingVisitor__T]): + """ + public classDefaultFieldMatrixChangingVisitor<T extends :class:`~org.hipparchus.FieldElement`<T>> extends :class:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.linear.FieldMatrixChangingVisitor`<T> + + Default implementation of the :class:`~org.hipparchus.linear.FieldMatrixChangingVisitor` interface. + + This class is a convenience to create custom visitors without defining all methods. This class provides default + implementations that do nothing. + """ def __init__(self, t: _DefaultFieldMatrixChangingVisitor__T): ... - def end(self) -> _DefaultFieldMatrixChangingVisitor__T: ... - def start(self, int: int, int2: int, int3: int, int4: int, int5: int, int6: int) -> None: ... - def visit(self, int: int, int2: int, t: _DefaultFieldMatrixChangingVisitor__T) -> _DefaultFieldMatrixChangingVisitor__T: ... + def end(self) -> _DefaultFieldMatrixChangingVisitor__T: + """ + End visiting a matrix. + + This method is called once after all entries of the matrix have been visited. + + Specified by: + :meth:`~org.hipparchus.linear.FieldMatrixChangingVisitor.end` in + interface :class:`~org.hipparchus.linear.FieldMatrixChangingVisitor` + + Returns: + the value that the :code:`walkInXxxOrder` must return + + + """ + ... + def start(self, int: int, int2: int, int3: int, int4: int, int5: int, int6: int) -> None: + """ + Start visiting a matrix. + + This method is called once before any entry of the matrix is visited. + + Specified by: + :meth:`~org.hipparchus.linear.FieldMatrixChangingVisitor.start` in + interface :class:`~org.hipparchus.linear.FieldMatrixChangingVisitor` + + Parameters: + rows (int): number of rows of the matrix + columns (int): number of columns of the matrix + startRow (int): Initial row index + endRow (int): Final row index (inclusive) + startColumn (int): Initial column index + endColumn (int): Final column index (inclusive) + + + """ + ... + def visit(self, int: int, int2: int, t: _DefaultFieldMatrixChangingVisitor__T) -> _DefaultFieldMatrixChangingVisitor__T: + """ + Visit one matrix entry. + + Specified by: + :meth:`~org.hipparchus.linear.FieldMatrixChangingVisitor.visit` in + interface :class:`~org.hipparchus.linear.FieldMatrixChangingVisitor` + + Parameters: + row (int): row index of the entry + column (int): column index of the entry + value (:class:`~org.hipparchus.linear.DefaultFieldMatrixChangingVisitor`): current value of the entry + + Returns: + the new value to be set for the entry + + + """ + ... _DefaultFieldMatrixPreservingVisitor__T = typing.TypeVar('_DefaultFieldMatrixPreservingVisitor__T', bound=org.hipparchus.FieldElement) # <T> class DefaultFieldMatrixPreservingVisitor(FieldMatrixPreservingVisitor[_DefaultFieldMatrixPreservingVisitor__T], typing.Generic[_DefaultFieldMatrixPreservingVisitor__T]): + """ + public classDefaultFieldMatrixPreservingVisitor<T extends :class:`~org.hipparchus.FieldElement`<T>> extends :class:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.linear.FieldMatrixPreservingVisitor`<T> + + Default implementation of the :class:`~org.hipparchus.linear.FieldMatrixPreservingVisitor` interface. + + This class is a convenience to create custom visitors without defining all methods. This class provides default + implementations that do nothing. + """ def __init__(self, t: _DefaultFieldMatrixPreservingVisitor__T): ... - def end(self) -> _DefaultFieldMatrixPreservingVisitor__T: ... - def start(self, int: int, int2: int, int3: int, int4: int, int5: int, int6: int) -> None: ... - def visit(self, int: int, int2: int, t: _DefaultFieldMatrixPreservingVisitor__T) -> None: ... + def end(self) -> _DefaultFieldMatrixPreservingVisitor__T: + """ + End visiting a matrix. + + This method is called once after all entries of the matrix have been visited. + + Specified by: + :meth:`~org.hipparchus.linear.FieldMatrixPreservingVisitor.end` in + interface :class:`~org.hipparchus.linear.FieldMatrixPreservingVisitor` + + Returns: + the value that the :code:`walkInXxxOrder` must return + + + """ + ... + def start(self, int: int, int2: int, int3: int, int4: int, int5: int, int6: int) -> None: + """ + Start visiting a matrix. + + This method is called once before any entry of the matrix is visited. + + Specified by: + :meth:`~org.hipparchus.linear.FieldMatrixPreservingVisitor.start` in + interface :class:`~org.hipparchus.linear.FieldMatrixPreservingVisitor` + + Parameters: + rows (int): number of rows of the matrix + columns (int): number of columns of the matrix + startRow (int): Initial row index + endRow (int): Final row index (inclusive) + startColumn (int): Initial column index + endColumn (int): Final column index (inclusive) + + + """ + ... + def visit(self, int: int, int2: int, t: _DefaultFieldMatrixPreservingVisitor__T) -> None: + """ + Visit one matrix entry. + + Specified by: + :meth:`~org.hipparchus.linear.FieldMatrixPreservingVisitor.visit` in + interface :class:`~org.hipparchus.linear.FieldMatrixPreservingVisitor` + + Parameters: + row (int): row index of the entry + column (int): column index of the entry + value (:class:`~org.hipparchus.linear.DefaultFieldMatrixPreservingVisitor`): current value of the entry + + + """ + ... class DefaultIterativeLinearSolverEvent(IterativeLinearSolverEvent): + """ + public classDefaultIterativeLinearSolverEvent extends :class:`~org.hipparchus.linear.IterativeLinearSolverEvent` + + A default concrete implementation of the abstract class :class:`~org.hipparchus.linear.IterativeLinearSolverEvent`. + + Also see: + + - :meth:`~serialized` + """ @typing.overload def __init__(self, object: typing.Any, int: int, realVector: RealVector, realVector2: RealVector, double: float): ... @typing.overload def __init__(self, object: typing.Any, int: int, realVector: RealVector, realVector2: RealVector, realVector3: RealVector, double: float): ... - def getNormOfResidual(self) -> float: ... - def getResidual(self) -> RealVector: ... - def getRightHandSideVector(self) -> RealVector: ... - def getSolution(self) -> RealVector: ... - def providesResidual(self) -> bool: ... + def getNormOfResidual(self) -> float: + """ + Returns the norm of the residual. The returned value is not required to be *exact*. Instead, the norm of the so-called + *updated* residual (if available) should be returned. For example, the :class:`~org.hipparchus.linear.ConjugateGradient` + method computes a sequence of residuals, the norm of which is cheap to compute. However, due to accumulation of + round-off errors, this residual might differ from the true residual after some iterations. See e.g. A. Greenbaum and Z. + Strakos, *Predicting the Behavior of Finite Precision Lanzos and Conjugate Gradient Computations*, Technical Report 538, + Department of Computer Science, New York University, 1991 (available `here + <http://www.archive.org/details/predictingbehavi00gree>`). + + Specified by: + :meth:`~org.hipparchus.linear.IterativeLinearSolverEvent.getNormOfResidual` in + class :class:`~org.hipparchus.linear.IterativeLinearSolverEvent` + + Returns: + the norm of the residual, ||r|| + + + """ + ... + def getResidual(self) -> RealVector: + """ + + Returns the residual. This is an optional operation, as all iterative linear solvers do not provide cheap estimate of + the updated residual vector, in which case + + - this method should throw a :class:`~org.hipparchus.exception.MathRuntimeException`, + - :meth:`~org.hipparchus.linear.IterativeLinearSolverEvent.providesResidual` returns :code:`false`. + + + The default implementation throws a :class:`~org.hipparchus.exception.MathRuntimeException`. If this method is + overriden, then :meth:`~org.hipparchus.linear.IterativeLinearSolverEvent.providesResidual` should be overriden as well. + This implementation throws a :class:`~org.hipparchus.exception.MathRuntimeException` if no residual vector :code:`r` was + provided at construction time. + + Overrides: + :meth:`~org.hipparchus.linear.IterativeLinearSolverEvent.getResidual` in + class :class:`~org.hipparchus.linear.IterativeLinearSolverEvent` + + Returns: + the updated residual, r + + + """ + ... + def getRightHandSideVector(self) -> RealVector: + """ + Returns the current right-hand side of the linear system to be solved. This method should return an unmodifiable view, + or a deep copy of the actual right-hand side vector, in order not to compromise subsequent iterations of the source + :class:`~org.hipparchus.linear.IterativeLinearSolver`. + + Specified by: + :meth:`~org.hipparchus.linear.IterativeLinearSolverEvent.getRightHandSideVector` in + class :class:`~org.hipparchus.linear.IterativeLinearSolverEvent` + + Returns: + the right-hand side vector, b + + + """ + ... + def getSolution(self) -> RealVector: + """ + Returns the current estimate of the solution to the linear system to be solved. This method should return an + unmodifiable view, or a deep copy of the actual current solution, in order not to compromise subsequent iterations of + the source :class:`~org.hipparchus.linear.IterativeLinearSolver`. + + Specified by: + :meth:`~org.hipparchus.linear.IterativeLinearSolverEvent.getSolution` in + class :class:`~org.hipparchus.linear.IterativeLinearSolverEvent` + + Returns: + the solution, x + + + """ + ... + def providesResidual(self) -> bool: + """ + Returns :code:`true` if :meth:`~org.hipparchus.linear.IterativeLinearSolverEvent.getResidual` is supported. The default + implementation returns :code:`false`. This implementation returns :code:`true` if a non-:code:`null` value was specified + for the residual vector :code:`r` at construction time. + + Overrides: + :meth:`~org.hipparchus.linear.IterativeLinearSolverEvent.providesResidual` in + class :class:`~org.hipparchus.linear.IterativeLinearSolverEvent` + + Returns: + :code:`true` if :code:`r != null` + + + """ + ... class DefaultRealMatrixChangingVisitor(RealMatrixChangingVisitor): + """ + public classDefaultRealMatrixChangingVisitor extends :class:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.linear.RealMatrixChangingVisitor` + + Default implementation of the :class:`~org.hipparchus.linear.RealMatrixChangingVisitor` interface. + + This class is a convenience to create custom visitors without defining all methods. This class provides default + implementations that do nothing. + """ def __init__(self): ... - def end(self) -> float: ... - def start(self, int: int, int2: int, int3: int, int4: int, int5: int, int6: int) -> None: ... - def visit(self, int: int, int2: int, double: float) -> float: ... + def end(self) -> float: + """ + End visiting a matrix. + + This method is called once after all entries of the matrix have been visited. + + Specified by: + :meth:`~org.hipparchus.linear.RealMatrixChangingVisitor.end` in + interface :class:`~org.hipparchus.linear.RealMatrixChangingVisitor` + + Returns: + the value that the :code:`walkInXxxOrder` must return + + + """ + ... + def start(self, int: int, int2: int, int3: int, int4: int, int5: int, int6: int) -> None: + """ + Start visiting a matrix. + + This method is called once before any entry of the matrix is visited. + + Specified by: + :meth:`~org.hipparchus.linear.RealMatrixChangingVisitor.start` in + interface :class:`~org.hipparchus.linear.RealMatrixChangingVisitor` + + Parameters: + rows (int): number of rows of the matrix + columns (int): number of columns of the matrix + startRow (int): Initial row index + endRow (int): Final row index (inclusive) + startColumn (int): Initial column index + endColumn (int): Final column index (inclusive) + + + """ + ... + def visit(self, int: int, int2: int, double: float) -> float: + """ + Visit one matrix entry. + + Specified by: + :meth:`~org.hipparchus.linear.RealMatrixChangingVisitor.visit` in + interface :class:`~org.hipparchus.linear.RealMatrixChangingVisitor` + + Parameters: + row (int): row index of the entry + column (int): column index of the entry + value (double): current value of the entry + + Returns: + the new value to be set for the entry + + + """ + ... class DefaultRealMatrixPreservingVisitor(RealMatrixPreservingVisitor): + """ + public classDefaultRealMatrixPreservingVisitor extends :class:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.linear.RealMatrixPreservingVisitor` + + Default implementation of the :class:`~org.hipparchus.linear.RealMatrixPreservingVisitor` interface. + + This class is a convenience to create custom visitors without defining all methods. This class provides default + implementations that do nothing. + """ def __init__(self): ... - def end(self) -> float: ... - def start(self, int: int, int2: int, int3: int, int4: int, int5: int, int6: int) -> None: ... - def visit(self, int: int, int2: int, double: float) -> None: ... + def end(self) -> float: + """ + End visiting a matrix. + + This method is called once after all entries of the matrix have been visited. + + Specified by: + :meth:`~org.hipparchus.linear.RealMatrixPreservingVisitor.end` in + interface :class:`~org.hipparchus.linear.RealMatrixPreservingVisitor` + + Returns: + the value that the :code:`walkInXxxOrder` must return + + + """ + ... + def start(self, int: int, int2: int, int3: int, int4: int, int5: int, int6: int) -> None: + """ + Start visiting a matrix. + + This method is called once before any entry of the matrix is visited. + + Specified by: + :meth:`~org.hipparchus.linear.RealMatrixPreservingVisitor.start` in + interface :class:`~org.hipparchus.linear.RealMatrixPreservingVisitor` + + Parameters: + rows (int): number of rows of the matrix + columns (int): number of columns of the matrix + startRow (int): Initial row index + endRow (int): Final row index (inclusive) + startColumn (int): Initial column index + endColumn (int): Final column index (inclusive) + + + """ + ... + def visit(self, int: int, int2: int, double: float) -> None: + """ + Visit one matrix entry. + + Specified by: + :meth:`~org.hipparchus.linear.RealMatrixPreservingVisitor.visit` in + interface :class:`~org.hipparchus.linear.RealMatrixPreservingVisitor` + + Parameters: + row (int): row index of the entry + column (int): column index of the entry + value (double): current value of the entry + + + """ + ... _FieldLUDecomposer__T = typing.TypeVar('_FieldLUDecomposer__T', bound=org.hipparchus.FieldElement) # <T> class FieldLUDecomposer(FieldMatrixDecomposer[_FieldLUDecomposer__T], typing.Generic[_FieldLUDecomposer__T]): + """ + public classFieldLUDecomposer<T extends :class:`~org.hipparchus.FieldElement`<T>> extends :class:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.linear.FieldMatrixDecomposer`<T> + + Matrix decomposer using LU-decomposition. + + Since: + 2.2 + """ def __init__(self, predicate: typing.Union[java.util.function.Predicate[_FieldLUDecomposer__T], typing.Callable[[_FieldLUDecomposer__T], bool]]): ... def decompose(self, fieldMatrix: 'FieldMatrix'[_FieldLUDecomposer__T]) -> FieldDecompositionSolver[_FieldLUDecomposer__T]: ... _FieldMatrix__T = typing.TypeVar('_FieldMatrix__T', bound=org.hipparchus.FieldElement) # <T> class FieldMatrix(AnyMatrix, org.hipparchus.util.FieldBlendable['FieldMatrix'[_FieldMatrix__T], _FieldMatrix__T], typing.Generic[_FieldMatrix__T]): + """ + public interfaceFieldMatrix<T extends :class:`~org.hipparchus.FieldElement`<T>>extends :class:`~org.hipparchus.linear.AnyMatrix`, :class:`~org.hipparchus.util.FieldBlendable`<:class:`~org.hipparchus.linear.FieldMatrix`<T>,T> + + Interface defining field-valued matrix with basic algebraic operations. + + Matrix element indexing is 0-based -- e.g., :code:`getEntry(0, 0)` returns the element in the first row, first column of + the matrix. + """ def add(self, fieldMatrix: 'FieldMatrix'[_FieldMatrix__T]) -> 'FieldMatrix'[_FieldMatrix__T]: ... def addToEntry(self, int: int, int2: int, t: _FieldMatrix__T) -> None: ... def blendArithmeticallyWith(self, fieldMatrix: 'FieldMatrix'[_FieldMatrix__T], t: _FieldMatrix__T) -> 'FieldMatrix'[_FieldMatrix__T]: ... @@ -856,7 +4760,16 @@ class FieldMatrix(AnyMatrix, org.hipparchus.util.FieldBlendable['FieldMatrix'[_F def getColumn(self, int: int) -> typing.MutableSequence[_FieldMatrix__T]: ... def getColumnMatrix(self, int: int) -> 'FieldMatrix'[_FieldMatrix__T]: ... def getColumnVector(self, int: int) -> FieldVector[_FieldMatrix__T]: ... - def getData(self) -> typing.MutableSequence[typing.MutableSequence[_FieldMatrix__T]]: ... + def getData(self) -> typing.MutableSequence[typing.MutableSequence[_FieldMatrix__T]]: + """ + Returns matrix entries as a two-dimensional array. + + Returns: + a 2-dimensional array of entries. + + + """ + ... def getEntry(self, int: int, int2: int) -> _FieldMatrix__T: ... def getField(self) -> org.hipparchus.Field[_FieldMatrix__T]: ... def getRow(self, int: int) -> typing.MutableSequence[_FieldMatrix__T]: ... @@ -923,23 +4836,121 @@ class FieldMatrix(AnyMatrix, org.hipparchus.util.FieldBlendable['FieldMatrix'[_F _FieldQRDecomposer__T = typing.TypeVar('_FieldQRDecomposer__T', bound=org.hipparchus.CalculusFieldElement) # <T> class FieldQRDecomposer(FieldMatrixDecomposer[_FieldQRDecomposer__T], typing.Generic[_FieldQRDecomposer__T]): + """ + public classFieldQRDecomposer<T extends :class:`~org.hipparchus.CalculusFieldElement`<T>> extends :class:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.linear.FieldMatrixDecomposer`<T> + + Matrix decomposer using QR-decomposition. + + Since: + 2.2 + """ def __init__(self, t: _FieldQRDecomposer__T): ... def decompose(self, fieldMatrix: FieldMatrix[_FieldQRDecomposer__T]) -> FieldDecompositionSolver[_FieldQRDecomposer__T]: ... class JacobiPreconditioner(RealLinearOperator): + """ + public classJacobiPreconditioner extends :class:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.linear.RealLinearOperator` + + This class implements the standard Jacobi (diagonal) preconditioner. For a matrix A :sub:`ij` , this preconditioner is M + = diag(1 / A :sub:`11` , 1 / A :sub:`22` , …). + """ def __init__(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], boolean: bool): ... @staticmethod def create(realLinearOperator: RealLinearOperator) -> 'JacobiPreconditioner': ... - def getColumnDimension(self) -> int: ... - def getRowDimension(self) -> int: ... - def operate(self, realVector: RealVector) -> RealVector: ... - def sqrt(self) -> RealLinearOperator: ... + def getColumnDimension(self) -> int: + """ + Returns the dimension of the domain of this operator. + + Specified by: + :meth:`~org.hipparchus.linear.RealLinearOperator.getColumnDimension` in + interface :class:`~org.hipparchus.linear.RealLinearOperator` + + Returns: + the number of columns of the underlying matrix + + + """ + ... + def getRowDimension(self) -> int: + """ + Returns the dimension of the codomain of this operator. + + Specified by: + :meth:`~org.hipparchus.linear.RealLinearOperator.getRowDimension` in + interface :class:`~org.hipparchus.linear.RealLinearOperator` + + Returns: + the number of rows of the underlying matrix + + + """ + ... + def operate(self, realVector: RealVector) -> RealVector: + """ + Returns the result of multiplying :code:`this` by the vector :code:`x`. + + Specified by: + :meth:`~org.hipparchus.linear.RealLinearOperator.operate` in + interface :class:`~org.hipparchus.linear.RealLinearOperator` + + Parameters: + x (:class:`~org.hipparchus.linear.RealVector`): the vector to operate on + + Returns: + the product of :code:`this` instance with :code:`x` + + + """ + ... + def sqrt(self) -> RealLinearOperator: + """ + Returns the square root of :code:`this` diagonal operator. More precisely, this method returns P = diag(1 / √A + :sub:`11` , 1 / √A :sub:`22` , …). + + Returns: + the square root of :code:`this` preconditioner + + + """ + ... class LUDecomposer(MatrixDecomposer): + """ + public classLUDecomposer extends :class:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.linear.MatrixDecomposer` + + Matrix decomposer using LU-decomposition. + + Since: + 1.3 + """ def __init__(self, double: float): ... - def decompose(self, realMatrix: 'RealMatrix') -> DecompositionSolver: ... + def decompose(self, realMatrix: 'RealMatrix') -> DecompositionSolver: + """ + Get a solver for finding the A × X = B solution in least square sense. + + Specified by: + :meth:`~org.hipparchus.linear.MatrixDecomposer.decompose` in interface :class:`~org.hipparchus.linear.MatrixDecomposer` + + Parameters: + a (:class:`~org.hipparchus.linear.RealMatrix`): coefficient matrix A to decompose + + Returns: + a solver + + + """ + ... class OrderedComplexEigenDecomposition(ComplexEigenDecomposition): + """ + public classOrderedComplexEigenDecomposition extends :class:`~org.hipparchus.linear.ComplexEigenDecomposition` + + Given a matrix A, it computes a complex eigen decomposition A = VDV^{T}. It ensures that eigen values in the diagonal of + D are in ascending order. + """ @typing.overload def __init__(self, realMatrix: 'RealMatrix'): ... @typing.overload @@ -949,6 +4960,20 @@ class OrderedComplexEigenDecomposition(ComplexEigenDecomposition): def getVT(self) -> FieldMatrix[org.hipparchus.complex.Complex]: ... class PreconditionedIterativeLinearSolver(IterativeLinearSolver): + """ + public abstract classPreconditionedIterativeLinearSolver extends :class:`~org.hipparchus.linear.IterativeLinearSolver` + + + This abstract class defines preconditioned iterative solvers. When A is ill-conditioned, instead of solving system A · + x = b directly, it is preferable to solve either \[ (M \cdot A) \cdot x = M \cdot b \] (left preconditioning), or \[ (A + \cdot M) \cdot y = b, \text{followed by} M \cdot y = x \] + + (right preconditioning), where M approximates in some way A :sup:`-1` , while matrix-vector products of the type \(M + \cdot y\) remain comparatively easy to compute. In this library, M (not M :sup:`-1` !) is called the *preconditioner*. + + Concrete implementations of this abstract class must be provided with the preconditioner M, as a + :class:`~org.hipparchus.linear.RealLinearOperator`. + """ @typing.overload def __init__(self, int: int): ... @typing.overload @@ -967,23 +4992,162 @@ class PreconditionedIterativeLinearSolver(IterativeLinearSolver): def solveInPlace(self, realLinearOperator: RealLinearOperator, realVector: RealVector, realVector2: RealVector) -> RealVector: ... class QRDecomposer(MatrixDecomposer): + """ + public classQRDecomposer extends :class:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.linear.MatrixDecomposer` + + Matrix decomposer using QR-decomposition. + + Since: + 1.3 + """ def __init__(self, double: float): ... - def decompose(self, realMatrix: 'RealMatrix') -> DecompositionSolver: ... + def decompose(self, realMatrix: 'RealMatrix') -> DecompositionSolver: + """ + Get a solver for finding the A × X = B solution in least square sense. + + Specified by: + :meth:`~org.hipparchus.linear.MatrixDecomposer.decompose` in interface :class:`~org.hipparchus.linear.MatrixDecomposer` + + Parameters: + a (:class:`~org.hipparchus.linear.RealMatrix`): coefficient matrix A to decompose + + Returns: + a solver + + + """ + ... class RRQRDecomposition(QRDecomposition): + """ + public classRRQRDecomposition extends :class:`~org.hipparchus.linear.QRDecomposition` + + Calculates the rank-revealing QR-decomposition of a matrix, with column pivoting. + + The rank-revealing QR-decomposition of a matrix A consists of three matrices Q, R and P such that AP=QR. Q is orthogonal + (Q :sup:`T` Q = I), and R is upper triangular. If A is m×n, Q is m×m and R is m×n and P is n×n. + + QR decomposition with column pivoting produces a rank-revealing QR decomposition and the + :meth:`~org.hipparchus.linear.RRQRDecomposition.getRank` method may be used to return the rank of the input matrix A. + + This class compute the decomposition using Householder reflectors. + + For efficiency purposes, the decomposition in packed form is transposed. This allows inner loop to iterate inside rows, + which is much more cache-efficient in Java. + + This class is based on the class with similar name from the `JAMA <http://math.nist.gov/javanumerics/jama/>` library, + with the following changes: + + - a :meth:`~org.hipparchus.linear.QRDecomposition.getQT` method has been added, + - the :code:`solve` and :code:`isFullRank` methods have been replaced by a + :meth:`~org.hipparchus.linear.RRQRDecomposition.getSolver` method and the equivalent methods provided by the returned + :class:`~org.hipparchus.linear.DecompositionSolver`. + + + Also see: + + - `MathWorld <http://mathworld.wolfram.com/QRDecomposition.html>` + - `Wikipedia <http://en.wikipedia.org/wiki/QR_decomposition>` + """ @typing.overload def __init__(self, realMatrix: 'RealMatrix'): ... @typing.overload def __init__(self, realMatrix: 'RealMatrix', double: float): ... - def getP(self) -> 'RealMatrix': ... - def getRank(self, double: float) -> int: ... - def getSolver(self) -> DecompositionSolver: ... + def getP(self) -> 'RealMatrix': + """ + Returns the pivot matrix, P, used in the QR Decomposition of matrix A such that AP = QR. If no pivoting is used in this + decomposition then P is equal to the identity matrix. + + Returns: + a permutation matrix. + + + """ + ... + def getRank(self, double: float) -> int: + """ + Return the effective numerical matrix rank. + + The effective numerical rank is the number of non-negligible singular values. + + This implementation looks at Frobenius norms of the sequence of bottom right submatrices. When a large fall in norm is + seen, the rank is returned. The drop is computed as: + + .. code-block: java + + (thisNorm/lastNorm) * rNorm < dropThreshold + + + where thisNorm is the Frobenius norm of the current submatrix, lastNorm is the Frobenius norm of the previous submatrix, + rNorm is is the Frobenius norm of the complete matrix + + Parameters: + dropThreshold (double): threshold triggering rank computation + + Returns: + effective numerical matrix rank + + + """ + ... + def getSolver(self) -> DecompositionSolver: + """ + Get a solver for finding the A × X = B solution in least square sense. + + Least Square sense means a solver can be computed for an overdetermined system, (i.e. a system with more equations than + unknowns, which corresponds to a tall A matrix with more rows than columns). In any case, if the matrix is singular + within the tolerance set at :meth:`~org.hipparchus.linear.RRQRDecomposition.%3Cinit%3E`, an error will be triggered when + the :meth:`~org.hipparchus.linear.DecompositionSolver.solve` method will be called. + + Overrides: + :meth:`~org.hipparchus.linear.QRDecomposition.getSolver` in class :class:`~org.hipparchus.linear.QRDecomposition` + + Returns: + a solver + + + """ + ... class RealMatrix(AnyMatrix, org.hipparchus.util.Blendable['RealMatrix']): + """ + public interfaceRealMatrixextends :class:`~org.hipparchus.linear.AnyMatrix`, :class:`~org.hipparchus.util.Blendable`<:class:`~org.hipparchus.linear.RealMatrix`> + + Interface defining a real-valued matrix with basic algebraic operations. + + Matrix element indexing is 0-based -- e.g., :code:`getEntry(0, 0)` returns the element in the first row, first column of + the matrix. + """ def add(self, realMatrix: 'RealMatrix') -> 'RealMatrix': ... def addToEntry(self, int: int, int2: int, double: float) -> None: ... - def blendArithmeticallyWith(self, realMatrix: 'RealMatrix', double: float) -> 'RealMatrix': ... - def copy(self) -> 'RealMatrix': ... + def blendArithmeticallyWith(self, realMatrix: 'RealMatrix', double: float) -> 'RealMatrix': + """ + Blend arithmetically this instance with another one. + + Specified by: + :meth:`~org.hipparchus.util.Blendable.blendArithmeticallyWith` in interface :class:`~org.hipparchus.util.Blendable` + + Parameters: + other (:class:`~org.hipparchus.linear.RealMatrix`): other instance to blend arithmetically with + blendingValue (double): value from smoothstep function B(x). It is expected to be between [0:1] and will throw an exception otherwise. + + Returns: + this * (1 - B(x)) + other * B(x) + + + """ + ... + def copy(self) -> 'RealMatrix': + """ + Returns a (deep) copy of this. + + Returns: + matrix copy + + + """ + ... @typing.overload def copySubMatrix(self, int: int, int2: int, int3: int, int4: int, doubleArray: typing.Union[typing.List[typing.MutableSequence[float]], jpype.JArray]) -> None: ... @typing.overload @@ -992,11 +5156,49 @@ class RealMatrix(AnyMatrix, org.hipparchus.util.Blendable['RealMatrix']): def getColumn(self, int: int) -> typing.MutableSequence[float]: ... def getColumnMatrix(self, int: int) -> 'RealMatrix': ... def getColumnVector(self, int: int) -> RealVector: ... - def getData(self) -> typing.MutableSequence[typing.MutableSequence[float]]: ... + def getData(self) -> typing.MutableSequence[typing.MutableSequence[float]]: + """ + Returns matrix entries as a two-dimensional array. + + Returns: + 2-dimensional array of entries + + + """ + ... def getEntry(self, int: int, int2: int) -> float: ... - def getFrobeniusNorm(self) -> float: ... - def getNorm1(self) -> float: ... - def getNormInfty(self) -> float: ... + def getFrobeniusNorm(self) -> float: + """ + Returns the ` Frobenius norm <http://mathworld.wolfram.com/FrobeniusNorm.html>` of the matrix. + + Returns: + norm + + + """ + ... + def getNorm1(self) -> float: + """ + Returns the ` maximum absolute column sum norm <http://mathworld.wolfram.com/MaximumAbsoluteColumnSumNorm.html>` (L + :sub:`1` ) of the matrix. + + Returns: + norm + + + """ + ... + def getNormInfty(self) -> float: + """ + Returns the ` maximum absolute row sum norm <http://mathworld.wolfram.com/MaximumAbsoluteRowSumNorm.html>` (L :sub:`∞` + ) of the matrix. + + Returns: + norm + + + """ + ... def getRow(self, int: int) -> typing.MutableSequence[float]: ... def getRowMatrix(self, int: int) -> 'RealMatrix': ... def getRowVector(self, int: int) -> RealVector: ... @@ -1005,8 +5207,44 @@ class RealMatrix(AnyMatrix, org.hipparchus.util.Blendable['RealMatrix']): @typing.overload def getSubMatrix(self, intArray: typing.Union[typing.List[int], jpype.JArray], intArray2: typing.Union[typing.List[int], jpype.JArray]) -> 'RealMatrix': ... def getTrace(self) -> float: ... - def map(self, univariateFunction: typing.Union[org.hipparchus.analysis.UnivariateFunction, typing.Callable]) -> 'RealMatrix': ... - def mapToSelf(self, univariateFunction: typing.Union[org.hipparchus.analysis.UnivariateFunction, typing.Callable]) -> 'RealMatrix': ... + def map(self, univariateFunction: typing.Union[org.hipparchus.analysis.UnivariateFunction, typing.Callable]) -> 'RealMatrix': + """ + Acts as if implemented as: + + .. code-block: java + + return copy().mapToSelf(function); + + Returns a new matrix. Does not change instance data. + + Parameters: + function (:class:`~org.hipparchus.analysis.UnivariateFunction`): Function to apply to each entry. + + Returns: + a new matrix. + + Since: + 1.7 + + + """ + ... + def mapToSelf(self, univariateFunction: typing.Union[org.hipparchus.analysis.UnivariateFunction, typing.Callable]) -> 'RealMatrix': + """ + Replace each entry by the result of applying the function to it. + + Parameters: + function (:class:`~org.hipparchus.analysis.UnivariateFunction`): Function to apply to each entry. + + Returns: + a reference to this matrix. + + Since: + 1.7 + + + """ + ... def multiply(self, realMatrix: 'RealMatrix') -> 'RealMatrix': ... def multiplyEntry(self, int: int, int2: int, double: float) -> None: ... def multiplyTransposed(self, realMatrix: 'RealMatrix') -> 'RealMatrix': ... @@ -1021,8 +5259,32 @@ class RealMatrix(AnyMatrix, org.hipparchus.util.Blendable['RealMatrix']): def preMultiply(self, realMatrix: 'RealMatrix') -> 'RealMatrix': ... @typing.overload def preMultiply(self, realVector: RealVector) -> RealVector: ... - def scalarAdd(self, double: float) -> 'RealMatrix': ... - def scalarMultiply(self, double: float) -> 'RealMatrix': ... + def scalarAdd(self, double: float) -> 'RealMatrix': + """ + Returns the result of adding :code:`d` to each entry of :code:`this`. + + Parameters: + d (double): value to be added to each entry + + Returns: + :code:`d + this` + + + """ + ... + def scalarMultiply(self, double: float) -> 'RealMatrix': + """ + Returns the result of multiplying each entry of :code:`this` by :code:`d`. + + Parameters: + d (double): value to multiply all entries by + + Returns: + :code:`d * this` + + + """ + ... def setColumn(self, int: int, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> None: ... def setColumnMatrix(self, int: int, realMatrix: 'RealMatrix') -> None: ... def setColumnVector(self, int: int, realVector: RealVector) -> None: ... @@ -1032,10 +5294,147 @@ class RealMatrix(AnyMatrix, org.hipparchus.util.Blendable['RealMatrix']): def setRowVector(self, int: int, realVector: RealVector) -> None: ... def setSubMatrix(self, doubleArray: typing.Union[typing.List[typing.MutableSequence[float]], jpype.JArray], int: int, int2: int) -> None: ... def subtract(self, realMatrix: 'RealMatrix') -> 'RealMatrix': ... - def transpose(self) -> 'RealMatrix': ... + def transpose(self) -> 'RealMatrix': + """ + Returns the transpose of this matrix. + + Returns: + transpose matrix + + + """ + ... def transposeMultiply(self, realMatrix: 'RealMatrix') -> 'RealMatrix': ... @typing.overload - def walkInColumnOrder(self, realMatrixChangingVisitor: RealMatrixChangingVisitor) -> float: ... + def walkInColumnOrder(self, realMatrixChangingVisitor: RealMatrixChangingVisitor) -> float: + """ + Visit (and possibly change) all matrix entries in column order. + + Column order starts at upper left and iterating through all elements of a column from top to bottom before going to the + topmost element of the next column. + + Parameters: + visitor (:class:`~org.hipparchus.linear.RealMatrixChangingVisitor`): visitor used to process all matrix entries + + Returns: + the value returned by :meth:`~org.hipparchus.linear.RealMatrixChangingVisitor.end` at the end of the walk + + Also see: + + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + + + Visit (but don't change) all matrix entries in column order. + + Column order starts at upper left and iterating through all elements of a column from top to bottom before going to the + topmost element of the next column. + + Parameters: + visitor (:class:`~org.hipparchus.linear.RealMatrixPreservingVisitor`): visitor used to process all matrix entries + + Returns: + the value returned by :meth:`~org.hipparchus.linear.RealMatrixPreservingVisitor.end` at the end of the walk + + Also see: + + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + + + double walkInColumnOrder(:class:`~org.hipparchus.linear.RealMatrixChangingVisitor` visitor, int startRow, int endRow, int startColumn, int endColumn) throws :class:`~org.hipparchus.exception.MathIllegalArgumentException` + + Visit (and possibly change) some matrix entries in column order. + + Column order starts at upper left and iterating through all elements of a column from top to bottom before going to the + topmost element of the next column. + + Parameters: + visitor (:class:`~org.hipparchus.linear.RealMatrixChangingVisitor`): visitor used to process all matrix entries + startRow (int): Initial row index + endRow (int): Final row index (inclusive) + startColumn (int): Initial column index + endColumn (int): Final column index + + Returns: + the value returned by :meth:`~org.hipparchus.linear.RealMatrixChangingVisitor.end` at the end of the walk + + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if the indices are not valid. + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if :code:`endRow < startRow` or :code:`endColumn < startColumn`. + + Also see: + + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + + + double walkInColumnOrder(:class:`~org.hipparchus.linear.RealMatrixPreservingVisitor` visitor, int startRow, int endRow, int startColumn, int endColumn) throws :class:`~org.hipparchus.exception.MathIllegalArgumentException` + + Visit (but don't change) some matrix entries in column order. + + Column order starts at upper left and iterating through all elements of a column from top to bottom before going to the + topmost element of the next column. + + Parameters: + visitor (:class:`~org.hipparchus.linear.RealMatrixPreservingVisitor`): visitor used to process all matrix entries + startRow (int): Initial row index + endRow (int): Final row index (inclusive) + startColumn (int): Initial column index + endColumn (int): Final column index + + Returns: + the value returned by :meth:`~org.hipparchus.linear.RealMatrixPreservingVisitor.end` at the end of the walk + + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if the indices are not valid. + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if :code:`endRow < startRow` or :code:`endColumn < startColumn`. + + Also see: + + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + + + + """ + ... @typing.overload def walkInColumnOrder(self, realMatrixChangingVisitor: RealMatrixChangingVisitor, int: int, int2: int, int3: int, int4: int) -> float: ... @typing.overload @@ -1043,7 +5442,131 @@ class RealMatrix(AnyMatrix, org.hipparchus.util.Blendable['RealMatrix']): @typing.overload def walkInColumnOrder(self, realMatrixPreservingVisitor: RealMatrixPreservingVisitor, int: int, int2: int, int3: int, int4: int) -> float: ... @typing.overload - def walkInOptimizedOrder(self, realMatrixChangingVisitor: RealMatrixChangingVisitor) -> float: ... + def walkInOptimizedOrder(self, realMatrixChangingVisitor: RealMatrixChangingVisitor) -> float: + """ + Visit (and possibly change) all matrix entries using the fastest possible order. + + The fastest walking order depends on the exact matrix class. It may be different from traditional row or column orders. + + Parameters: + visitor (:class:`~org.hipparchus.linear.RealMatrixChangingVisitor`): visitor used to process all matrix entries + + Returns: + the value returned by :meth:`~org.hipparchus.linear.RealMatrixChangingVisitor.end` at the end of the walk + + Also see: + + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + + + Visit (but don't change) all matrix entries using the fastest possible order. + + The fastest walking order depends on the exact matrix class. It may be different from traditional row or column orders. + + Parameters: + visitor (:class:`~org.hipparchus.linear.RealMatrixPreservingVisitor`): visitor used to process all matrix entries + + Returns: + the value returned by :meth:`~org.hipparchus.linear.RealMatrixPreservingVisitor.end` at the end of the walk + + Also see: + + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + + + double walkInOptimizedOrder(:class:`~org.hipparchus.linear.RealMatrixChangingVisitor` visitor, int startRow, int endRow, int startColumn, int endColumn) throws :class:`~org.hipparchus.exception.MathIllegalArgumentException` + + Visit (and possibly change) some matrix entries using the fastest possible order. + + The fastest walking order depends on the exact matrix class. It may be different from traditional row or column orders. + + Parameters: + visitor (:class:`~org.hipparchus.linear.RealMatrixChangingVisitor`): visitor used to process all matrix entries + startRow (int): Initial row index + endRow (int): Final row index (inclusive) + startColumn (int): Initial column index + endColumn (int): Final column index (inclusive) + + Returns: + the value returned by :meth:`~org.hipparchus.linear.RealMatrixChangingVisitor.end` at the end of the walk + + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if the indices are not valid. + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if :code:`endRow < startRow` or :code:`endColumn < startColumn`. + + Also see: + + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + + + double walkInOptimizedOrder(:class:`~org.hipparchus.linear.RealMatrixPreservingVisitor` visitor, int startRow, int endRow, int startColumn, int endColumn) throws :class:`~org.hipparchus.exception.MathIllegalArgumentException` + + Visit (but don't change) some matrix entries using the fastest possible order. + + The fastest walking order depends on the exact matrix class. It may be different from traditional row or column orders. + + Parameters: + visitor (:class:`~org.hipparchus.linear.RealMatrixPreservingVisitor`): visitor used to process all matrix entries + startRow (int): Initial row index + endRow (int): Final row index (inclusive) + startColumn (int): Initial column index + endColumn (int): Final column index (inclusive) + + Returns: + the value returned by :meth:`~org.hipparchus.linear.RealMatrixPreservingVisitor.end` at the end of the walk + + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if the indices are not valid. + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if :code:`endRow < startRow` or :code:`endColumn < startColumn`. + + Also see: + + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + + + + """ + ... @typing.overload def walkInOptimizedOrder(self, realMatrixChangingVisitor: RealMatrixChangingVisitor, int: int, int2: int, int3: int, int4: int) -> float: ... @typing.overload @@ -1051,7 +5574,135 @@ class RealMatrix(AnyMatrix, org.hipparchus.util.Blendable['RealMatrix']): @typing.overload def walkInOptimizedOrder(self, realMatrixPreservingVisitor: RealMatrixPreservingVisitor, int: int, int2: int, int3: int, int4: int) -> float: ... @typing.overload - def walkInRowOrder(self, realMatrixChangingVisitor: RealMatrixChangingVisitor) -> float: ... + def walkInRowOrder(self, realMatrixChangingVisitor: RealMatrixChangingVisitor) -> float: + """ + Visit (and possibly change) all matrix entries in row order. + + Row order starts at upper left and iterating through all elements of a row from left to right before going to the + leftmost element of the next row. + + Parameters: + visitor (:class:`~org.hipparchus.linear.RealMatrixChangingVisitor`): visitor used to process all matrix entries + + Returns: + the value returned by :meth:`~org.hipparchus.linear.RealMatrixChangingVisitor.end` at the end of the walk + + Also see: + + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + + + Visit (but don't change) all matrix entries in row order. + + Row order starts at upper left and iterating through all elements of a row from left to right before going to the + leftmost element of the next row. + + Parameters: + visitor (:class:`~org.hipparchus.linear.RealMatrixPreservingVisitor`): visitor used to process all matrix entries + + Returns: + the value returned by :meth:`~org.hipparchus.linear.RealMatrixPreservingVisitor.end` at the end of the walk + + Also see: + + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + + + double walkInRowOrder(:class:`~org.hipparchus.linear.RealMatrixChangingVisitor` visitor, int startRow, int endRow, int startColumn, int endColumn) throws :class:`~org.hipparchus.exception.MathIllegalArgumentException` + + Visit (and possibly change) some matrix entries in row order. + + Row order starts at upper left and iterating through all elements of a row from left to right before going to the + leftmost element of the next row. + + Parameters: + visitor (:class:`~org.hipparchus.linear.RealMatrixChangingVisitor`): visitor used to process all matrix entries + startRow (int): Initial row index + endRow (int): Final row index (inclusive) + startColumn (int): Initial column index + endColumn (int): Final column index + + Returns: + the value returned by :meth:`~org.hipparchus.linear.RealMatrixChangingVisitor.end` at the end of the walk + + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if the indices are not valid. + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if :code:`endRow < startRow` or :code:`endColumn < startColumn`. + + Also see: + + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + + + double walkInRowOrder(:class:`~org.hipparchus.linear.RealMatrixPreservingVisitor` visitor, int startRow, int endRow, int startColumn, int endColumn) throws :class:`~org.hipparchus.exception.MathIllegalArgumentException` + + Visit (but don't change) some matrix entries in row order. + + Row order starts at upper left and iterating through all elements of a row from left to right before going to the + leftmost element of the next row. + + Parameters: + visitor (:class:`~org.hipparchus.linear.RealMatrixPreservingVisitor`): visitor used to process all matrix entries + startRow (int): Initial row index + endRow (int): Final row index (inclusive) + startColumn (int): Initial column index + endColumn (int): Final column index + + Returns: + the value returned by :meth:`~org.hipparchus.linear.RealMatrixPreservingVisitor.end` at the end of the walk + + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if the indices are not valid. + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if :code:`endRow < startRow` or :code:`endColumn < startColumn`. + + Also see: + + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + + + + """ + ... @typing.overload def walkInRowOrder(self, realMatrixChangingVisitor: RealMatrixChangingVisitor, int: int, int2: int, int3: int, int4: int) -> float: ... @typing.overload @@ -1060,16 +5711,89 @@ class RealMatrix(AnyMatrix, org.hipparchus.util.Blendable['RealMatrix']): def walkInRowOrder(self, realMatrixPreservingVisitor: RealMatrixPreservingVisitor, int: int, int2: int, int3: int, int4: int) -> float: ... class RiccatiEquationSolverImpl(RiccatiEquationSolver): + """ + public classRiccatiEquationSolverImpl extends :class:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.linear.RiccatiEquationSolver` + + This solver computes the solution using the following approach: 1. Compute the Hamiltonian matrix 2. Extract its complex + eigen vectors (not the best solution, a better solution would be ordered Schur transformation) 3. Approximate the + initial solution given by 2 using the Kleinman algorithm (an iterative method) + """ def __init__(self, realMatrix: RealMatrix, realMatrix2: RealMatrix, realMatrix3: RealMatrix, realMatrix4: RealMatrix): ... - def getK(self) -> RealMatrix: ... - def getP(self) -> RealMatrix: ... + def getK(self) -> RealMatrix: + """ + {inheritDoc} + + Specified by: + :meth:`~org.hipparchus.linear.RiccatiEquationSolver.getK` in + interface :class:`~org.hipparchus.linear.RiccatiEquationSolver` + + Returns: + the linear controller k + + + """ + ... + def getP(self) -> RealMatrix: + """ + {inheritDoc} + + Specified by: + :meth:`~org.hipparchus.linear.RiccatiEquationSolver.getP` in + interface :class:`~org.hipparchus.linear.RiccatiEquationSolver` + + Returns: + the p + + + """ + ... class SingularValueDecomposer(MatrixDecomposer): + """ + public classSingularValueDecomposer extends :class:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.linear.MatrixDecomposer` + + Matrix decomposer using Singular Value Decomposition. + + Since: + 1.3 + """ def __init__(self): ... - def decompose(self, realMatrix: RealMatrix) -> DecompositionSolver: ... + def decompose(self, realMatrix: RealMatrix) -> DecompositionSolver: + """ + Get a solver for finding the A × X = B solution in least square sense. + + Specified by: + :meth:`~org.hipparchus.linear.MatrixDecomposer.decompose` in interface :class:`~org.hipparchus.linear.MatrixDecomposer` + + Parameters: + a (:class:`~org.hipparchus.linear.RealMatrix`): coefficient matrix A to decompose + + Returns: + a solver + + + """ + ... _SparseFieldVector__T = typing.TypeVar('_SparseFieldVector__T', bound=org.hipparchus.FieldElement) # <T> class SparseFieldVector(FieldVector[_SparseFieldVector__T], java.io.Serializable, typing.Generic[_SparseFieldVector__T]): + """ + public classSparseFieldVector<T extends :class:`~org.hipparchus.FieldElement`<T>> extends :class:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.linear.FieldVector`<T>, :class:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + This class implements the :class:`~org.hipparchus.linear.FieldVector` interface with a + :class:`~org.hipparchus.util.OpenIntToFieldHashMap` backing store. + + Caveat: This implementation assumes that, for any :code:`x`, the equality :code:`x * 0d == 0d` holds. But it is is not + true for :code:`NaN`. Moreover, zero entries will lose their sign. Some operations (that involve :code:`NaN` and/or + infinities) may thus give incorrect results. + + Also see: + + - :meth:`~serialized` + """ @typing.overload def __init__(self, field: org.hipparchus.Field[_SparseFieldVector__T]): ... @typing.overload @@ -1094,12 +5818,42 @@ class SparseFieldVector(FieldVector[_SparseFieldVector__T], java.io.Serializable def dotProduct(self, fieldVector: FieldVector[_SparseFieldVector__T]) -> _SparseFieldVector__T: ... def ebeDivide(self, fieldVector: FieldVector[_SparseFieldVector__T]) -> FieldVector[_SparseFieldVector__T]: ... def ebeMultiply(self, fieldVector: FieldVector[_SparseFieldVector__T]) -> FieldVector[_SparseFieldVector__T]: ... - def equals(self, object: typing.Any) -> bool: ... - def getDimension(self) -> int: ... + def equals(self, object: typing.Any) -> bool: + """ + + Overrides: + :meth:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.equals` in + class :class:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + + """ + ... + def getDimension(self) -> int: + """ + Returns the size of the vector. + + Specified by: + :meth:`~org.hipparchus.linear.FieldVector.getDimension` in interface :class:`~org.hipparchus.linear.FieldVector` + + Returns: + size + + + """ + ... def getEntry(self, int: int) -> _SparseFieldVector__T: ... def getField(self) -> org.hipparchus.Field[_SparseFieldVector__T]: ... def getSubVector(self, int: int, int2: int) -> FieldVector[_SparseFieldVector__T]: ... - def hashCode(self) -> int: ... + def hashCode(self) -> int: + """ + + Overrides: + :meth:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.hashCode` in + class :class:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + + """ + ... def mapAdd(self, t: _SparseFieldVector__T) -> FieldVector[_SparseFieldVector__T]: ... def mapAddToSelf(self, t: _SparseFieldVector__T) -> FieldVector[_SparseFieldVector__T]: ... def mapDivide(self, t: _SparseFieldVector__T) -> FieldVector[_SparseFieldVector__T]: ... @@ -1115,14 +5869,43 @@ class SparseFieldVector(FieldVector[_SparseFieldVector__T], java.io.Serializable @typing.overload def outerProduct(self, sparseFieldVector: 'SparseFieldVector'[_SparseFieldVector__T]) -> FieldMatrix[_SparseFieldVector__T]: ... def projection(self, fieldVector: FieldVector[_SparseFieldVector__T]) -> FieldVector[_SparseFieldVector__T]: ... - def set(self, t: _SparseFieldVector__T) -> None: ... + def set(self, t: _SparseFieldVector__T) -> None: + """ + Set all elements to a single value. + + Specified by: + :meth:`~org.hipparchus.linear.FieldVector.set` in interface :class:`~org.hipparchus.linear.FieldVector` + + Parameters: + value (:class:`~org.hipparchus.linear.SparseFieldVector`): single value to set for all elements + + Raises: + :class:`~org.hipparchus.exception.NullArgumentException`: if value is null + + + """ + ... def setEntry(self, int: int, t: _SparseFieldVector__T) -> None: ... def setSubVector(self, int: int, fieldVector: FieldVector[_SparseFieldVector__T]) -> None: ... @typing.overload def subtract(self, fieldVector: FieldVector[_SparseFieldVector__T]) -> FieldVector[_SparseFieldVector__T]: ... @typing.overload def subtract(self, sparseFieldVector: 'SparseFieldVector'[_SparseFieldVector__T]) -> 'SparseFieldVector'[_SparseFieldVector__T]: ... - def toArray(self) -> typing.MutableSequence[_SparseFieldVector__T]: ... + def toArray(self) -> typing.MutableSequence[_SparseFieldVector__T]: + """ + Convert the vector to a T array. + + The array is independent from vector data, it's elements are copied. + + Specified by: + :meth:`~org.hipparchus.linear.FieldVector.toArray` in interface :class:`~org.hipparchus.linear.FieldVector` + + Returns: + array containing a copy of vector elements + + + """ + ... @typing.overload def walkInDefaultOrder(self, fieldVectorChangingVisitor: FieldVectorChangingVisitor[_SparseFieldVector__T]) -> _SparseFieldVector__T: ... @typing.overload @@ -1141,10 +5924,28 @@ class SparseFieldVector(FieldVector[_SparseFieldVector__T], java.io.Serializable def walkInOptimizedOrder(self, fieldVectorPreservingVisitor: FieldVectorPreservingVisitor[_SparseFieldVector__T], int: int, int2: int) -> _SparseFieldVector__T: ... class SparseRealVector(RealVector): + """ + public abstract classSparseRealVector extends :class:`~org.hipparchus.linear.RealVector` + + Marker class for RealVectors that require sparse backing storage + + Caveat: Implementation are allowed to assume that, for any :code:`x`, the equality :code:`x * 0d == 0d` holds. But it is + is not true for :code:`NaN`. Moreover, zero entries will lose their sign. Some operations (that involve :code:`NaN` + and/or infinities) may thus give incorrect results, like multiplications, divisions or functions mapping. + """ def __init__(self): ... _AbstractFieldMatrix__T = typing.TypeVar('_AbstractFieldMatrix__T', bound=org.hipparchus.FieldElement) # <T> class AbstractFieldMatrix(FieldMatrix[_AbstractFieldMatrix__T], typing.Generic[_AbstractFieldMatrix__T]): + """ + public abstract classAbstractFieldMatrix<T extends :class:`~org.hipparchus.FieldElement`<T>> extends :class:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.linear.FieldMatrix`<T> + + Basic implementation of :class:`~org.hipparchus.linear.FieldMatrix` methods regardless of the underlying storage. + + All the methods implemented here use :meth:`~org.hipparchus.linear.AbstractFieldMatrix.getEntry` to access matrix + elements. Derived class can provide faster implementations. + """ def add(self, fieldMatrix: FieldMatrix[_AbstractFieldMatrix__T]) -> FieldMatrix[_AbstractFieldMatrix__T]: ... def addToEntry(self, int: int, int2: int, t: _AbstractFieldMatrix__T) -> None: ... def copy(self) -> FieldMatrix[_AbstractFieldMatrix__T]: ... @@ -1153,16 +5954,69 @@ class AbstractFieldMatrix(FieldMatrix[_AbstractFieldMatrix__T], typing.Generic[_ @typing.overload def copySubMatrix(self, intArray: typing.Union[typing.List[int], jpype.JArray], intArray2: typing.Union[typing.List[int], jpype.JArray], tArray: typing.Union[typing.List[typing.MutableSequence[_AbstractFieldMatrix__T]], jpype.JArray]) -> None: ... def createMatrix(self, int: int, int2: int) -> FieldMatrix[_AbstractFieldMatrix__T]: ... - def equals(self, object: typing.Any) -> bool: ... + def equals(self, object: typing.Any) -> bool: + """ + Returns true iff :code:`object` is a :code:`FieldMatrix` instance with the same dimensions as this and all corresponding + matrix entries are equal. + + Overrides: + :meth:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.equals` in + class :class:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Parameters: + object (:class:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object`): the object to test equality against. + + Returns: + true if object equals this + + + """ + ... def getColumn(self, int: int) -> typing.MutableSequence[_AbstractFieldMatrix__T]: ... - def getColumnDimension(self) -> int: ... + def getColumnDimension(self) -> int: + """ + Returns the number of columns in the matrix. + + Specified by: + :meth:`~org.hipparchus.linear.AnyMatrix.getColumnDimension` in interface :class:`~org.hipparchus.linear.AnyMatrix` + + Returns: + columnDimension + + + """ + ... def getColumnMatrix(self, int: int) -> FieldMatrix[_AbstractFieldMatrix__T]: ... def getColumnVector(self, int: int) -> FieldVector[_AbstractFieldMatrix__T]: ... - def getData(self) -> typing.MutableSequence[typing.MutableSequence[_AbstractFieldMatrix__T]]: ... + def getData(self) -> typing.MutableSequence[typing.MutableSequence[_AbstractFieldMatrix__T]]: + """ + Returns matrix entries as a two-dimensional array. + + Specified by: + :meth:`~org.hipparchus.linear.FieldMatrix.getData` in interface :class:`~org.hipparchus.linear.FieldMatrix` + + Returns: + a 2-dimensional array of entries. + + + """ + ... def getEntry(self, int: int, int2: int) -> _AbstractFieldMatrix__T: ... def getField(self) -> org.hipparchus.Field[_AbstractFieldMatrix__T]: ... def getRow(self, int: int) -> typing.MutableSequence[_AbstractFieldMatrix__T]: ... - def getRowDimension(self) -> int: ... + def getRowDimension(self) -> int: + """ + Returns the number of rows in the matrix. + + Specified by: + :meth:`~org.hipparchus.linear.AnyMatrix.getRowDimension` in interface :class:`~org.hipparchus.linear.AnyMatrix` + + Returns: + rowDimension + + + """ + ... def getRowMatrix(self, int: int) -> FieldMatrix[_AbstractFieldMatrix__T]: ... def getRowVector(self, int: int) -> FieldVector[_AbstractFieldMatrix__T]: ... @typing.overload @@ -1170,8 +6024,33 @@ class AbstractFieldMatrix(FieldMatrix[_AbstractFieldMatrix__T], typing.Generic[_ @typing.overload def getSubMatrix(self, intArray: typing.Union[typing.List[int], jpype.JArray], intArray2: typing.Union[typing.List[int], jpype.JArray]) -> FieldMatrix[_AbstractFieldMatrix__T]: ... def getTrace(self) -> _AbstractFieldMatrix__T: ... - def hashCode(self) -> int: ... - def isSquare(self) -> bool: ... + def hashCode(self) -> int: + """ + Computes a hashcode for the matrix. + + Overrides: + :meth:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.hashCode` in + class :class:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Returns: + hashcode for matrix + + + """ + ... + def isSquare(self) -> bool: + """ + Is this a square matrix? + + Specified by: + :meth:`~org.hipparchus.linear.AnyMatrix.isSquare` in interface :class:`~org.hipparchus.linear.AnyMatrix` + + Returns: + true if the matrix is square (rowDimension = columnDimension) + + + """ + ... def multiply(self, fieldMatrix: FieldMatrix[_AbstractFieldMatrix__T]) -> FieldMatrix[_AbstractFieldMatrix__T]: ... def multiplyEntry(self, int: int, int2: int, t: _AbstractFieldMatrix__T) -> None: ... @typing.overload @@ -1196,7 +6075,20 @@ class AbstractFieldMatrix(FieldMatrix[_AbstractFieldMatrix__T], typing.Generic[_ def setRowVector(self, int: int, fieldVector: FieldVector[_AbstractFieldMatrix__T]) -> None: ... def setSubMatrix(self, tArray: typing.Union[typing.List[typing.MutableSequence[_AbstractFieldMatrix__T]], jpype.JArray], int: int, int2: int) -> None: ... def subtract(self, fieldMatrix: FieldMatrix[_AbstractFieldMatrix__T]) -> FieldMatrix[_AbstractFieldMatrix__T]: ... - def toString(self) -> str: ... + def toString(self) -> str: + """ + Get a string representation for this matrix. + + Overrides: + :meth:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.toString` in + class :class:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Returns: + a string representation for this matrix + + + """ + ... def transpose(self) -> FieldMatrix[_AbstractFieldMatrix__T]: ... @typing.overload def walkInColumnOrder(self, fieldMatrixChangingVisitor: FieldMatrixChangingVisitor[_AbstractFieldMatrix__T]) -> _AbstractFieldMatrix__T: ... @@ -1224,24 +6116,118 @@ class AbstractFieldMatrix(FieldMatrix[_AbstractFieldMatrix__T], typing.Generic[_ def walkInRowOrder(self, fieldMatrixPreservingVisitor: FieldMatrixPreservingVisitor[_AbstractFieldMatrix__T], int: int, int2: int, int3: int, int4: int) -> _AbstractFieldMatrix__T: ... class AbstractRealMatrix(RealMatrix, RealLinearOperator): + """ + public abstract classAbstractRealMatrix extends :class:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.linear.RealMatrix`, :class:`~org.hipparchus.linear.RealLinearOperator` + + Basic implementation of RealMatrix methods regardless of the underlying storage. + + All the methods implemented here use :meth:`~org.hipparchus.linear.AbstractRealMatrix.getEntry` to access matrix + elements. Derived class can provide faster implementations. + """ def add(self, realMatrix: RealMatrix) -> RealMatrix: ... def addToEntry(self, int: int, int2: int, double: float) -> None: ... - def copy(self) -> RealMatrix: ... + def copy(self) -> RealMatrix: + """ + Returns a (deep) copy of this. + + Specified by: + :meth:`~org.hipparchus.linear.RealMatrix.copy` in interface :class:`~org.hipparchus.linear.RealMatrix` + + Returns: + matrix copy + + + """ + ... @typing.overload def copySubMatrix(self, int: int, int2: int, int3: int, int4: int, doubleArray: typing.Union[typing.List[typing.MutableSequence[float]], jpype.JArray]) -> None: ... @typing.overload def copySubMatrix(self, intArray: typing.Union[typing.List[int], jpype.JArray], intArray2: typing.Union[typing.List[int], jpype.JArray], doubleArray: typing.Union[typing.List[typing.MutableSequence[float]], jpype.JArray]) -> None: ... def createMatrix(self, int: int, int2: int) -> RealMatrix: ... - def equals(self, object: typing.Any) -> bool: ... + def equals(self, object: typing.Any) -> bool: + """ + Returns true iff :code:`object` is a :code:`RealMatrix` instance with the same dimensions as this and all corresponding + matrix entries are equal. + + Overrides: + :meth:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.equals` in + class :class:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Parameters: + object (:class:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object`): the object to test equality against. + + Returns: + true if object equals this + + + """ + ... def getColumn(self, int: int) -> typing.MutableSequence[float]: ... - def getColumnDimension(self) -> int: ... + def getColumnDimension(self) -> int: + """ + Returns the number of columns of this matrix. + + Specified by: + :meth:`~org.hipparchus.linear.AnyMatrix.getColumnDimension` in interface :class:`~org.hipparchus.linear.AnyMatrix` + + Specified by: + :meth:`~org.hipparchus.linear.RealLinearOperator.getColumnDimension` in + interface :class:`~org.hipparchus.linear.RealLinearOperator` + + Returns: + the number of columns. + + + """ + ... def getColumnMatrix(self, int: int) -> RealMatrix: ... def getColumnVector(self, int: int) -> RealVector: ... - def getData(self) -> typing.MutableSequence[typing.MutableSequence[float]]: ... + def getData(self) -> typing.MutableSequence[typing.MutableSequence[float]]: + """ + Returns matrix entries as a two-dimensional array. + + Specified by: + :meth:`~org.hipparchus.linear.RealMatrix.getData` in interface :class:`~org.hipparchus.linear.RealMatrix` + + Returns: + 2-dimensional array of entries + + + """ + ... def getEntry(self, int: int, int2: int) -> float: ... - def getFrobeniusNorm(self) -> float: ... + def getFrobeniusNorm(self) -> float: + """ + Returns the ` Frobenius norm <http://mathworld.wolfram.com/FrobeniusNorm.html>` of the matrix. + + Specified by: + :meth:`~org.hipparchus.linear.RealMatrix.getFrobeniusNorm` in interface :class:`~org.hipparchus.linear.RealMatrix` + + Returns: + norm + + + """ + ... def getRow(self, int: int) -> typing.MutableSequence[float]: ... - def getRowDimension(self) -> int: ... + def getRowDimension(self) -> int: + """ + Returns the number of rows of this matrix. + + Specified by: + :meth:`~org.hipparchus.linear.AnyMatrix.getRowDimension` in interface :class:`~org.hipparchus.linear.AnyMatrix` + + Specified by: + :meth:`~org.hipparchus.linear.RealLinearOperator.getRowDimension` in + interface :class:`~org.hipparchus.linear.RealLinearOperator` + + Returns: + the number of rows. + + + """ + ... def getRowMatrix(self, int: int) -> RealMatrix: ... def getRowVector(self, int: int) -> RealVector: ... @typing.overload @@ -1249,8 +6235,33 @@ class AbstractRealMatrix(RealMatrix, RealLinearOperator): @typing.overload def getSubMatrix(self, intArray: typing.Union[typing.List[int], jpype.JArray], intArray2: typing.Union[typing.List[int], jpype.JArray]) -> RealMatrix: ... def getTrace(self) -> float: ... - def hashCode(self) -> int: ... - def isSquare(self) -> bool: ... + def hashCode(self) -> int: + """ + Computes a hashcode for the matrix. + + Overrides: + :meth:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.hashCode` in + class :class:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Returns: + hashcode for matrix + + + """ + ... + def isSquare(self) -> bool: + """ + Is this a square matrix? + + Specified by: + :meth:`~org.hipparchus.linear.AnyMatrix.isSquare` in interface :class:`~org.hipparchus.linear.AnyMatrix` + + Returns: + true if the matrix is square (rowDimension = columnDimension) + + + """ + ... def multiply(self, realMatrix: RealMatrix) -> RealMatrix: ... def multiplyEntry(self, int: int, int2: int, double: float) -> None: ... @typing.overload @@ -1264,8 +6275,38 @@ class AbstractRealMatrix(RealMatrix, RealLinearOperator): def preMultiply(self, realMatrix: RealMatrix) -> RealMatrix: ... @typing.overload def preMultiply(self, realVector: RealVector) -> RealVector: ... - def scalarAdd(self, double: float) -> RealMatrix: ... - def scalarMultiply(self, double: float) -> RealMatrix: ... + def scalarAdd(self, double: float) -> RealMatrix: + """ + Returns the result of adding :code:`d` to each entry of :code:`this`. + + Specified by: + :meth:`~org.hipparchus.linear.RealMatrix.scalarAdd` in interface :class:`~org.hipparchus.linear.RealMatrix` + + Parameters: + d (double): value to be added to each entry + + Returns: + :code:`d + this` + + + """ + ... + def scalarMultiply(self, double: float) -> RealMatrix: + """ + Returns the result of multiplying each entry of :code:`this` by :code:`d`. + + Specified by: + :meth:`~org.hipparchus.linear.RealMatrix.scalarMultiply` in interface :class:`~org.hipparchus.linear.RealMatrix` + + Parameters: + d (double): value to multiply all entries by + + Returns: + :code:`d * this` + + + """ + ... def setColumn(self, int: int, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> None: ... def setColumnMatrix(self, int: int, realMatrix: RealMatrix) -> None: ... def setColumnVector(self, int: int, realVector: RealVector) -> None: ... @@ -1275,10 +6316,173 @@ class AbstractRealMatrix(RealMatrix, RealLinearOperator): def setRowVector(self, int: int, realVector: RealVector) -> None: ... def setSubMatrix(self, doubleArray: typing.Union[typing.List[typing.MutableSequence[float]], jpype.JArray], int: int, int2: int) -> None: ... def subtract(self, realMatrix: RealMatrix) -> RealMatrix: ... - def toString(self) -> str: ... - def transpose(self) -> RealMatrix: ... - @typing.overload - def walkInColumnOrder(self, realMatrixChangingVisitor: RealMatrixChangingVisitor) -> float: ... + def toString(self) -> str: + """ + Get a string representation for this matrix. + + Overrides: + :meth:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.toString` in + class :class:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Returns: + a string representation for this matrix + + + """ + ... + def transpose(self) -> RealMatrix: + """ + Returns the transpose of this matrix. + + Specified by: + :meth:`~org.hipparchus.linear.RealMatrix.transpose` in interface :class:`~org.hipparchus.linear.RealMatrix` + + Returns: + transpose matrix + + + """ + ... + @typing.overload + def walkInColumnOrder(self, realMatrixChangingVisitor: RealMatrixChangingVisitor) -> float: + """ + Visit (and possibly change) all matrix entries in column order. + + Column order starts at upper left and iterating through all elements of a column from top to bottom before going to the + topmost element of the next column. + + Specified by: + :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` in interface :class:`~org.hipparchus.linear.RealMatrix` + + Parameters: + visitor (:class:`~org.hipparchus.linear.RealMatrixChangingVisitor`): visitor used to process all matrix entries + + Returns: + the value returned by :meth:`~org.hipparchus.linear.RealMatrixChangingVisitor.end` at the end of the walk + + Also see: + + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + + + Visit (but don't change) all matrix entries in column order. + + Column order starts at upper left and iterating through all elements of a column from top to bottom before going to the + topmost element of the next column. + + Specified by: + :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` in interface :class:`~org.hipparchus.linear.RealMatrix` + + Parameters: + visitor (:class:`~org.hipparchus.linear.RealMatrixPreservingVisitor`): visitor used to process all matrix entries + + Returns: + the value returned by :meth:`~org.hipparchus.linear.RealMatrixPreservingVisitor.end` at the end of the walk + + Also see: + + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + + + public double walkInColumnOrder(:class:`~org.hipparchus.linear.RealMatrixChangingVisitor` visitor, int startRow, int endRow, int startColumn, int endColumn) throws :class:`~org.hipparchus.exception.MathIllegalArgumentException` + + Visit (and possibly change) some matrix entries in column order. + + Column order starts at upper left and iterating through all elements of a column from top to bottom before going to the + topmost element of the next column. + + Specified by: + :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` in interface :class:`~org.hipparchus.linear.RealMatrix` + + Parameters: + visitor (:class:`~org.hipparchus.linear.RealMatrixChangingVisitor`): visitor used to process all matrix entries + startRow (int): Initial row index + endRow (int): Final row index (inclusive) + startColumn (int): Initial column index + endColumn (int): Final column index + + Returns: + the value returned by :meth:`~org.hipparchus.linear.RealMatrixChangingVisitor.end` at the end of the walk + + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if the indices are not valid. + + Also see: + + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + + + public double walkInColumnOrder(:class:`~org.hipparchus.linear.RealMatrixPreservingVisitor` visitor, int startRow, int endRow, int startColumn, int endColumn) throws :class:`~org.hipparchus.exception.MathIllegalArgumentException` + + Visit (but don't change) some matrix entries in column order. + + Column order starts at upper left and iterating through all elements of a column from top to bottom before going to the + topmost element of the next column. + + Specified by: + :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` in interface :class:`~org.hipparchus.linear.RealMatrix` + + Parameters: + visitor (:class:`~org.hipparchus.linear.RealMatrixPreservingVisitor`): visitor used to process all matrix entries + startRow (int): Initial row index + endRow (int): Final row index (inclusive) + startColumn (int): Initial column index + endColumn (int): Final column index + + Returns: + the value returned by :meth:`~org.hipparchus.linear.RealMatrixPreservingVisitor.end` at the end of the walk + + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if the indices are not valid. + + Also see: + + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + + + + """ + ... @typing.overload def walkInColumnOrder(self, realMatrixChangingVisitor: RealMatrixChangingVisitor, int: int, int2: int, int3: int, int4: int) -> float: ... @typing.overload @@ -1286,7 +6490,141 @@ class AbstractRealMatrix(RealMatrix, RealLinearOperator): @typing.overload def walkInColumnOrder(self, realMatrixPreservingVisitor: RealMatrixPreservingVisitor, int: int, int2: int, int3: int, int4: int) -> float: ... @typing.overload - def walkInOptimizedOrder(self, realMatrixChangingVisitor: RealMatrixChangingVisitor) -> float: ... + def walkInOptimizedOrder(self, realMatrixChangingVisitor: RealMatrixChangingVisitor) -> float: + """ + Visit (and possibly change) all matrix entries using the fastest possible order. + + The fastest walking order depends on the exact matrix class. It may be different from traditional row or column orders. + + Specified by: + :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` in interface :class:`~org.hipparchus.linear.RealMatrix` + + Parameters: + visitor (:class:`~org.hipparchus.linear.RealMatrixChangingVisitor`): visitor used to process all matrix entries + + Returns: + the value returned by :meth:`~org.hipparchus.linear.RealMatrixChangingVisitor.end` at the end of the walk + + Also see: + + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + + + Visit (but don't change) all matrix entries using the fastest possible order. + + The fastest walking order depends on the exact matrix class. It may be different from traditional row or column orders. + + Specified by: + :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` in interface :class:`~org.hipparchus.linear.RealMatrix` + + Parameters: + visitor (:class:`~org.hipparchus.linear.RealMatrixPreservingVisitor`): visitor used to process all matrix entries + + Returns: + the value returned by :meth:`~org.hipparchus.linear.RealMatrixPreservingVisitor.end` at the end of the walk + + Also see: + + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + + + public double walkInOptimizedOrder(:class:`~org.hipparchus.linear.RealMatrixChangingVisitor` visitor, int startRow, int endRow, int startColumn, int endColumn) throws :class:`~org.hipparchus.exception.MathIllegalArgumentException` + + Visit (and possibly change) some matrix entries using the fastest possible order. + + The fastest walking order depends on the exact matrix class. It may be different from traditional row or column orders. + + Specified by: + :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` in interface :class:`~org.hipparchus.linear.RealMatrix` + + Parameters: + visitor (:class:`~org.hipparchus.linear.RealMatrixChangingVisitor`): visitor used to process all matrix entries + startRow (int): Initial row index + endRow (int): Final row index (inclusive) + startColumn (int): Initial column index + endColumn (int): Final column index (inclusive) + + Returns: + the value returned by :meth:`~org.hipparchus.linear.RealMatrixChangingVisitor.end` at the end of the walk + + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if the indices are not valid. + + Also see: + + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + + + public double walkInOptimizedOrder(:class:`~org.hipparchus.linear.RealMatrixPreservingVisitor` visitor, int startRow, int endRow, int startColumn, int endColumn) throws :class:`~org.hipparchus.exception.MathIllegalArgumentException` + + Visit (but don't change) some matrix entries using the fastest possible order. + + The fastest walking order depends on the exact matrix class. It may be different from traditional row or column orders. + + Specified by: + :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` in interface :class:`~org.hipparchus.linear.RealMatrix` + + Parameters: + visitor (:class:`~org.hipparchus.linear.RealMatrixPreservingVisitor`): visitor used to process all matrix entries + startRow (int): Initial row index + endRow (int): Final row index (inclusive) + startColumn (int): Initial column index + endColumn (int): Final column index (inclusive) + + Returns: + the value returned by :meth:`~org.hipparchus.linear.RealMatrixPreservingVisitor.end` at the end of the walk + + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if the indices are not valid. + + Also see: + + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + + + + """ + ... @typing.overload def walkInOptimizedOrder(self, realMatrixChangingVisitor: RealMatrixChangingVisitor, int: int, int2: int, int3: int, int4: int) -> float: ... @typing.overload @@ -1294,7 +6632,145 @@ class AbstractRealMatrix(RealMatrix, RealLinearOperator): @typing.overload def walkInOptimizedOrder(self, realMatrixPreservingVisitor: RealMatrixPreservingVisitor, int: int, int2: int, int3: int, int4: int) -> float: ... @typing.overload - def walkInRowOrder(self, realMatrixChangingVisitor: RealMatrixChangingVisitor) -> float: ... + def walkInRowOrder(self, realMatrixChangingVisitor: RealMatrixChangingVisitor) -> float: + """ + Visit (and possibly change) all matrix entries in row order. + + Row order starts at upper left and iterating through all elements of a row from left to right before going to the + leftmost element of the next row. + + Specified by: + :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` in interface :class:`~org.hipparchus.linear.RealMatrix` + + Parameters: + visitor (:class:`~org.hipparchus.linear.RealMatrixChangingVisitor`): visitor used to process all matrix entries + + Returns: + the value returned by :meth:`~org.hipparchus.linear.RealMatrixChangingVisitor.end` at the end of the walk + + Also see: + + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + + + Visit (but don't change) all matrix entries in row order. + + Row order starts at upper left and iterating through all elements of a row from left to right before going to the + leftmost element of the next row. + + Specified by: + :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` in interface :class:`~org.hipparchus.linear.RealMatrix` + + Parameters: + visitor (:class:`~org.hipparchus.linear.RealMatrixPreservingVisitor`): visitor used to process all matrix entries + + Returns: + the value returned by :meth:`~org.hipparchus.linear.RealMatrixPreservingVisitor.end` at the end of the walk + + Also see: + + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + + + public double walkInRowOrder(:class:`~org.hipparchus.linear.RealMatrixChangingVisitor` visitor, int startRow, int endRow, int startColumn, int endColumn) throws :class:`~org.hipparchus.exception.MathIllegalArgumentException` + + Visit (and possibly change) some matrix entries in row order. + + Row order starts at upper left and iterating through all elements of a row from left to right before going to the + leftmost element of the next row. + + Specified by: + :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` in interface :class:`~org.hipparchus.linear.RealMatrix` + + Parameters: + visitor (:class:`~org.hipparchus.linear.RealMatrixChangingVisitor`): visitor used to process all matrix entries + startRow (int): Initial row index + endRow (int): Final row index (inclusive) + startColumn (int): Initial column index + endColumn (int): Final column index + + Returns: + the value returned by :meth:`~org.hipparchus.linear.RealMatrixChangingVisitor.end` at the end of the walk + + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if the indices are not valid. + + Also see: + + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + + + public double walkInRowOrder(:class:`~org.hipparchus.linear.RealMatrixPreservingVisitor` visitor, int startRow, int endRow, int startColumn, int endColumn) throws :class:`~org.hipparchus.exception.MathIllegalArgumentException` + + Visit (but don't change) some matrix entries in row order. + + Row order starts at upper left and iterating through all elements of a row from left to right before going to the + leftmost element of the next row. + + Specified by: + :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` in interface :class:`~org.hipparchus.linear.RealMatrix` + + Parameters: + visitor (:class:`~org.hipparchus.linear.RealMatrixPreservingVisitor`): visitor used to process all matrix entries + startRow (int): Initial row index + endRow (int): Final row index (inclusive) + startColumn (int): Initial column index + endColumn (int): Final column index + + Returns: + the value returned by :meth:`~org.hipparchus.linear.RealMatrixPreservingVisitor.end` at the end of the walk + + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if the indices are not valid. + + Also see: + + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + + + + """ + ... @typing.overload def walkInRowOrder(self, realMatrixChangingVisitor: RealMatrixChangingVisitor, int: int, int2: int, int3: int, int4: int) -> float: ... @typing.overload @@ -1303,20 +6779,125 @@ class AbstractRealMatrix(RealMatrix, RealLinearOperator): def walkInRowOrder(self, realMatrixPreservingVisitor: RealMatrixPreservingVisitor, int: int, int2: int, int3: int, int4: int) -> float: ... class ConjugateGradient(PreconditionedIterativeLinearSolver): + """ + public classConjugateGradient extends :class:`~org.hipparchus.linear.PreconditionedIterativeLinearSolver` + + + This is an implementation of the conjugate gradient method for :class:`~org.hipparchus.linear.RealLinearOperator`. It + follows closely the template by :meth:`~org.hipparchus.linear.ConjugateGradient.BARR1994` (figure 2.5). The linear + system at hand is A · x = b, and the residual is r = b - A · x. + + **Default stopping criterion** + + A default stopping criterion is implemented. The iterations stop when || r || ≤ δ || b ||, where b is the right-hand + side vector, r the current estimate of the residual, and δ a user-specified tolerance. It should be noted that r is the + so-called *updated* residual, which might differ from the true residual due to rounding-off errors (see e.g. + :meth:`~org.hipparchus.linear.ConjugateGradient.STRA2002`). + + **Iteration count** + + In the present context, an iteration should be understood as one evaluation of the matrix-vector product A · x. The + initialization phase therefore counts as one iteration. + + **:class:`~org.hipparchus.linear`** + + Besides standard :class:`~org.hipparchus.exception.MathIllegalArgumentException`, this class might throw + :class:`~org.hipparchus.exception.MathIllegalArgumentException` if the linear operator or the preconditioner are not + positive definite. + + - key :code:`"operator"` points to the offending linear operator, say L, + - key :code:`"vector"` points to the offending vector, say x, such that x :sup:`T` · L · x < 0. + + + **References** + + Barret et al. (1994) + R. Barrett, M. Berry, T. F. Chan, J. Demmel, J. M. Donato, J. Dongarra, V. Eijkhout, R. Pozo, C. Romine and H. Van der + Vorst, `*Templates for the Solution of Linear Systems: Building Blocks for Iterative Methods* + <http://www.netlib.org/linalg/html_templates/Templates.html>`, SIAM + + Strakos and Tichy (2002) + Z. Strakos and P. Tichy, ` *On error estimation in the conjugate gradient method and why it works in finite precision + computations* <http://etna.mcs.kent.edu/vol.13.2002/pp56-80.dir/pp56-80.pdf>`, Electronic Transactions on Numerical + Analysis 13: 56-80, 2002 + """ OPERATOR: typing.ClassVar[str] = ... + """ + public static final :class:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.String` OPERATOR + + Key for the :meth:`~org.hipparchus.linear.ConjugateGradient.context`. + + Also see: + + - :meth:`~constant` + + + + """ VECTOR: typing.ClassVar[str] = ... + """ + public static final :class:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.String` VECTOR + + Key for the :meth:`~org.hipparchus.linear.ConjugateGradient.context`. + + Also see: + + - :meth:`~constant` + + + + """ @typing.overload def __init__(self, int: int, double: float, boolean: bool): ... @typing.overload def __init__(self, iterationManager: org.hipparchus.util.IterationManager, double: float, boolean: bool): ... - def shouldCheck(self) -> bool: ... + def shouldCheck(self) -> bool: + """ + Returns :code:`true` if positive-definiteness should be checked for both matrix and preconditioner. + + Returns: + :code:`true` if the tests are to be performed + + Since: + 1.4 + + + """ + ... @typing.overload def solveInPlace(self, realLinearOperator: RealLinearOperator, realLinearOperator2: RealLinearOperator, realVector: RealVector, realVector2: RealVector) -> RealVector: ... @typing.overload def solveInPlace(self, realLinearOperator: RealLinearOperator, realVector: RealVector, realVector2: RealVector) -> RealVector: ... class OpenMapRealVector(SparseRealVector, java.io.Serializable): + """ + public classOpenMapRealVector extends :class:`~org.hipparchus.linear.SparseRealVector` + implements :class:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + This class implements the :class:`~org.hipparchus.linear.RealVector` interface with a + :class:`~org.hipparchus.util.OpenIntToDoubleHashMap` backing store. + + Caveat: This implementation assumes that, for any :code:`x`, the equality :code:`x * 0d == 0d` holds. But it is is not + true for :code:`NaN`. Moreover, zero entries will lose their sign. Some operations (that involve :code:`NaN` and/or + infinities) may thus give incorrect results, like multiplications, divisions or functions mapping. + + Also see: + + - :meth:`~serialized` + """ DEFAULT_ZERO_TOLERANCE: typing.ClassVar[float] = ... + """ + public static final double DEFAULT_ZERO_TOLERANCE + + Default Tolerance for having a value considered zero. + + Also see: + + - :meth:`~constant` + + + + """ @typing.overload def __init__(self): ... @typing.overload @@ -1344,16 +6925,99 @@ class OpenMapRealVector(SparseRealVector, java.io.Serializable): @typing.overload def add(self, realVector: RealVector) -> RealVector: ... @typing.overload - def append(self, double: float) -> 'OpenMapRealVector': ... + def append(self, double: float) -> 'OpenMapRealVector': + """ + Optimized method to append a OpenMapRealVector. + + Parameters: + v (:class:`~org.hipparchus.linear.OpenMapRealVector`): vector to append + + Returns: + The result of appending :code:`v` to self + + Construct a new vector by appending a vector to this vector. + + Specified by: + :meth:`~org.hipparchus.linear.RealVector.append` in class :class:`~org.hipparchus.linear.RealVector` + + Parameters: + v (:class:`~org.hipparchus.linear.RealVector`): vector to append to this one. + + Returns: + a new vector. + + Construct a new vector by appending a double to this vector. + + Specified by: + :meth:`~org.hipparchus.linear.RealVector.append` in class :class:`~org.hipparchus.linear.RealVector` + + Parameters: + d (double): double to append. + + Returns: + a new vector. + + + """ + ... @typing.overload def append(self, openMapRealVector: 'OpenMapRealVector') -> 'OpenMapRealVector': ... @typing.overload def append(self, realVector: RealVector) -> 'OpenMapRealVector': ... - def copy(self) -> 'OpenMapRealVector': ... + def copy(self) -> 'OpenMapRealVector': + """ + Returns a (deep) copy of this vector. + + Specified by: + :meth:`~org.hipparchus.linear.RealVector.copy` in class :class:`~org.hipparchus.linear.RealVector` + + Returns: + a vector copy. + + + """ + ... def ebeDivide(self, realVector: RealVector) -> 'OpenMapRealVector': ... def ebeMultiply(self, realVector: RealVector) -> 'OpenMapRealVector': ... - def equals(self, object: typing.Any) -> bool: ... - def getDimension(self) -> int: ... + def equals(self, object: typing.Any) -> bool: + """ + + Test for the equality of two real vectors. If all coordinates of two real vectors are exactly the same, and none are + :code:`NaN`, the two real vectors are considered to be equal. :code:`NaN` coordinates are considered to affect globally + the vector and be equals to each other - i.e, if either (or all) coordinates of the real vector are equal to + :code:`NaN`, the real vector is equal to a vector with all :code:`NaN` coordinates. + + This method *must* be overriden by concrete subclasses of :class:`~org.hipparchus.linear.RealVector` (the current + implementation throws an exception). + Implementation Note: This performs an exact comparison, and as a result it is possible for :code:`a.subtract(b`} to be + the zero vector, while :code:`a.equals(b) == false`. + + Overrides: + :meth:`~org.hipparchus.linear.RealVector.equals` in class :class:`~org.hipparchus.linear.RealVector` + + Parameters: + obj (:class:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object`): Object to test for equality. + + Returns: + :code:`true` if two vector objects are equal, :code:`false` if :code:`other` is null, not an instance of + :code:`RealVector`, or not equal to this :code:`RealVector` instance. + + + """ + ... + def getDimension(self) -> int: + """ + Returns the size of the vector. + + Specified by: + :meth:`~org.hipparchus.linear.RealVector.getDimension` in class :class:`~org.hipparchus.linear.RealVector` + + Returns: + the size of this vector. + + + """ + ... @typing.overload def getDistance(self, openMapRealVector: 'OpenMapRealVector') -> float: ... @typing.overload @@ -1364,14 +7028,100 @@ class OpenMapRealVector(SparseRealVector, java.io.Serializable): @typing.overload def getL1Distance(self, realVector: RealVector) -> float: ... def getLInfDistance(self, realVector: RealVector) -> float: ... - def getSparsity(self) -> float: ... + def getSparsity(self) -> float: + """ + Get percentage of none zero elements as a decimal percent. + + Returns: + the percentage of none zero elements as a decimal percent + + + """ + ... def getSubVector(self, int: int, int2: int) -> 'OpenMapRealVector': ... - def hashCode(self) -> int: ... - def isInfinite(self) -> bool: ... - def isNaN(self) -> bool: ... - def mapAdd(self, double: float) -> 'OpenMapRealVector': ... - def mapAddToSelf(self, double: float) -> 'OpenMapRealVector': ... - def set(self, double: float) -> None: ... + def hashCode(self) -> int: + """ + . This method *must* be overriden by concrete subclasses of :class:`~org.hipparchus.linear.RealVector` (current + implementation throws an exception). Implementation Note: This works on exact values, and as a result it is possible for + :code:`a.subtract(b)` to be the zero vector, while :code:`a.hashCode() != b.hashCode()`. + + Overrides: + :meth:`~org.hipparchus.linear.RealVector.hashCode` in class :class:`~org.hipparchus.linear.RealVector` + + + """ + ... + def isInfinite(self) -> bool: + """ + Check whether any coordinate of this vector is infinite and none are :code:`NaN`. + + Specified by: + :meth:`~org.hipparchus.linear.RealVector.isInfinite` in class :class:`~org.hipparchus.linear.RealVector` + + Returns: + :code:`true` if any coordinate of this vector is infinite and none are :code:`NaN`, :code:`false` otherwise. + + + """ + ... + def isNaN(self) -> bool: + """ + Check whether any coordinate of this vector is :code:`NaN`. + + Specified by: + :meth:`~org.hipparchus.linear.RealVector.isNaN` in class :class:`~org.hipparchus.linear.RealVector` + + Returns: + :code:`true` if any coordinate of this vector is :code:`NaN`, :code:`false` otherwise. + + + """ + ... + def mapAdd(self, double: float) -> 'OpenMapRealVector': + """ + Add a value to each entry. Returns a new vector. Does not change instance data. + + Overrides: + :meth:`~org.hipparchus.linear.RealVector.mapAdd` in class :class:`~org.hipparchus.linear.RealVector` + + Parameters: + d (double): Value to be added to each entry. + + Returns: + :code:`this` + :code:`d`. + + + """ + ... + def mapAddToSelf(self, double: float) -> 'OpenMapRealVector': + """ + Add a value to each entry. The instance is changed in-place. + + Overrides: + :meth:`~org.hipparchus.linear.RealVector.mapAddToSelf` in class :class:`~org.hipparchus.linear.RealVector` + + Parameters: + d (double): Value to be added to each entry. + + Returns: + :code:`this`. + + + """ + ... + def set(self, double: float) -> None: + """ + Set all elements to a single value. + + Overrides: + :meth:`~org.hipparchus.linear.RealVector.set` in class :class:`~org.hipparchus.linear.RealVector` + + Parameters: + value (double): Single value to set for all elements. + + + """ + ... def setEntry(self, int: int, double: float) -> None: ... def setSubVector(self, int: int, realVector: RealVector) -> None: ... def sparseIterator(self) -> java.util.Iterator[RealVector.Entry]: ... @@ -1379,18 +7129,136 @@ class OpenMapRealVector(SparseRealVector, java.io.Serializable): def subtract(self, openMapRealVector: 'OpenMapRealVector') -> 'OpenMapRealVector': ... @typing.overload def subtract(self, realVector: RealVector) -> RealVector: ... - def toArray(self) -> typing.MutableSequence[float]: ... + def toArray(self) -> typing.MutableSequence[float]: + """ + Convert the vector to an array of :code:`double`s. The array is independent from this vector data: the elements are + copied. + + Overrides: + :meth:`~org.hipparchus.linear.RealVector.toArray` in class :class:`~org.hipparchus.linear.RealVector` + + Returns: + an array containing a copy of the vector elements. + + + """ + ... def unitVector(self) -> 'OpenMapRealVector': ... def unitize(self) -> None: ... -class SparseRealMatrix(RealMatrix): ... +class SparseRealMatrix(RealMatrix): + """ + public interfaceSparseRealMatrixextends :class:`~org.hipparchus.linear.RealMatrix` + + Marker interface for :class:`~org.hipparchus.linear.RealMatrix` implementations that require sparse backing storage + + Caveat: Implementation are allowed to assume that, for any :code:`x`, the equality :code:`x * 0d == 0d` holds. But it is + is not true for :code:`NaN`. Moreover, zero entries will lose their sign. Some operations (that involve :code:`NaN` + and/or infinities) may thus give incorrect results. + """ + ... class SymmLQ(PreconditionedIterativeLinearSolver): + """ + public classSymmLQ extends :class:`~org.hipparchus.linear.PreconditionedIterativeLinearSolver` + + + Implementation of the SYMMLQ iterative linear solver proposed by :meth:`~org.hipparchus.linear.SymmLQ.PAIG1975`. This + implementation is largely based on the FORTRAN code by Pr. Michael A. Saunders, available `here + <http://www.stanford.edu/group/SOL/software/symmlq/f77/>`. + + SYMMLQ is designed to solve the system of linear equations A · x = b where A is an n × n self-adjoint linear operator + (defined as a :class:`~org.hipparchus.linear.RealLinearOperator`), and b is a given vector. The operator A is not + required to be positive definite. If A is known to be definite, the method of conjugate gradients might be preferred, + since it will require about the same number of iterations as SYMMLQ but slightly less work per iteration. + + SYMMLQ is designed to solve the system (A - shift · I) · x = b, where shift is a specified scalar value. If shift and + b are suitably chosen, the computed vector x may approximate an (unnormalized) eigenvector of A, as in the methods of + inverse iteration and/or Rayleigh-quotient iteration. Again, the linear operator (A - shift · I) need not be positive + definite (but *must* be self-adjoint). The work per iteration is very slightly less if shift = 0. + + **Preconditioning** + + Preconditioning may reduce the number of iterations required. The solver may be provided with a positive definite + preconditioner M = P :sup:`T` · P that is known to approximate (A - shift · I) :sup:`-1` in some sense, where + matrix-vector products of the form M · y = x can be computed efficiently. Then SYMMLQ will implicitly solve the system + of equations P · (A - shift · I) · P :sup:`T` · x :sub:`hat` = P · b, i.e. A :sub:`hat` · x :sub:`hat` = b + :sub:`hat` , where A :sub:`hat` = P · (A - shift · I) · P :sup:`T` , b :sub:`hat` = P · b, and return the solution x + = P :sup:`T` · x :sub:`hat` . The associated residual is r :sub:`hat` = b :sub:`hat` - A :sub:`hat` · x :sub:`hat` = P + · [b - (A - shift · I) · x] = P · r. + + In the case of preconditioning, the :class:`~org.hipparchus.linear.IterativeLinearSolverEvent`s that this solver fires + are such that :meth:`~org.hipparchus.linear.IterativeLinearSolverEvent.getNormOfResidual` returns the norm of the + *preconditioned*, updated residual, ||P · r||, not the norm of the *true* residual ||r||. + + **Default stopping criterion** + + A default stopping criterion is implemented. The iterations stop when || rhat || ≤ δ || Ahat || || xhat ||, where + xhat is the current estimate of the solution of the transformed system, rhat the current estimate of the corresponding + residual, and δ a user-specified tolerance. + **Iteration count** + + In the present context, an iteration should be understood as one evaluation of the matrix-vector product A · x. The + initialization phase therefore counts as one iteration. If the user requires checks on the symmetry of A, this entails + one further matrix-vector product in the initial phase. This further product is *not* accounted for in the iteration + count. In other words, the number of iterations required to reach convergence will be identical, whether checks have + been required or not. + + The present definition of the iteration count differs from that adopted in the original FOTRAN code, where the + initialization phase was *not* taken into account. + **Initial guess of the solution** + + The :code:`x` parameter in + + - :meth:`~org.hipparchus.linear.SymmLQ.solve`, + - :meth:`~org.hipparchus.linear.SymmLQ.solve`}, + - :meth:`~org.hipparchus.linear.SymmLQ.solveInPlace`, + - :meth:`~org.hipparchus.linear.SymmLQ.solveInPlace`, + - :meth:`~org.hipparchus.linear.SymmLQ.solveInPlace`, + + + should not be considered as an initial guess, as it is set to zero in the initial phase. If x :sub:`0` is known to be a + good approximation to x, one should compute r :sub:`0` = b - A · x, solve A · dx = r0, and set x = x :sub:`0` + dx. + + **Exception context** + + Besides standard :class:`~org.hipparchus.exception.MathIllegalArgumentException`, this class might throw + :class:`~org.hipparchus.exception.MathIllegalArgumentException` if the linear operator or the preconditioner are not + symmetric. + + - key :code:`"operator"` points to the offending linear operator, say L, + - key :code:`"vector1"` points to the first offending vector, say x, + - key :code:`"vector2"` points to the second offending vector, say y, such that x :sup:`T` · L · y ≠y :sup:`T` · L + · x (within a certain accuracy). + + + :class:`~org.hipparchus.exception.MathIllegalArgumentException` might also be thrown in case the preconditioner is not + positive definite. + + **References** + + :class:`~org.hipparchus.linear` + C. C. Paige and M. A. Saunders, `*Solution of Sparse Indefinite Systems of Linear Equations* + <http://www.stanford.edu/group/SOL/software/symmlq/PS75.pdf>`, SIAM Journal on Numerical Analysis 12(4): 617-629, 1975 + """ @typing.overload def __init__(self, int: int, double: float, boolean: bool): ... @typing.overload def __init__(self, iterationManager: org.hipparchus.util.IterationManager, double: float, boolean: bool): ... - def shouldCheck(self) -> bool: ... + def shouldCheck(self) -> bool: + """ + Returns :code:`true` if symmetry of the matrix, and symmetry as well as positive definiteness of the preconditioner + should be checked. + + Returns: + :code:`true` if the tests are to be performed + + Since: + 1.4 + + + """ + ... @typing.overload def solve(self, realLinearOperator: RealLinearOperator, realLinearOperator2: RealLinearOperator, realVector: RealVector) -> RealVector: ... @typing.overload @@ -1412,6 +7280,20 @@ class SymmLQ(PreconditionedIterativeLinearSolver): _Array2DRowFieldMatrix__T = typing.TypeVar('_Array2DRowFieldMatrix__T', bound=org.hipparchus.FieldElement) # <T> class Array2DRowFieldMatrix(AbstractFieldMatrix[_Array2DRowFieldMatrix__T], java.io.Serializable, typing.Generic[_Array2DRowFieldMatrix__T]): + """ + public classArray2DRowFieldMatrix<T extends :class:`~org.hipparchus.FieldElement`<T>> extends :class:`~org.hipparchus.linear.AbstractFieldMatrix`<T> + implements :class:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + Implementation of :class:`~org.hipparchus.linear.FieldMatrix` using a :class:`~org.hipparchus.FieldElement`[][] array to + store entries. + + As specified in the :class:`~org.hipparchus.linear.FieldMatrix` interface, matrix element indexing is 0-based -- e.g., + :code:`getEntry(0, 0)` returns the element in the first row, first column of the matrix + + Also see: + + - :meth:`~serialized` + """ @typing.overload def __init__(self, field: org.hipparchus.Field[_Array2DRowFieldMatrix__T]): ... @typing.overload @@ -1435,12 +7317,68 @@ class Array2DRowFieldMatrix(AbstractFieldMatrix[_Array2DRowFieldMatrix__T], java def addToEntry(self, int: int, int2: int, t: _Array2DRowFieldMatrix__T) -> None: ... def copy(self) -> FieldMatrix[_Array2DRowFieldMatrix__T]: ... def createMatrix(self, int: int, int2: int) -> FieldMatrix[_Array2DRowFieldMatrix__T]: ... - def getColumnDimension(self) -> int: ... - def getData(self) -> typing.MutableSequence[typing.MutableSequence[_Array2DRowFieldMatrix__T]]: ... - def getDataRef(self) -> typing.MutableSequence[typing.MutableSequence[_Array2DRowFieldMatrix__T]]: ... + def getColumnDimension(self) -> int: + """ + Returns the number of columns in the matrix. + + Specified by: + :meth:`~org.hipparchus.linear.AnyMatrix.getColumnDimension` in interface :class:`~org.hipparchus.linear.AnyMatrix` + + Specified by: + :meth:`~org.hipparchus.linear.AbstractFieldMatrix.getColumnDimension` in + class :class:`~org.hipparchus.linear.AbstractFieldMatrix` + + Returns: + columnDimension + + + """ + ... + def getData(self) -> typing.MutableSequence[typing.MutableSequence[_Array2DRowFieldMatrix__T]]: + """ + Returns matrix entries as a two-dimensional array. + + Specified by: + :meth:`~org.hipparchus.linear.FieldMatrix.getData` in interface :class:`~org.hipparchus.linear.FieldMatrix` + + Overrides: + :meth:`~org.hipparchus.linear.AbstractFieldMatrix.getData` in class :class:`~org.hipparchus.linear.AbstractFieldMatrix` + + Returns: + a 2-dimensional array of entries. + + + """ + ... + def getDataRef(self) -> typing.MutableSequence[typing.MutableSequence[_Array2DRowFieldMatrix__T]]: + """ + Get a reference to the underlying data array. This methods returns internal data, **not** fresh copy of it. + + Returns: + the 2-dimensional array of entries. + + + """ + ... def getEntry(self, int: int, int2: int) -> _Array2DRowFieldMatrix__T: ... def getRow(self, int: int) -> typing.MutableSequence[_Array2DRowFieldMatrix__T]: ... - def getRowDimension(self) -> int: ... + def getRowDimension(self) -> int: + """ + Returns the number of rows in the matrix. + + Specified by: + :meth:`~org.hipparchus.linear.AnyMatrix.getRowDimension` in interface :class:`~org.hipparchus.linear.AnyMatrix` + + Specified by: + :meth:`~org.hipparchus.linear.AbstractFieldMatrix.getRowDimension` in + class :class:`~org.hipparchus.linear.AbstractFieldMatrix` + + Returns: + rowDimension + + + """ + ... @typing.overload def getSubMatrix(self, intArray: typing.Union[typing.List[int], jpype.JArray], intArray2: typing.Union[typing.List[int], jpype.JArray]) -> FieldMatrix[_Array2DRowFieldMatrix__T]: ... @typing.overload @@ -1493,6 +7431,16 @@ class Array2DRowFieldMatrix(AbstractFieldMatrix[_Array2DRowFieldMatrix__T], java def walkInRowOrder(self, fieldMatrixPreservingVisitor: FieldMatrixPreservingVisitor[_Array2DRowFieldMatrix__T], int: int, int2: int, int3: int, int4: int) -> _Array2DRowFieldMatrix__T: ... class Array2DRowRealMatrix(AbstractRealMatrix, java.io.Serializable): + """ + public classArray2DRowRealMatrix extends :class:`~org.hipparchus.linear.AbstractRealMatrix` + implements :class:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + Implementation of :class:`~org.hipparchus.linear.RealMatrix` using a :code:`double[][]` array to store entries. + + Also see: + + - :meth:`~serialized` + """ @typing.overload def __init__(self): ... @typing.overload @@ -1508,26 +7456,136 @@ class Array2DRowRealMatrix(AbstractRealMatrix, java.io.Serializable): @typing.overload def add(self, realMatrix: RealMatrix) -> RealMatrix: ... def addToEntry(self, int: int, int2: int, double: float) -> None: ... - def copy(self) -> RealMatrix: ... + def copy(self) -> RealMatrix: + """ + Returns a (deep) copy of this. + + Specified by: + :meth:`~org.hipparchus.linear.RealMatrix.copy` in interface :class:`~org.hipparchus.linear.RealMatrix` + + Specified by: + :meth:`~org.hipparchus.linear.AbstractRealMatrix.copy` in class :class:`~org.hipparchus.linear.AbstractRealMatrix` + + Returns: + matrix copy + + + """ + ... def createMatrix(self, int: int, int2: int) -> RealMatrix: ... - def getColumnDimension(self) -> int: ... - def getData(self) -> typing.MutableSequence[typing.MutableSequence[float]]: ... - def getDataRef(self) -> typing.MutableSequence[typing.MutableSequence[float]]: ... + def getColumnDimension(self) -> int: + """ + Returns the number of columns of this matrix. + + Specified by: + :meth:`~org.hipparchus.linear.AnyMatrix.getColumnDimension` in interface :class:`~org.hipparchus.linear.AnyMatrix` + + Specified by: + :meth:`~org.hipparchus.linear.RealLinearOperator.getColumnDimension` in + interface :class:`~org.hipparchus.linear.RealLinearOperator` + + Specified by: + :meth:`~org.hipparchus.linear.AbstractRealMatrix.getColumnDimension` in + class :class:`~org.hipparchus.linear.AbstractRealMatrix` + + Returns: + the number of columns. + + + """ + ... + def getData(self) -> typing.MutableSequence[typing.MutableSequence[float]]: + """ + Returns matrix entries as a two-dimensional array. + + Specified by: + :meth:`~org.hipparchus.linear.RealMatrix.getData` in interface :class:`~org.hipparchus.linear.RealMatrix` + + Overrides: + :meth:`~org.hipparchus.linear.AbstractRealMatrix.getData` in class :class:`~org.hipparchus.linear.AbstractRealMatrix` + + Returns: + 2-dimensional array of entries + + + """ + ... + def getDataRef(self) -> typing.MutableSequence[typing.MutableSequence[float]]: + """ + Get a reference to the underlying data array. + + Returns: + 2-dimensional array of entries. + + + """ + ... def getEntry(self, int: int, int2: int) -> float: ... def getRow(self, int: int) -> typing.MutableSequence[float]: ... - def getRowDimension(self) -> int: ... + def getRowDimension(self) -> int: + """ + Returns the number of rows of this matrix. + + Specified by: + :meth:`~org.hipparchus.linear.AnyMatrix.getRowDimension` in interface :class:`~org.hipparchus.linear.AnyMatrix` + + Specified by: + :meth:`~org.hipparchus.linear.RealLinearOperator.getRowDimension` in + interface :class:`~org.hipparchus.linear.RealLinearOperator` + + Specified by: + :meth:`~org.hipparchus.linear.AbstractRealMatrix.getRowDimension` in + class :class:`~org.hipparchus.linear.AbstractRealMatrix` + + Returns: + the number of rows. + + + """ + ... @typing.overload def getSubMatrix(self, intArray: typing.Union[typing.List[int], jpype.JArray], intArray2: typing.Union[typing.List[int], jpype.JArray]) -> RealMatrix: ... @typing.overload def getSubMatrix(self, int: int, int2: int, int3: int, int4: int) -> RealMatrix: ... - def kroneckerProduct(self, realMatrix: RealMatrix) -> RealMatrix: ... + def kroneckerProduct(self, realMatrix: RealMatrix) -> RealMatrix: + """ + Kronecker product of the current matrix and the parameter matrix. + + Parameters: + b (:class:`~org.hipparchus.linear.RealMatrix`): matrix to post Kronecker-multiply by + + Returns: + this ⨂ b + + + """ + ... @typing.overload def multiply(self, array2DRowRealMatrix: 'Array2DRowRealMatrix') -> 'Array2DRowRealMatrix': ... @typing.overload def multiply(self, realMatrix: RealMatrix) -> RealMatrix: ... def multiplyEntry(self, int: int, int2: int, double: float) -> None: ... @typing.overload - def multiplyTransposed(self, array2DRowRealMatrix: 'Array2DRowRealMatrix') -> RealMatrix: ... + def multiplyTransposed(self, array2DRowRealMatrix: 'Array2DRowRealMatrix') -> RealMatrix: + """ + Returns the result of postmultiplying :code:`this` by :code:`m^T`. + + This is equivalent to call + :meth:`~org.hipparchus.linear.RealMatrix.multiply`(m.:meth:`~org.hipparchus.linear.RealMatrix.transpose`), but some + implementations may avoid building the intermediate transposed matrix. + + Specified by: + :meth:`~org.hipparchus.linear.RealMatrix.multiplyTransposed` in interface :class:`~org.hipparchus.linear.RealMatrix` + + Parameters: + m (:class:`~org.hipparchus.linear.RealMatrix`): matrix to first transpose and second postmultiply by + + Returns: + :code:`this * m^T` + + + """ + ... @typing.overload def multiplyTransposed(self, realMatrix: RealMatrix) -> RealMatrix: ... @typing.overload @@ -1543,18 +7601,209 @@ class Array2DRowRealMatrix(AbstractRealMatrix, java.io.Serializable): def setEntry(self, int: int, int2: int, double: float) -> None: ... def setRow(self, int: int, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> None: ... def setSubMatrix(self, doubleArray: typing.Union[typing.List[typing.MutableSequence[float]], jpype.JArray], int: int, int2: int) -> None: ... - def stack(self) -> RealMatrix: ... + def stack(self) -> RealMatrix: + """ + Transforms a matrix in a vector (Vectorization). + + Returns: + a one column matrix + + + """ + ... @typing.overload def subtract(self, array2DRowRealMatrix: 'Array2DRowRealMatrix') -> 'Array2DRowRealMatrix': ... @typing.overload def subtract(self, realMatrix: RealMatrix) -> RealMatrix: ... @typing.overload - def transposeMultiply(self, array2DRowRealMatrix: 'Array2DRowRealMatrix') -> RealMatrix: ... + def transposeMultiply(self, array2DRowRealMatrix: 'Array2DRowRealMatrix') -> RealMatrix: + """ + Returns the result of postmultiplying :code:`this^T` by :code:`m`. + + This is equivalent to call + :meth:`~org.hipparchus.linear.RealMatrix.transpose`.:meth:`~org.hipparchus.linear.RealMatrix.multiply`, but some + implementations may avoid building the intermediate transposed matrix. + + Specified by: + :meth:`~org.hipparchus.linear.RealMatrix.transposeMultiply` in interface :class:`~org.hipparchus.linear.RealMatrix` + + Parameters: + m (:class:`~org.hipparchus.linear.RealMatrix`): matrix to postmultiply by + + Returns: + :code:`this^T * m` + + + """ + ... @typing.overload def transposeMultiply(self, realMatrix: RealMatrix) -> RealMatrix: ... - def unstackSquare(self) -> RealMatrix: ... - @typing.overload - def walkInColumnOrder(self, realMatrixChangingVisitor: RealMatrixChangingVisitor) -> float: ... + def unstackSquare(self) -> RealMatrix: + """ + Transforms a one-column stacked matrix into a squared matrix (devectorization). + + Returns: + square matrix + + + """ + ... + @typing.overload + def walkInColumnOrder(self, realMatrixChangingVisitor: RealMatrixChangingVisitor) -> float: + """ + Visit (and possibly change) all matrix entries in column order. + + Column order starts at upper left and iterating through all elements of a column from top to bottom before going to the + topmost element of the next column. + + Specified by: + :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` in interface :class:`~org.hipparchus.linear.RealMatrix` + + Overrides: + :meth:`~org.hipparchus.linear.AbstractRealMatrix.walkInColumnOrder` in + class :class:`~org.hipparchus.linear.AbstractRealMatrix` + + Parameters: + visitor (:class:`~org.hipparchus.linear.RealMatrixChangingVisitor`): visitor used to process all matrix entries + + Returns: + the value returned by :meth:`~org.hipparchus.linear.RealMatrixChangingVisitor.end` at the end of the walk + + Also see: + + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + + + Visit (but don't change) all matrix entries in column order. + + Column order starts at upper left and iterating through all elements of a column from top to bottom before going to the + topmost element of the next column. + + Specified by: + :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` in interface :class:`~org.hipparchus.linear.RealMatrix` + + Overrides: + :meth:`~org.hipparchus.linear.AbstractRealMatrix.walkInColumnOrder` in + class :class:`~org.hipparchus.linear.AbstractRealMatrix` + + Parameters: + visitor (:class:`~org.hipparchus.linear.RealMatrixPreservingVisitor`): visitor used to process all matrix entries + + Returns: + the value returned by :meth:`~org.hipparchus.linear.RealMatrixPreservingVisitor.end` at the end of the walk + + Also see: + + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + + + public double walkInColumnOrder(:class:`~org.hipparchus.linear.RealMatrixChangingVisitor` visitor, int startRow, int endRow, int startColumn, int endColumn) throws :class:`~org.hipparchus.exception.MathIllegalArgumentException` + + Visit (and possibly change) some matrix entries in column order. + + Column order starts at upper left and iterating through all elements of a column from top to bottom before going to the + topmost element of the next column. + + Specified by: + :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` in interface :class:`~org.hipparchus.linear.RealMatrix` + + Overrides: + :meth:`~org.hipparchus.linear.AbstractRealMatrix.walkInColumnOrder` in + class :class:`~org.hipparchus.linear.AbstractRealMatrix` + + Parameters: + visitor (:class:`~org.hipparchus.linear.RealMatrixChangingVisitor`): visitor used to process all matrix entries + startRow (int): Initial row index + endRow (int): Final row index (inclusive) + startColumn (int): Initial column index + endColumn (int): Final column index + + Returns: + the value returned by :meth:`~org.hipparchus.linear.RealMatrixChangingVisitor.end` at the end of the walk + + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if the indices are not valid. + + Also see: + + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + + + public double walkInColumnOrder(:class:`~org.hipparchus.linear.RealMatrixPreservingVisitor` visitor, int startRow, int endRow, int startColumn, int endColumn) throws :class:`~org.hipparchus.exception.MathIllegalArgumentException` + + Visit (but don't change) some matrix entries in column order. + + Column order starts at upper left and iterating through all elements of a column from top to bottom before going to the + topmost element of the next column. + + Specified by: + :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` in interface :class:`~org.hipparchus.linear.RealMatrix` + + Overrides: + :meth:`~org.hipparchus.linear.AbstractRealMatrix.walkInColumnOrder` in + class :class:`~org.hipparchus.linear.AbstractRealMatrix` + + Parameters: + visitor (:class:`~org.hipparchus.linear.RealMatrixPreservingVisitor`): visitor used to process all matrix entries + startRow (int): Initial row index + endRow (int): Final row index (inclusive) + startColumn (int): Initial column index + endColumn (int): Final column index + + Returns: + the value returned by :meth:`~org.hipparchus.linear.RealMatrixPreservingVisitor.end` at the end of the walk + + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if the indices are not valid. + + Also see: + + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + + + + """ + ... @typing.overload def walkInColumnOrder(self, realMatrixChangingVisitor: RealMatrixChangingVisitor, int: int, int2: int, int3: int, int4: int) -> float: ... @typing.overload @@ -1562,7 +7811,161 @@ class Array2DRowRealMatrix(AbstractRealMatrix, java.io.Serializable): @typing.overload def walkInColumnOrder(self, realMatrixPreservingVisitor: RealMatrixPreservingVisitor, int: int, int2: int, int3: int, int4: int) -> float: ... @typing.overload - def walkInRowOrder(self, realMatrixChangingVisitor: RealMatrixChangingVisitor) -> float: ... + def walkInRowOrder(self, realMatrixChangingVisitor: RealMatrixChangingVisitor) -> float: + """ + Visit (and possibly change) all matrix entries in row order. + + Row order starts at upper left and iterating through all elements of a row from left to right before going to the + leftmost element of the next row. + + Specified by: + :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` in interface :class:`~org.hipparchus.linear.RealMatrix` + + Overrides: + :meth:`~org.hipparchus.linear.AbstractRealMatrix.walkInRowOrder` in + class :class:`~org.hipparchus.linear.AbstractRealMatrix` + + Parameters: + visitor (:class:`~org.hipparchus.linear.RealMatrixChangingVisitor`): visitor used to process all matrix entries + + Returns: + the value returned by :meth:`~org.hipparchus.linear.RealMatrixChangingVisitor.end` at the end of the walk + + Also see: + + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + + + Visit (but don't change) all matrix entries in row order. + + Row order starts at upper left and iterating through all elements of a row from left to right before going to the + leftmost element of the next row. + + Specified by: + :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` in interface :class:`~org.hipparchus.linear.RealMatrix` + + Overrides: + :meth:`~org.hipparchus.linear.AbstractRealMatrix.walkInRowOrder` in + class :class:`~org.hipparchus.linear.AbstractRealMatrix` + + Parameters: + visitor (:class:`~org.hipparchus.linear.RealMatrixPreservingVisitor`): visitor used to process all matrix entries + + Returns: + the value returned by :meth:`~org.hipparchus.linear.RealMatrixPreservingVisitor.end` at the end of the walk + + Also see: + + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + + + public double walkInRowOrder(:class:`~org.hipparchus.linear.RealMatrixChangingVisitor` visitor, int startRow, int endRow, int startColumn, int endColumn) throws :class:`~org.hipparchus.exception.MathIllegalArgumentException` + + Visit (and possibly change) some matrix entries in row order. + + Row order starts at upper left and iterating through all elements of a row from left to right before going to the + leftmost element of the next row. + + Specified by: + :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` in interface :class:`~org.hipparchus.linear.RealMatrix` + + Overrides: + :meth:`~org.hipparchus.linear.AbstractRealMatrix.walkInRowOrder` in + class :class:`~org.hipparchus.linear.AbstractRealMatrix` + + Parameters: + visitor (:class:`~org.hipparchus.linear.RealMatrixChangingVisitor`): visitor used to process all matrix entries + startRow (int): Initial row index + endRow (int): Final row index (inclusive) + startColumn (int): Initial column index + endColumn (int): Final column index + + Returns: + the value returned by :meth:`~org.hipparchus.linear.RealMatrixChangingVisitor.end` at the end of the walk + + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if the indices are not valid. + + Also see: + + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + + + public double walkInRowOrder(:class:`~org.hipparchus.linear.RealMatrixPreservingVisitor` visitor, int startRow, int endRow, int startColumn, int endColumn) throws :class:`~org.hipparchus.exception.MathIllegalArgumentException` + + Visit (but don't change) some matrix entries in row order. + + Row order starts at upper left and iterating through all elements of a row from left to right before going to the + leftmost element of the next row. + + Specified by: + :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` in interface :class:`~org.hipparchus.linear.RealMatrix` + + Overrides: + :meth:`~org.hipparchus.linear.AbstractRealMatrix.walkInRowOrder` in + class :class:`~org.hipparchus.linear.AbstractRealMatrix` + + Parameters: + visitor (:class:`~org.hipparchus.linear.RealMatrixPreservingVisitor`): visitor used to process all matrix entries + startRow (int): Initial row index + endRow (int): Final row index (inclusive) + startColumn (int): Initial column index + endColumn (int): Final column index + + Returns: + the value returned by :meth:`~org.hipparchus.linear.RealMatrixPreservingVisitor.end` at the end of the walk + + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if the indices are not valid. + + Also see: + + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + + + + """ + ... @typing.overload def walkInRowOrder(self, realMatrixChangingVisitor: RealMatrixChangingVisitor, int: int, int2: int, int3: int, int4: int) -> float: ... @typing.overload @@ -1572,7 +7975,52 @@ class Array2DRowRealMatrix(AbstractRealMatrix, java.io.Serializable): _BlockFieldMatrix__T = typing.TypeVar('_BlockFieldMatrix__T', bound=org.hipparchus.FieldElement) # <T> class BlockFieldMatrix(AbstractFieldMatrix[_BlockFieldMatrix__T], java.io.Serializable, typing.Generic[_BlockFieldMatrix__T]): + """ + public classBlockFieldMatrix<T extends :class:`~org.hipparchus.FieldElement`<T>> extends :class:`~org.hipparchus.linear.AbstractFieldMatrix`<T> + implements :class:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + Cache-friendly implementation of FieldMatrix using a flat arrays to store square blocks of the matrix. + + This implementation is specially designed to be cache-friendly. Square blocks are stored as small arrays and allow + efficient traversal of data both in row major direction and columns major direction, one block at a time. This greatly + increases performances for algorithms that use crossed directions loops like multiplication or transposition. + + The size of square blocks is a static parameter. It may be tuned according to the cache size of the target computer + processor. As a rule of thumbs, it should be the largest value that allows three blocks to be simultaneously cached + (this is necessary for example for matrix multiplication). The default value is to use 36x36 blocks. + + The regular blocks represent :meth:`~org.hipparchus.linear.BlockFieldMatrix.BLOCK_SIZE` x + :meth:`~org.hipparchus.linear.BlockFieldMatrix.BLOCK_SIZE` squares. Blocks at right hand side and bottom side which may + be smaller to fit matrix dimensions. The square blocks are flattened in row major order in single dimension arrays which + are therefore :meth:`~org.hipparchus.linear.BlockFieldMatrix.BLOCK_SIZE` :sup:`2` elements long for regular blocks. The + blocks are themselves organized in row major order. + + As an example, for a block size of 36x36, a 100x60 matrix would be stored in 6 blocks. Block 0 would be a Field[1296] + array holding the upper left 36x36 square, block 1 would be a Field[1296] array holding the upper center 36x36 square, + block 2 would be a Field[1008] array holding the upper right 36x28 rectangle, block 3 would be a Field[864] array + holding the lower left 24x36 rectangle, block 4 would be a Field[864] array holding the lower center 24x36 rectangle and + block 5 would be a Field[672] array holding the lower right 24x28 rectangle. + + The layout complexity overhead versus simple mapping of matrices to java arrays is negligible for small matrices (about + 1%). The gain from cache efficiency leads to up to 3-fold improvements for matrices of moderate to large size. + + Also see: + + - :meth:`~serialized` + """ BLOCK_SIZE: typing.ClassVar[int] = ... + """ + public static final int BLOCK_SIZE + + Block size. + + Also see: + + - :meth:`~constant` + + + + """ @typing.overload def __init__(self, int: int, int2: int, tArray: typing.Union[typing.List[typing.MutableSequence[_BlockFieldMatrix__T]], jpype.JArray], boolean: bool): ... @typing.overload @@ -1587,16 +8035,86 @@ class BlockFieldMatrix(AbstractFieldMatrix[_BlockFieldMatrix__T], java.io.Serial def copy(self) -> FieldMatrix[_BlockFieldMatrix__T]: ... _createBlocksLayout__T = typing.TypeVar('_createBlocksLayout__T', bound=org.hipparchus.FieldElement) # <T> @staticmethod - def createBlocksLayout(field: org.hipparchus.Field[_createBlocksLayout__T], int: int, int2: int) -> typing.MutableSequence[typing.MutableSequence[_createBlocksLayout__T]]: ... + def createBlocksLayout(field: org.hipparchus.Field[_createBlocksLayout__T], int: int, int2: int) -> typing.MutableSequence[typing.MutableSequence[_createBlocksLayout__T]]: + """ + Create a data array in blocks layout. + + This method can be used to create the array argument of the :meth:`~org.hipparchus.linear.BlockFieldMatrix.%3Cinit%3E` + constructor. + + Parameters: + field (:class:`~org.hipparchus.Field`<T> field): Field to which the elements belong. + rows (int): Number of rows in the new matrix. + columns (int): Number of columns in the new matrix. + + Returns: + a new data array in blocks layout. + + Also see: + + - :meth:`~org.hipparchus.linear.BlockFieldMatrix.toBlocksLayout` + - :meth:`~org.hipparchus.linear.BlockFieldMatrix.%3Cinit%3E` + + + + """ + ... def createMatrix(self, int: int, int2: int) -> FieldMatrix[_BlockFieldMatrix__T]: ... def getColumn(self, int: int) -> typing.MutableSequence[_BlockFieldMatrix__T]: ... - def getColumnDimension(self) -> int: ... + def getColumnDimension(self) -> int: + """ + Returns the number of columns in the matrix. + + Specified by: + :meth:`~org.hipparchus.linear.AnyMatrix.getColumnDimension` in interface :class:`~org.hipparchus.linear.AnyMatrix` + + Specified by: + :meth:`~org.hipparchus.linear.AbstractFieldMatrix.getColumnDimension` in + class :class:`~org.hipparchus.linear.AbstractFieldMatrix` + + Returns: + columnDimension + + + """ + ... def getColumnMatrix(self, int: int) -> FieldMatrix[_BlockFieldMatrix__T]: ... def getColumnVector(self, int: int) -> FieldVector[_BlockFieldMatrix__T]: ... - def getData(self) -> typing.MutableSequence[typing.MutableSequence[_BlockFieldMatrix__T]]: ... + def getData(self) -> typing.MutableSequence[typing.MutableSequence[_BlockFieldMatrix__T]]: + """ + Returns matrix entries as a two-dimensional array. + + Specified by: + :meth:`~org.hipparchus.linear.FieldMatrix.getData` in interface :class:`~org.hipparchus.linear.FieldMatrix` + + Overrides: + :meth:`~org.hipparchus.linear.AbstractFieldMatrix.getData` in class :class:`~org.hipparchus.linear.AbstractFieldMatrix` + + Returns: + a 2-dimensional array of entries. + + + """ + ... def getEntry(self, int: int, int2: int) -> _BlockFieldMatrix__T: ... def getRow(self, int: int) -> typing.MutableSequence[_BlockFieldMatrix__T]: ... - def getRowDimension(self) -> int: ... + def getRowDimension(self) -> int: + """ + Returns the number of rows in the matrix. + + Specified by: + :meth:`~org.hipparchus.linear.AnyMatrix.getRowDimension` in interface :class:`~org.hipparchus.linear.AnyMatrix` + + Specified by: + :meth:`~org.hipparchus.linear.AbstractFieldMatrix.getRowDimension` in + class :class:`~org.hipparchus.linear.AbstractFieldMatrix` + + Returns: + rowDimension + + + """ + ... def getRowMatrix(self, int: int) -> FieldMatrix[_BlockFieldMatrix__T]: ... def getRowVector(self, int: int) -> FieldVector[_BlockFieldMatrix__T]: ... @typing.overload @@ -1665,7 +8183,53 @@ class BlockFieldMatrix(AbstractFieldMatrix[_BlockFieldMatrix__T], java.io.Serial def walkInRowOrder(self, fieldMatrixPreservingVisitor: FieldMatrixPreservingVisitor[_BlockFieldMatrix__T], int: int, int2: int, int3: int, int4: int) -> _BlockFieldMatrix__T: ... class BlockRealMatrix(AbstractRealMatrix, java.io.Serializable): + """ + public classBlockRealMatrix extends :class:`~org.hipparchus.linear.AbstractRealMatrix` + implements :class:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + Cache-friendly implementation of RealMatrix using a flat arrays to store square blocks of the matrix. + + This implementation is specially designed to be cache-friendly. Square blocks are stored as small arrays and allow + efficient traversal of data both in row major direction and columns major direction, one block at a time. This greatly + increases performances for algorithms that use crossed directions loops like multiplication or transposition. + + The size of square blocks is a static parameter. It may be tuned according to the cache size of the target computer + processor. As a rule of thumbs, it should be the largest value that allows three blocks to be simultaneously cached + (this is necessary for example for matrix multiplication). The default value is to use 52x52 blocks which is well suited + for processors with 64k L1 cache (one block holds 2704 values or 21632 bytes). This value could be lowered to 36x36 for + processors with 32k L1 cache. + + The regular blocks represent :meth:`~org.hipparchus.linear.BlockRealMatrix.BLOCK_SIZE` x + :meth:`~org.hipparchus.linear.BlockRealMatrix.BLOCK_SIZE` squares. Blocks at right hand side and bottom side may be + smaller to fit matrix dimensions. The square blocks are flattened in row major order in single dimension arrays which + are therefore :meth:`~org.hipparchus.linear.BlockRealMatrix.BLOCK_SIZE` :sup:`2` elements long for regular blocks. The + blocks are themselves organized in row major order. + + As an example, for a block size of 52x52, a 100x60 matrix would be stored in 4 blocks. Block 0 would be a + :code:`double[2704]` array holding the upper left 52x52 square, block 1 would be a :code:`double[416]` array holding the + upper right 52x8 rectangle, block 2 would be a :code:`double[2496]` array holding the lower left 48x52 rectangle and + block 3 would be a :code:`double[384]` array holding the lower right 48x8 rectangle. + + The layout complexity overhead versus simple mapping of matrices to java arrays is negligible for small matrices (about + 1%). The gain from cache efficiency leads to up to 3-fold improvements for matrices of moderate to large size. + + Also see: + + - :meth:`~serialized` + """ BLOCK_SIZE: typing.ClassVar[int] = ... + """ + public static final int BLOCK_SIZE + + Block size. + + Also see: + + - :meth:`~constant` + + + + """ @typing.overload def __init__(self, doubleArray: typing.Union[typing.List[typing.MutableSequence[float]], jpype.JArray]): ... @typing.overload @@ -1677,21 +8241,155 @@ class BlockRealMatrix(AbstractRealMatrix, java.io.Serializable): @typing.overload def add(self, realMatrix: RealMatrix) -> 'BlockRealMatrix': ... def addToEntry(self, int: int, int2: int, double: float) -> None: ... - def copy(self) -> 'BlockRealMatrix': ... + def copy(self) -> 'BlockRealMatrix': + """ + Returns a (deep) copy of this. + + Specified by: + :meth:`~org.hipparchus.linear.RealMatrix.copy` in interface :class:`~org.hipparchus.linear.RealMatrix` + + Specified by: + :meth:`~org.hipparchus.linear.AbstractRealMatrix.copy` in class :class:`~org.hipparchus.linear.AbstractRealMatrix` + + Returns: + matrix copy + + + """ + ... @staticmethod - def createBlocksLayout(int: int, int2: int) -> typing.MutableSequence[typing.MutableSequence[float]]: ... + def createBlocksLayout(int: int, int2: int) -> typing.MutableSequence[typing.MutableSequence[float]]: + """ + Create a data array in blocks layout. + + This method can be used to create the array argument of the :meth:`~org.hipparchus.linear.BlockRealMatrix.%3Cinit%3E` + constructor. + + Parameters: + rows (int): Number of rows in the new matrix. + columns (int): Number of columns in the new matrix. + + Returns: + a new data array in blocks layout. + + Also see: + + - :meth:`~org.hipparchus.linear.BlockRealMatrix.toBlocksLayout` + - :meth:`~org.hipparchus.linear.BlockRealMatrix.%3Cinit%3E` + + + + """ + ... def createMatrix(self, int: int, int2: int) -> 'BlockRealMatrix': ... def getColumn(self, int: int) -> typing.MutableSequence[float]: ... - def getColumnDimension(self) -> int: ... + def getColumnDimension(self) -> int: + """ + Returns the number of columns of this matrix. + + Specified by: + :meth:`~org.hipparchus.linear.AnyMatrix.getColumnDimension` in interface :class:`~org.hipparchus.linear.AnyMatrix` + + Specified by: + :meth:`~org.hipparchus.linear.RealLinearOperator.getColumnDimension` in + interface :class:`~org.hipparchus.linear.RealLinearOperator` + + Specified by: + :meth:`~org.hipparchus.linear.AbstractRealMatrix.getColumnDimension` in + class :class:`~org.hipparchus.linear.AbstractRealMatrix` + + Returns: + the number of columns. + + + """ + ... def getColumnMatrix(self, int: int) -> 'BlockRealMatrix': ... def getColumnVector(self, int: int) -> RealVector: ... - def getData(self) -> typing.MutableSequence[typing.MutableSequence[float]]: ... + def getData(self) -> typing.MutableSequence[typing.MutableSequence[float]]: + """ + Returns matrix entries as a two-dimensional array. + + Specified by: + :meth:`~org.hipparchus.linear.RealMatrix.getData` in interface :class:`~org.hipparchus.linear.RealMatrix` + + Overrides: + :meth:`~org.hipparchus.linear.AbstractRealMatrix.getData` in class :class:`~org.hipparchus.linear.AbstractRealMatrix` + + Returns: + 2-dimensional array of entries + + + """ + ... def getEntry(self, int: int, int2: int) -> float: ... - def getFrobeniusNorm(self) -> float: ... - def getNorm1(self) -> float: ... - def getNormInfty(self) -> float: ... + def getFrobeniusNorm(self) -> float: + """ + Returns the ` Frobenius norm <http://mathworld.wolfram.com/FrobeniusNorm.html>` of the matrix. + + Specified by: + :meth:`~org.hipparchus.linear.RealMatrix.getFrobeniusNorm` in interface :class:`~org.hipparchus.linear.RealMatrix` + + Overrides: + :meth:`~org.hipparchus.linear.AbstractRealMatrix.getFrobeniusNorm` in + class :class:`~org.hipparchus.linear.AbstractRealMatrix` + + Returns: + norm + + + """ + ... + def getNorm1(self) -> float: + """ + Returns the ` maximum absolute column sum norm <http://mathworld.wolfram.com/MaximumAbsoluteColumnSumNorm.html>` (L + :sub:`1` ) of the matrix. + + Specified by: + :meth:`~org.hipparchus.linear.RealMatrix.getNorm1` in interface :class:`~org.hipparchus.linear.RealMatrix` + + Returns: + norm + + + """ + ... + def getNormInfty(self) -> float: + """ + Returns the ` maximum absolute row sum norm <http://mathworld.wolfram.com/MaximumAbsoluteRowSumNorm.html>` (L :sub:`∞` + ) of the matrix. + + Specified by: + :meth:`~org.hipparchus.linear.RealMatrix.getNormInfty` in interface :class:`~org.hipparchus.linear.RealMatrix` + + Returns: + norm + + + """ + ... def getRow(self, int: int) -> typing.MutableSequence[float]: ... - def getRowDimension(self) -> int: ... + def getRowDimension(self) -> int: + """ + Returns the number of rows of this matrix. + + Specified by: + :meth:`~org.hipparchus.linear.AnyMatrix.getRowDimension` in interface :class:`~org.hipparchus.linear.AnyMatrix` + + Specified by: + :meth:`~org.hipparchus.linear.RealLinearOperator.getRowDimension` in + interface :class:`~org.hipparchus.linear.RealLinearOperator` + + Specified by: + :meth:`~org.hipparchus.linear.AbstractRealMatrix.getRowDimension` in + class :class:`~org.hipparchus.linear.AbstractRealMatrix` + + Returns: + the number of rows. + + + """ + ... def getRowMatrix(self, int: int) -> 'BlockRealMatrix': ... def getRowVector(self, int: int) -> RealVector: ... @typing.overload @@ -1717,8 +8415,45 @@ class BlockRealMatrix(AbstractRealMatrix, java.io.Serializable): def preMultiply(self, realMatrix: RealMatrix) -> RealMatrix: ... @typing.overload def preMultiply(self, realVector: RealVector) -> RealVector: ... - def scalarAdd(self, double: float) -> 'BlockRealMatrix': ... - def scalarMultiply(self, double: float) -> RealMatrix: ... + def scalarAdd(self, double: float) -> 'BlockRealMatrix': + """ + Returns the result of adding :code:`d` to each entry of :code:`this`. + + Specified by: + :meth:`~org.hipparchus.linear.RealMatrix.scalarAdd` in interface :class:`~org.hipparchus.linear.RealMatrix` + + Overrides: + :meth:`~org.hipparchus.linear.AbstractRealMatrix.scalarAdd` in class :class:`~org.hipparchus.linear.AbstractRealMatrix` + + Parameters: + d (double): value to be added to each entry + + Returns: + :code:`d + this` + + + """ + ... + def scalarMultiply(self, double: float) -> RealMatrix: + """ + Returns the result of multiplying each entry of :code:`this` by :code:`d`. + + Specified by: + :meth:`~org.hipparchus.linear.RealMatrix.scalarMultiply` in interface :class:`~org.hipparchus.linear.RealMatrix` + + Overrides: + :meth:`~org.hipparchus.linear.AbstractRealMatrix.scalarMultiply` in + class :class:`~org.hipparchus.linear.AbstractRealMatrix` + + Parameters: + d (double): value to multiply all entries by + + Returns: + :code:`d * this` + + + """ + ... def setColumn(self, int: int, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> None: ... def setColumnMatrix(self, int: int, realMatrix: RealMatrix) -> None: ... def setColumnVector(self, int: int, realVector: RealVector) -> None: ... @@ -1736,13 +8471,178 @@ class BlockRealMatrix(AbstractRealMatrix, java.io.Serializable): def subtract(self, realMatrix: RealMatrix) -> 'BlockRealMatrix': ... @staticmethod def toBlocksLayout(doubleArray: typing.Union[typing.List[typing.MutableSequence[float]], jpype.JArray]) -> typing.MutableSequence[typing.MutableSequence[float]]: ... - def transpose(self) -> 'BlockRealMatrix': ... + def transpose(self) -> 'BlockRealMatrix': + """ + Returns the transpose of this matrix. + + Specified by: + :meth:`~org.hipparchus.linear.RealMatrix.transpose` in interface :class:`~org.hipparchus.linear.RealMatrix` + + Overrides: + :meth:`~org.hipparchus.linear.AbstractRealMatrix.transpose` in class :class:`~org.hipparchus.linear.AbstractRealMatrix` + + Returns: + transpose matrix + + + """ + ... @typing.overload def transposeMultiply(self, blockRealMatrix: 'BlockRealMatrix') -> 'BlockRealMatrix': ... @typing.overload def transposeMultiply(self, realMatrix: RealMatrix) -> 'BlockRealMatrix': ... @typing.overload - def walkInOptimizedOrder(self, realMatrixChangingVisitor: RealMatrixChangingVisitor) -> float: ... + def walkInOptimizedOrder(self, realMatrixChangingVisitor: RealMatrixChangingVisitor) -> float: + """ + Visit (and possibly change) all matrix entries using the fastest possible order. + + The fastest walking order depends on the exact matrix class. It may be different from traditional row or column orders. + + Specified by: + :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` in interface :class:`~org.hipparchus.linear.RealMatrix` + + Overrides: + :meth:`~org.hipparchus.linear.AbstractRealMatrix.walkInOptimizedOrder` in + class :class:`~org.hipparchus.linear.AbstractRealMatrix` + + Parameters: + visitor (:class:`~org.hipparchus.linear.RealMatrixChangingVisitor`): visitor used to process all matrix entries + + Returns: + the value returned by :meth:`~org.hipparchus.linear.RealMatrixChangingVisitor.end` at the end of the walk + + Also see: + + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + + + Visit (but don't change) all matrix entries using the fastest possible order. + + The fastest walking order depends on the exact matrix class. It may be different from traditional row or column orders. + + Specified by: + :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` in interface :class:`~org.hipparchus.linear.RealMatrix` + + Overrides: + :meth:`~org.hipparchus.linear.AbstractRealMatrix.walkInOptimizedOrder` in + class :class:`~org.hipparchus.linear.AbstractRealMatrix` + + Parameters: + visitor (:class:`~org.hipparchus.linear.RealMatrixPreservingVisitor`): visitor used to process all matrix entries + + Returns: + the value returned by :meth:`~org.hipparchus.linear.RealMatrixPreservingVisitor.end` at the end of the walk + + Also see: + + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + + + public double walkInOptimizedOrder(:class:`~org.hipparchus.linear.RealMatrixChangingVisitor` visitor, int startRow, int endRow, int startColumn, int endColumn) throws :class:`~org.hipparchus.exception.MathIllegalArgumentException` + + Visit (and possibly change) some matrix entries using the fastest possible order. + + The fastest walking order depends on the exact matrix class. It may be different from traditional row or column orders. + + Specified by: + :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` in interface :class:`~org.hipparchus.linear.RealMatrix` + + Overrides: + :meth:`~org.hipparchus.linear.AbstractRealMatrix.walkInOptimizedOrder` in + class :class:`~org.hipparchus.linear.AbstractRealMatrix` + + Parameters: + visitor (:class:`~org.hipparchus.linear.RealMatrixChangingVisitor`): visitor used to process all matrix entries + startRow (int): Initial row index + endRow (int): Final row index (inclusive) + startColumn (int): Initial column index + endColumn (int): Final column index (inclusive) + + Returns: + the value returned by :meth:`~org.hipparchus.linear.RealMatrixChangingVisitor.end` at the end of the walk + + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if the indices are not valid. + + Also see: + + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + + + public double walkInOptimizedOrder(:class:`~org.hipparchus.linear.RealMatrixPreservingVisitor` visitor, int startRow, int endRow, int startColumn, int endColumn) throws :class:`~org.hipparchus.exception.MathIllegalArgumentException` + + Visit (but don't change) some matrix entries using the fastest possible order. + + The fastest walking order depends on the exact matrix class. It may be different from traditional row or column orders. + + Specified by: + :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` in interface :class:`~org.hipparchus.linear.RealMatrix` + + Overrides: + :meth:`~org.hipparchus.linear.AbstractRealMatrix.walkInOptimizedOrder` in + class :class:`~org.hipparchus.linear.AbstractRealMatrix` + + Parameters: + visitor (:class:`~org.hipparchus.linear.RealMatrixPreservingVisitor`): visitor used to process all matrix entries + startRow (int): Initial row index + endRow (int): Final row index (inclusive) + startColumn (int): Initial column index + endColumn (int): Final column index (inclusive) + + Returns: + the value returned by :meth:`~org.hipparchus.linear.RealMatrixPreservingVisitor.end` at the end of the walk + + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if the indices are not valid. + + Also see: + + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + + + + """ + ... @typing.overload def walkInOptimizedOrder(self, realMatrixChangingVisitor: RealMatrixChangingVisitor, int: int, int2: int, int3: int, int4: int) -> float: ... @typing.overload @@ -1750,7 +8650,161 @@ class BlockRealMatrix(AbstractRealMatrix, java.io.Serializable): @typing.overload def walkInOptimizedOrder(self, realMatrixPreservingVisitor: RealMatrixPreservingVisitor, int: int, int2: int, int3: int, int4: int) -> float: ... @typing.overload - def walkInRowOrder(self, realMatrixChangingVisitor: RealMatrixChangingVisitor) -> float: ... + def walkInRowOrder(self, realMatrixChangingVisitor: RealMatrixChangingVisitor) -> float: + """ + Visit (and possibly change) all matrix entries in row order. + + Row order starts at upper left and iterating through all elements of a row from left to right before going to the + leftmost element of the next row. + + Specified by: + :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` in interface :class:`~org.hipparchus.linear.RealMatrix` + + Overrides: + :meth:`~org.hipparchus.linear.AbstractRealMatrix.walkInRowOrder` in + class :class:`~org.hipparchus.linear.AbstractRealMatrix` + + Parameters: + visitor (:class:`~org.hipparchus.linear.RealMatrixChangingVisitor`): visitor used to process all matrix entries + + Returns: + the value returned by :meth:`~org.hipparchus.linear.RealMatrixChangingVisitor.end` at the end of the walk + + Also see: + + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + + + Visit (but don't change) all matrix entries in row order. + + Row order starts at upper left and iterating through all elements of a row from left to right before going to the + leftmost element of the next row. + + Specified by: + :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` in interface :class:`~org.hipparchus.linear.RealMatrix` + + Overrides: + :meth:`~org.hipparchus.linear.AbstractRealMatrix.walkInRowOrder` in + class :class:`~org.hipparchus.linear.AbstractRealMatrix` + + Parameters: + visitor (:class:`~org.hipparchus.linear.RealMatrixPreservingVisitor`): visitor used to process all matrix entries + + Returns: + the value returned by :meth:`~org.hipparchus.linear.RealMatrixPreservingVisitor.end` at the end of the walk + + Also see: + + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + + + public double walkInRowOrder(:class:`~org.hipparchus.linear.RealMatrixChangingVisitor` visitor, int startRow, int endRow, int startColumn, int endColumn) throws :class:`~org.hipparchus.exception.MathIllegalArgumentException` + + Visit (and possibly change) some matrix entries in row order. + + Row order starts at upper left and iterating through all elements of a row from left to right before going to the + leftmost element of the next row. + + Specified by: + :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` in interface :class:`~org.hipparchus.linear.RealMatrix` + + Overrides: + :meth:`~org.hipparchus.linear.AbstractRealMatrix.walkInRowOrder` in + class :class:`~org.hipparchus.linear.AbstractRealMatrix` + + Parameters: + visitor (:class:`~org.hipparchus.linear.RealMatrixChangingVisitor`): visitor used to process all matrix entries + startRow (int): Initial row index + endRow (int): Final row index (inclusive) + startColumn (int): Initial column index + endColumn (int): Final column index + + Returns: + the value returned by :meth:`~org.hipparchus.linear.RealMatrixChangingVisitor.end` at the end of the walk + + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if the indices are not valid. + + Also see: + + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + + + public double walkInRowOrder(:class:`~org.hipparchus.linear.RealMatrixPreservingVisitor` visitor, int startRow, int endRow, int startColumn, int endColumn) throws :class:`~org.hipparchus.exception.MathIllegalArgumentException` + + Visit (but don't change) some matrix entries in row order. + + Row order starts at upper left and iterating through all elements of a row from left to right before going to the + leftmost element of the next row. + + Specified by: + :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` in interface :class:`~org.hipparchus.linear.RealMatrix` + + Overrides: + :meth:`~org.hipparchus.linear.AbstractRealMatrix.walkInRowOrder` in + class :class:`~org.hipparchus.linear.AbstractRealMatrix` + + Parameters: + visitor (:class:`~org.hipparchus.linear.RealMatrixPreservingVisitor`): visitor used to process all matrix entries + startRow (int): Initial row index + endRow (int): Final row index (inclusive) + startColumn (int): Initial column index + endColumn (int): Final column index + + Returns: + the value returned by :meth:`~org.hipparchus.linear.RealMatrixPreservingVisitor.end` at the end of the walk + + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if the indices are not valid. + + Also see: + + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInRowOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInColumnOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + - :meth:`~org.hipparchus.linear.RealMatrix.walkInOptimizedOrder` + + + + """ + ... @typing.overload def walkInRowOrder(self, realMatrixChangingVisitor: RealMatrixChangingVisitor, int: int, int2: int, int3: int, int4: int) -> float: ... @typing.overload @@ -1759,6 +8813,16 @@ class BlockRealMatrix(AbstractRealMatrix, java.io.Serializable): def walkInRowOrder(self, realMatrixPreservingVisitor: RealMatrixPreservingVisitor, int: int, int2: int, int3: int, int4: int) -> float: ... class DiagonalMatrix(AbstractRealMatrix, java.io.Serializable): + """ + public classDiagonalMatrix extends :class:`~org.hipparchus.linear.AbstractRealMatrix` + implements :class:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + Implementation of a diagonal matrix. + + Also see: + + - :meth:`~serialized` + """ @typing.overload def __init__(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]): ... @typing.overload @@ -1770,18 +8834,110 @@ class DiagonalMatrix(AbstractRealMatrix, java.io.Serializable): @typing.overload def add(self, realMatrix: RealMatrix) -> RealMatrix: ... def addToEntry(self, int: int, int2: int, double: float) -> None: ... - def copy(self) -> RealMatrix: ... + def copy(self) -> RealMatrix: + """ + Returns a (deep) copy of this. + + Specified by: + :meth:`~org.hipparchus.linear.RealMatrix.copy` in interface :class:`~org.hipparchus.linear.RealMatrix` + + Specified by: + :meth:`~org.hipparchus.linear.AbstractRealMatrix.copy` in class :class:`~org.hipparchus.linear.AbstractRealMatrix` + + Returns: + matrix copy + + + """ + ... def createMatrix(self, int: int, int2: int) -> RealMatrix: ... - def getColumnDimension(self) -> int: ... - def getData(self) -> typing.MutableSequence[typing.MutableSequence[float]]: ... - def getDataRef(self) -> typing.MutableSequence[float]: ... + def getColumnDimension(self) -> int: + """ + Returns the number of columns of this matrix. + + Specified by: + :meth:`~org.hipparchus.linear.AnyMatrix.getColumnDimension` in interface :class:`~org.hipparchus.linear.AnyMatrix` + + Specified by: + :meth:`~org.hipparchus.linear.RealLinearOperator.getColumnDimension` in + interface :class:`~org.hipparchus.linear.RealLinearOperator` + + Specified by: + :meth:`~org.hipparchus.linear.AbstractRealMatrix.getColumnDimension` in + class :class:`~org.hipparchus.linear.AbstractRealMatrix` + + Returns: + the number of columns. + + + """ + ... + def getData(self) -> typing.MutableSequence[typing.MutableSequence[float]]: + """ + Returns matrix entries as a two-dimensional array. + + Specified by: + :meth:`~org.hipparchus.linear.RealMatrix.getData` in interface :class:`~org.hipparchus.linear.RealMatrix` + + Overrides: + :meth:`~org.hipparchus.linear.AbstractRealMatrix.getData` in class :class:`~org.hipparchus.linear.AbstractRealMatrix` + + Returns: + 2-dimensional array of entries + + + """ + ... + def getDataRef(self) -> typing.MutableSequence[float]: + """ + Gets a reference to the underlying data array. + + Returns: + 1-dimensional array of entries. + + + """ + ... def getEntry(self, int: int, int2: int) -> float: ... - def getRowDimension(self) -> int: ... + def getRowDimension(self) -> int: + """ + Returns the number of rows of this matrix. + + Specified by: + :meth:`~org.hipparchus.linear.AnyMatrix.getRowDimension` in interface :class:`~org.hipparchus.linear.AnyMatrix` + + Specified by: + :meth:`~org.hipparchus.linear.RealLinearOperator.getRowDimension` in + interface :class:`~org.hipparchus.linear.RealLinearOperator` + + Specified by: + :meth:`~org.hipparchus.linear.AbstractRealMatrix.getRowDimension` in + class :class:`~org.hipparchus.linear.AbstractRealMatrix` + + Returns: + the number of rows. + + + """ + ... @typing.overload def inverse(self) -> 'DiagonalMatrix': ... @typing.overload def inverse(self, double: float) -> 'DiagonalMatrix': ... - def isSingular(self, double: float) -> bool: ... + def isSingular(self, double: float) -> bool: + """ + Returns whether this diagonal matrix is singular, i.e. any diagonal entry is equal to :code:`0` within the given + threshold. + + Parameters: + threshold (double): Singularity threshold. + + Returns: + :code:`true` if the matrix is singular, :code:`false` otherwise + + + """ + ... @typing.overload def multiply(self, diagonalMatrix: 'DiagonalMatrix') -> 'DiagonalMatrix': ... @typing.overload @@ -1807,11 +8963,44 @@ class DiagonalMatrix(AbstractRealMatrix, java.io.Serializable): @typing.overload def subtract(self, realMatrix: RealMatrix) -> RealMatrix: ... @typing.overload - def transposeMultiply(self, diagonalMatrix: 'DiagonalMatrix') -> 'DiagonalMatrix': ... + def transposeMultiply(self, diagonalMatrix: 'DiagonalMatrix') -> 'DiagonalMatrix': + """ + Returns the result of postmultiplying :code:`this^T` by :code:`m`. + + This is equivalent to call + :meth:`~org.hipparchus.linear.RealMatrix.transpose`.:meth:`~org.hipparchus.linear.RealMatrix.multiply`, but some + implementations may avoid building the intermediate transposed matrix. + + Specified by: + :meth:`~org.hipparchus.linear.RealMatrix.transposeMultiply` in interface :class:`~org.hipparchus.linear.RealMatrix` + + Parameters: + m (:class:`~org.hipparchus.linear.RealMatrix`): matrix to postmultiply by + + Returns: + :code:`this^T * m` + + + """ + ... @typing.overload def transposeMultiply(self, realMatrix: RealMatrix) -> RealMatrix: ... class OpenMapRealMatrix(AbstractRealMatrix, SparseRealMatrix, java.io.Serializable): + """ + public classOpenMapRealMatrix extends :class:`~org.hipparchus.linear.AbstractRealMatrix` + implements :class:`~org.hipparchus.linear.SparseRealMatrix`, :class:`~org.hipparchus.linear.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + Sparse matrix implementation based on an open addressed map. + + Caveat: This implementation assumes that, for any :code:`x`, the equality :code:`x * 0d == 0d` holds. But it is is not + true for :code:`NaN`. Moreover, zero entries will lose their sign. Some operations (that involve :code:`NaN` and/or + infinities) may thus give incorrect results. + + Also see: + + - :meth:`~serialized` + """ @typing.overload def __init__(self, int: int, int2: int): ... @typing.overload @@ -1821,11 +9010,66 @@ class OpenMapRealMatrix(AbstractRealMatrix, SparseRealMatrix, java.io.Serializab @typing.overload def add(self, realMatrix: RealMatrix) -> RealMatrix: ... def addToEntry(self, int: int, int2: int, double: float) -> None: ... - def copy(self) -> 'OpenMapRealMatrix': ... + def copy(self) -> 'OpenMapRealMatrix': + """ + Returns a (deep) copy of this. + + Specified by: + :meth:`~org.hipparchus.linear.RealMatrix.copy` in interface :class:`~org.hipparchus.linear.RealMatrix` + + Specified by: + :meth:`~org.hipparchus.linear.AbstractRealMatrix.copy` in class :class:`~org.hipparchus.linear.AbstractRealMatrix` + + Returns: + matrix copy + + + """ + ... def createMatrix(self, int: int, int2: int) -> 'OpenMapRealMatrix': ... - def getColumnDimension(self) -> int: ... + def getColumnDimension(self) -> int: + """ + Returns the number of columns of this matrix. + + Specified by: + :meth:`~org.hipparchus.linear.AnyMatrix.getColumnDimension` in interface :class:`~org.hipparchus.linear.AnyMatrix` + + Specified by: + :meth:`~org.hipparchus.linear.RealLinearOperator.getColumnDimension` in + interface :class:`~org.hipparchus.linear.RealLinearOperator` + + Specified by: + :meth:`~org.hipparchus.linear.AbstractRealMatrix.getColumnDimension` in + class :class:`~org.hipparchus.linear.AbstractRealMatrix` + + Returns: + the number of columns. + + + """ + ... def getEntry(self, int: int, int2: int) -> float: ... - def getRowDimension(self) -> int: ... + def getRowDimension(self) -> int: + """ + Returns the number of rows of this matrix. + + Specified by: + :meth:`~org.hipparchus.linear.AnyMatrix.getRowDimension` in interface :class:`~org.hipparchus.linear.AnyMatrix` + + Specified by: + :meth:`~org.hipparchus.linear.RealLinearOperator.getRowDimension` in + interface :class:`~org.hipparchus.linear.RealLinearOperator` + + Specified by: + :meth:`~org.hipparchus.linear.AbstractRealMatrix.getRowDimension` in + class :class:`~org.hipparchus.linear.AbstractRealMatrix` + + Returns: + the number of rows. + + + """ + ... @typing.overload def multiply(self, openMapRealMatrix: 'OpenMapRealMatrix') -> 'OpenMapRealMatrix': ... @typing.overload @@ -1841,6 +9085,15 @@ class OpenMapRealMatrix(AbstractRealMatrix, SparseRealMatrix, java.io.Serializab _SparseFieldMatrix__T = typing.TypeVar('_SparseFieldMatrix__T', bound=org.hipparchus.FieldElement) # <T> class SparseFieldMatrix(AbstractFieldMatrix[_SparseFieldMatrix__T], typing.Generic[_SparseFieldMatrix__T]): + """ + public classSparseFieldMatrix<T extends :class:`~org.hipparchus.FieldElement`<T>> extends :class:`~org.hipparchus.linear.AbstractFieldMatrix`<T> + + Sparse matrix implementation based on an open addressed map. + + Caveat: This implementation assumes that, for any :code:`x`, the equality :code:`x * 0d == 0d` holds. But it is is not + true for :code:`NaN`. Moreover, zero entries will lose their sign. Some operations (that involve :code:`NaN` and/or + infinities) may thus give incorrect results. + """ @typing.overload def __init__(self, field: org.hipparchus.Field[_SparseFieldMatrix__T]): ... @typing.overload @@ -1849,15 +9102,121 @@ class SparseFieldMatrix(AbstractFieldMatrix[_SparseFieldMatrix__T], typing.Gener def __init__(self, fieldMatrix: FieldMatrix[_SparseFieldMatrix__T]): ... @typing.overload def __init__(self, sparseFieldMatrix: 'SparseFieldMatrix'[_SparseFieldMatrix__T]): ... - def addToEntry(self, int: int, int2: int, t: _SparseFieldMatrix__T) -> None: ... + def addToEntry(self, int: int, int2: int, t: _SparseFieldMatrix__T) -> None: + """ + Change an entry in the specified row and column. + + Specified by: + :meth:`~org.hipparchus.linear.FieldMatrix.addToEntry` in interface :class:`~org.hipparchus.linear.FieldMatrix` + + Specified by: + :meth:`~org.hipparchus.linear.AbstractFieldMatrix.addToEntry` in + class :class:`~org.hipparchus.linear.AbstractFieldMatrix` + + Parameters: + row (int): Row location of entry to be set. + column (int): Column location of entry to be set. + increment (:class:`~org.hipparchus.linear.SparseFieldMatrix`): Value to add to the current matrix entry in :code:`(row, column)`. + + + """ + ... def copy(self) -> FieldMatrix[_SparseFieldMatrix__T]: ... def createMatrix(self, int: int, int2: int) -> FieldMatrix[_SparseFieldMatrix__T]: ... - def getColumnDimension(self) -> int: ... - def getEntry(self, int: int, int2: int) -> _SparseFieldMatrix__T: ... - def getRowDimension(self) -> int: ... - def multiplyEntry(self, int: int, int2: int, t: _SparseFieldMatrix__T) -> None: ... + def getColumnDimension(self) -> int: + """ + Returns the number of columns in the matrix. + + Specified by: + :meth:`~org.hipparchus.linear.AnyMatrix.getColumnDimension` in interface :class:`~org.hipparchus.linear.AnyMatrix` + + Specified by: + :meth:`~org.hipparchus.linear.AbstractFieldMatrix.getColumnDimension` in + class :class:`~org.hipparchus.linear.AbstractFieldMatrix` + + Returns: + columnDimension + + + """ + ... + def getEntry(self, int: int, int2: int) -> _SparseFieldMatrix__T: + """ + Returns the entry in the specified row and column. + + Specified by: + :meth:`~org.hipparchus.linear.FieldMatrix.getEntry` in interface :class:`~org.hipparchus.linear.FieldMatrix` + + Specified by: + :meth:`~org.hipparchus.linear.AbstractFieldMatrix.getEntry` in + class :class:`~org.hipparchus.linear.AbstractFieldMatrix` + + Parameters: + row (int): row location of entry to be fetched + column (int): column location of entry to be fetched + + Returns: + matrix entry in row,column + + + """ + ... + def getRowDimension(self) -> int: + """ + Returns the number of rows in the matrix. + + Specified by: + :meth:`~org.hipparchus.linear.AnyMatrix.getRowDimension` in interface :class:`~org.hipparchus.linear.AnyMatrix` + + Specified by: + :meth:`~org.hipparchus.linear.AbstractFieldMatrix.getRowDimension` in + class :class:`~org.hipparchus.linear.AbstractFieldMatrix` + + Returns: + rowDimension + + + """ + ... + def multiplyEntry(self, int: int, int2: int, t: _SparseFieldMatrix__T) -> None: + """ + Change an entry in the specified row and column. + + Specified by: + :meth:`~org.hipparchus.linear.FieldMatrix.multiplyEntry` in interface :class:`~org.hipparchus.linear.FieldMatrix` + + Specified by: + :meth:`~org.hipparchus.linear.AbstractFieldMatrix.multiplyEntry` in + class :class:`~org.hipparchus.linear.AbstractFieldMatrix` + + Parameters: + row (int): Row location of entry to be set. + column (int): Column location of entry to be set. + factor (:class:`~org.hipparchus.linear.SparseFieldMatrix`): Multiplication factor for the current matrix entry in :code:`(row,column)` + + + """ + ... def multiplyTransposed(self, fieldMatrix: FieldMatrix[_SparseFieldMatrix__T]) -> FieldMatrix[_SparseFieldMatrix__T]: ... - def setEntry(self, int: int, int2: int, t: _SparseFieldMatrix__T) -> None: ... + def setEntry(self, int: int, int2: int, t: _SparseFieldMatrix__T) -> None: + """ + Set the entry in the specified row and column. + + Specified by: + :meth:`~org.hipparchus.linear.FieldMatrix.setEntry` in interface :class:`~org.hipparchus.linear.FieldMatrix` + + Specified by: + :meth:`~org.hipparchus.linear.AbstractFieldMatrix.setEntry` in + class :class:`~org.hipparchus.linear.AbstractFieldMatrix` + + Parameters: + row (int): row location of entry to be set + column (int): column location of entry to be set + value (:class:`~org.hipparchus.linear.SparseFieldMatrix`): matrix entry to be set in row,column + + + """ + ... def transposeMultiply(self, fieldMatrix: FieldMatrix[_SparseFieldMatrix__T]) -> FieldMatrix[_SparseFieldMatrix__T]: ... diff --git a/org-stubs/hipparchus/ode/__init__.pyi b/org-stubs/hipparchus/ode/__init__.pyi index da2e2a4..8ce9c26 100644 --- a/org-stubs/hipparchus/ode/__init__.pyi +++ b/org-stubs/hipparchus/ode/__init__.pyi @@ -20,84 +20,731 @@ import typing class ComplexODEConverter: + """ + public classComplexODEConverter extends :class:`~org.hipparchus.ode.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + This class converts :class:`~org.hipparchus.ode.ComplexOrdinaryDifferentialEquation` into + :class:`~org.hipparchus.ode.OrdinaryDifferentialEquation`. + + This class is a wrapper around a :class:`~org.hipparchus.ode.ComplexOrdinaryDifferentialEquation` which allow to use a + :class:`~org.hipparchus.ode.ODEIntegrator` to integrate it. + + The transformation is done by changing the n dimension state vector to a 2n dimension vector, where the even components + are real parts and odd components are imaginary parts. + + One should be aware that the data is duplicated during the transformation process and that for each call to + :meth:`~org.hipparchus.ode.OrdinaryDifferentialEquation.computeDerivatives`, this wrapper does copy 4n scalars : 2n + before the call to :meth:`~org.hipparchus.ode.OrdinaryDifferentialEquation.computeDerivatives` in order to dispatch the + y state vector, and 2n after the call to gather zDot. Since the underlying problem by itself perhaps also needs to copy + data and dispatch the arrays into domain objects, this has an impact on both memory and CPU usage. The only way to avoid + this duplication is to perform the transformation at the problem level, i.e. to implement the problem as a first order + one and then avoid using this class. + + The proper way to use the converter is as follows: + + .. code-block: java + + ODEIntegrator integrator = ...build some integrator...; + ComplexOrdinaryDifferentialEquation complexEquations = ...set up the complex problem...; + ComplexODEState initialState = ...set up initial state...; + ComplexODEConverter converter = new ComplexODEConverter(); + ComplexODEStateAndDerivative finalstate = + converter.convertStateAndDerivative(integrator.integrate(converter.convertEquations(complexEquations), + converter.convertState(initialState), + t); + + + If there are :class:`~org.hipparchus.ode.ComplexSecondaryODE`, they must be converted too and both the converted primary + equations and converted secondary equations must be combined together using :class:`~org.hipparchus.ode.ExpandableODE` + as usual for regular real equations. + + Since: + 1.4 + + Also see: + + - :class:`~org.hipparchus.ode.ComplexOrdinaryDifferentialEquation` + - :class:`~org.hipparchus.ode.OrdinaryDifferentialEquation` + """ def __init__(self): ... - def convertEquations(self, complexOrdinaryDifferentialEquation: 'ComplexOrdinaryDifferentialEquation') -> 'OrdinaryDifferentialEquation': ... - def convertSecondaryEquations(self, complexSecondaryODE: 'ComplexSecondaryODE') -> 'SecondaryODE': ... + def convertEquations(self, complexOrdinaryDifferentialEquation: 'ComplexOrdinaryDifferentialEquation') -> 'OrdinaryDifferentialEquation': + """ + Convert an equations set. + + Parameters: + equations (:class:`~org.hipparchus.ode.ComplexOrdinaryDifferentialEquation`): equations to convert + + Returns: + converted equations + + + """ + ... + def convertSecondaryEquations(self, complexSecondaryODE: 'ComplexSecondaryODE') -> 'SecondaryODE': + """ + Convert a secondary equations set. + + Parameters: + equations (:class:`~org.hipparchus.ode.ComplexSecondaryODE`): equations to convert + + Returns: + converted equations + + + """ + ... @typing.overload - def convertState(self, oDEStateAndDerivative: 'ODEStateAndDerivative') -> 'ComplexODEStateAndDerivative': ... + def convertState(self, oDEStateAndDerivative: 'ODEStateAndDerivative') -> 'ComplexODEStateAndDerivative': + """ + Convert a complex state (typically the initial state). + + Parameters: + state (:class:`~org.hipparchus.ode.ComplexODEState`): state to convert + + Returns: + converted state + + Convert a real state and derivatives (typically the final state or some intermediate state for step handling or event + handling). + + Parameters: + state (:class:`~org.hipparchus.ode.ODEStateAndDerivative`): state to convert + + Returns: + converted state + + + """ + ... @typing.overload def convertState(self, complexODEState: 'ComplexODEState') -> 'ODEState': ... class ComplexODEState(java.io.Serializable): + """ + public classComplexODEState extends :class:`~org.hipparchus.ode.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.ode.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + Container for time, main and secondary state vectors. + + Since: + 1.4 + + Also see: + + - :class:`~org.hipparchus.ode.ComplexOrdinaryDifferentialEquation` + - :class:`~org.hipparchus.ode.SecondaryODE` + - :class:`~org.hipparchus.ode.ODEIntegrator` + - :class:`~org.hipparchus.ode.ODEStateAndDerivative` + - :meth:`~serialized` + """ @typing.overload def __init__(self, double: float, complexArray: typing.Union[typing.List[org.hipparchus.complex.Complex], jpype.JArray]): ... @typing.overload def __init__(self, double: float, complexArray: typing.Union[typing.List[org.hipparchus.complex.Complex], jpype.JArray], complexArray2: typing.Union[typing.List[typing.MutableSequence[org.hipparchus.complex.Complex]], jpype.JArray]): ... - def getCompleteState(self) -> typing.MutableSequence[org.hipparchus.complex.Complex]: ... - def getCompleteStateDimension(self) -> int: ... - def getNumberOfSecondaryStates(self) -> int: ... - def getPrimaryState(self) -> typing.MutableSequence[org.hipparchus.complex.Complex]: ... - def getPrimaryStateDimension(self) -> int: ... - def getSecondaryState(self, int: int) -> typing.MutableSequence[org.hipparchus.complex.Complex]: ... - def getSecondaryStateDimension(self, int: int) -> int: ... - def getTime(self) -> float: ... + def getCompleteState(self) -> typing.MutableSequence[org.hipparchus.complex.Complex]: + """ + Get complete state at time. + + Returns: + complete state at time, starting with :meth:`~org.hipparchus.ode.ComplexODEState.getPrimaryState`, followed by all + :meth:`~org.hipparchus.ode.ComplexODEState.getSecondaryState` in increasing index order + + Also see: + + - :meth:`~org.hipparchus.ode.ComplexODEState.getPrimaryState` + - :meth:`~org.hipparchus.ode.ComplexODEState.getSecondaryState` + + + + """ + ... + def getCompleteStateDimension(self) -> int: + """ + Return the dimension of the complete set of equations. + + The complete set of equations correspond to the primary set plus all secondary sets. + + Returns: + dimension of the complete set of equations + + Also see: + + - :meth:`~org.hipparchus.ode.ComplexODEState.getPrimaryStateDimension` + - :meth:`~org.hipparchus.ode.ComplexODEState.getSecondaryStateDimension` + + + + """ + ... + def getNumberOfSecondaryStates(self) -> int: + """ + Get the number of secondary states. + + Returns: + number of secondary states. + + + """ + ... + def getPrimaryState(self) -> typing.MutableSequence[org.hipparchus.complex.Complex]: + """ + Get primary state at time. + + Returns: + primary state at time + + Also see: + + - :meth:`~org.hipparchus.ode.ComplexODEState.getSecondaryState` + - :meth:`~org.hipparchus.ode.ComplexODEState.getCompleteState` + + + + """ + ... + def getPrimaryStateDimension(self) -> int: + """ + Get primary state dimension. + + Returns: + primary state dimension + + Also see: + + - :meth:`~org.hipparchus.ode.ComplexODEState.getSecondaryStateDimension` + - :meth:`~org.hipparchus.ode.ComplexODEState.getCompleteStateDimension` + + + + """ + ... + def getSecondaryState(self, int: int) -> typing.MutableSequence[org.hipparchus.complex.Complex]: + """ + Get secondary state at time. + + Parameters: + index (int): index of the secondary set as returned by :meth:`~org.hipparchus.ode.ExpandableODE.addSecondaryEquations` (beware index + 0 corresponds to primary state, secondary states start at 1) + + Returns: + secondary state at time + + Also see: + + - :meth:`~org.hipparchus.ode.ComplexODEState.getPrimaryState` + - :meth:`~org.hipparchus.ode.ComplexODEState.getCompleteState` + + + + """ + ... + def getSecondaryStateDimension(self, int: int) -> int: + """ + Get secondary state dimension. + + Parameters: + index (int): index of the secondary set as returned by :meth:`~org.hipparchus.ode.ExpandableODE.addSecondaryEquations` (beware index + 0 corresponds to primary state, secondary states start at 1) + + Returns: + secondary state dimension + + Also see: + + - :meth:`~org.hipparchus.ode.ComplexODEState.getPrimaryStateDimension` + - :meth:`~org.hipparchus.ode.ComplexODEState.getCompleteStateDimension` + + + + """ + ... + def getTime(self) -> float: + """ + Get time. + + Returns: + time + + + """ + ... class ComplexOrdinaryDifferentialEquation: - def computeDerivatives(self, double: float, complexArray: typing.Union[typing.List[org.hipparchus.complex.Complex], jpype.JArray]) -> typing.MutableSequence[org.hipparchus.complex.Complex]: ... - def getDimension(self) -> int: ... - def init(self, double: float, complexArray: typing.Union[typing.List[org.hipparchus.complex.Complex], jpype.JArray], double2: float) -> None: ... + """ + public interfaceComplexOrdinaryDifferentialEquation + + This interface represents a first order differential equations set for + :class:`~org.hipparchus.ode.https:.www.hipparchus.org.hipparchus`. + + Since: + 1.4 + + Also see: + + - :class:`~org.hipparchus.ode.OrdinaryDifferentialEquation` + - :class:`~org.hipparchus.ode.ComplexODEConverter` + """ + def computeDerivatives(self, double: float, complexArray: typing.Union[typing.List[org.hipparchus.complex.Complex], jpype.JArray]) -> typing.MutableSequence[org.hipparchus.complex.Complex]: + """ + Get the current time derivative of the state vector. + + Parameters: + t (double): current value of the independent *time* variable + y (:class:`~org.hipparchus.ode.https:.www.hipparchus.org.hipparchus`[]): array containing the current value of the state vector + + Returns: + time derivative of the state vector + + + """ + ... + def getDimension(self) -> int: + """ + Get the dimension of the problem. + + Returns: + dimension of the problem + + + """ + ... + def init(self, double: float, complexArray: typing.Union[typing.List[org.hipparchus.complex.Complex], jpype.JArray], double2: float) -> None: + """ + Initialize equations at the start of an ODE integration. + + This method is called once at the start of the integration. It may be used by the equations to initialize some internal + data if needed. + + The default implementation does nothing. + + Parameters: + t0 (double): value of the independent *time* variable at integration start + y0 (:class:`~org.hipparchus.ode.https:.www.hipparchus.org.hipparchus`[]): array containing the value of the state vector at integration start + finalTime (double): target time for the integration + + + """ + ... class ComplexSecondaryODE: + """ + public interfaceComplexSecondaryODE + + This interface allows users to add secondary differential equations to a primary set of differential equations. + + In some cases users may need to integrate some problem-specific equations along with a primary set of differential + equations. One example is optimal control where adjoined parameters linked to the minimized hamiltonian must be + integrated. + + This interface allows users to add such equations to a primary set of + :class:`~org.hipparchus.ode.OrdinaryDifferentialEquation` thanks to the + :meth:`~org.hipparchus.ode.ExpandableODE.addSecondaryEquations` method, after having converted the instance to + :class:`~org.hipparchus.ode.SecondaryODE` + + Since: + 1.4 + + Also see: + + - :class:`~org.hipparchus.ode.ExpandableODE` + - :class:`~org.hipparchus.ode.ComplexODEConverter` + """ def computeDerivatives(self, double: float, complexArray: typing.Union[typing.List[org.hipparchus.complex.Complex], jpype.JArray], complexArray2: typing.Union[typing.List[org.hipparchus.complex.Complex], jpype.JArray], complexArray3: typing.Union[typing.List[org.hipparchus.complex.Complex], jpype.JArray]) -> typing.MutableSequence[org.hipparchus.complex.Complex]: ... - def getDimension(self) -> int: ... - def init(self, double: float, complexArray: typing.Union[typing.List[org.hipparchus.complex.Complex], jpype.JArray], complexArray2: typing.Union[typing.List[org.hipparchus.complex.Complex], jpype.JArray], double2: float) -> None: ... + def getDimension(self) -> int: + """ + Get the dimension of the secondary state parameters. + + Returns: + dimension of the secondary state parameters + + + """ + ... + def init(self, double: float, complexArray: typing.Union[typing.List[org.hipparchus.complex.Complex], jpype.JArray], complexArray2: typing.Union[typing.List[org.hipparchus.complex.Complex], jpype.JArray], double2: float) -> None: + """ + Initialize equations at the start of an ODE integration. + + This method is called once at the start of the integration. It may be used by the equations to initialize some internal + data if needed. + + The default implementation does nothing. + + Parameters: + t0 (double): value of the independent *time* variable at integration start + primary0 (:class:`~org.hipparchus.ode.https:.www.hipparchus.org.hipparchus`[]): array containing the value of the primary state vector at integration start + secondary0 (:class:`~org.hipparchus.ode.https:.www.hipparchus.org.hipparchus`[]): array containing the value of the secondary state vector at integration start + finalTime (double): target time for the integration + + + """ + ... class DenseOutputModel(org.hipparchus.ode.sampling.ODEStepHandler, java.io.Serializable): + """ + public classDenseOutputModel extends :class:`~org.hipparchus.ode.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.ode.sampling.ODEStepHandler`, :class:`~org.hipparchus.ode.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + This class stores all information provided by an ODE integrator during the integration process and build a continuous + model of the solution from this. + + This class act as a step handler from the integrator point of view. It is called iteratively during the integration + process and stores a copy of all steps information in a sorted collection for later use. Once the integration process is + over, the user can use the :meth:`~org.hipparchus.ode.DenseOutputModel.getInterpolatedState` method to retrieve this + information at any time. It is important to wait for the integration to be over before attempting to call + :meth:`~org.hipparchus.ode.DenseOutputModel.getInterpolatedState` because some internal variables are set only once the + last step has been handled. + + This is useful for example if the main loop of the user application should remain independent from the integration + process or if one needs to mimic the behaviour of an analytical model despite a numerical model is used (i.e. one needs + the ability to get the model value at any time or to navigate through the data). + + If problem modeling is done with several separate integration phases for contiguous intervals, the same DenseOutputModel + can be used as step handler for all integration phases as long as they are performed in order and in the same direction. + As an example, one can extrapolate the trajectory of a satellite with one model (i.e. one set of differential equations) + up to the beginning of a maneuver, use another more complex model including thrusters modeling and accurate attitude + control during the maneuver, and revert to the first model after the end of the maneuver. If the same continuous output + model handles the steps of all integration phases, the user do not need to bother when the maneuver begins or ends, he + has all the data available in a transparent manner. + + An important feature of this class is that it implements the :code:`Serializable` interface. This means that the result + of an integration can be serialized and reused later (if stored into a persistent medium like a filesystem or a + database) or elsewhere (if sent to another application). Only the result of the integration is stored, there is no + reference to the integrated problem by itself. + + One should be aware that the amount of data stored in a DenseOutputModel instance can be important if the state vector + is large, if the integration interval is long or if the steps are small (which can result from small tolerance settings + in :class:`~org.hipparchus.ode.nonstiff.AdaptiveStepsizeIntegrator`). + + Also see: + + - :class:`~org.hipparchus.ode.sampling.ODEStepHandler` + - :class:`~org.hipparchus.ode.sampling.ODEStateInterpolator` + - :meth:`~serialized` + """ def __init__(self): ... def append(self, denseOutputModel: 'DenseOutputModel') -> None: ... - def finish(self, oDEStateAndDerivative: 'ODEStateAndDerivative') -> None: ... - def getFinalTime(self) -> float: ... - def getInitialTime(self) -> float: ... - def getInterpolatedState(self, double: float) -> 'ODEStateAndDerivative': ... - def handleStep(self, oDEStateInterpolator: org.hipparchus.ode.sampling.ODEStateInterpolator) -> None: ... - def init(self, oDEStateAndDerivative: 'ODEStateAndDerivative', double: float) -> None: ... + def finish(self, oDEStateAndDerivative: 'ODEStateAndDerivative') -> None: + """ + Finalize integration. + + Specified by: + :meth:`~org.hipparchus.ode.sampling.ODEStepHandler.finish` in + interface :class:`~org.hipparchus.ode.sampling.ODEStepHandler` + + Parameters: + finalState (:class:`~org.hipparchus.ode.ODEStateAndDerivative`): state at integration end + + + """ + ... + def getFinalTime(self) -> float: + """ + Get the final integration time. + + Returns: + final integration time + + + """ + ... + def getInitialTime(self) -> float: + """ + Get the initial integration time. + + Returns: + initial integration time + + + """ + ... + def getInterpolatedState(self, double: float) -> 'ODEStateAndDerivative': + """ + Get the state at interpolated time. + + Parameters: + time (double): time of the interpolated point + + Returns: + state at interpolated time + + + """ + ... + def handleStep(self, oDEStateInterpolator: org.hipparchus.ode.sampling.ODEStateInterpolator) -> None: + """ + Handle the last accepted step. + + Specified by: + :meth:`~org.hipparchus.ode.sampling.ODEStepHandler.handleStep` in + interface :class:`~org.hipparchus.ode.sampling.ODEStepHandler` + + Parameters: + interpolator (:class:`~org.hipparchus.ode.sampling.ODEStateInterpolator`): interpolator for the last accepted step + + + """ + ... + def init(self, oDEStateAndDerivative: 'ODEStateAndDerivative', double: float) -> None: + """ + Initialize step handler at the start of an ODE integration. + + This method is called once at the start of the integration. It may be used by the step handler to initialize some + internal data if needed. + + The default implementation does nothing + + Specified by: + :meth:`~org.hipparchus.ode.sampling.ODEStepHandler.init` in + interface :class:`~org.hipparchus.ode.sampling.ODEStepHandler` + + Parameters: + initialState (:class:`~org.hipparchus.ode.ODEStateAndDerivative`): initial time, state vector and derivative + targetTime (double): target time for the integration + + + """ + ... class EquationsMapper(java.io.Serializable): + """ + public classEquationsMapper extends :class:`~org.hipparchus.ode.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.ode.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + Class mapping the part of a complete state or derivative that pertains to a specific differential equation. + + Instances of this class are guaranteed to be immutable. + + Also see: + + - :class:`~org.hipparchus.ode.SecondaryODE` + - :meth:`~serialized` + """ def extractEquationData(self, int: int, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> typing.MutableSequence[float]: ... - def getNumberOfEquations(self) -> int: ... - def getTotalDimension(self) -> int: ... + def getNumberOfEquations(self) -> int: + """ + Get the number of equations mapped. + + Returns: + number of equations mapped + + + """ + ... + def getTotalDimension(self) -> int: + """ + Return the dimension of the complete set of equations. + + The complete set of equations correspond to the primary set plus all secondary sets. + + Returns: + dimension of the complete set of equations + + + """ + ... def insertEquationData(self, int: int, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray]) -> None: ... def mapStateAndDerivative(self, double: float, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray]) -> 'ODEStateAndDerivative': ... class ExpandableODE: + """ + public classExpandableODE extends :class:`~org.hipparchus.ode.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + This class represents a combined set of first order differential equations, with at least a primary set of equations + expandable by some sets of secondary equations. + + One typical use case is the computation of the Jacobian matrix for some ODE. In this case, the primary set of equations + corresponds to the raw ODE, and we add to this set another bunch of secondary equations which represent the Jacobian + matrix of the primary set. + + We want the integrator to use *only* the primary set to estimate the errors and hence the step sizes. It should *not* + use the secondary equations in this computation. The :class:`~org.hipparchus.ode.AbstractIntegrator` will be able to + know where the primary set ends and so where the secondary sets begin. + + Also see: + + - :class:`~org.hipparchus.ode.OrdinaryDifferentialEquation` + - :class:`~org.hipparchus.ode.VariationalEquation` + """ def __init__(self, ordinaryDifferentialEquation: 'OrdinaryDifferentialEquation'): ... - def addSecondaryEquations(self, secondaryODE: 'SecondaryODE') -> int: ... + def addSecondaryEquations(self, secondaryODE: 'SecondaryODE') -> int: + """ + Add a set of secondary equations to be integrated along with the primary set. + + Parameters: + secondary (:class:`~org.hipparchus.ode.SecondaryODE`): secondary equations set + + Returns: + index of the secondary equation in the expanded state, to be used as the parameter to + :meth:`~org.hipparchus.ode.FieldODEState.getSecondaryState` and + :meth:`~org.hipparchus.ode.FieldODEStateAndDerivative.getSecondaryDerivative` (beware index 0 corresponds to primary + state, secondary states start at 1) + + + """ + ... def computeDerivatives(self, double: float, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> typing.MutableSequence[float]: ... - def getMapper(self) -> EquationsMapper: ... - def getPrimary(self) -> 'OrdinaryDifferentialEquation': ... - def init(self, oDEState: 'ODEState', double: float) -> None: ... + def getMapper(self) -> EquationsMapper: + """ + Get the mapper for the set of equations. + + Returns: + mapper for the set of equations + + + """ + ... + def getPrimary(self) -> 'OrdinaryDifferentialEquation': + """ + Get the primary set of differential equations to be integrated. + + Returns: + primary set of differential equations to be integrated + + + """ + ... + def init(self, oDEState: 'ODEState', double: float) -> None: + """ + Initialize equations at the start of an ODE integration. + + Parameters: + s0 (:class:`~org.hipparchus.ode.ODEState`): state at integration start + finalTime (double): target time for the integration + + Raises: + :class:`~org.hipparchus.ode.https:.www.hipparchus.org.hipparchus`: if the number of functions evaluations is exceeded + :class:`~org.hipparchus.ode.https:.www.hipparchus.org.hipparchus`: if arrays dimensions do not match equations settings + + + """ + ... _FieldDenseOutputModel__T = typing.TypeVar('_FieldDenseOutputModel__T', bound=org.hipparchus.CalculusFieldElement) # <T> class FieldDenseOutputModel(org.hipparchus.ode.sampling.FieldODEStepHandler[_FieldDenseOutputModel__T], typing.Generic[_FieldDenseOutputModel__T]): + """ + public classFieldDenseOutputModel<T extends :class:`~org.hipparchus.ode.https:.www.hipparchus.org.hipparchus`<T>> extends :class:`~org.hipparchus.ode.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.ode.sampling.FieldODEStepHandler`<T> + + This class stores all information provided by an ODE integrator during the integration process and build a continuous + model of the solution from this. + + This class act as a step handler from the integrator point of view. It is called iteratively during the integration + process and stores a copy of all steps information in a sorted collection for later use. Once the integration process is + over, the user can use the :meth:`~org.hipparchus.ode.FieldDenseOutputModel.getInterpolatedState` method to retrieve + this information at any time. It is important to wait for the integration to be over before attempting to call + :meth:`~org.hipparchus.ode.FieldDenseOutputModel.getInterpolatedState` because some internal variables are set only once + the last step has been handled. + + This is useful for example if the main loop of the user application should remain independent from the integration + process or if one needs to mimic the behaviour of an analytical model despite a numerical model is used (i.e. one needs + the ability to get the model value at any time or to navigate through the data). + + If problem modeling is done with several separate integration phases for contiguous intervals, the same + FieldDenseOutputModel can be used as step handler for all integration phases as long as they are performed in order and + in the same direction. As an example, one can extrapolate the trajectory of a satellite with one model (i.e. one set of + differential equations) up to the beginning of a maneuver, use another more complex model including thrusters modeling + and accurate attitude control during the maneuver, and revert to the first model after the end of the maneuver. If the + same continuous output model handles the steps of all integration phases, the user do not need to bother when the + maneuver begins or ends, he has all the data available in a transparent manner. + + One should be aware that the amount of data stored in a FieldDenseOutputModel instance can be important if the state + vector is large, if the integration interval is long or if the steps are small (which can result from small tolerance + settings in :class:`~org.hipparchus.ode.nonstiff.AdaptiveStepsizeFieldIntegrator`). + + Also see: + + - :class:`~org.hipparchus.ode.sampling.FieldODEStepHandler` + - :class:`~org.hipparchus.ode.sampling.FieldODEStateInterpolator` + """ def __init__(self): ... def append(self, fieldDenseOutputModel: 'FieldDenseOutputModel'[_FieldDenseOutputModel__T]) -> None: ... def finish(self, fieldODEStateAndDerivative: 'FieldODEStateAndDerivative'[_FieldDenseOutputModel__T]) -> None: ... - def getFinalTime(self) -> _FieldDenseOutputModel__T: ... - def getInitialTime(self) -> _FieldDenseOutputModel__T: ... + def getFinalTime(self) -> _FieldDenseOutputModel__T: + """ + Get the final integration time. + + Returns: + final integration time + + + """ + ... + def getInitialTime(self) -> _FieldDenseOutputModel__T: + """ + Get the initial integration time. + + Returns: + initial integration time + + + """ + ... def getInterpolatedState(self, t: _FieldDenseOutputModel__T) -> 'FieldODEStateAndDerivative'[_FieldDenseOutputModel__T]: ... def handleStep(self, fieldODEStateInterpolator: org.hipparchus.ode.sampling.FieldODEStateInterpolator[_FieldDenseOutputModel__T]) -> None: ... def init(self, fieldODEStateAndDerivative: 'FieldODEStateAndDerivative'[_FieldDenseOutputModel__T], t: _FieldDenseOutputModel__T) -> None: ... _FieldEquationsMapper__T = typing.TypeVar('_FieldEquationsMapper__T', bound=org.hipparchus.CalculusFieldElement) # <T> class FieldEquationsMapper(java.io.Serializable, typing.Generic[_FieldEquationsMapper__T]): + """ + public classFieldEquationsMapper<T extends :class:`~org.hipparchus.ode.https:.www.hipparchus.org.hipparchus`<T>> extends :class:`~org.hipparchus.ode.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.ode.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + Class mapping the part of a complete state or derivative that pertains to a set of differential equations. + + Instances of this class are guaranteed to be immutable. + + Also see: + + - :class:`~org.hipparchus.ode.FieldExpandableODE` + - :meth:`~serialized` + """ def extractEquationData(self, int: int, tArray: typing.Union[typing.List[_FieldEquationsMapper__T], jpype.JArray]) -> typing.MutableSequence[_FieldEquationsMapper__T]: ... - def getNumberOfEquations(self) -> int: ... - def getTotalDimension(self) -> int: ... + def getNumberOfEquations(self) -> int: + """ + Get the number of equations mapped. + + Returns: + number of equations mapped + + + """ + ... + def getTotalDimension(self) -> int: + """ + Return the dimension of the complete set of equations. + + The complete set of equations correspond to the primary set plus all secondary sets. + + Returns: + dimension of the complete set of equations + + + """ + ... def insertEquationData(self, int: int, tArray: typing.Union[typing.List[_FieldEquationsMapper__T], jpype.JArray], tArray2: typing.Union[typing.List[_FieldEquationsMapper__T], jpype.JArray]) -> None: ... def mapStateAndDerivative(self, t: _FieldEquationsMapper__T, tArray: typing.Union[typing.List[_FieldEquationsMapper__T], jpype.JArray], tArray2: typing.Union[typing.List[_FieldEquationsMapper__T], jpype.JArray]) -> 'FieldODEStateAndDerivative'[_FieldEquationsMapper__T]: ... _FieldExpandableODE__T = typing.TypeVar('_FieldExpandableODE__T', bound=org.hipparchus.CalculusFieldElement) # <T> class FieldExpandableODE(typing.Generic[_FieldExpandableODE__T]): + """ + public classFieldExpandableODE<T extends :class:`~org.hipparchus.ode.https:.www.hipparchus.org.hipparchus`<T>> extends :class:`~org.hipparchus.ode.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + This class represents a combined set of first order differential equations, with at least a primary set of equations + expandable by some sets of secondary equations. + + One typical use case is the computation of the Jacobian matrix for some ODE. In this case, the primary set of equations + corresponds to the raw ODE, and we add to this set another bunch of secondary equations which represent the Jacobian + matrix of the primary set. + + We want the integrator to use *only* the primary set to estimate the errors and hence the step sizes. It should *not* + use the secondary equations in this computation. The :class:`~org.hipparchus.ode.FieldODEIntegrator` will be able to + know where the primary set ends and so where the secondary sets begin. + + Also see: + + - :class:`~org.hipparchus.ode.FieldOrdinaryDifferentialEquation` + - :class:`~org.hipparchus.ode.FieldSecondaryODE` + """ def __init__(self, fieldOrdinaryDifferentialEquation: 'FieldOrdinaryDifferentialEquation'[_FieldExpandableODE__T]): ... def addSecondaryEquations(self, fieldSecondaryODE: 'FieldSecondaryODE'[_FieldExpandableODE__T]) -> int: ... def computeDerivatives(self, t: _FieldExpandableODE__T, tArray: typing.Union[typing.List[_FieldExpandableODE__T], jpype.JArray]) -> typing.MutableSequence[_FieldExpandableODE__T]: ... @@ -107,51 +754,390 @@ class FieldExpandableODE(typing.Generic[_FieldExpandableODE__T]): _FieldODEIntegrator__T = typing.TypeVar('_FieldODEIntegrator__T', bound=org.hipparchus.CalculusFieldElement) # <T> class FieldODEIntegrator(typing.Generic[_FieldODEIntegrator__T]): + """ + public interfaceFieldODEIntegrator<T extends :class:`~org.hipparchus.ode.https:.www.hipparchus.org.hipparchus`<T>> + + This interface represents a first order integrator for differential equations. + + The classes which are devoted to solve first order differential equations should implement this interface. The problems + which can be handled should implement the :class:`~org.hipparchus.ode.FieldOrdinaryDifferentialEquation` interface. + + Also see: + + - :class:`~org.hipparchus.ode.FieldOrdinaryDifferentialEquation` + """ def addEventDetector(self, fieldODEEventDetector: org.hipparchus.ode.events.FieldODEEventDetector[_FieldODEIntegrator__T]) -> None: ... def addStepEndHandler(self, fieldODEStepEndHandler: typing.Union[org.hipparchus.ode.events.FieldODEStepEndHandler[_FieldODEIntegrator__T], typing.Callable[['FieldODEStateAndDerivative'[org.hipparchus.CalculusFieldElement], bool], org.hipparchus.ode.events.Action]]) -> None: ... def addStepHandler(self, fieldODEStepHandler: typing.Union[org.hipparchus.ode.sampling.FieldODEStepHandler[_FieldODEIntegrator__T], typing.Callable[[org.hipparchus.ode.sampling.FieldODEStateInterpolator[org.hipparchus.CalculusFieldElement]], None]]) -> None: ... - def clearEventDetectors(self) -> None: ... - def clearStepEndHandlers(self) -> None: ... - def clearStepHandlers(self) -> None: ... - def getCurrentSignedStepsize(self) -> _FieldODEIntegrator__T: ... - def getEvaluations(self) -> int: ... + def clearEventDetectors(self) -> None: + """ + Remove all the event handlers that have been added to the integrator. + + Since: + 3.0 + + Also see: + + - :meth:`~org.hipparchus.ode.FieldODEIntegrator.addEventDetector` + - :meth:`~org.hipparchus.ode.FieldODEIntegrator.getEventDetectors` + + + + """ + ... + def clearStepEndHandlers(self) -> None: + """ + Remove all the handlers for step ends that have been added to the integrator. + + Since: + 3.0 + + Also see: + + - :meth:`~org.hipparchus.ode.FieldODEIntegrator.addStepEndHandler` + - :meth:`~org.hipparchus.ode.FieldODEIntegrator.getStepEndHandlers` + + + + """ + ... + def clearStepHandlers(self) -> None: + """ + Remove all the step handlers that have been added to the integrator. + + Also see: + + - :meth:`~org.hipparchus.ode.FieldODEIntegrator.addStepHandler` + - :meth:`~org.hipparchus.ode.FieldODEIntegrator.getStepHandlers` + + + + """ + ... + def getCurrentSignedStepsize(self) -> _FieldODEIntegrator__T: + """ + Get the current signed value of the integration stepsize. + + This method can be called during integration (typically by the object implementing the + :class:`~org.hipparchus.ode.FieldOrdinaryDifferentialEquation` problem) if the signed value of the current stepsize that + is tried is needed. + + The result is undefined if the method is called outside of calls to :code:`integrate`. + + Returns: + current signed value of the stepsize + + + """ + ... + def getEvaluations(self) -> int: + """ + Get the number of evaluations of the differential equations function. + + The number of evaluations corresponds to the last call to the :code:`integrate` method. It is 0 if the method has not + been called yet. + + Returns: + number of evaluations of the differential equations function + + + """ + ... def getEventDetectors(self) -> java.util.List[org.hipparchus.ode.events.FieldODEEventDetector[_FieldODEIntegrator__T]]: ... - def getMaxEvaluations(self) -> int: ... - def getName(self) -> str: ... + def getMaxEvaluations(self) -> int: + """ + Get the maximal number of functions evaluations. + + Returns: + maximal number of functions evaluations + + + """ + ... + def getName(self) -> str: + """ + Get the name of the method. + + Returns: + name of the method + + + """ + ... def getStepEndHandlers(self) -> java.util.List[org.hipparchus.ode.events.FieldODEStepEndHandler[_FieldODEIntegrator__T]]: ... def getStepHandlers(self) -> java.util.List[org.hipparchus.ode.sampling.FieldODEStepHandler[_FieldODEIntegrator__T]]: ... def getStepStart(self) -> 'FieldODEStateAndDerivative'[_FieldODEIntegrator__T]: ... def integrate(self, fieldExpandableODE: FieldExpandableODE[_FieldODEIntegrator__T], fieldODEState: 'FieldODEState'[_FieldODEIntegrator__T], t: _FieldODEIntegrator__T) -> 'FieldODEStateAndDerivative'[_FieldODEIntegrator__T]: ... - def setMaxEvaluations(self, int: int) -> None: ... + def setMaxEvaluations(self, int: int) -> None: + """ + Set the maximal number of differential equations function evaluations. + + The purpose of this method is to avoid infinite loops which can occur for example when stringent error constraints are + set or when lots of discrete events are triggered, thus leading to many rejected steps. + + Parameters: + maxEvaluations (int): maximal number of function evaluations (negative values are silently converted to maximal integer value, thus + representing almost unlimited evaluations) + + + """ + ... _FieldODEState__T = typing.TypeVar('_FieldODEState__T', bound=org.hipparchus.CalculusFieldElement) # <T> class FieldODEState(typing.Generic[_FieldODEState__T]): + """ + public classFieldODEState<T extends :class:`~org.hipparchus.ode.https:.www.hipparchus.org.hipparchus`<T>> extends :class:`~org.hipparchus.ode.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Container for time, main and secondary state vectors. + + Also see: + + - :class:`~org.hipparchus.ode.FieldOrdinaryDifferentialEquation` + - :class:`~org.hipparchus.ode.FieldSecondaryODE` + - :class:`~org.hipparchus.ode.FieldODEIntegrator` + - :class:`~org.hipparchus.ode.FieldODEStateAndDerivative` + """ @typing.overload def __init__(self, t: _FieldODEState__T, tArray: typing.Union[typing.List[_FieldODEState__T], jpype.JArray]): ... @typing.overload def __init__(self, t: _FieldODEState__T, tArray: typing.Union[typing.List[_FieldODEState__T], jpype.JArray], tArray2: typing.Union[typing.List[typing.MutableSequence[_FieldODEState__T]], jpype.JArray]): ... - def getCompleteState(self) -> typing.MutableSequence[_FieldODEState__T]: ... - def getCompleteStateDimension(self) -> int: ... - def getNumberOfSecondaryStates(self) -> int: ... - def getPrimaryState(self) -> typing.MutableSequence[_FieldODEState__T]: ... - def getPrimaryStateDimension(self) -> int: ... - def getSecondaryState(self, int: int) -> typing.MutableSequence[_FieldODEState__T]: ... - def getSecondaryStateDimension(self, int: int) -> int: ... - def getTime(self) -> _FieldODEState__T: ... + def getCompleteState(self) -> typing.MutableSequence[_FieldODEState__T]: + """ + Get complete state at time. + + Returns: + complete state at time, starting with :meth:`~org.hipparchus.ode.FieldODEState.getPrimaryState`, followed by all + :meth:`~org.hipparchus.ode.FieldODEState.getSecondaryState` in increasing index order + + Also see: + + - :meth:`~org.hipparchus.ode.FieldODEState.getPrimaryState` + - :meth:`~org.hipparchus.ode.FieldODEState.getSecondaryState` + + + + """ + ... + def getCompleteStateDimension(self) -> int: + """ + Return the dimension of the complete set of equations. + + The complete set of equations correspond to the primary set plus all secondary sets. + + Returns: + dimension of the complete set of equations + + + """ + ... + def getNumberOfSecondaryStates(self) -> int: + """ + Get the number of secondary states. + + Returns: + number of secondary states. + + + """ + ... + def getPrimaryState(self) -> typing.MutableSequence[_FieldODEState__T]: + """ + Get primary state at time. + + Returns: + primary state at time + + Also see: + + - :meth:`~org.hipparchus.ode.FieldODEState.getSecondaryState` + - :meth:`~org.hipparchus.ode.FieldODEState.getCompleteState` + + + + """ + ... + def getPrimaryStateDimension(self) -> int: + """ + Get primary state dimension. + + Returns: + primary state dimension + + Also see: + + - :meth:`~org.hipparchus.ode.FieldODEState.getSecondaryStateDimension` + - :meth:`~org.hipparchus.ode.FieldODEState.getCompleteStateDimension` + + + + """ + ... + def getSecondaryState(self, int: int) -> typing.MutableSequence[_FieldODEState__T]: + """ + Get secondary state at time. + + Parameters: + index (int): index of the secondary set as returned by :meth:`~org.hipparchus.ode.FieldExpandableODE.addSecondaryEquations` (beware + index 0 corresponds to primary state, secondary states start at 1) + + Returns: + secondary state at time + + + """ + ... + def getSecondaryStateDimension(self, int: int) -> int: + """ + Get secondary state dimension. + + Parameters: + index (int): index of the secondary set as returned by :meth:`~org.hipparchus.ode.FieldExpandableODE.addSecondaryEquations` (beware + index 0 corresponds to primary state, secondary states start at 1) + + Returns: + secondary state dimension + + + """ + ... + def getTime(self) -> _FieldODEState__T: + """ + Get time. + + Returns: + time + + + """ + ... _FieldOrdinaryDifferentialEquation__T = typing.TypeVar('_FieldOrdinaryDifferentialEquation__T', bound=org.hipparchus.CalculusFieldElement) # <T> class FieldOrdinaryDifferentialEquation(typing.Generic[_FieldOrdinaryDifferentialEquation__T]): - def computeDerivatives(self, t: _FieldOrdinaryDifferentialEquation__T, tArray: typing.Union[typing.List[_FieldOrdinaryDifferentialEquation__T], jpype.JArray]) -> typing.MutableSequence[_FieldOrdinaryDifferentialEquation__T]: ... - def getDimension(self) -> int: ... - def init(self, t: _FieldOrdinaryDifferentialEquation__T, tArray: typing.Union[typing.List[_FieldOrdinaryDifferentialEquation__T], jpype.JArray], t3: _FieldOrdinaryDifferentialEquation__T) -> None: ... + """ + public interfaceFieldOrdinaryDifferentialEquation<T extends :class:`~org.hipparchus.ode.https:.www.hipparchus.org.hipparchus`<T>> + + This interface represents a first order differential equations set. + + This interface should be implemented by all real first order differential equation problems before they can be handled + by the integrators :meth:`~org.hipparchus.ode.FieldODEIntegrator.integrate` method. + + A first order differential equations problem, as seen by an integrator is the time derivative :code:`dY/dt` of a state + vector :code:`Y`, both being one dimensional arrays. From the integrator point of view, this derivative depends only on + the current time :code:`t` and on the state vector :code:`Y`. + + For real problems, the derivative depends also on parameters that do not belong to the state vector (dynamical model + constants for example). These constants are completely outside of the scope of this interface, the classes that + implement it are allowed to handle them as they want. + + Also see: + + - :class:`~org.hipparchus.ode.FieldODEIntegrator` + """ + def computeDerivatives(self, t: _FieldOrdinaryDifferentialEquation__T, tArray: typing.Union[typing.List[_FieldOrdinaryDifferentialEquation__T], jpype.JArray]) -> typing.MutableSequence[_FieldOrdinaryDifferentialEquation__T]: + """ + Get the current time derivative of the state vector. + + Parameters: + t (:class:`~org.hipparchus.ode.FieldOrdinaryDifferentialEquation`): current value of the independent *time* variable + y (:class:`~org.hipparchus.ode.FieldOrdinaryDifferentialEquation`[]): array containing the current value of the state vector + + Returns: + time derivative of the state vector + + + """ + ... + def getDimension(self) -> int: + """ + Get the dimension of the problem. + + Returns: + dimension of the problem + + + """ + ... + def init(self, t: _FieldOrdinaryDifferentialEquation__T, tArray: typing.Union[typing.List[_FieldOrdinaryDifferentialEquation__T], jpype.JArray], t3: _FieldOrdinaryDifferentialEquation__T) -> None: + """ + Initialize equations at the start of an ODE integration. + + This method is called once at the start of the integration. It may be used by the equations to initialize some internal + data if needed. + + The default implementation does nothing. + + Parameters: + t0 (:class:`~org.hipparchus.ode.FieldOrdinaryDifferentialEquation`): value of the independent *time* variable at integration start + y0 (:class:`~org.hipparchus.ode.FieldOrdinaryDifferentialEquation`[]): array containing the value of the state vector at integration start + finalTime (:class:`~org.hipparchus.ode.FieldOrdinaryDifferentialEquation`): target time for the integration + + + """ + ... _FieldSecondaryODE__T = typing.TypeVar('_FieldSecondaryODE__T', bound=org.hipparchus.CalculusFieldElement) # <T> class FieldSecondaryODE(typing.Generic[_FieldSecondaryODE__T]): + """ + public interfaceFieldSecondaryODE<T extends :class:`~org.hipparchus.ode.https:.www.hipparchus.org.hipparchus`<T>> + + This interface allows users to add secondary differential equations to a primary set of differential equations. + + In some cases users may need to integrate some problem-specific equations along with a primary set of differential + equations. One example is optimal control where adjoined parameters linked to the minimized Hamiltonian must be + integrated. + + This interface allows users to add such equations to a primary set of + :class:`~org.hipparchus.ode.FieldOrdinaryDifferentialEquation` thanks to the + :meth:`~org.hipparchus.ode.FieldExpandableODE.addSecondaryEquations` method. + + Also see: + + - :class:`~org.hipparchus.ode.FieldOrdinaryDifferentialEquation` + - :class:`~org.hipparchus.ode.FieldExpandableODE` + """ def computeDerivatives(self, t: _FieldSecondaryODE__T, tArray: typing.Union[typing.List[_FieldSecondaryODE__T], jpype.JArray], tArray2: typing.Union[typing.List[_FieldSecondaryODE__T], jpype.JArray], tArray3: typing.Union[typing.List[_FieldSecondaryODE__T], jpype.JArray]) -> typing.MutableSequence[_FieldSecondaryODE__T]: ... - def getDimension(self) -> int: ... - def init(self, t: _FieldSecondaryODE__T, tArray: typing.Union[typing.List[_FieldSecondaryODE__T], jpype.JArray], tArray2: typing.Union[typing.List[_FieldSecondaryODE__T], jpype.JArray], t4: _FieldSecondaryODE__T) -> None: ... + def getDimension(self) -> int: + """ + Get the dimension of the secondary state parameters. + + Returns: + dimension of the secondary state parameters + + + """ + ... + def init(self, t: _FieldSecondaryODE__T, tArray: typing.Union[typing.List[_FieldSecondaryODE__T], jpype.JArray], tArray2: typing.Union[typing.List[_FieldSecondaryODE__T], jpype.JArray], t4: _FieldSecondaryODE__T) -> None: + """ + Initialize equations at the start of an ODE integration. + + This method is called once at the start of the integration. It may be used by the equations to initialize some internal + data if needed. + + The default implementation does nothing. + + Parameters: + t0 (:class:`~org.hipparchus.ode.FieldSecondaryODE`): value of the independent *time* variable at integration start + primary0 (:class:`~org.hipparchus.ode.FieldSecondaryODE`[]): array containing the value of the primary state vector at integration start + secondary0 (:class:`~org.hipparchus.ode.FieldSecondaryODE`[]): array containing the value of the secondary state vector at integration start + finalTime (:class:`~org.hipparchus.ode.FieldSecondaryODE`): target time for the integration + + + """ + ... class LocalizedODEFormats(java.lang.Enum['LocalizedODEFormats'], org.hipparchus.exception.Localizable): + """ + public enumLocalizedODEFormats extends :class:`~org.hipparchus.ode.https:.docs.oracle.com.javase.8.docs.api.java.lang.Enum`<:class:`~org.hipparchus.ode.LocalizedODEFormats`> + implements :class:`~org.hipparchus.ode.https:.www.hipparchus.org.hipparchus` + + Enumeration for localized messages formats used in exceptions messages. + + The constants in this enumeration represent the available formats as localized strings. These formats are intended to be + localized using simple properties files, using the constant name as the key and the property value as the message + format. The source English format is provided in the constants themselves to serve both as a reminder for developers to + understand the parameters needed by each format, as a basis for translators to create localized properties files, and as + a default format if some translation is missing. + """ HOLE_BETWEEN_MODELS_TIME_RANGES: typing.ClassVar['LocalizedODEFormats'] = ... INTEGRATION_METHOD_NEEDS_AT_LEAST_TWO_PREVIOUS_POINTS: typing.ClassVar['LocalizedODEFormats'] = ... MINIMAL_STEPSIZE_REACHED_DURING_INTEGRATION: typing.ClassVar['LocalizedODEFormats'] = ... @@ -162,199 +1148,1700 @@ class LocalizedODEFormats(java.lang.Enum['LocalizedODEFormats'], org.hipparchus. UNMATCHED_ODE_IN_EXPANDED_SET: typing.ClassVar['LocalizedODEFormats'] = ... NAN_APPEARING_DURING_INTEGRATION: typing.ClassVar['LocalizedODEFormats'] = ... FIND_ROOT: typing.ClassVar['LocalizedODEFormats'] = ... - def getLocalizedString(self, locale: java.util.Locale) -> str: ... - def getSourceString(self) -> str: ... + def getLocalizedString(self, locale: java.util.Locale) -> str: + """ + + Specified by: + :meth:`~org.hipparchus.ode.https:.www.hipparchus.org.hipparchus` in + interface :class:`~org.hipparchus.ode.https:.www.hipparchus.org.hipparchus` + + + """ + ... + def getSourceString(self) -> str: + """ + + Specified by: + :meth:`~org.hipparchus.ode.https:.www.hipparchus.org.hipparchus` in + interface :class:`~org.hipparchus.ode.https:.www.hipparchus.org.hipparchus` + + + """ + ... _valueOf_0__T = typing.TypeVar('_valueOf_0__T', bound=java.lang.Enum) # <T> @typing.overload @staticmethod def valueOf(class_: typing.Type[_valueOf_0__T], string: str) -> _valueOf_0__T: ... @typing.overload @staticmethod - def valueOf(string: str) -> 'LocalizedODEFormats': ... + def valueOf(string: str) -> 'LocalizedODEFormats': + """ + Returns the enum constant of this type with the specified name. The string must match *exactly* an identifier used to + declare an enum constant in this type. (Extraneous whitespace characters are not permitted.) + + Parameters: + name (:class:`~org.hipparchus.ode.https:.docs.oracle.com.javase.8.docs.api.java.lang.String`): the name of the enum constant to be returned. + + Returns: + the enum constant with the specified name + + Raises: + :class:`~org.hipparchus.ode.https:.docs.oracle.com.javase.8.docs.api.java.lang.IllegalArgumentException`: if this enum type has no constant with the specified name + :class:`~org.hipparchus.ode.https:.docs.oracle.com.javase.8.docs.api.java.lang.NullPointerException`: if the argument is null + + + """ + ... @staticmethod - def values() -> typing.MutableSequence['LocalizedODEFormats']: ... + def values() -> typing.MutableSequence['LocalizedODEFormats']: + """ + Returns an array containing the constants of this enum type, in the order they are declared. + + Returns: + an array containing the constants of this enum type, in the order they are declared + + + """ + ... _MultistepFieldIntegrator__T = typing.TypeVar('_MultistepFieldIntegrator__T', bound=org.hipparchus.CalculusFieldElement) # <T> class MultistepFieldIntegrator(org.hipparchus.ode.nonstiff.AdaptiveStepsizeFieldIntegrator[_MultistepFieldIntegrator__T], typing.Generic[_MultistepFieldIntegrator__T]): - def getMaxGrowth(self) -> float: ... - def getMinReduction(self) -> float: ... - def getNSteps(self) -> int: ... - def getSafety(self) -> float: ... + """ + public abstract classMultistepFieldIntegrator<T extends :class:`~org.hipparchus.ode.https:.www.hipparchus.org.hipparchus`<T>> extends :class:`~org.hipparchus.ode.nonstiff.AdaptiveStepsizeFieldIntegrator`<T> + + This class is the base class for multistep integrators for Ordinary Differential Equations. + + We define scaled derivatives s :sub:`i` (n) at step n as: \[ \left\{\begin{align} s_1(n) &= h y'_n \text{ for first + derivative}\\ s_2(n) &= \frac{h^2}{2} y_n'' \text{ for second derivative}\\ s_3(n) &= \frac{h^3}{6} y_n''' \text{ for + third derivative}\\ &\cdots\\ s_k(n) &= \frac{h^k}{k!} y_n^{(k)} \text{ for } k^\mathrm{th} \text{ derivative} + \end{align}\right. \] + + Rather than storing several previous steps separately, this implementation uses the Nordsieck vector with higher degrees + scaled derivatives all taken at the same step (y :sub:`n` , s :sub:`1` (n) and r :sub:`n` ) where r :sub:`n` is defined + as: \[ r_n = [ s_2(n), s_3(n) \ldots s_k(n) ]^T \] (we omit the k index in the notation for clarity) + + Multistep integrators with Nordsieck representation are highly sensitive to large step changes because when the step is + multiplied by factor a, the k :sup:`th` component of the Nordsieck vector is multiplied by a :sup:`k` and the last + components are the least accurate ones. The default max growth factor is therefore set to a quite low value: 2 + :sup:`1/order` . + + Also see: + + - :class:`~org.hipparchus.ode.nonstiff.AdamsBashforthFieldIntegrator` + - :class:`~org.hipparchus.ode.nonstiff.AdamsMoultonFieldIntegrator` + """ + def getMaxGrowth(self) -> float: + """ + Get the maximal growth factor for stepsize control. + + Returns: + maximal growth factor + + + """ + ... + def getMinReduction(self) -> float: + """ + Get the minimal reduction factor for stepsize control. + + Returns: + minimal reduction factor + + + """ + ... + def getNSteps(self) -> int: + """ + Get the number of steps of the multistep method (excluding the one being computed). + + Returns: + number of steps of the multistep method (excluding the one being computed) + + + """ + ... + def getSafety(self) -> float: + """ + Get the safety factor for stepsize control. + + Returns: + safety factor + + + """ + ... def getStarterIntegrator(self) -> FieldODEIntegrator[_MultistepFieldIntegrator__T]: ... - def setMaxGrowth(self, double: float) -> None: ... - def setMinReduction(self, double: float) -> None: ... - def setSafety(self, double: float) -> None: ... + def setMaxGrowth(self, double: float) -> None: + """ + Set the maximal growth factor for stepsize control. + + Parameters: + maxGrowth (double): maximal growth factor + + + """ + ... + def setMinReduction(self, double: float) -> None: + """ + Set the minimal reduction factor for stepsize control. + + Parameters: + minReduction (double): minimal reduction factor + + + """ + ... + def setSafety(self, double: float) -> None: + """ + Set the safety factor for stepsize control. + + Parameters: + safety (double): safety factor + + + """ + ... def setStarterIntegrator(self, fieldODEIntegrator: FieldODEIntegrator[_MultistepFieldIntegrator__T]) -> None: ... class MultistepIntegrator(org.hipparchus.ode.nonstiff.AdaptiveStepsizeIntegrator): - def getMaxGrowth(self) -> float: ... - def getMinReduction(self) -> float: ... - def getNSteps(self) -> int: ... - def getSafety(self) -> float: ... - def getStarterIntegrator(self) -> 'ODEIntegrator': ... - def setMaxGrowth(self, double: float) -> None: ... - def setMinReduction(self, double: float) -> None: ... - def setSafety(self, double: float) -> None: ... - def setStarterIntegrator(self, oDEIntegrator: 'ODEIntegrator') -> None: ... + """ + public abstract classMultistepIntegrator extends :class:`~org.hipparchus.ode.nonstiff.AdaptiveStepsizeIntegrator` + + This class is the base class for multistep integrators for Ordinary Differential Equations. + + We define scaled derivatives s :sub:`i` (n) at step n as: \[ \left\{\begin{align} s_1(n) &= h y'_n \text{ for first + derivative}\\ s_2(n) &= \frac{h^2}{2} y_n'' \text{ for second derivative}\\ s_3(n) &= \frac{h^3}{6} y_n''' \text{ for + third derivative}\\ &\cdots\\ s_k(n) &= \frac{h^k}{k!} y_n^{(k)} \text{ for } k^\mathrm{th} \text{ derivative} + \end{align}\right. \] + + Rather than storing several previous steps separately, this implementation uses the Nordsieck vector with higher degrees + scaled derivatives all taken at the same step (y :sub:`n` , s :sub:`1` (n) and r :sub:`n` ) where r :sub:`n` is defined + as: \[ r_n = [ s_2(n), s_3(n) \ldots s_k(n) ]^T \] (we omit the k index in the notation for clarity) + + Multistep integrators with Nordsieck representation are highly sensitive to large step changes because when the step is + multiplied by factor a, the k :sup:`th` component of the Nordsieck vector is multiplied by a :sup:`k` and the last + components are the least accurate ones. The default max growth factor is therefore set to a quite low value: 2 + :sup:`1/order` . + + Also see: + + - :class:`~org.hipparchus.ode.nonstiff.AdamsBashforthIntegrator` + - :class:`~org.hipparchus.ode.nonstiff.AdamsMoultonIntegrator` + """ + def getMaxGrowth(self) -> float: + """ + Get the maximal growth factor for stepsize control. + + Returns: + maximal growth factor + + + """ + ... + def getMinReduction(self) -> float: + """ + Get the minimal reduction factor for stepsize control. + + Returns: + minimal reduction factor + + + """ + ... + def getNSteps(self) -> int: + """ + Get the number of steps of the multistep method (excluding the one being computed). + + Returns: + number of steps of the multistep method (excluding the one being computed) + + + """ + ... + def getSafety(self) -> float: + """ + Get the safety factor for stepsize control. + + Returns: + safety factor + + + """ + ... + def getStarterIntegrator(self) -> 'ODEIntegrator': + """ + Get the starter integrator. + + Returns: + starter integrator + + + """ + ... + def setMaxGrowth(self, double: float) -> None: + """ + Set the maximal growth factor for stepsize control. + + Parameters: + maxGrowth (double): maximal growth factor + + + """ + ... + def setMinReduction(self, double: float) -> None: + """ + Set the minimal reduction factor for stepsize control. + + Parameters: + minReduction (double): minimal reduction factor + + + """ + ... + def setSafety(self, double: float) -> None: + """ + Set the safety factor for stepsize control. + + Parameters: + safety (double): safety factor + + + """ + ... + def setStarterIntegrator(self, oDEIntegrator: 'ODEIntegrator') -> None: + """ + Set the starter integrator. + + The various step and event handlers for this starter integrator will be managed automatically by the multi-step + integrator. Any user configuration for these elements will be cleared before use. + + Parameters: + starterIntegrator (:class:`~org.hipparchus.ode.ODEIntegrator`): starter integrator + + + """ + ... class ODEIntegrator: - def addEventDetector(self, oDEEventDetector: org.hipparchus.ode.events.ODEEventDetector) -> None: ... - def addStepEndHandler(self, oDEStepEndHandler: typing.Union[org.hipparchus.ode.events.ODEStepEndHandler, typing.Callable]) -> None: ... - def addStepHandler(self, oDEStepHandler: typing.Union[org.hipparchus.ode.sampling.ODEStepHandler, typing.Callable]) -> None: ... - def clearEventDetectors(self) -> None: ... - def clearStepEndHandlers(self) -> None: ... - def clearStepHandlers(self) -> None: ... - def getCurrentSignedStepsize(self) -> float: ... - def getEvaluations(self) -> int: ... + """ + public interfaceODEIntegrator + + This interface represents a first order integrator for differential equations. + + The classes which are devoted to solve first order differential equations should implement this interface. The problems + which can be handled should implement the :class:`~org.hipparchus.ode.OrdinaryDifferentialEquation` interface. + + Also see: + + - :class:`~org.hipparchus.ode.OrdinaryDifferentialEquation` + - :class:`~org.hipparchus.ode.sampling.ODEStepHandler` + - :class:`~org.hipparchus.ode.events.ODEEventHandler` + """ + def addEventDetector(self, oDEEventDetector: org.hipparchus.ode.events.ODEEventDetector) -> None: + """ + Add an event detector to the integrator. + + Parameters: + detector (:class:`~org.hipparchus.ode.events.ODEEventDetector`): event detector + + Since: + 3.0 + + Also see: + + - :meth:`~org.hipparchus.ode.ODEIntegrator.getEventDetectors` + - :meth:`~org.hipparchus.ode.ODEIntegrator.clearEventDetectors` + + + + """ + ... + def addStepEndHandler(self, oDEStepEndHandler: typing.Union[org.hipparchus.ode.events.ODEStepEndHandler, typing.Callable]) -> None: + """ + Add a handler for step ends to the integrator. + + The :meth:`~org.hipparchus.ode.events.ODEStepEndHandler.stepEndOccurred` method of the :code:`handler` will be called at + each step end. + + Parameters: + handler (:class:`~org.hipparchus.ode.events.ODEStepEndHandler`): handler for step ends + + Since: + 3.0 + + Also see: + + - :meth:`~org.hipparchus.ode.ODEIntegrator.getStepEndHandlers` + - :meth:`~org.hipparchus.ode.ODEIntegrator.clearStepEndHandlers` + + + + """ + ... + def addStepHandler(self, oDEStepHandler: typing.Union[org.hipparchus.ode.sampling.ODEStepHandler, typing.Callable]) -> None: + """ + Add a step handler to this integrator. + + The handler will be called by the integrator for each accepted step. + + Parameters: + handler (:class:`~org.hipparchus.ode.sampling.ODEStepHandler`): handler for the accepted steps + + Also see: + + - :meth:`~org.hipparchus.ode.ODEIntegrator.getStepHandlers` + - :meth:`~org.hipparchus.ode.ODEIntegrator.clearStepHandlers` + + + + """ + ... + def clearEventDetectors(self) -> None: + """ + Remove all the event handlers that have been added to the integrator. + + Since: + 3.0 + + Also see: + + - :meth:`~org.hipparchus.ode.ODEIntegrator.addEventDetector` + - :meth:`~org.hipparchus.ode.ODEIntegrator.getEventDetectors` + + + + """ + ... + def clearStepEndHandlers(self) -> None: + """ + Remove all the handlers for step ends that have been added to the integrator. + + Since: + 3.0 + + Also see: + + - :meth:`~org.hipparchus.ode.ODEIntegrator.addStepEndHandler` + - :meth:`~org.hipparchus.ode.ODEIntegrator.getStepEndHandlers` + + + + """ + ... + def clearStepHandlers(self) -> None: + """ + Remove all the step handlers that have been added to the integrator. + + Also see: + + - :meth:`~org.hipparchus.ode.ODEIntegrator.addStepHandler` + - :meth:`~org.hipparchus.ode.ODEIntegrator.getStepHandlers` + + + + """ + ... + def getCurrentSignedStepsize(self) -> float: + """ + Get the current signed value of the integration stepsize. + + This method can be called during integration (typically by the object implementing the + :class:`~org.hipparchus.ode.OrdinaryDifferentialEquation` problem) if the signed value of the current stepsize that is + tried is needed. + + The result is undefined if the method is called outside of calls to :code:`integrate`. + + Returns: + current signed value of the stepsize + + + """ + ... + def getEvaluations(self) -> int: + """ + Get the number of evaluations of the differential equations function. + + The number of evaluations corresponds to the last call to the :code:`integrate` method. It is 0 if the method has not + been called yet. + + Returns: + number of evaluations of the differential equations function + + + """ + ... def getEventDetectors(self) -> java.util.List[org.hipparchus.ode.events.ODEEventDetector]: ... - def getMaxEvaluations(self) -> int: ... - def getName(self) -> str: ... + def getMaxEvaluations(self) -> int: + """ + Get the maximal number of functions evaluations. + + Returns: + maximal number of functions evaluations + + + """ + ... + def getName(self) -> str: + """ + Get the name of the method. + + Returns: + name of the method + + + """ + ... def getStepEndHandlers(self) -> java.util.List[org.hipparchus.ode.events.ODEStepEndHandler]: ... def getStepHandlers(self) -> java.util.List[org.hipparchus.ode.sampling.ODEStepHandler]: ... - def getStepStart(self) -> 'ODEStateAndDerivative': ... + def getStepStart(self) -> 'ODEStateAndDerivative': + """ + Get the state at step start time t :sub:`i` . + + This method can be called during integration (typically by the object implementing the + :class:`~org.hipparchus.ode.OrdinaryDifferentialEquation` problem) if the value of the current step that is attempted is + needed. + + The result is undefined if the method is called outside of calls to :code:`integrate`. + + Returns: + state at step start time t :sub:`i` + + + """ + ... @typing.overload def integrate(self, expandableODE: ExpandableODE, oDEState: 'ODEState', double: float) -> 'ODEStateAndDerivative': ... @typing.overload def integrate(self, ordinaryDifferentialEquation: 'OrdinaryDifferentialEquation', oDEState: 'ODEState', double: float) -> 'ODEStateAndDerivative': ... - def setMaxEvaluations(self, int: int) -> None: ... + def setMaxEvaluations(self, int: int) -> None: + """ + Set the maximal number of differential equations function evaluations. + + The purpose of this method is to avoid infinite loops which can occur for example when stringent error constraints are + set or when lots of discrete events are triggered, thus leading to many rejected steps. + + Parameters: + maxEvaluations (int): maximal number of function evaluations (negative values are silently converted to maximal integer value, thus + representing almost unlimited evaluations) + + + """ + ... class ODEState(java.io.Serializable): + """ + public classODEState extends :class:`~org.hipparchus.ode.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.ode.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + Container for time, main and secondary state vectors. + + Also see: + + - :class:`~org.hipparchus.ode.OrdinaryDifferentialEquation` + - :class:`~org.hipparchus.ode.SecondaryODE` + - :class:`~org.hipparchus.ode.ODEIntegrator` + - :class:`~org.hipparchus.ode.ODEStateAndDerivative` + - :meth:`~serialized` + """ @typing.overload def __init__(self, double: float, doubleArray: typing.Union[typing.List[float], jpype.JArray]): ... @typing.overload def __init__(self, double: float, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[typing.MutableSequence[float]], jpype.JArray]): ... - def getCompleteState(self) -> typing.MutableSequence[float]: ... - def getCompleteStateDimension(self) -> int: ... - def getNumberOfSecondaryStates(self) -> int: ... - def getPrimaryState(self) -> typing.MutableSequence[float]: ... - def getPrimaryStateDimension(self) -> int: ... - def getSecondaryState(self, int: int) -> typing.MutableSequence[float]: ... - def getSecondaryStateDimension(self, int: int) -> int: ... - def getTime(self) -> float: ... + def getCompleteState(self) -> typing.MutableSequence[float]: + """ + Get complete state at time. + + Returns: + complete state at time, starting with :meth:`~org.hipparchus.ode.ODEState.getPrimaryState`, followed by all + :meth:`~org.hipparchus.ode.ODEState.getSecondaryState` in increasing index order + + Also see: + + - :meth:`~org.hipparchus.ode.ODEState.getPrimaryState` + - :meth:`~org.hipparchus.ode.ODEState.getSecondaryState` + + + + """ + ... + def getCompleteStateDimension(self) -> int: + """ + Return the dimension of the complete set of equations. + + The complete set of equations correspond to the primary set plus all secondary sets. + + Returns: + dimension of the complete set of equations + + Also see: + + - :meth:`~org.hipparchus.ode.ODEState.getPrimaryStateDimension` + - :meth:`~org.hipparchus.ode.ODEState.getSecondaryStateDimension` + + + + """ + ... + def getNumberOfSecondaryStates(self) -> int: + """ + Get the number of secondary states. + + Returns: + number of secondary states. + + + """ + ... + def getPrimaryState(self) -> typing.MutableSequence[float]: + """ + Get primary state at time. + + Returns: + primary state at time + + Also see: + + - :meth:`~org.hipparchus.ode.ODEState.getSecondaryState` + - :meth:`~org.hipparchus.ode.ODEState.getCompleteState` + + + + """ + ... + def getPrimaryStateDimension(self) -> int: + """ + Get primary state dimension. + + Returns: + primary state dimension + + Also see: + + - :meth:`~org.hipparchus.ode.ODEState.getSecondaryStateDimension` + - :meth:`~org.hipparchus.ode.ODEState.getCompleteStateDimension` + + + + """ + ... + def getSecondaryState(self, int: int) -> typing.MutableSequence[float]: + """ + Get secondary state at time. + + Parameters: + index (int): index of the secondary set as returned by :meth:`~org.hipparchus.ode.ExpandableODE.addSecondaryEquations` (beware index + 0 corresponds to primary state, secondary states start at 1) + + Returns: + secondary state at time + + Also see: + + - :meth:`~org.hipparchus.ode.ODEState.getPrimaryState` + - :meth:`~org.hipparchus.ode.ODEState.getCompleteState` + + + + """ + ... + def getSecondaryStateDimension(self, int: int) -> int: + """ + Get secondary state dimension. + + Parameters: + index (int): index of the secondary set as returned by :meth:`~org.hipparchus.ode.ExpandableODE.addSecondaryEquations` (beware index + 0 corresponds to primary state, secondary states start at 1) + + Returns: + secondary state dimension + + Also see: + + - :meth:`~org.hipparchus.ode.ODEState.getPrimaryStateDimension` + - :meth:`~org.hipparchus.ode.ODEState.getCompleteStateDimension` + + + + """ + ... + def getTime(self) -> float: + """ + Get time. + + Returns: + time + + + """ + ... class OrdinaryDifferentialEquation: - def computeDerivatives(self, double: float, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> typing.MutableSequence[float]: ... - def getDimension(self) -> int: ... - def init(self, double: float, doubleArray: typing.Union[typing.List[float], jpype.JArray], double3: float) -> None: ... + """ + public interfaceOrdinaryDifferentialEquation + + This interface represents a first order differential equations set. + + This interface should be implemented by all real first order differential equation problems before they can be handled + by the integrators :meth:`~org.hipparchus.ode.ODEIntegrator.integrate` method. + + A first order differential equations problem, as seen by an integrator is the time derivative :code:`dY/dt` of a state + vector :code:`Y`, both being one dimensional arrays. From the integrator point of view, this derivative depends only on + the current time :code:`t` and on the state vector :code:`Y`. + + For real problems, the derivative depends also on parameters that do not belong to the state vector (dynamical model + constants for example). These constants are completely outside of the scope of this interface, the classes that + implement it are allowed to handle them as they want. + + Also see: + + - :class:`~org.hipparchus.ode.ODEIntegrator` + - :class:`~org.hipparchus.ode.FirstOrderConverter` + - :class:`~org.hipparchus.ode.SecondOrderODE` + """ + def computeDerivatives(self, double: float, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> typing.MutableSequence[float]: + """ + Get the current time derivative of the state vector. + + Parameters: + t (double): current value of the independent *time* variable + y (double[]): array containing the current value of the state vector + + Returns: + time derivative of the state vector + + + """ + ... + def getDimension(self) -> int: + """ + Get the dimension of the problem. + + Returns: + dimension of the problem + + + """ + ... + def init(self, double: float, doubleArray: typing.Union[typing.List[float], jpype.JArray], double3: float) -> None: + """ + Initialize equations at the start of an ODE integration. + + This method is called once at the start of the integration. It may be used by the equations to initialize some internal + data if needed. + + The default implementation does nothing. + + Parameters: + t0 (double): value of the independent *time* variable at integration start + y0 (double[]): array containing the value of the state vector at integration start + finalTime (double): target time for the integration + + + """ + ... class ParameterConfiguration: - def getHP(self) -> float: ... - def getParameterName(self) -> str: ... + """ + public classParameterConfiguration extends :class:`~org.hipparchus.ode.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Simple container pairing a parameter name with a step in order to compute the associated Jacobian matrix by finite + difference. + + Instances of this class are guaranteed to be immutable. + """ + def getHP(self) -> float: + """ + Get parameter step. + + Returns: + hP parameter step + + + """ + ... + def getParameterName(self) -> str: + """ + Get parameter name. + + Returns: + parameterName parameter name + + + """ + ... class Parameterizable: + """ + public interfaceParameterizable + + This interface enables to process any parameterizable object. + """ def getParametersNames(self) -> java.util.List[str]: ... - def isSupported(self, string: str) -> bool: ... + def isSupported(self, string: str) -> bool: + """ + Check if a parameter is supported. + + Supported parameters are those listed by :meth:`~org.hipparchus.ode.Parameterizable.getParametersNames`. + + Parameters: + name (:class:`~org.hipparchus.ode.https:.docs.oracle.com.javase.8.docs.api.java.lang.String`): parameter name to check + + Returns: + true if the parameter is supported + + Also see: + + - :meth:`~org.hipparchus.ode.Parameterizable.getParametersNames` + + + + """ + ... class SecondOrderODE: - def computeSecondDerivatives(self, double: float, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray]) -> typing.MutableSequence[float]: ... - def getDimension(self) -> int: ... + """ + public interfaceSecondOrderODE + + This interface represents a second order differential equations set. + + This interface should be implemented by all real second order differential equation problems before they can be handled + by the integrators :class:`~org.hipparchus.ode.FirstOrderConverter`. + + A second order differential equations problem, as seen by an integrator is the second time derivative :code:`d2Y/dt^2` + of a state vector :code:`Y`, both being one dimensional arrays. From the integrator point of view, this derivative + depends only on the current time :code:`t`, on the state vector :code:`Y` and on the first time derivative of the state + vector. + + For real problems, the derivative depends also on parameters that do not belong to the state vector (dynamical model + constants for example). These constants are completely outside of the scope of this interface, the classes that + implement it are allowed to handle them as they want. + + Also see: + + - :class:`~org.hipparchus.ode.FirstOrderConverter` + - :class:`~org.hipparchus.ode.OrdinaryDifferentialEquation` + """ + def computeSecondDerivatives(self, double: float, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray]) -> typing.MutableSequence[float]: + """ + Get the current time derivative of the state vector. + + Parameters: + t (double): current value of the independent *time* variable + y (double[]): array containing the current value of the state vector + yDot (double[]): array containing the current value of the first derivative of the state vector + + Returns: + second time derivative of the state vector + + + """ + ... + def getDimension(self) -> int: + """ + Get the dimension of the problem. + + Returns: + dimension of the problem + + + """ + ... class SecondaryODE: + """ + public interfaceSecondaryODE + + This interface allows users to add secondary differential equations to a primary set of differential equations. + + In some cases users may need to integrate some problem-specific equations along with a primary set of differential + equations. One example is optimal control where adjoined parameters linked to the minimized hamiltonian must be + integrated. + + This interface allows users to add such equations to a primary set of + :class:`~org.hipparchus.ode.OrdinaryDifferentialEquation` thanks to the + :meth:`~org.hipparchus.ode.ExpandableODE.addSecondaryEquations` method. + + Also see: + + - :class:`~org.hipparchus.ode.ExpandableODE` + """ def computeDerivatives(self, double: float, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray], doubleArray3: typing.Union[typing.List[float], jpype.JArray]) -> typing.MutableSequence[float]: ... - def getDimension(self) -> int: ... - def init(self, double: float, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray], double4: float) -> None: ... + def getDimension(self) -> int: + """ + Get the dimension of the secondary state parameters. + + Returns: + dimension of the secondary state parameters + + + """ + ... + def init(self, double: float, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray], double4: float) -> None: + """ + Initialize equations at the start of an ODE integration. + + This method is called once at the start of the integration. It may be used by the equations to initialize some internal + data if needed. + + The default implementation does nothing. + + Parameters: + t0 (double): value of the independent *time* variable at integration start + primary0 (double[]): array containing the value of the primary state vector at integration start + secondary0 (double[]): array containing the value of the secondary state vector at integration start + finalTime (double): target time for the integration + + + """ + ... class VariationalEquation: + """ + public classVariationalEquation extends :class:`~org.hipparchus.ode.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + This class defines a set of :class:`~org.hipparchus.ode.SecondaryODE` to compute the global Jacobian matrices with + respect to the initial state vector and, if any, to some parameters of the primary ODE set. + + The primary set of ODE for which Jaobian matrices are requested may be: + + - a full-fledged :class:`~org.hipparchus.ode.ODEJacobiansProvider` that computes by itself both the ODE and its local + partial derivatives, + - a simple :class:`~org.hipparchus.ode.OrdinaryDifferentialEquation` which must therefore be completed with a finite + differences configuration to compute local partial derivatives (so-called internal differentiation). + + + As the variational equation automatically inserts :meth:`~org.hipparchus.ode.ExpandableODE.addSecondaryEquations`, in + the :class:`~org.hipparchus.ode.ExpandableODE`, data for initial state must also be inserted before integration and + matrices result must be extracted after integration. This implies a precise scheduling of the calls to the various + methods of this class. The proper scheduling is the following one: + + .. code-block: 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); + + + The most important part is to not forget to call :meth:`~org.hipparchus.ode.VariationalEquation.setUpInitialState` to + add the secondary state with the initial matrices to the :class:`~org.hipparchus.ode.ODEState` used in the + :meth:`~org.hipparchus.ode.ODEIntegrator.integrate` method. Forgetting to do this and passing only a + :class:`~org.hipparchus.ode.ODEState` without the secondary state set up will trigger an error as the state vector will + not have the correct dimension. + + Also see: + + - :class:`~org.hipparchus.ode.ExpandableODE` + - :class:`~org.hipparchus.ode.ODEJacobiansProvider` + - :class:`~org.hipparchus.ode.OrdinaryDifferentialEquation` + - :class:`~org.hipparchus.ode.NamedParameterJacobianProvider` + - :class:`~org.hipparchus.ode.ParametersController` + """ @typing.overload def __init__(self, expandableODE: ExpandableODE, oDEJacobiansProvider: 'ODEJacobiansProvider'): ... @typing.overload def __init__(self, expandableODE: ExpandableODE, ordinaryDifferentialEquation: OrdinaryDifferentialEquation, doubleArray: typing.Union[typing.List[float], jpype.JArray], parametersController: 'ParametersController', *parameterConfiguration: ParameterConfiguration): ... - def extractMainSetJacobian(self, oDEState: ODEState) -> typing.MutableSequence[typing.MutableSequence[float]]: ... - def extractParameterJacobian(self, oDEState: ODEState, string: str) -> typing.MutableSequence[float]: ... + def extractMainSetJacobian(self, oDEState: ODEState) -> typing.MutableSequence[typing.MutableSequence[float]]: + """ + Extract the Jacobian matrix with respect to state. + + Parameters: + state (:class:`~org.hipparchus.ode.ODEState`): state from which to extract Jacobian matrix + + Returns: + Jacobian matrix dY/dY0 with respect to state. + + + """ + ... + def extractParameterJacobian(self, oDEState: ODEState, string: str) -> typing.MutableSequence[float]: + """ + Extract the Jacobian matrix with respect to one parameter. + + Parameters: + state (:class:`~org.hipparchus.ode.ODEState`): state from which to extract Jacobian matrix + pName (:class:`~org.hipparchus.ode.https:.docs.oracle.com.javase.8.docs.api.java.lang.String`): name of the parameter for the computed Jacobian matrix + + Returns: + Jacobian matrix dY/dP with respect to the named parameter + + + """ + ... def setInitialMainStateJacobian(self, doubleArray: typing.Union[typing.List[typing.MutableSequence[float]], jpype.JArray]) -> None: ... def setInitialParameterJacobian(self, string: str, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> None: ... - def setUpInitialState(self, oDEState: ODEState) -> ODEState: ... + def setUpInitialState(self, oDEState: ODEState) -> ODEState: + """ + Set up initial state. + + This method inserts the initial Jacobian matrices data into an :class:`~org.hipparchus.ode.ODEState` by overriding the + additional state components corresponding to the instance. It must be called prior to integrate the equations. + + This method must be called *after* :meth:`~org.hipparchus.ode.VariationalEquation.setInitialMainStateJacobian` and + :meth:`~org.hipparchus.ode.VariationalEquation.setInitialParameterJacobian`. + + Parameters: + initialState (:class:`~org.hipparchus.ode.ODEState`): initial state, without the initial Jacobians matrices + + Returns: + a new instance of initial state, with the initial Jacobians matrices properly initialized + + + """ + ... class MismatchedEquations(org.hipparchus.exception.MathIllegalArgumentException): def __init__(self): ... _AbstractFieldIntegrator__T = typing.TypeVar('_AbstractFieldIntegrator__T', bound=org.hipparchus.CalculusFieldElement) # <T> class AbstractFieldIntegrator(FieldODEIntegrator[_AbstractFieldIntegrator__T], typing.Generic[_AbstractFieldIntegrator__T]): + """ + public abstract classAbstractFieldIntegrator<T extends :class:`~org.hipparchus.ode.https:.www.hipparchus.org.hipparchus`<T>> extends :class:`~org.hipparchus.ode.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.ode.FieldODEIntegrator`<T> + + Base class managing common boilerplate for all integrators. + """ def addEventDetector(self, fieldODEEventDetector: org.hipparchus.ode.events.FieldODEEventDetector[_AbstractFieldIntegrator__T]) -> None: ... def addStepEndHandler(self, fieldODEStepEndHandler: typing.Union[org.hipparchus.ode.events.FieldODEStepEndHandler[_AbstractFieldIntegrator__T], typing.Callable[['FieldODEStateAndDerivative'[org.hipparchus.CalculusFieldElement], bool], org.hipparchus.ode.events.Action]]) -> None: ... def addStepHandler(self, fieldODEStepHandler: typing.Union[org.hipparchus.ode.sampling.FieldODEStepHandler[_AbstractFieldIntegrator__T], typing.Callable[[org.hipparchus.ode.sampling.FieldODEStateInterpolator[org.hipparchus.CalculusFieldElement]], None]]) -> None: ... - def clearEventDetectors(self) -> None: ... - def clearStepEndHandlers(self) -> None: ... - def clearStepHandlers(self) -> None: ... + def clearEventDetectors(self) -> None: + """ + Remove all the event handlers that have been added to the integrator. + + Specified by: + :meth:`~org.hipparchus.ode.FieldODEIntegrator.clearEventDetectors` in + interface :class:`~org.hipparchus.ode.FieldODEIntegrator` + + Also see: + + - :meth:`~org.hipparchus.ode.FieldODEIntegrator.addEventDetector` + - :meth:`~org.hipparchus.ode.FieldODEIntegrator.getEventDetectors` + + + + """ + ... + def clearStepEndHandlers(self) -> None: + """ + Remove all the handlers for step ends that have been added to the integrator. + + Specified by: + :meth:`~org.hipparchus.ode.FieldODEIntegrator.clearStepEndHandlers` in + interface :class:`~org.hipparchus.ode.FieldODEIntegrator` + + Also see: + + - :meth:`~org.hipparchus.ode.FieldODEIntegrator.addStepEndHandler` + - :meth:`~org.hipparchus.ode.FieldODEIntegrator.getStepEndHandlers` + + + + """ + ... + def clearStepHandlers(self) -> None: + """ + Remove all the step handlers that have been added to the integrator. + + Specified by: + :meth:`~org.hipparchus.ode.FieldODEIntegrator.clearStepHandlers` in + interface :class:`~org.hipparchus.ode.FieldODEIntegrator` + + Also see: + + - :meth:`~org.hipparchus.ode.FieldODEIntegrator.addStepHandler` + - :meth:`~org.hipparchus.ode.FieldODEIntegrator.getStepHandlers` + + + + """ + ... def computeDerivatives(self, t: _AbstractFieldIntegrator__T, tArray: typing.Union[typing.List[_AbstractFieldIntegrator__T], jpype.JArray]) -> typing.MutableSequence[_AbstractFieldIntegrator__T]: ... - def getCurrentSignedStepsize(self) -> _AbstractFieldIntegrator__T: ... - def getEvaluations(self) -> int: ... + def getCurrentSignedStepsize(self) -> _AbstractFieldIntegrator__T: + """ + Get the current signed value of the integration stepsize. + + This method can be called during integration (typically by the object implementing the + :class:`~org.hipparchus.ode.FieldOrdinaryDifferentialEquation` problem) if the signed value of the current stepsize that + is tried is needed. + + The result is undefined if the method is called outside of calls to :code:`integrate`. + + Specified by: + :meth:`~org.hipparchus.ode.FieldODEIntegrator.getCurrentSignedStepsize` in + interface :class:`~org.hipparchus.ode.FieldODEIntegrator` + + Returns: + current signed value of the stepsize + + + """ + ... + def getEvaluations(self) -> int: + """ + Get the number of evaluations of the differential equations function. + + The number of evaluations corresponds to the last call to the :code:`integrate` method. It is 0 if the method has not + been called yet. + + Specified by: + :meth:`~org.hipparchus.ode.FieldODEIntegrator.getEvaluations` in + interface :class:`~org.hipparchus.ode.FieldODEIntegrator` + + Returns: + number of evaluations of the differential equations function + + + """ + ... def getEventDetectors(self) -> java.util.List[org.hipparchus.ode.events.FieldODEEventDetector[_AbstractFieldIntegrator__T]]: ... def getField(self) -> org.hipparchus.Field[_AbstractFieldIntegrator__T]: ... - def getMaxEvaluations(self) -> int: ... - def getName(self) -> str: ... + def getMaxEvaluations(self) -> int: + """ + Get the maximal number of functions evaluations. + + Specified by: + :meth:`~org.hipparchus.ode.FieldODEIntegrator.getMaxEvaluations` in + interface :class:`~org.hipparchus.ode.FieldODEIntegrator` + + Returns: + maximal number of functions evaluations + + + """ + ... + def getName(self) -> str: + """ + Get the name of the method. + + Specified by: + :meth:`~org.hipparchus.ode.FieldODEIntegrator.getName` in interface :class:`~org.hipparchus.ode.FieldODEIntegrator` + + Returns: + name of the method + + + """ + ... def getStepEndHandlers(self) -> java.util.List[org.hipparchus.ode.events.FieldODEStepEndHandler[_AbstractFieldIntegrator__T]]: ... def getStepHandlers(self) -> java.util.List[org.hipparchus.ode.sampling.FieldODEStepHandler[_AbstractFieldIntegrator__T]]: ... def getStepStart(self) -> 'FieldODEStateAndDerivative'[_AbstractFieldIntegrator__T]: ... - def setMaxEvaluations(self, int: int) -> None: ... + def setMaxEvaluations(self, int: int) -> None: + """ + Set the maximal number of differential equations function evaluations. + + The purpose of this method is to avoid infinite loops which can occur for example when stringent error constraints are + set or when lots of discrete events are triggered, thus leading to many rejected steps. + + Specified by: + :meth:`~org.hipparchus.ode.FieldODEIntegrator.setMaxEvaluations` in + interface :class:`~org.hipparchus.ode.FieldODEIntegrator` + + Parameters: + maxEvaluations (int): maximal number of function evaluations (negative values are silently converted to maximal integer value, thus + representing almost unlimited evaluations) + + + """ + ... class AbstractIntegrator(ODEIntegrator): - def addEventDetector(self, oDEEventDetector: org.hipparchus.ode.events.ODEEventDetector) -> None: ... - def addStepEndHandler(self, oDEStepEndHandler: typing.Union[org.hipparchus.ode.events.ODEStepEndHandler, typing.Callable]) -> None: ... - def addStepHandler(self, oDEStepHandler: typing.Union[org.hipparchus.ode.sampling.ODEStepHandler, typing.Callable]) -> None: ... - def clearEventDetectors(self) -> None: ... - def clearStepEndHandlers(self) -> None: ... - def clearStepHandlers(self) -> None: ... + """ + public abstract classAbstractIntegrator extends :class:`~org.hipparchus.ode.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.ode.ODEIntegrator` + + Base class managing common boilerplate for all integrators. + """ + def addEventDetector(self, oDEEventDetector: org.hipparchus.ode.events.ODEEventDetector) -> None: + """ + Add an event detector to the integrator. + + Specified by: + :meth:`~org.hipparchus.ode.ODEIntegrator.addEventDetector` in interface :class:`~org.hipparchus.ode.ODEIntegrator` + + Parameters: + detector (:class:`~org.hipparchus.ode.events.ODEEventDetector`): event detector + + Also see: + + - :meth:`~org.hipparchus.ode.ODEIntegrator.getEventDetectors` + - :meth:`~org.hipparchus.ode.ODEIntegrator.clearEventDetectors` + + + + """ + ... + def addStepEndHandler(self, oDEStepEndHandler: typing.Union[org.hipparchus.ode.events.ODEStepEndHandler, typing.Callable]) -> None: + """ + Add a handler for step ends to the integrator. + + The :meth:`~org.hipparchus.ode.events.ODEStepEndHandler.stepEndOccurred` method of the :code:`handler` will be called at + each step end. + + Specified by: + :meth:`~org.hipparchus.ode.ODEIntegrator.addStepEndHandler` in interface :class:`~org.hipparchus.ode.ODEIntegrator` + + Parameters: + handler (:class:`~org.hipparchus.ode.events.ODEStepEndHandler`): handler for step ends + + Also see: + + - :meth:`~org.hipparchus.ode.ODEIntegrator.getStepEndHandlers` + - :meth:`~org.hipparchus.ode.ODEIntegrator.clearStepEndHandlers` + + + + """ + ... + def addStepHandler(self, oDEStepHandler: typing.Union[org.hipparchus.ode.sampling.ODEStepHandler, typing.Callable]) -> None: + """ + Add a step handler to this integrator. + + The handler will be called by the integrator for each accepted step. + + Specified by: + :meth:`~org.hipparchus.ode.ODEIntegrator.addStepHandler` in interface :class:`~org.hipparchus.ode.ODEIntegrator` + + Parameters: + handler (:class:`~org.hipparchus.ode.sampling.ODEStepHandler`): handler for the accepted steps + + Also see: + + - :meth:`~org.hipparchus.ode.ODEIntegrator.getStepHandlers` + - :meth:`~org.hipparchus.ode.ODEIntegrator.clearStepHandlers` + + + + """ + ... + def clearEventDetectors(self) -> None: + """ + Remove all the event handlers that have been added to the integrator. + + Specified by: + :meth:`~org.hipparchus.ode.ODEIntegrator.clearEventDetectors` in interface :class:`~org.hipparchus.ode.ODEIntegrator` + + Also see: + + - :meth:`~org.hipparchus.ode.ODEIntegrator.addEventDetector` + - :meth:`~org.hipparchus.ode.ODEIntegrator.getEventDetectors` + + + + """ + ... + def clearStepEndHandlers(self) -> None: + """ + Remove all the handlers for step ends that have been added to the integrator. + + Specified by: + :meth:`~org.hipparchus.ode.ODEIntegrator.clearStepEndHandlers` in interface :class:`~org.hipparchus.ode.ODEIntegrator` + + Also see: + + - :meth:`~org.hipparchus.ode.ODEIntegrator.addStepEndHandler` + - :meth:`~org.hipparchus.ode.ODEIntegrator.getStepEndHandlers` + + + + """ + ... + def clearStepHandlers(self) -> None: + """ + Remove all the step handlers that have been added to the integrator. + + Specified by: + :meth:`~org.hipparchus.ode.ODEIntegrator.clearStepHandlers` in interface :class:`~org.hipparchus.ode.ODEIntegrator` + + Also see: + + - :meth:`~org.hipparchus.ode.ODEIntegrator.addStepHandler` + - :meth:`~org.hipparchus.ode.ODEIntegrator.getStepHandlers` + + + + """ + ... def computeDerivatives(self, double: float, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> typing.MutableSequence[float]: ... - def getCurrentSignedStepsize(self) -> float: ... - def getEvaluations(self) -> int: ... + def getCurrentSignedStepsize(self) -> float: + """ + Get the current signed value of the integration stepsize. + + This method can be called during integration (typically by the object implementing the + :class:`~org.hipparchus.ode.OrdinaryDifferentialEquation` problem) if the signed value of the current stepsize that is + tried is needed. + + The result is undefined if the method is called outside of calls to :code:`integrate`. + + Specified by: + :meth:`~org.hipparchus.ode.ODEIntegrator.getCurrentSignedStepsize` in + interface :class:`~org.hipparchus.ode.ODEIntegrator` + + Returns: + current signed value of the stepsize + + + """ + ... + def getEvaluations(self) -> int: + """ + Get the number of evaluations of the differential equations function. + + The number of evaluations corresponds to the last call to the :code:`integrate` method. It is 0 if the method has not + been called yet. + + Specified by: + :meth:`~org.hipparchus.ode.ODEIntegrator.getEvaluations` in interface :class:`~org.hipparchus.ode.ODEIntegrator` + + Returns: + number of evaluations of the differential equations function + + + """ + ... def getEventDetectors(self) -> java.util.List[org.hipparchus.ode.events.ODEEventDetector]: ... - def getMaxEvaluations(self) -> int: ... - def getName(self) -> str: ... + def getMaxEvaluations(self) -> int: + """ + Get the maximal number of functions evaluations. + + Specified by: + :meth:`~org.hipparchus.ode.ODEIntegrator.getMaxEvaluations` in interface :class:`~org.hipparchus.ode.ODEIntegrator` + + Returns: + maximal number of functions evaluations + + + """ + ... + def getName(self) -> str: + """ + Get the name of the method. + + Specified by: + :meth:`~org.hipparchus.ode.ODEIntegrator.getName` in interface :class:`~org.hipparchus.ode.ODEIntegrator` + + Returns: + name of the method + + + """ + ... def getStepEndHandlers(self) -> java.util.List[org.hipparchus.ode.events.ODEStepEndHandler]: ... def getStepHandlers(self) -> java.util.List[org.hipparchus.ode.sampling.ODEStepHandler]: ... - def getStepStart(self) -> 'ODEStateAndDerivative': ... - def setMaxEvaluations(self, int: int) -> None: ... + def getStepStart(self) -> 'ODEStateAndDerivative': + """ + Get the state at step start time t :sub:`i` . + + This method can be called during integration (typically by the object implementing the + :class:`~org.hipparchus.ode.OrdinaryDifferentialEquation` problem) if the value of the current step that is attempted is + needed. + + The result is undefined if the method is called outside of calls to :code:`integrate`. + + Specified by: + :meth:`~org.hipparchus.ode.ODEIntegrator.getStepStart` in interface :class:`~org.hipparchus.ode.ODEIntegrator` + + Returns: + state at step start time t :sub:`i` + + + """ + ... + def setMaxEvaluations(self, int: int) -> None: + """ + Set the maximal number of differential equations function evaluations. + + The purpose of this method is to avoid infinite loops which can occur for example when stringent error constraints are + set or when lots of discrete events are triggered, thus leading to many rejected steps. + + Specified by: + :meth:`~org.hipparchus.ode.ODEIntegrator.setMaxEvaluations` in interface :class:`~org.hipparchus.ode.ODEIntegrator` + + Parameters: + maxEvaluations (int): maximal number of function evaluations (negative values are silently converted to maximal integer value, thus + representing almost unlimited evaluations) + + + """ + ... class AbstractParameterizable(Parameterizable): + """ + public abstract classAbstractParameterizable extends :class:`~org.hipparchus.ode.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.ode.Parameterizable` + + This abstract class provides boilerplate parameters list. + """ def complainIfNotSupported(self, string: str) -> None: ... def getParametersNames(self) -> java.util.List[str]: ... - def isSupported(self, string: str) -> bool: ... + def isSupported(self, string: str) -> bool: + """ + Check if a parameter is supported. + + Supported parameters are those listed by :meth:`~org.hipparchus.ode.Parameterizable.getParametersNames`. + + Specified by: + :meth:`~org.hipparchus.ode.Parameterizable.isSupported` in interface :class:`~org.hipparchus.ode.Parameterizable` + + Parameters: + name (:class:`~org.hipparchus.ode.https:.docs.oracle.com.javase.8.docs.api.java.lang.String`): parameter name to check + + Returns: + true if the parameter is supported + + Also see: + + - :meth:`~org.hipparchus.ode.Parameterizable.getParametersNames` + + + + """ + ... class ComplexODEStateAndDerivative(ComplexODEState): + """ + public classComplexODEStateAndDerivative extends :class:`~org.hipparchus.ode.ComplexODEState` + + Container for time, main and secondary state vectors as well as their derivatives. + + Also see: + + - :class:`~org.hipparchus.ode.ComplexOrdinaryDifferentialEquation` + - :class:`~org.hipparchus.ode.ComplexSecondaryODE` + - :class:`~org.hipparchus.ode.ODEIntegrator` + - :meth:`~serialized` + """ @typing.overload def __init__(self, double: float, complexArray: typing.Union[typing.List[org.hipparchus.complex.Complex], jpype.JArray], complexArray2: typing.Union[typing.List[org.hipparchus.complex.Complex], jpype.JArray]): ... @typing.overload def __init__(self, double: float, complexArray: typing.Union[typing.List[org.hipparchus.complex.Complex], jpype.JArray], complexArray2: typing.Union[typing.List[org.hipparchus.complex.Complex], jpype.JArray], complexArray3: typing.Union[typing.List[typing.MutableSequence[org.hipparchus.complex.Complex]], jpype.JArray], complexArray4: typing.Union[typing.List[typing.MutableSequence[org.hipparchus.complex.Complex]], jpype.JArray]): ... - def getCompleteDerivative(self) -> typing.MutableSequence[org.hipparchus.complex.Complex]: ... - def getPrimaryDerivative(self) -> typing.MutableSequence[org.hipparchus.complex.Complex]: ... - def getSecondaryDerivative(self, int: int) -> typing.MutableSequence[org.hipparchus.complex.Complex]: ... + def getCompleteDerivative(self) -> typing.MutableSequence[org.hipparchus.complex.Complex]: + """ + Get complete derivative at time. + + Returns: + complete derivative at time, starting with + :meth:`~org.hipparchus.ode.ComplexODEStateAndDerivative.getPrimaryDerivative`, followed by all + :meth:`~org.hipparchus.ode.ComplexODEStateAndDerivative.getSecondaryDerivative` in increasing index order + + Also see: + + - :meth:`~org.hipparchus.ode.ComplexODEStateAndDerivative.getPrimaryDerivative` + - :meth:`~org.hipparchus.ode.ComplexODEStateAndDerivative.getSecondaryDerivative` + + + + """ + ... + def getPrimaryDerivative(self) -> typing.MutableSequence[org.hipparchus.complex.Complex]: + """ + Get derivative of the primary state at time. + + Returns: + derivative of the primary state at time + + Also see: + + - :meth:`~org.hipparchus.ode.ComplexODEStateAndDerivative.getSecondaryDerivative` + - :meth:`~org.hipparchus.ode.ComplexODEStateAndDerivative.getCompleteDerivative` + + + + """ + ... + def getSecondaryDerivative(self, int: int) -> typing.MutableSequence[org.hipparchus.complex.Complex]: + """ + Get derivative of the secondary state at time. + + Parameters: + index (int): index of the secondary set as returned by :meth:`~org.hipparchus.ode.ExpandableODE.addSecondaryEquations` (beware index + 0 corresponds to primary state, secondary states start at 1) + + Returns: + derivative of the secondary state at time + + Also see: + + - :meth:`~org.hipparchus.ode.ComplexODEStateAndDerivative.getPrimaryDerivative` + - :meth:`~org.hipparchus.ode.ComplexODEStateAndDerivative.getCompleteDerivative` + + + + """ + ... _FieldODEStateAndDerivative__T = typing.TypeVar('_FieldODEStateAndDerivative__T', bound=org.hipparchus.CalculusFieldElement) # <T> class FieldODEStateAndDerivative(FieldODEState[_FieldODEStateAndDerivative__T], typing.Generic[_FieldODEStateAndDerivative__T]): + """ + public classFieldODEStateAndDerivative<T extends :class:`~org.hipparchus.ode.https:.www.hipparchus.org.hipparchus`<T>> extends :class:`~org.hipparchus.ode.FieldODEState`<T> + + Container for time, main and secondary state vectors as well as their derivatives. + + Also see: + + - :class:`~org.hipparchus.ode.FieldOrdinaryDifferentialEquation` + - :class:`~org.hipparchus.ode.FieldSecondaryODE` + - :class:`~org.hipparchus.ode.FieldODEIntegrator` + """ @typing.overload def __init__(self, t: _FieldODEStateAndDerivative__T, tArray: typing.Union[typing.List[_FieldODEStateAndDerivative__T], jpype.JArray], tArray2: typing.Union[typing.List[_FieldODEStateAndDerivative__T], jpype.JArray]): ... @typing.overload def __init__(self, t: _FieldODEStateAndDerivative__T, tArray: typing.Union[typing.List[_FieldODEStateAndDerivative__T], jpype.JArray], tArray2: typing.Union[typing.List[_FieldODEStateAndDerivative__T], jpype.JArray], tArray3: typing.Union[typing.List[typing.MutableSequence[_FieldODEStateAndDerivative__T]], jpype.JArray], tArray4: typing.Union[typing.List[typing.MutableSequence[_FieldODEStateAndDerivative__T]], jpype.JArray]): ... - def getCompleteDerivative(self) -> typing.MutableSequence[_FieldODEStateAndDerivative__T]: ... - def getPrimaryDerivative(self) -> typing.MutableSequence[_FieldODEStateAndDerivative__T]: ... - def getSecondaryDerivative(self, int: int) -> typing.MutableSequence[_FieldODEStateAndDerivative__T]: ... + def getCompleteDerivative(self) -> typing.MutableSequence[_FieldODEStateAndDerivative__T]: + """ + Get complete derivative at time. + + Returns: + complete derivative at time, starting with :meth:`~org.hipparchus.ode.FieldODEStateAndDerivative.getPrimaryDerivative`, + followed by all :meth:`~org.hipparchus.ode.FieldODEStateAndDerivative.getSecondaryDerivative` in increasing index order + + Also see: + + - :meth:`~org.hipparchus.ode.FieldODEStateAndDerivative.getPrimaryDerivative` + - :meth:`~org.hipparchus.ode.FieldODEStateAndDerivative.getSecondaryDerivative` + + + + """ + ... + def getPrimaryDerivative(self) -> typing.MutableSequence[_FieldODEStateAndDerivative__T]: + """ + Get derivative of the primary state at time. + + Returns: + derivative of the primary state at time + + Also see: + + - :meth:`~org.hipparchus.ode.FieldODEStateAndDerivative.getSecondaryDerivative` + - :meth:`~org.hipparchus.ode.FieldODEStateAndDerivative.getCompleteDerivative` + + + + """ + ... + def getSecondaryDerivative(self, int: int) -> typing.MutableSequence[_FieldODEStateAndDerivative__T]: + """ + Get derivative of the secondary state at time. + + Parameters: + index (int): index of the secondary set as returned by :meth:`~org.hipparchus.ode.FieldExpandableODE.addSecondaryEquations` (beware + index 0 corresponds to primary state, secondary states start at 1) + + Returns: + derivative of the secondary state at time + + Also see: + + - :meth:`~org.hipparchus.ode.FieldODEStateAndDerivative.getPrimaryDerivative` + - :meth:`~org.hipparchus.ode.FieldODEStateAndDerivative.getCompleteDerivative` + + + + """ + ... class FirstOrderConverter(OrdinaryDifferentialEquation): + """ + public classFirstOrderConverter extends :class:`~org.hipparchus.ode.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.ode.OrdinaryDifferentialEquation` + + This class converts second order differential equations to first order ones. + + This class is a wrapper around a :class:`~org.hipparchus.ode.SecondOrderODE` which allow to use a + :class:`~org.hipparchus.ode.ODEIntegrator` to integrate it. + + The transformation is done by changing the n dimension state vector to a 2n dimension vector, where the first n + components are the initial state variables and the n last components are their first time derivative. The first time + derivative of this state vector then really contains both the first and second time derivative of the initial state + vector, which can be handled by the underlying second order equations set. + + One should be aware that the data is duplicated during the transformation process and that for each call to + :meth:`~org.hipparchus.ode.FirstOrderConverter.computeDerivatives`, this wrapper does copy 4n scalars : 2n before the + call to :meth:`~org.hipparchus.ode.SecondOrderODE.computeSecondDerivatives` in order to dispatch the y state vector into + z and zDot, and 2n after the call to gather zDot and zDDot into yDot. Since the underlying problem by itself perhaps + also needs to copy data and dispatch the arrays into domain objects, this has an impact on both memory and CPU usage. + The only way to avoid this duplication is to perform the transformation at the problem level, i.e. to implement the + problem as a first order one and then avoid using this class. + + Also see: + + - :class:`~org.hipparchus.ode.ODEIntegrator` + - :class:`~org.hipparchus.ode.OrdinaryDifferentialEquation` + - :class:`~org.hipparchus.ode.SecondOrderODE` + """ def __init__(self, secondOrderODE: SecondOrderODE): ... - def computeDerivatives(self, double: float, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> typing.MutableSequence[float]: ... - def getDimension(self) -> int: ... + def computeDerivatives(self, double: float, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> typing.MutableSequence[float]: + """ + Get the current time derivative of the state vector. + + Specified by: + :meth:`~org.hipparchus.ode.OrdinaryDifferentialEquation.computeDerivatives` in + interface :class:`~org.hipparchus.ode.OrdinaryDifferentialEquation` + + Parameters: + t (double): current value of the independent *time* variable + y (double[]): array containing the current value of the state vector + + Returns: + time derivative of the state vector + + + """ + ... + def getDimension(self) -> int: + """ + Get the dimension of the problem. + + The dimension of the first order problem is twice the dimension of the underlying second order problem. + + Specified by: + :meth:`~org.hipparchus.ode.OrdinaryDifferentialEquation.getDimension` in + interface :class:`~org.hipparchus.ode.OrdinaryDifferentialEquation` + + Returns: + dimension of the problem + + + """ + ... class NamedParameterJacobianProvider(Parameterizable): + """ + public interfaceNamedParameterJacobianProviderextends :class:`~org.hipparchus.ode.Parameterizable` + + Interface to compute exactly Jacobian matrix for some parameter when computing + :class:`~org.hipparchus.ode.VariationalEquation`. + """ def computeParameterJacobian(self, double: float, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray], string: str) -> typing.MutableSequence[float]: ... class ODEStateAndDerivative(ODEState): + """ + public classODEStateAndDerivative extends :class:`~org.hipparchus.ode.ODEState` + + Container for time, main and secondary state vectors as well as their derivatives. + + Also see: + + - :class:`~org.hipparchus.ode.OrdinaryDifferentialEquation` + - :class:`~org.hipparchus.ode.SecondaryODE` + - :class:`~org.hipparchus.ode.ODEIntegrator` + - :meth:`~serialized` + """ @typing.overload def __init__(self, double: float, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray]): ... @typing.overload def __init__(self, double: float, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray], doubleArray3: typing.Union[typing.List[typing.MutableSequence[float]], jpype.JArray], doubleArray4: typing.Union[typing.List[typing.MutableSequence[float]], jpype.JArray]): ... - def getCompleteDerivative(self) -> typing.MutableSequence[float]: ... - def getPrimaryDerivative(self) -> typing.MutableSequence[float]: ... - def getSecondaryDerivative(self, int: int) -> typing.MutableSequence[float]: ... + def getCompleteDerivative(self) -> typing.MutableSequence[float]: + """ + Get complete derivative at time. + + Returns: + complete derivative at time, starting with :meth:`~org.hipparchus.ode.ODEStateAndDerivative.getPrimaryDerivative`, + followed by all :meth:`~org.hipparchus.ode.ODEStateAndDerivative.getSecondaryDerivative` in increasing index order + + Also see: + + - :meth:`~org.hipparchus.ode.ODEStateAndDerivative.getPrimaryDerivative` + - :meth:`~org.hipparchus.ode.ODEStateAndDerivative.getSecondaryDerivative` + + + + """ + ... + def getPrimaryDerivative(self) -> typing.MutableSequence[float]: + """ + Get derivative of the primary state at time. + + Returns: + derivative of the primary state at time + + Also see: + + - :meth:`~org.hipparchus.ode.ODEStateAndDerivative.getSecondaryDerivative` + - :meth:`~org.hipparchus.ode.ODEStateAndDerivative.getCompleteDerivative` + + + + """ + ... + def getSecondaryDerivative(self, int: int) -> typing.MutableSequence[float]: + """ + Get derivative of the secondary state at time. + + Parameters: + index (int): index of the secondary set as returned by :meth:`~org.hipparchus.ode.ExpandableODE.addSecondaryEquations` (beware index + 0 corresponds to primary state, secondary states start at 1) + + Returns: + derivative of the secondary state at time + + Also see: + + - :meth:`~org.hipparchus.ode.ODEStateAndDerivative.getPrimaryDerivative` + - :meth:`~org.hipparchus.ode.ODEStateAndDerivative.getCompleteDerivative` + + + + """ + ... class ParametersController(Parameterizable): + """ + public interfaceParametersControllerextends :class:`~org.hipparchus.ode.Parameterizable` + + Interface to compute by finite difference Jacobian matrix for some parameter when computing + :class:`~org.hipparchus.ode.VariationalEquation`. + """ def getParameter(self, string: str) -> float: ... def setParameter(self, string: str, double: float) -> None: ... class ODEJacobiansProvider(OrdinaryDifferentialEquation, NamedParameterJacobianProvider): + """ + public interfaceODEJacobiansProviderextends :class:`~org.hipparchus.ode.OrdinaryDifferentialEquation`, :class:`~org.hipparchus.ode.NamedParameterJacobianProvider` + + Interface expanding :class:`~org.hipparchus.ode.OrdinaryDifferentialEquation` in order to compute exactly the Jacobian + matrices for :class:`~org.hipparchus.ode.VariationalEquation`. + """ def computeMainStateJacobian(self, double: float, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray]) -> typing.MutableSequence[typing.MutableSequence[float]]: ... def computeParameterJacobian(self, double: float, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray], string: str) -> typing.MutableSequence[float]: ... def getParametersNames(self) -> java.util.List[str]: ... - def isSupported(self, string: str) -> bool: ... + def isSupported(self, string: str) -> bool: + """ + Check if a parameter is supported. + + Supported parameters are those listed by :meth:`~org.hipparchus.ode.Parameterizable.getParametersNames`. + + The default implementation supports no parameters at all. + + Specified by: + :meth:`~org.hipparchus.ode.Parameterizable.isSupported` in interface :class:`~org.hipparchus.ode.Parameterizable` + + Parameters: + name (:class:`~org.hipparchus.ode.https:.docs.oracle.com.javase.8.docs.api.java.lang.String`): parameter name to check + + Returns: + true if the parameter is supported + + Also see: + + - :meth:`~org.hipparchus.ode.Parameterizable.getParametersNames` + + + + """ + ... class __module_protocol__(Protocol): diff --git a/org-stubs/hipparchus/ode/events/__init__.pyi b/org-stubs/hipparchus/ode/events/__init__.pyi index f4599cb..c0e2750 100644 --- a/org-stubs/hipparchus/ode/events/__init__.pyi +++ b/org-stubs/hipparchus/ode/events/__init__.pyi @@ -16,6 +16,11 @@ import typing class Action(java.lang.Enum['Action']): + """ + public enumAction extends :class:`~org.hipparchus.ode.events.https:.docs.oracle.com.javase.8.docs.api.java.lang.Enum`<:class:`~org.hipparchus.ode.events.Action`> + + Enumerate for actions to be performed when an event occurs during ODE integration. + """ STOP: typing.ClassVar['Action'] = ... RESET_STATE: typing.ClassVar['Action'] = ... RESET_DERIVATIVES: typing.ClassVar['Action'] = ... @@ -27,65 +32,336 @@ class Action(java.lang.Enum['Action']): def valueOf(class_: typing.Type[_valueOf_0__T], string: str) -> _valueOf_0__T: ... @typing.overload @staticmethod - def valueOf(string: str) -> 'Action': ... + def valueOf(string: str) -> 'Action': + """ + Returns the enum constant of this type with the specified name. The string must match *exactly* an identifier used to + declare an enum constant in this type. (Extraneous whitespace characters are not permitted.) + + Parameters: + name (:class:`~org.hipparchus.ode.events.https:.docs.oracle.com.javase.8.docs.api.java.lang.String`): the name of the enum constant to be returned. + + Returns: + the enum constant with the specified name + + Raises: + :class:`~org.hipparchus.ode.events.https:.docs.oracle.com.javase.8.docs.api.java.lang.IllegalArgumentException`: if this enum type has no constant with the specified name + :class:`~org.hipparchus.ode.events.https:.docs.oracle.com.javase.8.docs.api.java.lang.NullPointerException`: if the argument is null + + + """ + ... @staticmethod - def values() -> typing.MutableSequence['Action']: ... + def values() -> typing.MutableSequence['Action']: + """ + Returns an array containing the constants of this enum type, in the order they are declared. + + Returns: + an array containing the constants of this enum type, in the order they are declared + + + """ + ... class AdaptableInterval: - def currentInterval(self, oDEStateAndDerivative: org.hipparchus.ode.ODEStateAndDerivative) -> float: ... + """ + :class:`~org.hipparchus.ode.events.https:.docs.oracle.com.javase.8.docs.api.java.lang.FunctionalInterface`public interfaceAdaptableInterval + + This interface represents an event checking interval that depends on state. + + Since: + 3.0 + + Also see: + + - :class:`~org.hipparchus.ode.events.ODEEventDetector` + """ + def currentInterval(self, oDEStateAndDerivative: org.hipparchus.ode.ODEStateAndDerivative) -> float: + """ + Get the current value of maximal time interval between events handler checks. + + Parameters: + state (:class:`~org.hipparchus.ode.ODEStateAndDerivative`): current state + + Returns: + current value of maximal time interval between events handler checks + + + """ + ... class EventOccurrence: + """ + public classEventOccurrence extends :class:`~org.hipparchus.ode.events.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Class to hold the data related to an event occurrence that is needed to decide how to modify integration. + + Since: + 3.O + """ def __init__(self, action: Action, oDEState: org.hipparchus.ode.ODEState, double: float): ... - def getAction(self) -> Action: ... - def getNewState(self) -> org.hipparchus.ode.ODEState: ... - def getStopTime(self) -> float: ... + def getAction(self) -> Action: + """ + Get the user requested action. + + Returns: + the action. + + + """ + ... + def getNewState(self) -> org.hipparchus.ode.ODEState: + """ + Get the new state for a reset action. + + Returns: + the new state. + + + """ + ... + def getStopTime(self) -> float: + """ + Get the new time for a stop action. + + Returns: + when to stop propagation. + + + """ + ... class EventState: - def doEvent(self, oDEStateAndDerivative: org.hipparchus.ode.ODEStateAndDerivative) -> EventOccurrence: ... + """ + public interfaceEventState + + This interface handles the state for either one :class:`~org.hipparchus.ode.events.ODEEventHandler` or one + :class:`~org.hipparchus.ode.events.ODEStepEndHandler` during integration steps. + + Since: + 3.0 + """ + def doEvent(self, oDEStateAndDerivative: org.hipparchus.ode.ODEStateAndDerivative) -> EventOccurrence: + """ + Notify the user's listener of the event. The event occurs wholly within this method call including a call to + :meth:`~org.hipparchus.ode.events.ODEEventHandler.resetState` if necessary. + + Parameters: + state (:class:`~org.hipparchus.ode.ODEStateAndDerivative`): the state at the time of the event. This must be at the same time as the current value of + :meth:`~org.hipparchus.ode.events.EventState.getEventTime`. + + Returns: + the user's requested action and the new state if the action is :meth:`~org.hipparchus.ode.events.Action.RESET_STATE`. + Otherwise the new state is :code:`state`. The stop time indicates what time propagation should stop if the action is + :meth:`~org.hipparchus.ode.events.Action.STOP`. This guarantees the integration will stop on or after the root, so that + integration may be restarted safely. + + + """ + ... def evaluateStep(self, oDEStateInterpolator: org.hipparchus.ode.sampling.ODEStateInterpolator) -> bool: ... - def getEventTime(self) -> float: ... - def init(self, oDEStateAndDerivative: org.hipparchus.ode.ODEStateAndDerivative, double: float) -> None: ... + def getEventTime(self) -> float: + """ + Get the occurrence time of the event triggered in the current step. + + Returns: + occurrence time of the event triggered in the current step or infinity if no events are triggered + + + """ + ... + def init(self, oDEStateAndDerivative: org.hipparchus.ode.ODEStateAndDerivative, double: float) -> None: + """ + Initialize handler at the start of an integration. + + This method is called once at the start of the integration. It may be used by the handler to initialize some internal + data if needed. + + Parameters: + s0 (:class:`~org.hipparchus.ode.ODEStateAndDerivative`): initial state + t (double): target time for the integration + + + """ + ... _FieldAdaptableInterval__T = typing.TypeVar('_FieldAdaptableInterval__T', bound=org.hipparchus.CalculusFieldElement) # <T> class FieldAdaptableInterval(typing.Generic[_FieldAdaptableInterval__T]): + """ + :class:`~org.hipparchus.ode.events.https:.docs.oracle.com.javase.8.docs.api.java.lang.FunctionalInterface`public interfaceFieldAdaptableInterval<T extends :class:`~org.hipparchus.ode.events.https:.www.hipparchus.org.hipparchus`<T>> + + This interface represents an event checking interval that depends on state. + + Since: + 3.0 + + Also see: + + - :class:`~org.hipparchus.ode.events.ODEEventDetector` + """ def currentInterval(self, fieldODEStateAndDerivative: org.hipparchus.ode.FieldODEStateAndDerivative[_FieldAdaptableInterval__T]) -> float: ... _FieldEventOccurrence__T = typing.TypeVar('_FieldEventOccurrence__T', bound=org.hipparchus.CalculusFieldElement) # <T> class FieldEventOccurrence(typing.Generic[_FieldEventOccurrence__T]): + """ + public classFieldEventOccurrence<T extends :class:`~org.hipparchus.ode.events.https:.www.hipparchus.org.hipparchus`<T>> extends :class:`~org.hipparchus.ode.events.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Class to hold the data related to an event occurrence that is needed to decide how to modify integration. + """ def __init__(self, action: Action, fieldODEState: org.hipparchus.ode.FieldODEState[_FieldEventOccurrence__T], t: _FieldEventOccurrence__T): ... - def getAction(self) -> Action: ... + def getAction(self) -> Action: + """ + Get the user requested action. + + Returns: + the action. + + + """ + ... def getNewState(self) -> org.hipparchus.ode.FieldODEState[_FieldEventOccurrence__T]: ... - def getStopTime(self) -> _FieldEventOccurrence__T: ... + def getStopTime(self) -> _FieldEventOccurrence__T: + """ + Get the new time for a stop action. + + Returns: + when to stop propagation. + + + """ + ... _FieldEventState__T = typing.TypeVar('_FieldEventState__T', bound=org.hipparchus.CalculusFieldElement) # <T> class FieldEventState(typing.Generic[_FieldEventState__T]): + """ + public interfaceFieldEventState<T extends :class:`~org.hipparchus.ode.events.https:.www.hipparchus.org.hipparchus`<T>> + + This interface handles the state for either one :class:`~org.hipparchus.ode.events.FieldODEEventHandler` or one + :class:`~org.hipparchus.ode.events.FieldODEStepEndHandler` during integration steps. + + Since: + 3.0 + """ def doEvent(self, fieldODEStateAndDerivative: org.hipparchus.ode.FieldODEStateAndDerivative[_FieldEventState__T]) -> FieldEventOccurrence[_FieldEventState__T]: ... def evaluateStep(self, fieldODEStateInterpolator: org.hipparchus.ode.sampling.FieldODEStateInterpolator[_FieldEventState__T]) -> bool: ... - def getEventTime(self) -> _FieldEventState__T: ... + def getEventTime(self) -> _FieldEventState__T: + """ + Get the occurrence time of the event triggered in the current step. + + Returns: + occurrence time of the event triggered in the current step or infinity if no events are triggered + + + """ + ... def init(self, fieldODEStateAndDerivative: org.hipparchus.ode.FieldODEStateAndDerivative[_FieldEventState__T], t: _FieldEventState__T) -> None: ... _FieldODEEventDetector__T = typing.TypeVar('_FieldODEEventDetector__T', bound=org.hipparchus.CalculusFieldElement) # <T> class FieldODEEventDetector(typing.Generic[_FieldODEEventDetector__T]): + """ + public interfaceFieldODEEventDetector<T extends :class:`~org.hipparchus.ode.events.https:.www.hipparchus.org.hipparchus`<T>> + + This interface represents a handler for discrete events triggered during ODE integration. + + Some events can be triggered at discrete times as an ODE problem is solved. This occurs for example when the integration + process should be stopped as some state is reached (G-stop facility) when the precise date is unknown a priori, or when + the derivatives have states boundaries crossings. + + These events are defined as occurring when a :code:`g` switching function sign changes. + + Since events are only problem-dependent and are triggered by the independent *time* variable and the state vector, they + can occur at virtually any time, unknown in advance. The integrators will take care to avoid sign changes inside the + steps, they will reduce the step size when such an event is detected in order to put this event exactly at the end of + the current step. This guarantees that step interpolation (which always has a one step scope) is relevant even in + presence of discontinuities. This is independent from the stepsize control provided by integrators that monitor the + local error (this event handling feature is available for all integrators, including fixed step ones). + + Note that prior to Hipparchus 3.0, the methods in this interface were in the + :class:`~org.hipparchus.ode.events.FieldODEEventHandler` interface and the defunct + :code:`FieldEventHandlerConfiguration` interface. The interfaces have been reorganized to allow different objects to be + used in event detection and event handling, hence allowing users to reuse predefined events detectors with custom + handlers. + + Since: + 3.0 + + Also see: + + - :class:`~org.hipparchus.ode.events.package` + """ def g(self, fieldODEStateAndDerivative: org.hipparchus.ode.FieldODEStateAndDerivative[_FieldODEEventDetector__T]) -> _FieldODEEventDetector__T: ... def getHandler(self) -> 'FieldODEEventHandler'[_FieldODEEventDetector__T]: ... def getMaxCheckInterval(self) -> FieldAdaptableInterval[_FieldODEEventDetector__T]: ... - def getMaxIterationCount(self) -> int: ... + def getMaxIterationCount(self) -> int: + """ + Get the upper limit in the iteration count for event localization. + + Returns: + upper limit in the iteration count for event localization + + + """ + ... def getSolver(self) -> org.hipparchus.analysis.solvers.BracketedRealFieldUnivariateSolver[_FieldODEEventDetector__T]: ... def init(self, fieldODEStateAndDerivative: org.hipparchus.ode.FieldODEStateAndDerivative[_FieldODEEventDetector__T], t: _FieldODEEventDetector__T) -> None: ... _FieldODEEventHandler__T = typing.TypeVar('_FieldODEEventHandler__T', bound=org.hipparchus.CalculusFieldElement) # <T> class FieldODEEventHandler(typing.Generic[_FieldODEEventHandler__T]): + """ + public interfaceFieldODEEventHandler<T extends :class:`~org.hipparchus.ode.events.https:.www.hipparchus.org.hipparchus`<T>> + + This interface represents a handler for discrete events triggered during ODE integration. + + Some events can be triggered at discrete times as an ODE problem is solved. This occurs for example when the integration + process should be stopped as some state is reached (G-stop facility) when the precise date is unknown a priori, or when + the derivatives have states boundaries crossings. + + These events are defined as occurring when a :code:`g` switching function sign changes. + + Since events are only problem-dependent and are triggered by the independent *time* variable and the state vector, they + can occur at virtually any time, unknown in advance. The integrators will take care to avoid sign changes inside the + steps, they will reduce the step size when such an event is detected in order to put this event exactly at the end of + the current step. This guarantees that step interpolation (which always has a one step scope) is relevant even in + presence of discontinuities. This is independent from the stepsize control provided by integrators that monitor the + local error (this event handling feature is available for all integrators, including fixed step ones). + + Note that prior to Hipparchus 3.0, some of the methods that are now in + :class:`~org.hipparchus.ode.events.FieldODEEventDetector` were in this interface (and the remaining ones were in the + defunct :code:`FieldEventHandlerConfiguration` interface). The interfaces have been reorganized to allow different + objects to be used in event detection and event handling, hence allowing users to reuse predefined events detectors with + custom handlers. + + Also see: + + - :class:`~org.hipparchus.ode.events.package` + """ def eventOccurred(self, fieldODEStateAndDerivative: org.hipparchus.ode.FieldODEStateAndDerivative[_FieldODEEventHandler__T], fieldODEEventDetector: FieldODEEventDetector[_FieldODEEventHandler__T], boolean: bool) -> Action: ... def init(self, fieldODEStateAndDerivative: org.hipparchus.ode.FieldODEStateAndDerivative[_FieldODEEventHandler__T], t: _FieldODEEventHandler__T, fieldODEEventDetector: FieldODEEventDetector[_FieldODEEventHandler__T]) -> None: ... def resetState(self, fieldODEEventDetector: FieldODEEventDetector[_FieldODEEventHandler__T], fieldODEStateAndDerivative: org.hipparchus.ode.FieldODEStateAndDerivative[_FieldODEEventHandler__T]) -> org.hipparchus.ode.FieldODEState[_FieldODEEventHandler__T]: ... _FieldODEStepEndHandler__T = typing.TypeVar('_FieldODEStepEndHandler__T', bound=org.hipparchus.CalculusFieldElement) # <T> class FieldODEStepEndHandler(typing.Generic[_FieldODEStepEndHandler__T]): + """ + public interfaceFieldODEStepEndHandler<T extends :class:`~org.hipparchus.ode.events.https:.www.hipparchus.org.hipparchus`<T>> + + This interface represents a handler for discrete events triggered during ODE integration at each step end. + + Since: + 3.0 + + Also see: + + - :class:`~org.hipparchus.ode.events.package` + """ def init(self, fieldODEStateAndDerivative: org.hipparchus.ode.FieldODEStateAndDerivative[_FieldODEStepEndHandler__T], t: _FieldODEStepEndHandler__T) -> None: ... def resetState(self, fieldODEStateAndDerivative: org.hipparchus.ode.FieldODEStateAndDerivative[_FieldODEStepEndHandler__T]) -> org.hipparchus.ode.FieldODEState[_FieldODEStepEndHandler__T]: ... def stepEndOccurred(self, fieldODEStateAndDerivative: org.hipparchus.ode.FieldODEStateAndDerivative[_FieldODEStepEndHandler__T], boolean: bool) -> Action: ... class FilterType(java.lang.Enum['FilterType']): + """ + public enumFilterType extends :class:`~org.hipparchus.ode.events.https:.docs.oracle.com.javase.8.docs.api.java.lang.Enum`<:class:`~org.hipparchus.ode.events.FilterType`> + + Enumerate for :class:`~org.hipparchus.ode.events.EventSlopeFilter`. + """ TRIGGER_ONLY_DECREASING_EVENTS: typing.ClassVar['FilterType'] = ... TRIGGER_ONLY_INCREASING_EVENTS: typing.ClassVar['FilterType'] = ... _valueOf_0__T = typing.TypeVar('_valueOf_0__T', bound=java.lang.Enum) # <T> @@ -94,124 +370,1206 @@ class FilterType(java.lang.Enum['FilterType']): def valueOf(class_: typing.Type[_valueOf_0__T], string: str) -> _valueOf_0__T: ... @typing.overload @staticmethod - def valueOf(string: str) -> 'FilterType': ... + def valueOf(string: str) -> 'FilterType': + """ + Returns the enum constant of this type with the specified name. The string must match *exactly* an identifier used to + declare an enum constant in this type. (Extraneous whitespace characters are not permitted.) + + Parameters: + name (:class:`~org.hipparchus.ode.events.https:.docs.oracle.com.javase.8.docs.api.java.lang.String`): the name of the enum constant to be returned. + + Returns: + the enum constant with the specified name + + Raises: + :class:`~org.hipparchus.ode.events.https:.docs.oracle.com.javase.8.docs.api.java.lang.IllegalArgumentException`: if this enum type has no constant with the specified name + :class:`~org.hipparchus.ode.events.https:.docs.oracle.com.javase.8.docs.api.java.lang.NullPointerException`: if the argument is null + + + """ + ... @staticmethod - def values() -> typing.MutableSequence['FilterType']: ... + def values() -> typing.MutableSequence['FilterType']: + """ + Returns an array containing the constants of this enum type, in the order they are declared. + + Returns: + an array containing the constants of this enum type, in the order they are declared + + + """ + ... class ODEEventDetector: - def g(self, oDEStateAndDerivative: org.hipparchus.ode.ODEStateAndDerivative) -> float: ... - def getHandler(self) -> 'ODEEventHandler': ... - def getMaxCheckInterval(self) -> AdaptableInterval: ... - def getMaxIterationCount(self) -> int: ... + """ + public interfaceODEEventDetector + + This interface represents a detector for discrete events triggered during ODE integration. + + Some events can be triggered at discrete times as an ODE problem is solved. This occurs for example when the integration + process should be stopped as some state is reached (G-stop facility) when the precise date is unknown a priori, or when + the derivatives have discontinuities, or simply when the user wants to monitor some states boundaries crossings. + + These events are defined as occurring when a :code:`g` switching function sign changes. + + Since events are only problem-dependent and are triggered by the independent *time* variable and the state vector, they + can occur at virtually any time, unknown in advance. The integrators will take care to avoid sign changes inside the + steps, they will reduce the step size when such an event is detected in order to put this event exactly at the end of + the current step. This guarantees that step interpolation (which always has a one step scope) is relevant even in + presence of discontinuities. This is independent from the stepsize control provided by integrators that monitor the + local error (this event handling feature is available for all integrators, including fixed step ones). + + Note that prior to Hipparchus 3.0, the methods in this interface were in the + :class:`~org.hipparchus.ode.events.ODEEventHandler` interface and the defunct :code:`EventHandlerConfiguration` + interface. The interfaces have been reorganized to allow different objects to be used in event detection and event + handling, hence allowing users to reuse predefined events detectors with custom handlers. + + Since: + 3.0 + + Also see: + + - :class:`~org.hipparchus.ode.events.package` + """ + def g(self, oDEStateAndDerivative: org.hipparchus.ode.ODEStateAndDerivative) -> float: + """ + Compute the value of the switching function. + + The discrete events are generated when the sign of this switching function changes. The integrator will take care to + change the stepsize in such a way these events occur exactly at step boundaries. The switching function must be + continuous in its roots neighborhood (but not necessarily smooth), as the integrator will need to find its roots to + locate precisely the events. + + Also note that for the integrator to detect an event the sign of the switching function must have opposite signs just + before and after the event. If this consistency is not preserved the integrator may not detect any events. + + This need for consistency is sometimes tricky to achieve. A typical example is using an event to model a ball bouncing + on the floor. The first idea to represent this would be to have :code:`g(state) = h(state)` where h is the height above + the floor at time :code:`state.getTime()`. When :code:`g(state)` reaches 0, the ball is on the floor, so it should + bounce and the typical way to do this is to reverse its vertical velocity. However, this would mean that before the + event :code:`g(state)` was decreasing from positive values to 0, and after the event :code:`g(state)` would be + increasing from 0 to positive values again. Consistency is broken here! The solution here is to have :code:`g(state) = + sign * h(state)`, where sign is a variable with initial value set to :code:`+1`. Each time + :meth:`~org.hipparchus.ode.events.ODEEventHandler.eventOccurred` is called, :code:`sign` is reset to :code:`-sign`. This + allows the :code:`g(state)` function to remain continuous (and even smooth) even across events, despite :code:`h(state)` + is not. Basically, the event is used to *fold* :code:`h(state)` at bounce points, and :code:`sign` is used to *unfold* + it back, so the solvers sees a :code:`g(state)` function which behaves smoothly even across events. + + This method is idempotent, that is calling this multiple times with the same state will result in the same value, with + two exceptions. First, the definition of the g function may change when an + :meth:`~org.hipparchus.ode.events.ODEEventHandler.eventOccurred` on the handler, as in the above example. Second, the + definition of the g function may change when the :meth:`~org.hipparchus.ode.events.ODEEventHandler.eventOccurred` method + of any other event handler in the same integrator returns :meth:`~org.hipparchus.ode.events.Action.RESET_EVENTS`, + :meth:`~org.hipparchus.ode.events.Action.RESET_DERIVATIVES`, or :meth:`~org.hipparchus.ode.events.Action.RESET_STATE`. + + Parameters: + state (:class:`~org.hipparchus.ode.ODEStateAndDerivative`): current value of the independent *time* variable, state vector and derivative + + Returns: + value of the g switching function + + Also see: + + - :class:`~org.hipparchus.ode.events.package` + + + + """ + ... + def getHandler(self) -> 'ODEEventHandler': + """ + Get the underlying event handler. + + Returns: + underlying event handler + + + """ + ... + def getMaxCheckInterval(self) -> AdaptableInterval: + """ + Get the maximal time interval between events handler checks. + + Returns: + maximal time interval between events handler checks + + + """ + ... + def getMaxIterationCount(self) -> int: + """ + Get the upper limit in the iteration count for event localization. + + Returns: + upper limit in the iteration count for event localization + + + """ + ... def getSolver(self) -> org.hipparchus.analysis.solvers.BracketedUnivariateSolver[org.hipparchus.analysis.UnivariateFunction]: ... - def init(self, oDEStateAndDerivative: org.hipparchus.ode.ODEStateAndDerivative, double: float) -> None: ... + def init(self, oDEStateAndDerivative: org.hipparchus.ode.ODEStateAndDerivative, double: float) -> None: + """ + Initialize event handler at the start of an ODE integration. + + This method is called once at the start of the integration. It may be used by the event handler to initialize some + internal data if needed. + + The default implementation does nothing + + Parameters: + initialState (:class:`~org.hipparchus.ode.ODEStateAndDerivative`): initial time, state vector and derivative + finalTime (double): target time for the integration + + + """ + ... class ODEEventHandler: - def eventOccurred(self, oDEStateAndDerivative: org.hipparchus.ode.ODEStateAndDerivative, oDEEventDetector: ODEEventDetector, boolean: bool) -> Action: ... - def init(self, oDEStateAndDerivative: org.hipparchus.ode.ODEStateAndDerivative, double: float, oDEEventDetector: ODEEventDetector) -> None: ... - def resetState(self, oDEEventDetector: ODEEventDetector, oDEStateAndDerivative: org.hipparchus.ode.ODEStateAndDerivative) -> org.hipparchus.ode.ODEState: ... + """ + public interfaceODEEventHandler + + This interface represents a handler for discrete events triggered during ODE integration. + + Some events can be triggered at discrete times as an ODE problem is solved. This occurs for example when the integration + process should be stopped as some state is reached (G-stop facility) when the precise date is unknown a priori, or when + the derivatives have discontinuities, or simply when the user wants to monitor some states boundaries crossings. + + These events are defined as occurring when a :code:`g` switching function sign changes. + + Since events are only problem-dependent and are triggered by the independent *time* variable and the state vector, they + can occur at virtually any time, unknown in advance. The integrators will take care to avoid sign changes inside the + steps, they will reduce the step size when such an event is detected in order to put this event exactly at the end of + the current step. This guarantees that step interpolation (which always has a one step scope) is relevant even in + presence of discontinuities. This is independent from the stepsize control provided by integrators that monitor the + local error (this event handling feature is available for all integrators, including fixed step ones). + + Note that prior to Hipparchus 3.0, some of the methods that are now in + :class:`~org.hipparchus.ode.events.ODEEventDetector` were in this interface (and the remaining ones were in the defunct + :code:`EventHandlerConfiguration` interface). The interfaces have been reorganized to allow different objects to be used + in event detection and event handling, hence allowing users to reuse predefined events detectors with custom handlers. + + Since: + 3.0 + + Also see: + + - :class:`~org.hipparchus.ode.events.package` + """ + def eventOccurred(self, oDEStateAndDerivative: org.hipparchus.ode.ODEStateAndDerivative, oDEEventDetector: ODEEventDetector, boolean: bool) -> Action: + """ + Handle an event and choose what to do next. + + This method is called when the integrator has accepted a step ending exactly on a sign change of the function, just + *after* the step handler itself is called (see below for scheduling). It allows the user to update his internal data to + acknowledge the fact the event has been handled (for example setting a flag in the + :class:`~org.hipparchus.ode.OrdinaryDifferentialEquation` to switch the derivatives computation in case of + discontinuity), or to direct the integrator to either stop or continue integration, possibly with a reset state or + derivatives. + + - if :meth:`~org.hipparchus.ode.events.Action.STOP` is returned, the integration will be stopped, + - if :meth:`~org.hipparchus.ode.events.Action.RESET_STATE` is returned, the + :meth:`~org.hipparchus.ode.events.ODEEventHandler.resetState` method will be called once the step handler has finished + its task, and the integrator will also recompute the derivatives, + - if :meth:`~org.hipparchus.ode.events.Action.RESET_DERIVATIVES` is returned, the integrator will recompute the + derivatives, + - if :meth:`~org.hipparchus.ode.events.Action.RESET_EVENTS` is returned, the integrator will recheck all event handlers, + - if :meth:`~org.hipparchus.ode.events.Action.CONTINUE` is returned, no specific action will be taken (apart from having + called this method) and integration will continue. + + + The scheduling between this method and the :class:`~org.hipparchus.ode.sampling.ODEStepHandler` method + :meth:`~org.hipparchus.ode.sampling.ODEStepHandler.handleStep` is to call :code:`handleStep` first and this method + afterwards (this scheduling changed as of Hipparchus 2.0). This scheduling allows user code called by this method and + user code called by step handlers to get values of the independent time variable consistent with integration direction. + + Parameters: + state (:class:`~org.hipparchus.ode.ODEStateAndDerivative`): current value of the independent *time* variable, state vector and derivative + detector (:class:`~org.hipparchus.ode.events.ODEEventDetector`): detector that triggered the event + increasing (boolean): if true, the value of the switching function increases when times increases around event (note that increase is measured + with respect to physical time, not with respect to integration which may go backward in time) + + Returns: + indication of what the integrator should do next, this value must be one of + :meth:`~org.hipparchus.ode.events.Action.STOP`, :meth:`~org.hipparchus.ode.events.Action.RESET_STATE`, + :meth:`~org.hipparchus.ode.events.Action.RESET_DERIVATIVES`, :meth:`~org.hipparchus.ode.events.Action.RESET_EVENTS`, or + :meth:`~org.hipparchus.ode.events.Action.CONTINUE` + + + """ + ... + def init(self, oDEStateAndDerivative: org.hipparchus.ode.ODEStateAndDerivative, double: float, oDEEventDetector: ODEEventDetector) -> None: + """ + Initialize event handler at the start of an ODE integration. + + This method is called once at the start of the integration. It may be used by the event handler to initialize some + internal data if needed. + + The default implementation does nothing + + Parameters: + initialState (:class:`~org.hipparchus.ode.ODEStateAndDerivative`): initial time, state vector and derivative + finalTime (double): target time for the integration + detector (:class:`~org.hipparchus.ode.events.ODEEventDetector`): event detector related to the event handler + + + """ + ... + def resetState(self, oDEEventDetector: ODEEventDetector, oDEStateAndDerivative: org.hipparchus.ode.ODEStateAndDerivative) -> org.hipparchus.ode.ODEState: + """ + Reset the state prior to continue the integration. + + This method is called after the step handler has returned and before the next step is started, but only when + :meth:`~org.hipparchus.ode.events.ODEEventHandler.eventOccurred` has itself returned the + :meth:`~org.hipparchus.ode.events.Action.RESET_STATE` indicator. It allows the user to reset the state vector for the + next step, without perturbing the step handler of the finishing step. + + The default implementation returns its argument. + + Parameters: + detector (:class:`~org.hipparchus.ode.events.ODEEventDetector`): detector that triggered the event + state (:class:`~org.hipparchus.ode.ODEStateAndDerivative`): current value of the independent *time* variable, state vector and derivative + + Returns: + reset state (note that it does not include the derivatives, they will be added automatically by the integrator + afterwards) + + + """ + ... class ODEStepEndHandler: - def init(self, oDEStateAndDerivative: org.hipparchus.ode.ODEStateAndDerivative, double: float) -> None: ... - def resetState(self, oDEStateAndDerivative: org.hipparchus.ode.ODEStateAndDerivative) -> org.hipparchus.ode.ODEState: ... - def stepEndOccurred(self, oDEStateAndDerivative: org.hipparchus.ode.ODEStateAndDerivative, boolean: bool) -> Action: ... + """ + public interfaceODEStepEndHandler + + This interface represents a handler for discrete events triggered during ODE integration at each step end. + + Since: + 3.0 + + Also see: + + - :class:`~org.hipparchus.ode.events.package` + """ + def init(self, oDEStateAndDerivative: org.hipparchus.ode.ODEStateAndDerivative, double: float) -> None: + """ + Initialize step end handler at the start of an ODE integration. + + This method is called once at the start of the integration. It may be used by the step end handler to initialize some + internal data if needed. + + The default implementation does nothing + + Parameters: + initialState (:class:`~org.hipparchus.ode.ODEStateAndDerivative`): initial time, state vector and derivative + finalTime (double): target time for the integration + + + """ + ... + def resetState(self, oDEStateAndDerivative: org.hipparchus.ode.ODEStateAndDerivative) -> org.hipparchus.ode.ODEState: + """ + Reset the state prior to continue the integration. + + This method is called after the step handler has returned and before the next step is started, but only when + :meth:`~org.hipparchus.ode.events.ODEEventHandler.eventOccurred` has itself returned the + :meth:`~org.hipparchus.ode.events.Action.RESET_STATE` indicator. It allows the user to reset the state vector for the + next step, without perturbing the step handler of the finishing step. + + The default implementation returns its argument. + + Parameters: + state (:class:`~org.hipparchus.ode.ODEStateAndDerivative`): current value of the independent *time* variable, state vector and derivative at step end + + Returns: + reset state (note that it does not include the derivatives, they will be added automatically by the integrator + afterwards) + + + """ + ... + def stepEndOccurred(self, oDEStateAndDerivative: org.hipparchus.ode.ODEStateAndDerivative, boolean: bool) -> Action: + """ + Handle an event and choose what to do next. + + This method is called when the integrator has accepted a step ending exactly on step end, just *after* the step handler + itself is called (see below for scheduling). It allows the user to update his internal data to acknowledge the fact the + event has been handled (for example setting a flag in the :class:`~org.hipparchus.ode.OrdinaryDifferentialEquation` to + switch the derivatives computation in case of discontinuity), or to direct the integrator to either stop or continue + integration, possibly with a reset state or derivatives. + + - if :meth:`~org.hipparchus.ode.events.Action.STOP` is returned, the integration will be stopped, + - if :meth:`~org.hipparchus.ode.events.Action.RESET_STATE` is returned, the + :meth:`~org.hipparchus.ode.events.ODEStepEndHandler.resetState` method will be called once the step handler has finished + its task, and the integrator will also recompute the derivatives, + - if :meth:`~org.hipparchus.ode.events.Action.RESET_DERIVATIVES` is returned, the integrator will recompute the + derivatives, + - if :meth:`~org.hipparchus.ode.events.Action.RESET_EVENTS` is returned, the integrator will recheck all event handlers, + - if :meth:`~org.hipparchus.ode.events.Action.CONTINUE` is returned, no specific action will be taken (apart from having + called this method) and integration will continue. + + + The scheduling between this method and the :class:`~org.hipparchus.ode.sampling.ODEStepHandler` method + :meth:`~org.hipparchus.ode.sampling.ODEStepHandler.handleStep` is to call :code:`handleStep` first and this method + afterwards. This scheduling allows user code called by this method and user code called by step handlers to get values + of the independent time variable consistent with integration direction. + + Parameters: + state (:class:`~org.hipparchus.ode.ODEStateAndDerivative`): current value of the independent *time* variable, state vector and derivative at step end + forward (boolean): if true, propagation is forward + + Returns: + indication of what the integrator should do next, this value must be one of + :meth:`~org.hipparchus.ode.events.Action.STOP`, :meth:`~org.hipparchus.ode.events.Action.RESET_STATE`, + :meth:`~org.hipparchus.ode.events.Action.RESET_DERIVATIVES`, :meth:`~org.hipparchus.ode.events.Action.RESET_EVENTS`, or + :meth:`~org.hipparchus.ode.events.Action.CONTINUE` + + + """ + ... _AbstractFieldODEDetector__T = typing.TypeVar('_AbstractFieldODEDetector__T', bound='AbstractFieldODEDetector') # <T> _AbstractFieldODEDetector__E = typing.TypeVar('_AbstractFieldODEDetector__E', bound=org.hipparchus.CalculusFieldElement) # <E> class AbstractFieldODEDetector(FieldODEEventDetector[_AbstractFieldODEDetector__E], typing.Generic[_AbstractFieldODEDetector__T, _AbstractFieldODEDetector__E]): + """ + public abstract classAbstractFieldODEDetector<T extends AbstractFieldODEDetector<T,E>,E extends :class:`~org.hipparchus.ode.events.https:.www.hipparchus.org.hipparchus`<E>> extends :class:`~org.hipparchus.ode.events.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.ode.events.FieldODEEventDetector`<E> + + Base class for #@link :class:`~org.hipparchus.ode.events.FieldODEEventDetector`. + + Since: + 3.0 + """ DEFAULT_MAXCHECK: typing.ClassVar[float] = ... + """ + public static final double DEFAULT_MAXCHECK + + Default maximum checking interval (s). + + Also see: + + - :meth:`~constant` + + + + """ DEFAULT_THRESHOLD: typing.ClassVar[float] = ... + """ + public static final double DEFAULT_THRESHOLD + + Default convergence threshold (s). + + Also see: + + - :meth:`~constant` + + + + """ DEFAULT_MAX_ITER: typing.ClassVar[int] = ... + """ + public static final int DEFAULT_MAX_ITER + + Default maximum number of iterations in the event time search. + + Also see: + + - :meth:`~constant` + + + + """ def g(self, fieldODEStateAndDerivative: org.hipparchus.ode.FieldODEStateAndDerivative[_AbstractFieldODEDetector__E]) -> _AbstractFieldODEDetector__E: ... def getHandler(self) -> FieldODEEventHandler[_AbstractFieldODEDetector__E]: ... def getMaxCheckInterval(self) -> FieldAdaptableInterval[_AbstractFieldODEDetector__E]: ... - def getMaxIterationCount(self) -> int: ... + def getMaxIterationCount(self) -> int: + """ + Get the upper limit in the iteration count for event localization. + + Specified by: + :meth:`~org.hipparchus.ode.events.FieldODEEventDetector.getMaxIterationCount` in + interface :class:`~org.hipparchus.ode.events.FieldODEEventDetector` + + Returns: + upper limit in the iteration count for event localization + + + """ + ... def getSolver(self) -> org.hipparchus.analysis.solvers.BracketedRealFieldUnivariateSolver[_AbstractFieldODEDetector__E]: ... def init(self, fieldODEStateAndDerivative: org.hipparchus.ode.FieldODEStateAndDerivative[_AbstractFieldODEDetector__E], e: _AbstractFieldODEDetector__E) -> None: ... - def isForward(self) -> bool: ... + def isForward(self) -> bool: + """ + Check if the current propagation is forward or backward. + + Returns: + true if the current propagation is forward + + + """ + ... def withHandler(self, fieldODEEventHandler: typing.Union[FieldODEEventHandler[_AbstractFieldODEDetector__E], typing.Callable[[org.hipparchus.ode.FieldODEStateAndDerivative[org.hipparchus.CalculusFieldElement], FieldODEEventDetector[org.hipparchus.CalculusFieldElement], bool], Action]]) -> _AbstractFieldODEDetector__T: ... @typing.overload - def withMaxCheck(self, e: _AbstractFieldODEDetector__E) -> _AbstractFieldODEDetector__T: ... + def withMaxCheck(self, e: _AbstractFieldODEDetector__E) -> _AbstractFieldODEDetector__T: + """ + Setup the maximum checking interval. + + This will override a maximum checking interval if it has been configured previously. + + Parameters: + newMaxCheck (:class:`~org.hipparchus.ode.events.AbstractFieldODEDetector`): maximum checking interval (s) + + Returns: + a new detector with updated configuration (the instance is not changed) + + public :class:`~org.hipparchus.ode.events.AbstractFieldODEDetector` withMaxCheck(:class:`~org.hipparchus.ode.events.FieldAdaptableInterval`<:class:`~org.hipparchus.ode.events.AbstractFieldODEDetector`> newMaxCheck) + + Setup the maximum checking interval. + + This will override a maximum checking interval if it has been configured previously. + + Parameters: + newMaxCheck (:class:`~org.hipparchus.ode.events.FieldAdaptableInterval`<:class:`~org.hipparchus.ode.events.AbstractFieldODEDetector`> newMaxCheck): maximum checking interval (s) + + Returns: + a new detector with updated configuration (the instance is not changed) + + Since: + 3.0 + + + """ + ... @typing.overload def withMaxCheck(self, fieldAdaptableInterval: typing.Union[FieldAdaptableInterval[_AbstractFieldODEDetector__E], typing.Callable[[org.hipparchus.ode.FieldODEStateAndDerivative[org.hipparchus.CalculusFieldElement]], float]]) -> _AbstractFieldODEDetector__T: ... - def withMaxIter(self, int: int) -> _AbstractFieldODEDetector__T: ... + def withMaxIter(self, int: int) -> _AbstractFieldODEDetector__T: + """ + Setup the maximum number of iterations in the event time search. + + This will override a number of iterations if it has been configured previously. + + Parameters: + newMaxIter (int): maximum number of iterations in the event time search + + Returns: + a new detector with updated configuration (the instance is not changed) + + + """ + ... def withSolver(self, bracketedRealFieldUnivariateSolver: org.hipparchus.analysis.solvers.BracketedRealFieldUnivariateSolver[_AbstractFieldODEDetector__E]) -> _AbstractFieldODEDetector__T: ... - def withThreshold(self, e: _AbstractFieldODEDetector__E) -> _AbstractFieldODEDetector__T: ... + def withThreshold(self, e: _AbstractFieldODEDetector__E) -> _AbstractFieldODEDetector__T: + """ + Setup the convergence threshold. + + This is equivalent to call :code:`withSolver(new FieldBracketingNthOrderBrentSolver<>(zero, newThreshold, zero, 5)`, + so it will override a solver if one has been configured previously. + + Parameters: + newThreshold (:class:`~org.hipparchus.ode.events.AbstractFieldODEDetector`): convergence threshold + + Returns: + a new detector with updated configuration (the instance is not changed) + + Also see: + + - :meth:`~org.hipparchus.ode.events.AbstractFieldODEDetector.withSolver` + + + + """ + ... _AbstractODEDetector__T = typing.TypeVar('_AbstractODEDetector__T', bound='AbstractODEDetector') # <T> class AbstractODEDetector(ODEEventDetector, typing.Generic[_AbstractODEDetector__T]): + """ + public abstract classAbstractODEDetector<T extends AbstractODEDetector<T>> extends :class:`~org.hipparchus.ode.events.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.ode.events.ODEEventDetector` + + Base class for #@link :class:`~org.hipparchus.ode.events.ODEEventDetector`. + + Since: + 3.0 + """ DEFAULT_MAXCHECK: typing.ClassVar[float] = ... + """ + public static final double DEFAULT_MAXCHECK + + Default maximum checking interval (s). + + Also see: + + - :meth:`~constant` + + + + """ DEFAULT_THRESHOLD: typing.ClassVar[float] = ... + """ + public static final double DEFAULT_THRESHOLD + + Default convergence threshold (s). + + Also see: + + - :meth:`~constant` + + + + """ DEFAULT_MAX_ITER: typing.ClassVar[int] = ... - def g(self, oDEStateAndDerivative: org.hipparchus.ode.ODEStateAndDerivative) -> float: ... - def getHandler(self) -> ODEEventHandler: ... - def getMaxCheckInterval(self) -> AdaptableInterval: ... - def getMaxIterationCount(self) -> int: ... + """ + public static final int DEFAULT_MAX_ITER + + Default maximum number of iterations in the event time search. + + Also see: + + - :meth:`~constant` + + + + """ + def g(self, oDEStateAndDerivative: org.hipparchus.ode.ODEStateAndDerivative) -> float: + """ + Compute the value of the switching function. + + The discrete events are generated when the sign of this switching function changes. The integrator will take care to + change the stepsize in such a way these events occur exactly at step boundaries. The switching function must be + continuous in its roots neighborhood (but not necessarily smooth), as the integrator will need to find its roots to + locate precisely the events. + + Also note that for the integrator to detect an event the sign of the switching function must have opposite signs just + before and after the event. If this consistency is not preserved the integrator may not detect any events. + + This need for consistency is sometimes tricky to achieve. A typical example is using an event to model a ball bouncing + on the floor. The first idea to represent this would be to have :code:`g(state) = h(state)` where h is the height above + the floor at time :code:`state.getTime()`. When :code:`g(state)` reaches 0, the ball is on the floor, so it should + bounce and the typical way to do this is to reverse its vertical velocity. However, this would mean that before the + event :code:`g(state)` was decreasing from positive values to 0, and after the event :code:`g(state)` would be + increasing from 0 to positive values again. Consistency is broken here! The solution here is to have :code:`g(state) = + sign * h(state)`, where sign is a variable with initial value set to :code:`+1`. Each time + :meth:`~org.hipparchus.ode.events.ODEEventHandler.eventOccurred` is called, :code:`sign` is reset to :code:`-sign`. This + allows the :code:`g(state)` function to remain continuous (and even smooth) even across events, despite :code:`h(state)` + is not. Basically, the event is used to *fold* :code:`h(state)` at bounce points, and :code:`sign` is used to *unfold* + it back, so the solvers sees a :code:`g(state)` function which behaves smoothly even across events. + + This method is idempotent, that is calling this multiple times with the same state will result in the same value, with + two exceptions. First, the definition of the g function may change when an + :meth:`~org.hipparchus.ode.events.ODEEventHandler.eventOccurred` on the handler, as in the above example. Second, the + definition of the g function may change when the :meth:`~org.hipparchus.ode.events.ODEEventHandler.eventOccurred` method + of any other event handler in the same integrator returns :meth:`~org.hipparchus.ode.events.Action.RESET_EVENTS`, + :meth:`~org.hipparchus.ode.events.Action.RESET_DERIVATIVES`, or :meth:`~org.hipparchus.ode.events.Action.RESET_STATE`. + + Specified by: + :meth:`~org.hipparchus.ode.events.ODEEventDetector.g` in interface :class:`~org.hipparchus.ode.events.ODEEventDetector` + + Parameters: + s (:class:`~org.hipparchus.ode.ODEStateAndDerivative`): current value of the independent *time* variable, state vector and derivative + + Returns: + value of the g switching function + + Also see: + + - :class:`~org.hipparchus.ode.events.package` + + + + """ + ... + def getHandler(self) -> ODEEventHandler: + """ + Get the underlying event handler. + + Specified by: + :meth:`~org.hipparchus.ode.events.ODEEventDetector.getHandler` in + interface :class:`~org.hipparchus.ode.events.ODEEventDetector` + + Returns: + underlying event handler + + + """ + ... + def getMaxCheckInterval(self) -> AdaptableInterval: + """ + Get the maximal time interval between events handler checks. + + Specified by: + :meth:`~org.hipparchus.ode.events.ODEEventDetector.getMaxCheckInterval` in + interface :class:`~org.hipparchus.ode.events.ODEEventDetector` + + Returns: + maximal time interval between events handler checks + + + """ + ... + def getMaxIterationCount(self) -> int: + """ + Get the upper limit in the iteration count for event localization. + + Specified by: + :meth:`~org.hipparchus.ode.events.ODEEventDetector.getMaxIterationCount` in + interface :class:`~org.hipparchus.ode.events.ODEEventDetector` + + Returns: + upper limit in the iteration count for event localization + + + """ + ... def getSolver(self) -> org.hipparchus.analysis.solvers.BracketedUnivariateSolver[org.hipparchus.analysis.UnivariateFunction]: ... - def init(self, oDEStateAndDerivative: org.hipparchus.ode.ODEStateAndDerivative, double: float) -> None: ... - def isForward(self) -> bool: ... - def withHandler(self, oDEEventHandler: typing.Union[ODEEventHandler, typing.Callable]) -> _AbstractODEDetector__T: ... + def init(self, oDEStateAndDerivative: org.hipparchus.ode.ODEStateAndDerivative, double: float) -> None: + """ + Initialize event handler at the start of an ODE integration. + + This method is called once at the start of the integration. It may be used by the event handler to initialize some + internal data if needed. + + The default implementation does nothing + + This implementation sets the direction of integration and initializes the event handler. If a subclass overrides this + method it should call :code:`super.init(s0, t)`. + + Specified by: + :meth:`~org.hipparchus.ode.events.ODEEventDetector.init` in + interface :class:`~org.hipparchus.ode.events.ODEEventDetector` + + Parameters: + s0 (:class:`~org.hipparchus.ode.ODEStateAndDerivative`): initial time, state vector and derivative + t (double): target time for the integration + + + """ + ... + def isForward(self) -> bool: + """ + Check if the current propagation is forward or backward. + + Returns: + true if the current propagation is forward + + + """ + ... + def withHandler(self, oDEEventHandler: typing.Union[ODEEventHandler, typing.Callable]) -> _AbstractODEDetector__T: + """ + Setup the event handler to call at event occurrences. + + This will override a handler if it has been configured previously. + + Parameters: + newHandler (:class:`~org.hipparchus.ode.events.ODEEventHandler`): event handler to call at event occurrences + + Returns: + a new detector with updated configuration (the instance is not changed) + + + """ + ... @typing.overload - def withMaxCheck(self, double: float) -> _AbstractODEDetector__T: ... + def withMaxCheck(self, double: float) -> _AbstractODEDetector__T: + """ + Setup the maximum checking interval. + + This will override a maximum checking interval if it has been configured previously. + + Parameters: + newMaxCheck (double): maximum checking interval + + Returns: + a new detector with updated configuration (the instance is not changed) + + Setup the maximum checking interval. + + This will override a maximum checking interval if it has been configured previously. + + Parameters: + newMaxCheck (:class:`~org.hipparchus.ode.events.AdaptableInterval`): maximum checking interval + + Returns: + a new detector with updated configuration (the instance is not changed) + + Since: + 3.0 + + + """ + ... @typing.overload def withMaxCheck(self, adaptableInterval: typing.Union[AdaptableInterval, typing.Callable]) -> _AbstractODEDetector__T: ... - def withMaxIter(self, int: int) -> _AbstractODEDetector__T: ... + def withMaxIter(self, int: int) -> _AbstractODEDetector__T: + """ + Setup the maximum number of iterations in the event time search. + + This will override a number of iterations if it has been configured previously. + + Parameters: + newMaxIter (int): maximum number of iterations in the event time search + + Returns: + a new detector with updated configuration (the instance is not changed) + + + """ + ... def withSolver(self, bracketedUnivariateSolver: org.hipparchus.analysis.solvers.BracketedUnivariateSolver[typing.Union[org.hipparchus.analysis.UnivariateFunction, typing.Callable]]) -> _AbstractODEDetector__T: ... - def withThreshold(self, double: float) -> _AbstractODEDetector__T: ... + def withThreshold(self, double: float) -> _AbstractODEDetector__T: + """ + Setup the convergence threshold. + + This is equivalent to call :code:`withSolver(new BracketingNthOrderBrentSolver(0, newThreshold, 0, 5))`, so it will + override a solver if one has been configured previously. + + Parameters: + newThreshold (double): convergence threshold + + Returns: + a new detector with updated configuration (the instance is not changed) + + Also see: + + - :meth:`~org.hipparchus.ode.events.AbstractODEDetector.withSolver` + + + + """ + ... class DetectorBasedEventState(EventState): + """ + public classDetectorBasedEventState extends :class:`~org.hipparchus.ode.events.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.ode.events.EventState` + + This class handles the state for one :class:`~org.hipparchus.ode.events.ODEEventHandler` during integration steps. + + Each time the integrator proposes a step, the event handler switching function should be checked. This class handles the + state of one handler during one integration step, with references to the state at the end of the preceding step. This + information is used to decide if the handler should trigger an event or not during the proposed step. + """ def __init__(self, oDEEventDetector: ODEEventDetector): ... - def doEvent(self, oDEStateAndDerivative: org.hipparchus.ode.ODEStateAndDerivative) -> EventOccurrence: ... + def doEvent(self, oDEStateAndDerivative: org.hipparchus.ode.ODEStateAndDerivative) -> EventOccurrence: + """ + Notify the user's listener of the event. The event occurs wholly within this method call including a call to + :meth:`~org.hipparchus.ode.events.ODEEventHandler.resetState` if necessary. + + Specified by: + :meth:`~org.hipparchus.ode.events.EventState.doEvent` in interface :class:`~org.hipparchus.ode.events.EventState` + + Parameters: + state (:class:`~org.hipparchus.ode.ODEStateAndDerivative`): the state at the time of the event. This must be at the same time as the current value of + :meth:`~org.hipparchus.ode.events.EventState.getEventTime`. + + Returns: + the user's requested action and the new state if the action is :meth:`~org.hipparchus.ode.events.Action.RESET_STATE`. + Otherwise the new state is :code:`state`. The stop time indicates what time propagation should stop if the action is + :meth:`~org.hipparchus.ode.events.Action.STOP`. This guarantees the integration will stop on or after the root, so that + integration may be restarted safely. + + + """ + ... def evaluateStep(self, oDEStateInterpolator: org.hipparchus.ode.sampling.ODEStateInterpolator) -> bool: ... - def getEventDetector(self) -> ODEEventDetector: ... - def getEventTime(self) -> float: ... - def init(self, oDEStateAndDerivative: org.hipparchus.ode.ODEStateAndDerivative, double: float) -> None: ... + def getEventDetector(self) -> ODEEventDetector: + """ + Get the underlying event detector. + + Returns: + underlying event detector + + Since: + 3.0 + + + """ + ... + def getEventTime(self) -> float: + """ + Get the occurrence time of the event triggered in the current step. + + Specified by: + :meth:`~org.hipparchus.ode.events.EventState.getEventTime` in interface :class:`~org.hipparchus.ode.events.EventState` + + Returns: + occurrence time of the event triggered in the current step or infinity if no events are triggered + + + """ + ... + def init(self, oDEStateAndDerivative: org.hipparchus.ode.ODEStateAndDerivative, double: float) -> None: + """ + Initialize handler at the start of an integration. + + This method is called once at the start of the integration. It may be used by the handler to initialize some internal + data if needed. + + Specified by: + :meth:`~org.hipparchus.ode.events.EventState.init` in interface :class:`~org.hipparchus.ode.events.EventState` + + Parameters: + s0 (:class:`~org.hipparchus.ode.ODEStateAndDerivative`): initial state + t (double): target time for the integration + + + """ + ... def reinitializeBegin(self, oDEStateInterpolator: org.hipparchus.ode.sampling.ODEStateInterpolator) -> None: ... - def tryAdvance(self, oDEStateAndDerivative: org.hipparchus.ode.ODEStateAndDerivative, oDEStateInterpolator: org.hipparchus.ode.sampling.ODEStateInterpolator) -> bool: ... + def tryAdvance(self, oDEStateAndDerivative: org.hipparchus.ode.ODEStateAndDerivative, oDEStateInterpolator: org.hipparchus.ode.sampling.ODEStateInterpolator) -> bool: + """ + Try to accept the current history up to the given time. + + It is not necessary to call this method before calling + :meth:`~org.hipparchus.ode.events.DetectorBasedEventState.doEvent` with the same state. It is necessary to call this + method before you call :meth:`~org.hipparchus.ode.events.DetectorBasedEventState.doEvent` on some other event detector. + + Parameters: + state (:class:`~org.hipparchus.ode.ODEStateAndDerivative`): to try to accept. + interpolator (:class:`~org.hipparchus.ode.sampling.ODEStateInterpolator`): to use to find the new root, if any. + + Returns: + if the event detector has an event it has not detected before that is on or before the same time as :code:`state`. In + other words :code:`false` means continue on while :code:`true` means stop and handle my event first. + + + """ + ... _FieldDetectorBasedEventState__T = typing.TypeVar('_FieldDetectorBasedEventState__T', bound=org.hipparchus.CalculusFieldElement) # <T> class FieldDetectorBasedEventState(FieldEventState[_FieldDetectorBasedEventState__T], typing.Generic[_FieldDetectorBasedEventState__T]): + """ + public classFieldDetectorBasedEventState<T extends :class:`~org.hipparchus.ode.events.https:.www.hipparchus.org.hipparchus`<T>> extends :class:`~org.hipparchus.ode.events.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.ode.events.FieldEventState`<T> + + This class handles the state for one :class:`~org.hipparchus.ode.events.FieldODEEventHandler` during integration steps. + + Each time the integrator proposes a step, the event handler switching function should be checked. This class handles the + state of one handler during one integration step, with references to the state at the end of the preceding step. This + information is used to decide if the handler should trigger an event or not during the proposed step. + """ def __init__(self, fieldODEEventDetector: FieldODEEventDetector[_FieldDetectorBasedEventState__T]): ... def doEvent(self, fieldODEStateAndDerivative: org.hipparchus.ode.FieldODEStateAndDerivative[_FieldDetectorBasedEventState__T]) -> FieldEventOccurrence[_FieldDetectorBasedEventState__T]: ... def evaluateStep(self, fieldODEStateInterpolator: org.hipparchus.ode.sampling.FieldODEStateInterpolator[_FieldDetectorBasedEventState__T]) -> bool: ... def getEventDetector(self) -> FieldODEEventDetector[_FieldDetectorBasedEventState__T]: ... - def getEventTime(self) -> _FieldDetectorBasedEventState__T: ... + def getEventTime(self) -> _FieldDetectorBasedEventState__T: + """ + Get the occurrence time of the event triggered in the current step. + + Specified by: + :meth:`~org.hipparchus.ode.events.FieldEventState.getEventTime` in + interface :class:`~org.hipparchus.ode.events.FieldEventState` + + Returns: + occurrence time of the event triggered in the current step or infinity if no events are triggered + + + """ + ... def init(self, fieldODEStateAndDerivative: org.hipparchus.ode.FieldODEStateAndDerivative[_FieldDetectorBasedEventState__T], t: _FieldDetectorBasedEventState__T) -> None: ... def reinitializeBegin(self, fieldODEStateInterpolator: org.hipparchus.ode.sampling.FieldODEStateInterpolator[_FieldDetectorBasedEventState__T]) -> None: ... def tryAdvance(self, fieldODEStateAndDerivative: org.hipparchus.ode.FieldODEStateAndDerivative[_FieldDetectorBasedEventState__T], fieldODEStateInterpolator: org.hipparchus.ode.sampling.FieldODEStateInterpolator[_FieldDetectorBasedEventState__T]) -> bool: ... _FieldStepEndEventState__T = typing.TypeVar('_FieldStepEndEventState__T', bound=org.hipparchus.CalculusFieldElement) # <T> class FieldStepEndEventState(FieldEventState[_FieldStepEndEventState__T], typing.Generic[_FieldStepEndEventState__T]): + """ + public classFieldStepEndEventState<T extends :class:`~org.hipparchus.ode.events.https:.www.hipparchus.org.hipparchus`<T>> extends :class:`~org.hipparchus.ode.events.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.ode.events.FieldEventState`<T> + + This class handles the state for one :class:`~org.hipparchus.ode.events.ODEEventHandler` that triggers at step end. + + Since: + 3.0 + """ def __init__(self, fieldODEStepEndHandler: typing.Union[FieldODEStepEndHandler[_FieldStepEndEventState__T], typing.Callable[[org.hipparchus.ode.FieldODEStateAndDerivative[org.hipparchus.CalculusFieldElement], bool], Action]]): ... def doEvent(self, fieldODEStateAndDerivative: org.hipparchus.ode.FieldODEStateAndDerivative[_FieldStepEndEventState__T]) -> FieldEventOccurrence[_FieldStepEndEventState__T]: ... def evaluateStep(self, fieldODEStateInterpolator: org.hipparchus.ode.sampling.FieldODEStateInterpolator[_FieldStepEndEventState__T]) -> bool: ... - def getEventTime(self) -> _FieldStepEndEventState__T: ... + def getEventTime(self) -> _FieldStepEndEventState__T: + """ + Get the occurrence time of the event triggered in the current step. + + Specified by: + :meth:`~org.hipparchus.ode.events.FieldEventState.getEventTime` in + interface :class:`~org.hipparchus.ode.events.FieldEventState` + + Returns: + occurrence time of the event triggered in the current step or infinity if no events are triggered + + + """ + ... def getHandler(self) -> FieldODEStepEndHandler[_FieldStepEndEventState__T]: ... def init(self, fieldODEStateAndDerivative: org.hipparchus.ode.FieldODEStateAndDerivative[_FieldStepEndEventState__T], t: _FieldStepEndEventState__T) -> None: ... - def setStepEnd(self, t: _FieldStepEndEventState__T) -> None: ... + def setStepEnd(self, t: _FieldStepEndEventState__T) -> None: + """ + Set the step end. + + Parameters: + stepEnd (:class:`~org.hipparchus.ode.events.FieldStepEndEventState`): step end + + + """ + ... class StepEndEventState(EventState): + """ + public classStepEndEventState extends :class:`~org.hipparchus.ode.events.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.ode.events.EventState` + + This class handles the state for one :class:`~org.hipparchus.ode.events.ODEEventHandler` that triggers at step end. + + Since: + 3.0 + """ def __init__(self, oDEStepEndHandler: typing.Union[ODEStepEndHandler, typing.Callable]): ... - def doEvent(self, oDEStateAndDerivative: org.hipparchus.ode.ODEStateAndDerivative) -> EventOccurrence: ... - def evaluateStep(self, oDEStateInterpolator: org.hipparchus.ode.sampling.ODEStateInterpolator) -> bool: ... - def getEventTime(self) -> float: ... - def getHandler(self) -> ODEStepEndHandler: ... - def init(self, oDEStateAndDerivative: org.hipparchus.ode.ODEStateAndDerivative, double: float) -> None: ... - def setStepEnd(self, double: float) -> None: ... + def doEvent(self, oDEStateAndDerivative: org.hipparchus.ode.ODEStateAndDerivative) -> EventOccurrence: + """ + Notify the user's listener of the event. The event occurs wholly within this method call including a call to + :meth:`~org.hipparchus.ode.events.ODEEventHandler.resetState` if necessary. + + Specified by: + :meth:`~org.hipparchus.ode.events.EventState.doEvent` in interface :class:`~org.hipparchus.ode.events.EventState` + + Parameters: + state (:class:`~org.hipparchus.ode.ODEStateAndDerivative`): the state at the time of the event. This must be at the same time as the current value of + :meth:`~org.hipparchus.ode.events.EventState.getEventTime`. + + Returns: + the user's requested action and the new state if the action is :meth:`~org.hipparchus.ode.events.Action.RESET_STATE`. + Otherwise the new state is :code:`state`. The stop time indicates what time propagation should stop if the action is + :meth:`~org.hipparchus.ode.events.Action.STOP`. This guarantees the integration will stop on or after the root, so that + integration may be restarted safely. + + + """ + ... + def evaluateStep(self, oDEStateInterpolator: org.hipparchus.ode.sampling.ODEStateInterpolator) -> bool: + """ + Evaluate the impact of the proposed step on the handler. + + Specified by: + :meth:`~org.hipparchus.ode.events.EventState.evaluateStep` in interface :class:`~org.hipparchus.ode.events.EventState` + + Parameters: + interpolator (:class:`~org.hipparchus.ode.sampling.ODEStateInterpolator`): step interpolator for the proposed step + + Returns: + true if the event handler triggers an event before the end of the proposed step + + + """ + ... + def getEventTime(self) -> float: + """ + Get the occurrence time of the event triggered in the current step. + + Specified by: + :meth:`~org.hipparchus.ode.events.EventState.getEventTime` in interface :class:`~org.hipparchus.ode.events.EventState` + + Returns: + occurrence time of the event triggered in the current step or infinity if no events are triggered + + + """ + ... + def getHandler(self) -> ODEStepEndHandler: + """ + Get the underlying step end handler. + + Returns: + underlying step end handler + + + """ + ... + def init(self, oDEStateAndDerivative: org.hipparchus.ode.ODEStateAndDerivative, double: float) -> None: + """ + Initialize handler at the start of an integration. + + This method is called once at the start of the integration. It may be used by the handler to initialize some internal + data if needed. + + Specified by: + :meth:`~org.hipparchus.ode.events.EventState.init` in interface :class:`~org.hipparchus.ode.events.EventState` + + Parameters: + s0 (:class:`~org.hipparchus.ode.ODEStateAndDerivative`): initial state + t (double): target time for the integration + + + """ + ... + def setStepEnd(self, double: float) -> None: + """ + Set the step end. + + Parameters: + stepEnd (double): step end + + + """ + ... _EventSlopeFilter__T = typing.TypeVar('_EventSlopeFilter__T', bound=ODEEventDetector) # <T> class EventSlopeFilter(AbstractODEDetector['EventSlopeFilter'[_EventSlopeFilter__T]], typing.Generic[_EventSlopeFilter__T]): + """ + public classEventSlopeFilter<T extends :class:`~org.hipparchus.ode.events.ODEEventDetector`> extends :class:`~org.hipparchus.ode.events.AbstractODEDetector`<:class:`~org.hipparchus.ode.events.EventSlopeFilter`<T>> + + Wrapper used to detect only increasing or decreasing events. + + General :class:`~org.hipparchus.ode.events.ODEEventDetector` are defined implicitly by a + :meth:`~org.hipparchus.ode.events.ODEEventDetector.g` crossing zero. This function needs to be continuous in the event + neighborhood, and its sign must remain consistent between events. This implies that during an ODE integration, events + triggered are alternately events for which the function increases from negative to positive values, and events for which + the function decreases from positive to negative values. + + Sometimes, users are only interested in one type of event (say increasing events for example) and not in the other type. + In these cases, looking precisely for all events location and triggering events that will later be ignored is a waste of + computing time. + + Users can wrap a regular :class:`~org.hipparchus.ode.events.ODEEventDetector` in an instance of this class and provide + this wrapping instance to the :class:`~org.hipparchus.ode.ODEIntegrator` in order to avoid wasting time looking for + uninteresting events. The wrapper will intercept the calls to the :meth:`~org.hipparchus.ode.events.ODEEventDetector.g` + and to the :meth:`~org.hipparchus.ode.events.ODEEventHandler.eventOccurred` method in order to ignore uninteresting + events. The wrapped regular :class:`~org.hipparchus.ode.events.ODEEventHandler` will the see only the interesting + events, i.e. either only :code:`increasing` events or :code:`decreasing` events. the number of calls to the + :meth:`~org.hipparchus.ode.events.ODEEventDetector.g` will also be reduced. + + Since: + 3.0 + """ def __init__(self, t: _EventSlopeFilter__T, filterType: FilterType): ... - def g(self, oDEStateAndDerivative: org.hipparchus.ode.ODEStateAndDerivative) -> float: ... - def getDetector(self) -> _EventSlopeFilter__T: ... - def init(self, oDEStateAndDerivative: org.hipparchus.ode.ODEStateAndDerivative, double: float) -> None: ... + def g(self, oDEStateAndDerivative: org.hipparchus.ode.ODEStateAndDerivative) -> float: + """ + Compute the value of the switching function. + + The discrete events are generated when the sign of this switching function changes. The integrator will take care to + change the stepsize in such a way these events occur exactly at step boundaries. The switching function must be + continuous in its roots neighborhood (but not necessarily smooth), as the integrator will need to find its roots to + locate precisely the events. + + Also note that for the integrator to detect an event the sign of the switching function must have opposite signs just + before and after the event. If this consistency is not preserved the integrator may not detect any events. + + This need for consistency is sometimes tricky to achieve. A typical example is using an event to model a ball bouncing + on the floor. The first idea to represent this would be to have :code:`g(state) = h(state)` where h is the height above + the floor at time :code:`state.getTime()`. When :code:`g(state)` reaches 0, the ball is on the floor, so it should + bounce and the typical way to do this is to reverse its vertical velocity. However, this would mean that before the + event :code:`g(state)` was decreasing from positive values to 0, and after the event :code:`g(state)` would be + increasing from 0 to positive values again. Consistency is broken here! The solution here is to have :code:`g(state) = + sign * h(state)`, where sign is a variable with initial value set to :code:`+1`. Each time + :meth:`~org.hipparchus.ode.events.ODEEventHandler.eventOccurred` is called, :code:`sign` is reset to :code:`-sign`. This + allows the :code:`g(state)` function to remain continuous (and even smooth) even across events, despite :code:`h(state)` + is not. Basically, the event is used to *fold* :code:`h(state)` at bounce points, and :code:`sign` is used to *unfold* + it back, so the solvers sees a :code:`g(state)` function which behaves smoothly even across events. + + This method is idempotent, that is calling this multiple times with the same state will result in the same value, with + two exceptions. First, the definition of the g function may change when an + :meth:`~org.hipparchus.ode.events.ODEEventHandler.eventOccurred` on the handler, as in the above example. Second, the + definition of the g function may change when the :meth:`~org.hipparchus.ode.events.ODEEventHandler.eventOccurred` method + of any other event handler in the same integrator returns :meth:`~org.hipparchus.ode.events.Action.RESET_EVENTS`, + :meth:`~org.hipparchus.ode.events.Action.RESET_DERIVATIVES`, or :meth:`~org.hipparchus.ode.events.Action.RESET_STATE`. + + Specified by: + :meth:`~org.hipparchus.ode.events.ODEEventDetector.g` in interface :class:`~org.hipparchus.ode.events.ODEEventDetector` + + Specified by: + :meth:`~org.hipparchus.ode.events.AbstractODEDetector.g` in + class :class:`~org.hipparchus.ode.events.AbstractODEDetector` + + Parameters: + state (:class:`~org.hipparchus.ode.ODEStateAndDerivative`): current value of the independent *time* variable, state vector and derivative + + Returns: + value of the g switching function + + Also see: + + - :class:`~org.hipparchus.ode.events.package` + + + + """ + ... + def getDetector(self) -> _EventSlopeFilter__T: + """ + Get the wrapped raw detector. + + Returns: + the wrapped raw detector + + + """ + ... + def init(self, oDEStateAndDerivative: org.hipparchus.ode.ODEStateAndDerivative, double: float) -> None: + """ + Initialize event handler at the start of an ODE integration. + + This method is called once at the start of the integration. It may be used by the event handler to initialize some + internal data if needed. + + The default implementation does nothing + + This implementation sets the direction of integration and initializes the event handler. If a subclass overrides this + method it should call :code:`super.init(s0, t)`. + + Specified by: + :meth:`~org.hipparchus.ode.events.ODEEventDetector.init` in + interface :class:`~org.hipparchus.ode.events.ODEEventDetector` + + Overrides: + :meth:`~org.hipparchus.ode.events.AbstractODEDetector.init` in + class :class:`~org.hipparchus.ode.events.AbstractODEDetector` + + Parameters: + initialState (:class:`~org.hipparchus.ode.ODEStateAndDerivative`): initial time, state vector and derivative + finalTime (double): target time for the integration + + + """ + ... _FieldEventSlopeFilter__T = typing.TypeVar('_FieldEventSlopeFilter__T', bound=FieldODEEventDetector) # <T> _FieldEventSlopeFilter__E = typing.TypeVar('_FieldEventSlopeFilter__E', bound=org.hipparchus.CalculusFieldElement) # <E> class FieldEventSlopeFilter(AbstractFieldODEDetector['FieldEventSlopeFilter'[_FieldEventSlopeFilter__T, _FieldEventSlopeFilter__E], _FieldEventSlopeFilter__E], typing.Generic[_FieldEventSlopeFilter__T, _FieldEventSlopeFilter__E]): + """ + public classFieldEventSlopeFilter<T extends :class:`~org.hipparchus.ode.events.FieldODEEventDetector`<E>,E extends :class:`~org.hipparchus.ode.events.https:.www.hipparchus.org.hipparchus`<E>> extends :class:`~org.hipparchus.ode.events.AbstractFieldODEDetector`<:class:`~org.hipparchus.ode.events.FieldEventSlopeFilter`<T,E>,E> + + Wrapper used to detect only increasing or decreasing events. + + General :class:`~org.hipparchus.ode.events.FieldODEEventDetector` are defined implicitly by a + :meth:`~org.hipparchus.ode.events.FieldODEEventDetector.g` crossing zero. This function needs to be continuous in the + event neighborhood, and its sign must remain consistent between events. This implies that during an ODE integration, + events triggered are alternately events for which the function increases from negative to positive values, and events + for which the function decreases from positive to negative values. + + Sometimes, users are only interested in one type of event (say increasing events for example) and not in the other type. + In these cases, looking precisely for all events location and triggering events that will later be ignored is a waste of + computing time. + + Users can wrap a regular :class:`~org.hipparchus.ode.events.FieldODEEventDetector` in an instance of this class and + provide this wrapping instance to the :class:`~org.hipparchus.ode.FieldODEIntegrator` in order to avoid wasting time + looking for uninteresting events. The wrapper will intercept the calls to the + :meth:`~org.hipparchus.ode.events.FieldODEEventDetector.g` and to the + :meth:`~org.hipparchus.ode.events.FieldODEEventHandler.eventOccurred` method in order to ignore uninteresting events. + The wrapped regular :class:`~org.hipparchus.ode.events.FieldODEEventDetector` will the see only the interesting events, + i.e. either only :code:`increasing` events or :code:`decreasing` events. the number of calls to the + :meth:`~org.hipparchus.ode.events.FieldODEEventDetector.g` will also be reduced. + + Since: + 3.0 + """ def __init__(self, field: org.hipparchus.Field[_FieldEventSlopeFilter__E], t: _FieldEventSlopeFilter__T, filterType: FilterType): ... def g(self, fieldODEStateAndDerivative: org.hipparchus.ode.FieldODEStateAndDerivative[_FieldEventSlopeFilter__E]) -> _FieldEventSlopeFilter__E: ... - def getDetector(self) -> _FieldEventSlopeFilter__T: ... + def getDetector(self) -> _FieldEventSlopeFilter__T: + """ + Get the wrapped raw detector. + + Returns: + the wrapped raw detector + + + """ + ... def init(self, fieldODEStateAndDerivative: org.hipparchus.ode.FieldODEStateAndDerivative[_FieldEventSlopeFilter__E], e: _FieldEventSlopeFilter__E) -> None: ... diff --git a/org-stubs/hipparchus/ode/nonstiff/__init__.pyi b/org-stubs/hipparchus/ode/nonstiff/__init__.pyi index c50de5d..e75f32d 100644 --- a/org-stubs/hipparchus/ode/nonstiff/__init__.pyi +++ b/org-stubs/hipparchus/ode/nonstiff/__init__.pyi @@ -15,6 +15,12 @@ import typing _AdamsFieldIntegrator__T = typing.TypeVar('_AdamsFieldIntegrator__T', bound=org.hipparchus.CalculusFieldElement) # <T> class AdamsFieldIntegrator(org.hipparchus.ode.MultistepFieldIntegrator[_AdamsFieldIntegrator__T], typing.Generic[_AdamsFieldIntegrator__T]): + """ + public abstract classAdamsFieldIntegrator<T extends :class:`~org.hipparchus.ode.nonstiff.https:.www.hipparchus.org.hipparchus`<T>> extends :class:`~org.hipparchus.ode.MultistepFieldIntegrator`<T> + + Base class for :class:`~org.hipparchus.ode.nonstiff.AdamsBashforthFieldIntegrator` and + :class:`~org.hipparchus.ode.nonstiff.AdamsMoultonFieldIntegrator` integrators. + """ @typing.overload def __init__(self, field: org.hipparchus.Field[_AdamsFieldIntegrator__T], string: str, int: int, int2: int, double: float, double2: float, double3: float, double4: float): ... @typing.overload @@ -24,6 +30,12 @@ class AdamsFieldIntegrator(org.hipparchus.ode.MultistepFieldIntegrator[_AdamsFie def updateHighOrderDerivativesPhase2(self, tArray: typing.Union[typing.List[_AdamsFieldIntegrator__T], jpype.JArray], tArray2: typing.Union[typing.List[_AdamsFieldIntegrator__T], jpype.JArray], array2DRowFieldMatrix: org.hipparchus.linear.Array2DRowFieldMatrix[_AdamsFieldIntegrator__T]) -> None: ... class AdamsIntegrator(org.hipparchus.ode.MultistepIntegrator): + """ + public abstract classAdamsIntegrator extends :class:`~org.hipparchus.ode.MultistepIntegrator` + + Base class for :class:`~org.hipparchus.ode.nonstiff.AdamsBashforthIntegrator` and + :class:`~org.hipparchus.ode.nonstiff.AdamsMoultonIntegrator` integrators. + """ @typing.overload def __init__(self, string: str, int: int, int2: int, double: float, double2: float, double3: float, double4: float): ... @typing.overload @@ -32,66 +44,600 @@ class AdamsIntegrator(org.hipparchus.ode.MultistepIntegrator): def integrate(self, ordinaryDifferentialEquation: org.hipparchus.ode.OrdinaryDifferentialEquation, oDEState: org.hipparchus.ode.ODEState, double: float) -> org.hipparchus.ode.ODEStateAndDerivative: ... @typing.overload def integrate(self, expandableODE: org.hipparchus.ode.ExpandableODE, oDEState: org.hipparchus.ode.ODEState, double: float) -> org.hipparchus.ode.ODEStateAndDerivative: ... - def updateHighOrderDerivativesPhase1(self, array2DRowRealMatrix: org.hipparchus.linear.Array2DRowRealMatrix) -> org.hipparchus.linear.Array2DRowRealMatrix: ... - def updateHighOrderDerivativesPhase2(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray], array2DRowRealMatrix: org.hipparchus.linear.Array2DRowRealMatrix) -> None: ... + def updateHighOrderDerivativesPhase1(self, array2DRowRealMatrix: org.hipparchus.linear.Array2DRowRealMatrix) -> org.hipparchus.linear.Array2DRowRealMatrix: + """ + Update the high order scaled derivatives for Adams integrators (phase 1). + + The complete update of high order derivatives has a form similar to: \[ r_{n+1} = (s_1(n) - s_1(n+1)) P^{-1} u + P^{-1} + A P r_n \] this method computes the P :sup:`-1` A P r :sub:`n` part. + + Parameters: + highOrder (:class:`~org.hipparchus.ode.nonstiff.https:.www.hipparchus.org.hipparchus`): high order scaled derivatives (h :sup:`2` /2 y'', ... h :sup:`k` /k! y(k)) + + Returns: + updated high order derivatives + + Also see: + + - :meth:`~org.hipparchus.ode.nonstiff.AdamsIntegrator.updateHighOrderDerivativesPhase2` + + + + """ + ... + def updateHighOrderDerivativesPhase2(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray], array2DRowRealMatrix: org.hipparchus.linear.Array2DRowRealMatrix) -> None: + """ + Update the high order scaled derivatives Adams integrators (phase 2). + + The complete update of high order derivatives has a form similar to: \[ r_{n+1} = (s_1(n) - s_1(n+1)) P^{-1} u + P^{-1} + A P r_n \] this method computes the (s :sub:`1` (n) - s :sub:`1` (n+1)) P :sup:`-1` u part. + + Phase 1 of the update must already have been performed. + + Parameters: + start (double[]): first order scaled derivatives at step start + end (double[]): first order scaled derivatives at step end + highOrder (:class:`~org.hipparchus.ode.nonstiff.https:.www.hipparchus.org.hipparchus`): high order scaled derivatives, will be modified (h :sup:`2` /2 y'', ... h :sup:`k` /k! y(k)) + + Also see: + + - :meth:`~org.hipparchus.ode.nonstiff.AdamsIntegrator.updateHighOrderDerivativesPhase1` + + + + """ + ... _AdamsNordsieckFieldTransformer__T = typing.TypeVar('_AdamsNordsieckFieldTransformer__T', bound=org.hipparchus.CalculusFieldElement) # <T> class AdamsNordsieckFieldTransformer(typing.Generic[_AdamsNordsieckFieldTransformer__T]): + """ + public classAdamsNordsieckFieldTransformer<T extends :class:`~org.hipparchus.ode.nonstiff.https:.www.hipparchus.org.hipparchus`<T>> extends :class:`~org.hipparchus.ode.nonstiff.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Transformer to Nordsieck vectors for Adams integrators. + + This class is used by :class:`~org.hipparchus.ode.nonstiff.AdamsBashforthIntegrator` and + :class:`~org.hipparchus.ode.nonstiff.AdamsMoultonIntegrator` integrators to convert between classical representation + with several previous first derivatives and Nordsieck representation with higher order scaled derivatives. + + We define scaled derivatives s :sub:`i` (n) at step n as: \[ \left\{\begin{align} s_1(n) &= h y'_n \text{ for first + derivative}\\ s_2(n) &= \frac{h^2}{2} y_n'' \text{ for second derivative}\\ s_3(n) &= \frac{h^3}{6} y_n''' \text{ for + third derivative}\\ &\cdots\\ s_k(n) &= \frac{h^k}{k!} y_n^{(k)} \text{ for } k^\mathrm{th} \text{ derivative} + \end{align}\right. \] + + With the previous definition, the classical representation of multistep methods uses first derivatives only, i.e. it + handles y :sub:`n` , s :sub:`1` (n) and q :sub:`n` where q :sub:`n` is defined as: \[ q_n = [ s_1(n-1) s_1(n-2) \ldots + s_1(n-(k-1)) ]^T \] (we omit the k index in the notation for clarity). + + Another possible representation uses the Nordsieck vector with higher degrees scaled derivatives all taken at the same + step, i.e it handles y :sub:`n` , s :sub:`1` (n) and r :sub:`n` ) where r :sub:`n` is defined as: \[ r_n = [ s_2(n), + s_3(n) \ldots s_k(n) ]^T \] (here again we omit the k index in the notation for clarity) + + Taylor series formulas show that for any index offset i, s :sub:`1` (n-i) can be computed from s :sub:`1` (n), s + :sub:`2` (n) ... s :sub:`k` (n), the formula being exact for degree k polynomials. \[ s_1(n-i) = s_1(n) + \sum_{j\gt 0} + (j+1) (-i)^j s_{j+1}(n) \] The previous formula can be used with several values for i to compute the transform between + classical representation and Nordsieck vector at step end. The transform between r :sub:`n` and q :sub:`n` resulting + from the Taylor series formulas above is: \[ q_n = s_1(n) u + P r_n \] where u is the [ 1 1 ... 1 ] :sup:`T` vector and + P is the (k-1)×(k-1) matrix built with the \((j+1) (-i)^j\) terms with i being the row number starting from 1 and j + being the column number starting from 1: \[ P=\begin{bmatrix} -2 & 3 & -4 & 5 & \ldots \\ -4 & 12 & -32 & 80 & \ldots \\ + -6 & 27 & -108 & 405 & \ldots \\ -8 & 48 & -256 & 1280 & \ldots \\ & & \ldots\\ \end{bmatrix} \] + + Changing -i into +i in the formula above can be used to compute a similar transform between classical representation and + Nordsieck vector at step start. The resulting matrix is simply the absolute value of matrix P. + + For :class:`~org.hipparchus.ode.nonstiff.AdamsBashforthIntegrator` method, the Nordsieck vector at step n+1 is computed + from the Nordsieck vector at step n as follows: + + - y :sub:`n+1` = y :sub:`n` + s :sub:`1` (n) + u :sup:`T` r :sub:`n` + - s :sub:`1` (n+1) = h f(t :sub:`n+1` , y :sub:`n+1` ) + - r :sub:`n+1` = (s :sub:`1` (n) - s :sub:`1` (n+1)) P :sup:`-1` u + P :sup:`-1` A P r :sub:`n` + + + where A is a rows shifting matrix (the lower left part is an identity matrix): + + .. code-block: java + + [ 0 0 ... 0 0 | 0 ] + [ ---------------+---] + [ 1 0 ... 0 0 | 0 ] + A = [ 0 1 ... 0 0 | 0 ] + [ ... | 0 ] + [ 0 0 ... 1 0 | 0 ] + [ 0 0 ... 0 1 | 0 ] + + + For :class:`~org.hipparchus.ode.nonstiff.AdamsMoultonIntegrator` method, the predicted Nordsieck vector at step n+1 is + computed from the Nordsieck vector at step n as follows: + + - Y :sub:`n+1` = y :sub:`n` + s :sub:`1` (n) + u :sup:`T` r :sub:`n` + - S :sub:`1` (n+1) = h f(t :sub:`n+1` , Y :sub:`n+1` ) + - R :sub:`n+1` = (s :sub:`1` (n) - s :sub:`1` (n+1)) P :sup:`-1` u + P :sup:`-1` A P r :sub:`n` + + From this predicted vector, the corrected vector is computed as follows: + + - y :sub:`n+1` = y :sub:`n` + S :sub:`1` (n+1) + [ -1 +1 -1 +1 ... ±1 ] r :sub:`n+1` + - s :sub:`1` (n+1) = h f(t :sub:`n+1` , y :sub:`n+1` ) + - r :sub:`n+1` = R :sub:`n+1` + (s :sub:`1` (n+1) - S :sub:`1` (n+1)) P :sup:`-1` u + + + where the upper case Y :sub:`n+1` , S :sub:`1` (n+1) and R :sub:`n+1` represent the predicted states whereas the lower + case y :sub:`n+1` , s :sub:`n+1` and r :sub:`n+1` represent the corrected states. + + We observe that both methods use similar update formulas. In both cases a P :sup:`-1` u vector and a P :sup:`-1` A P + matrix are used that do not depend on the state, they only depend on k. This class handles these transformations. + """ _getInstance__T = typing.TypeVar('_getInstance__T', bound=org.hipparchus.CalculusFieldElement) # <T> @staticmethod - def getInstance(field: org.hipparchus.Field[_getInstance__T], int: int) -> 'AdamsNordsieckFieldTransformer'[_getInstance__T]: ... + def getInstance(field: org.hipparchus.Field[_getInstance__T], int: int) -> 'AdamsNordsieckFieldTransformer'[_getInstance__T]: + """ + Get the Nordsieck transformer for a given field and number of steps. + + Parameters: + field (:class:`~org.hipparchus.ode.nonstiff.https:.www.hipparchus.org.hipparchus`<T> field): field to which the time and state vector elements belong + nSteps (int): number of steps of the multistep method (excluding the one being computed) + + Returns: + Nordsieck transformer for the specified field and number of steps + + + """ + ... def initializeHighOrderDerivatives(self, t: _AdamsNordsieckFieldTransformer__T, tArray: typing.Union[typing.List[_AdamsNordsieckFieldTransformer__T], jpype.JArray], tArray2: typing.Union[typing.List[typing.MutableSequence[_AdamsNordsieckFieldTransformer__T]], jpype.JArray], tArray3: typing.Union[typing.List[typing.MutableSequence[_AdamsNordsieckFieldTransformer__T]], jpype.JArray]) -> org.hipparchus.linear.Array2DRowFieldMatrix[_AdamsNordsieckFieldTransformer__T]: ... def updateHighOrderDerivativesPhase1(self, array2DRowFieldMatrix: org.hipparchus.linear.Array2DRowFieldMatrix[_AdamsNordsieckFieldTransformer__T]) -> org.hipparchus.linear.Array2DRowFieldMatrix[_AdamsNordsieckFieldTransformer__T]: ... def updateHighOrderDerivativesPhase2(self, tArray: typing.Union[typing.List[_AdamsNordsieckFieldTransformer__T], jpype.JArray], tArray2: typing.Union[typing.List[_AdamsNordsieckFieldTransformer__T], jpype.JArray], array2DRowFieldMatrix: org.hipparchus.linear.Array2DRowFieldMatrix[_AdamsNordsieckFieldTransformer__T]) -> None: ... class AdamsNordsieckTransformer: + """ + public classAdamsNordsieckTransformer extends :class:`~org.hipparchus.ode.nonstiff.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Transformer to Nordsieck vectors for Adams integrators. + + This class is used by :class:`~org.hipparchus.ode.nonstiff.AdamsBashforthIntegrator` and + :class:`~org.hipparchus.ode.nonstiff.AdamsMoultonIntegrator` integrators to convert between classical representation + with several previous first derivatives and Nordsieck representation with higher order scaled derivatives. + + We define scaled derivatives s :sub:`i` (n) at step n as: \[ \left\{\begin{align} s_1(n) &= h y'_n \text{ for first + derivative}\\ s_2(n) &= \frac{h^2}{2} y_n'' \text{ for second derivative}\\ s_3(n) &= \frac{h^3}{6} y_n''' \text{ for + third derivative}\\ &\cdots\\ s_k(n) &= \frac{h^k}{k!} y_n^{(k)} \text{ for } k^\mathrm{th} \text{ derivative} + \end{align}\right. \] + + With the previous definition, the classical representation of multistep methods uses first derivatives only, i.e. it + handles y :sub:`n` , s :sub:`1` (n) and q :sub:`n` where q :sub:`n` is defined as: \[ q_n = [ s_1(n-1) s_1(n-2) \ldots + s_1(n-(k-1)) ]^T \] (we omit the k index in the notation for clarity). + + Another possible representation uses the Nordsieck vector with higher degrees scaled derivatives all taken at the same + step, i.e it handles y :sub:`n` , s :sub:`1` (n) and r :sub:`n` ) where r :sub:`n` is defined as: \[ r_n = [ s_2(n), + s_3(n) \ldots s_k(n) ]^T \] (here again we omit the k index in the notation for clarity) + + Taylor series formulas show that for any index offset i, s :sub:`1` (n-i) can be computed from s :sub:`1` (n), s + :sub:`2` (n) ... s :sub:`k` (n), the formula being exact for degree k polynomials. \[ s_1(n-i) = s_1(n) + \sum_{j\gt 0} + (j+1) (-i)^j s_{j+1}(n) \] The previous formula can be used with several values for i to compute the transform between + classical representation and Nordsieck vector at step end. The transform between r :sub:`n` and q :sub:`n` resulting + from the Taylor series formulas above is: \[ q_n = s_1(n) u + P r_n \] where u is the [ 1 1 ... 1 ] :sup:`T` vector and + P is the (k-1)×(k-1) matrix built with the \((j+1) (-i)^j\) terms with i being the row number starting from 1 and j + being the column number starting from 1: \[ P=\begin{bmatrix} -2 & 3 & -4 & 5 & \ldots \\ -4 & 12 & -32 & 80 & \ldots \\ + -6 & 27 & -108 & 405 & \ldots \\ -8 & 48 & -256 & 1280 & \ldots \\ & & \ldots\\ \end{bmatrix} \] + + Changing -i into +i in the formula above can be used to compute a similar transform between classical representation and + Nordsieck vector at step start. The resulting matrix is simply the absolute value of matrix P. + + For :class:`~org.hipparchus.ode.nonstiff.AdamsBashforthIntegrator` method, the Nordsieck vector at step n+1 is computed + from the Nordsieck vector at step n as follows: + + - y :sub:`n+1` = y :sub:`n` + s :sub:`1` (n) + u :sup:`T` r :sub:`n` + - s :sub:`1` (n+1) = h f(t :sub:`n+1` , y :sub:`n+1` ) + - r :sub:`n+1` = (s :sub:`1` (n) - s :sub:`1` (n+1)) P :sup:`-1` u + P :sup:`-1` A P r :sub:`n` + + + where A is a rows shifting matrix (the lower left part is an identity matrix): + + .. code-block: java + + [ 0 0 ... 0 0 | 0 ] + [ ---------------+---] + [ 1 0 ... 0 0 | 0 ] + A = [ 0 1 ... 0 0 | 0 ] + [ ... | 0 ] + [ 0 0 ... 1 0 | 0 ] + [ 0 0 ... 0 1 | 0 ] + + + For :class:`~org.hipparchus.ode.nonstiff.AdamsMoultonIntegrator` method, the predicted Nordsieck vector at step n+1 is + computed from the Nordsieck vector at step n as follows: + + - Y :sub:`n+1` = y :sub:`n` + s :sub:`1` (n) + u :sup:`T` r :sub:`n` + - S :sub:`1` (n+1) = h f(t :sub:`n+1` , Y :sub:`n+1` ) + - R :sub:`n+1` = (s :sub:`1` (n) - s :sub:`1` (n+1)) P :sup:`-1` u + P :sup:`-1` A P r :sub:`n` + + From this predicted vector, the corrected vector is computed as follows: + + - y :sub:`n+1` = y :sub:`n` + S :sub:`1` (n+1) + [ -1 +1 -1 +1 ... ±1 ] r :sub:`n+1` + - s :sub:`1` (n+1) = h f(t :sub:`n+1` , y :sub:`n+1` ) + - r :sub:`n+1` = R :sub:`n+1` + (s :sub:`1` (n+1) - S :sub:`1` (n+1)) P :sup:`-1` u + + + where the upper case Y :sub:`n+1` , S :sub:`1` (n+1) and R :sub:`n+1` represent the predicted states whereas the lower + case y :sub:`n+1` , s :sub:`n+1` and r :sub:`n+1` represent the corrected states. + + We observe that both methods use similar update formulas. In both cases a P :sup:`-1` u vector and a P :sup:`-1` A P + matrix are used that do not depend on the state, they only depend on k. This class handles these transformations. + """ @staticmethod - def getInstance(int: int) -> 'AdamsNordsieckTransformer': ... - def initializeHighOrderDerivatives(self, double: float, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[typing.MutableSequence[float]], jpype.JArray], doubleArray3: typing.Union[typing.List[typing.MutableSequence[float]], jpype.JArray]) -> org.hipparchus.linear.Array2DRowRealMatrix: ... - def updateHighOrderDerivativesPhase1(self, array2DRowRealMatrix: org.hipparchus.linear.Array2DRowRealMatrix) -> org.hipparchus.linear.Array2DRowRealMatrix: ... - def updateHighOrderDerivativesPhase2(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray], array2DRowRealMatrix: org.hipparchus.linear.Array2DRowRealMatrix) -> None: ... + def getInstance(int: int) -> 'AdamsNordsieckTransformer': + """ + Get the Nordsieck transformer for a given number of steps. + + Parameters: + nSteps (int): number of steps of the multistep method (excluding the one being computed) + + Returns: + Nordsieck transformer for the specified number of steps + + + """ + ... + def initializeHighOrderDerivatives(self, double: float, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[typing.MutableSequence[float]], jpype.JArray], doubleArray3: typing.Union[typing.List[typing.MutableSequence[float]], jpype.JArray]) -> org.hipparchus.linear.Array2DRowRealMatrix: + """ + Initialize the high order scaled derivatives at step start. + + Parameters: + h (double): step size to use for scaling + t (double[]): first steps times + y (double[][]): first steps states + yDot (double[][]): first steps derivatives + + Returns: + Nordieck vector at start of first step (h :sup:`2` /2 y'' :sub:`n` , h :sup:`3` /6 y''' :sub:`n` ... h :sup:`k` /k! y + :sup:`(k)` :sub:`n` ) + + + """ + ... + def updateHighOrderDerivativesPhase1(self, array2DRowRealMatrix: org.hipparchus.linear.Array2DRowRealMatrix) -> org.hipparchus.linear.Array2DRowRealMatrix: + """ + Update the high order scaled derivatives for Adams integrators (phase 1). + + The complete update of high order derivatives has a form similar to: \[ r_{n+1} = (s_1(n) - s_1(n+1)) P^{-1} u + P^{-1} + A P r_n \] this method computes the P :sup:`-1` A P r :sub:`n` part. + + Parameters: + highOrder (:class:`~org.hipparchus.ode.nonstiff.https:.www.hipparchus.org.hipparchus`): high order scaled derivatives (h :sup:`2` /2 y'', ... h :sup:`k` /k! y(k)) + + Returns: + updated high order derivatives + + Also see: + + - :meth:`~org.hipparchus.ode.nonstiff.AdamsNordsieckTransformer.updateHighOrderDerivativesPhase2` + + + + """ + ... + def updateHighOrderDerivativesPhase2(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray], array2DRowRealMatrix: org.hipparchus.linear.Array2DRowRealMatrix) -> None: + """ + Update the high order scaled derivatives Adams integrators (phase 2). + + The complete update of high order derivatives has a form similar to: \[ r_{n+1} = (s_1(n) - s_1(n+1)) P^{-1} u + P^{-1} + A P r_n \] this method computes the (s :sub:`1` (n) - s :sub:`1` (n+1)) P :sup:`-1` u part. + + Phase 1 of the update must already have been performed. + + Parameters: + start (double[]): first order scaled derivatives at step start + end (double[]): first order scaled derivatives at step end + highOrder (:class:`~org.hipparchus.ode.nonstiff.https:.www.hipparchus.org.hipparchus`): high order scaled derivatives, will be modified (h :sup:`2` /2 y'', ... h :sup:`k` /k! y(k)) + + Also see: + + - :meth:`~org.hipparchus.ode.nonstiff.AdamsNordsieckTransformer.updateHighOrderDerivativesPhase1` + + + + """ + ... _AdaptiveStepsizeFieldIntegrator__T = typing.TypeVar('_AdaptiveStepsizeFieldIntegrator__T', bound=org.hipparchus.CalculusFieldElement) # <T> class AdaptiveStepsizeFieldIntegrator(org.hipparchus.ode.AbstractFieldIntegrator[_AdaptiveStepsizeFieldIntegrator__T], typing.Generic[_AdaptiveStepsizeFieldIntegrator__T]): + """ + public abstract classAdaptiveStepsizeFieldIntegrator<T extends :class:`~org.hipparchus.ode.nonstiff.https:.www.hipparchus.org.hipparchus`<T>> extends :class:`~org.hipparchus.ode.AbstractFieldIntegrator`<T> + + This abstract class holds the common part of all adaptive stepsize integrators for Ordinary Differential Equations. + + These algorithms perform integration with stepsize control, which means the user does not specify the integration step + but rather a tolerance on error. The error threshold is computed as + + .. code-block: java + + threshold_i = absTol_i + relTol_i * max (abs (ym), abs (ym+1)) + + + where absTol_i is the absolute tolerance for component i of the state vector and relTol_i is the relative tolerance for + the same component. The user can also use only two scalar values absTol and relTol which will be used for all + components. + + Note that *only* the :meth:`~org.hipparchus.ode.FieldODEState.getPrimaryState` of the state vector is used for stepsize + control. The :meth:`~org.hipparchus.ode.FieldODEState.getSecondaryState` of the state vector are explicitly ignored for + stepsize control. + + If the estimated error for ym+1 is such that + + .. code-block: java + + sqrt((sum (errEst_i / threshold_i)^2 ) / n) < 1 + + + (where n is the main set dimension) then the step is accepted, otherwise the step is rejected and a new attempt is made + with a new stepsize. + """ @typing.overload def __init__(self, field: org.hipparchus.Field[_AdaptiveStepsizeFieldIntegrator__T], string: str, double: float, double2: float, double3: float, double4: float): ... @typing.overload def __init__(self, field: org.hipparchus.Field[_AdaptiveStepsizeFieldIntegrator__T], string: str, double: float, double2: float, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray]): ... - def getMaxStep(self) -> float: ... - def getMinStep(self) -> float: ... + def getMaxStep(self) -> float: + """ + Get the maximal step. + + Returns: + maximal step + + + """ + ... + def getMinStep(self) -> float: + """ + Get the minimal step. + + Returns: + minimal step + + + """ + ... def initializeStep(self, boolean: bool, int: int, tArray: typing.Union[typing.List[_AdaptiveStepsizeFieldIntegrator__T], jpype.JArray], fieldODEStateAndDerivative: org.hipparchus.ode.FieldODEStateAndDerivative[_AdaptiveStepsizeFieldIntegrator__T], fieldEquationsMapper: org.hipparchus.ode.FieldEquationsMapper[_AdaptiveStepsizeFieldIntegrator__T]) -> float: ... - def setInitialStepSize(self, double: float) -> None: ... + def setInitialStepSize(self, double: float) -> None: + """ + Set the initial step size. + + This method allows the user to specify an initial positive step size instead of letting the integrator guess it by + itself. If this method is not called before integration is started, the initial step size will be estimated by the + integrator. + + Parameters: + initialStepSize (double): initial step size to use (must be positive even for backward integration ; providing a negative value or a value outside + of the min/max step interval will lead the integrator to ignore the value and compute the initial step size by itself) + + + """ + ... @typing.overload - def setStepSizeControl(self, double: float, double2: float, double3: float, double4: float) -> None: ... + def setStepSizeControl(self, double: float, double2: float, double3: float, double4: float) -> None: + """ + Set the adaptive step size control parameters. + + A side effect of this method is to also reset the initial step so it will be automatically computed by the integrator if + :meth:`~org.hipparchus.ode.nonstiff.AdaptiveStepsizeFieldIntegrator.setInitialStepSize` is not called by the user. + + Parameters: + minimalStep (double): minimal step (must be positive even for backward integration), the last step can be smaller than this + maximalStep (double): maximal step (must be positive even for backward integration) + absoluteTolerance (double): allowed absolute error + relativeTolerance (double): allowed relative error + + Set the adaptive step size control parameters. + + A side effect of this method is to also reset the initial step so it will be automatically computed by the integrator if + :meth:`~org.hipparchus.ode.nonstiff.AdaptiveStepsizeFieldIntegrator.setInitialStepSize` is not called by the user. + + Parameters: + minimalStep (double): minimal step (must be positive even for backward integration), the last step can be smaller than this + maximalStep (double): maximal step (must be positive even for backward integration) + absoluteTolerance (double[]): allowed absolute error + relativeTolerance (double[]): allowed relative error + + + """ + ... @typing.overload def setStepSizeControl(self, double: float, double2: float, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray]) -> None: ... class AdaptiveStepsizeIntegrator(org.hipparchus.ode.AbstractIntegrator): + """ + public abstract classAdaptiveStepsizeIntegrator extends :class:`~org.hipparchus.ode.AbstractIntegrator` + + This abstract class holds the common part of all adaptive stepsize integrators for Ordinary Differential Equations. + + These algorithms perform integration with stepsize control, which means the user does not specify the integration step + but rather a tolerance on error. The error threshold is computed as + + .. code-block: java + + threshold_i = absTol_i + relTol_i * max (abs (ym), abs (ym+1)) + + + where absTol_i is the absolute tolerance for component i of the state vector and relTol_i is the relative tolerance for + the same component. The user can also use only two scalar values absTol and relTol which will be used for all + components. + + If the Ordinary Differential Equations is an :class:`~org.hipparchus.ode.ExpandableODE` rather than a + :class:`~org.hipparchus.ode.OrdinaryDifferentialEquation`, then *only* the + :meth:`~org.hipparchus.ode.ExpandableODE.getPrimary` of the state vector is used for stepsize control, not the complete + state vector. + + If the estimated error for ym+1 is such that + + .. code-block: java + + sqrt((sum (errEst_i / threshold_i)^2 ) / n) < 1 + + + (where n is the main set dimension) then the step is accepted, otherwise the step is rejected and a new attempt is made + with a new stepsize. + """ @typing.overload def __init__(self, string: str, double: float, double2: float, double3: float, double4: float): ... @typing.overload def __init__(self, string: str, double: float, double2: float, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray]): ... - def getMaxStep(self) -> float: ... - def getMinStep(self) -> float: ... + def getMaxStep(self) -> float: + """ + Get the maximal step. + + Returns: + maximal step + + + """ + ... + def getMinStep(self) -> float: + """ + Get the minimal step. + + Returns: + minimal step + + + """ + ... def initializeStep(self, boolean: bool, int: int, doubleArray: typing.Union[typing.List[float], jpype.JArray], oDEStateAndDerivative: org.hipparchus.ode.ODEStateAndDerivative) -> float: ... - def setInitialStepSize(self, double: float) -> None: ... + def setInitialStepSize(self, double: float) -> None: + """ + Set the initial step size. + + This method allows the user to specify an initial positive step size instead of letting the integrator guess it by + itself. If this method is not called before integration is started, the initial step size will be estimated by the + integrator. + + Parameters: + initialStepSize (double): initial step size to use (must be positive even for backward integration ; providing a negative value or a value outside + of the min/max step interval will lead the integrator to ignore the value and compute the initial step size by itself) + + + """ + ... @typing.overload - def setStepSizeControl(self, double: float, double2: float, double3: float, double4: float) -> None: ... + def setStepSizeControl(self, double: float, double2: float, double3: float, double4: float) -> None: + """ + Set the adaptive step size control parameters. + + A side effect of this method is to also reset the initial step so it will be automatically computed by the integrator if + :meth:`~org.hipparchus.ode.nonstiff.AdaptiveStepsizeIntegrator.setInitialStepSize` is not called by the user. + + Parameters: + minimalStep (double): minimal step (must be positive even for backward integration), the last step can be smaller than this + maximalStep (double): maximal step (must be positive even for backward integration) + absoluteTolerance (double): allowed absolute error + relativeTolerance (double): allowed relative error + + Set the adaptive step size control parameters. + + A side effect of this method is to also reset the initial step so it will be automatically computed by the integrator if + :meth:`~org.hipparchus.ode.nonstiff.AdaptiveStepsizeIntegrator.setInitialStepSize` is not called by the user. + + Parameters: + minimalStep (double): minimal step (must be positive even for backward integration), the last step can be smaller than this + maximalStep (double): maximal step (must be positive even for backward integration) + absoluteTolerance (double[]): allowed absolute error + relativeTolerance (double[]): allowed relative error + + + """ + ... @typing.overload def setStepSizeControl(self, double: float, double2: float, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray]) -> None: ... class ButcherArrayProvider: - def getA(self) -> typing.MutableSequence[typing.MutableSequence[float]]: ... - def getB(self) -> typing.MutableSequence[float]: ... - def getC(self) -> typing.MutableSequence[float]: ... + """ + public interfaceButcherArrayProvider + + This interface represents an integrator based on Butcher arrays. + + Also see: + + - :class:`~org.hipparchus.ode.nonstiff.RungeKuttaIntegrator` + - :class:`~org.hipparchus.ode.nonstiff.EmbeddedRungeKuttaIntegrator` + """ + def getA(self) -> typing.MutableSequence[typing.MutableSequence[float]]: + """ + Get the internal weights from Butcher array (without the first empty row). + + Returns: + internal weights from Butcher array (without the first empty row) + + + """ + ... + def getB(self) -> typing.MutableSequence[float]: + """ + Get the external weights for the high order method from Butcher array. + + Returns: + external weights for the high order method from Butcher array + + + """ + ... + def getC(self) -> typing.MutableSequence[float]: + """ + Get the time steps from Butcher array (without the first zero). + + Returns: + time steps from Butcher array (without the first zero + + + """ + ... _FieldButcherArrayProvider__T = typing.TypeVar('_FieldButcherArrayProvider__T', bound=org.hipparchus.CalculusFieldElement) # <T> class FieldButcherArrayProvider(typing.Generic[_FieldButcherArrayProvider__T]): - def getA(self) -> typing.MutableSequence[typing.MutableSequence[_FieldButcherArrayProvider__T]]: ... - def getB(self) -> typing.MutableSequence[_FieldButcherArrayProvider__T]: ... - def getC(self) -> typing.MutableSequence[_FieldButcherArrayProvider__T]: ... + """ + public interfaceFieldButcherArrayProvider<T extends :class:`~org.hipparchus.ode.nonstiff.https:.www.hipparchus.org.hipparchus`<T>> + + This interface represents an integrator based on Butcher arrays. + + Also see: + + - :class:`~org.hipparchus.ode.nonstiff.RungeKuttaFieldIntegrator` + - :class:`~org.hipparchus.ode.nonstiff.EmbeddedRungeKuttaFieldIntegrator` + """ + def getA(self) -> typing.MutableSequence[typing.MutableSequence[_FieldButcherArrayProvider__T]]: + """ + Get the internal weights from Butcher array (without the first empty row). + + Returns: + internal weights from Butcher array (without the first empty row) + + + """ + ... + def getB(self) -> typing.MutableSequence[_FieldButcherArrayProvider__T]: + """ + Get the external weights for the high order method from Butcher array. + + Returns: + external weights for the high order method from Butcher array + + + """ + ... + def getC(self) -> typing.MutableSequence[_FieldButcherArrayProvider__T]: + """ + Get the time steps from Butcher array (without the first zero). + + Returns: + time steps from Butcher array (without the first zero + + + """ + ... class StepsizeHelper: + """ + public classStepsizeHelper extends :class:`~org.hipparchus.ode.nonstiff.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Helper for adaptive stepsize control. + + Since: + 2.0 + """ @typing.overload def __init__(self, double: float, double2: float, double3: float, double4: float): ... @typing.overload @@ -101,29 +647,316 @@ class StepsizeHelper: def filterStep(self, double: float, boolean: bool, boolean2: bool) -> float: ... @typing.overload def filterStep(self, t: _filterStep_1__T, boolean: bool, boolean2: bool) -> _filterStep_1__T: ... - def getDummyStepsize(self) -> float: ... - def getInitialStep(self) -> float: ... - def getMainSetDimension(self) -> int: ... - def getMaxStep(self) -> float: ... - def getMinStep(self) -> float: ... - def getRelativeTolerance(self, int: int) -> float: ... + def getDummyStepsize(self) -> float: + """ + Get a dummy step size. + + Returns: + geometric mean of :meth:`~org.hipparchus.ode.nonstiff.StepsizeHelper.getMinStep` and + :meth:`~org.hipparchus.ode.nonstiff.StepsizeHelper.getMaxStep` + + + """ + ... + def getInitialStep(self) -> float: + """ + Get the initial step. + + Returns: + initial step + + + """ + ... + def getMainSetDimension(self) -> int: + """ + Get the main set dimension. + + Returns: + main set dimension + + + """ + ... + def getMaxStep(self) -> float: + """ + Get the maximal step. + + Returns: + maximal step + + + """ + ... + def getMinStep(self) -> float: + """ + Get the minimal step. + + Returns: + minimal step + + + """ + ... + def getRelativeTolerance(self, int: int) -> float: + """ + Get the relative tolerance for one component. + + Parameters: + i (int): component to select + + Returns: + relative tolerance for selected component + + + """ + ... _getTolerance_1__T = typing.TypeVar('_getTolerance_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload - def getTolerance(self, int: int, double: float) -> float: ... + def getTolerance(self, int: int, double: float) -> float: + """ + Get the tolerance for one component. + + Parameters: + i (int): component to select + scale (double): scale factor for relative tolerance (i.e. y[i]) + + Returns: + tolerance for selected component + + """ + ... @typing.overload - def getTolerance(self, int: int, t: _getTolerance_1__T) -> _getTolerance_1__T: ... - def setInitialStepSize(self, double: float) -> None: ... + def getTolerance(self, int: int, t: _getTolerance_1__T) -> _getTolerance_1__T: + """ + Get the tolerance for one component. + + Parameters: + i (int): component to select + scale (T): scale factor for relative tolerance (i.e. y[i]) + + Returns: + tolerance for selected component + + + """ + ... + def setInitialStepSize(self, double: float) -> None: + """ + Set the initial step size. + + This method allows the user to specify an initial positive step size instead of letting the integrator guess it by + itself. If this method is not called before integration is started, the initial step size will be estimated by the + integrator. + + Parameters: + initialStepSize (double): initial step size to use (must be positive even for backward integration ; providing a negative value or a value outside + of the min/max step interval will lead the integrator to ignore the value and compute the initial step size by itself) + + + """ + ... _AdamsBashforthFieldIntegrator__T = typing.TypeVar('_AdamsBashforthFieldIntegrator__T', bound=org.hipparchus.CalculusFieldElement) # <T> class AdamsBashforthFieldIntegrator(AdamsFieldIntegrator[_AdamsBashforthFieldIntegrator__T], typing.Generic[_AdamsBashforthFieldIntegrator__T]): + """ + public classAdamsBashforthFieldIntegrator<T extends :class:`~org.hipparchus.ode.nonstiff.https:.www.hipparchus.org.hipparchus`<T>> extends :class:`~org.hipparchus.ode.nonstiff.AdamsFieldIntegrator`<T> + + This class implements explicit Adams-Bashforth integrators for Ordinary Differential Equations. + + Adams-Bashforth methods (in fact due to Adams alone) are explicit multistep ODE solvers. This implementation is a + variation of the classical one: it uses adaptive stepsize to implement error control, whereas classical implementations + are fixed step size. The value of state vector at step n+1 is a simple combination of the value at step n and of the + derivatives at steps n, n-1, n-2 ... Depending on the number k of previous steps one wants to use for computing the next + value, different formulas are available: + + - k = 1: y :sub:`n+1` = y :sub:`n` + h y' :sub:`n` + - k = 2: y :sub:`n+1` = y :sub:`n` + h (3y' :sub:`n` -y' :sub:`n-1` )/2 + - k = 3: y :sub:`n+1` = y :sub:`n` + h (23y' :sub:`n` -16y' :sub:`n-1` +5y' :sub:`n-2` )/12 + - k = 4: y :sub:`n+1` = y :sub:`n` + h (55y' :sub:`n` -59y' :sub:`n-1` +37y' :sub:`n-2` -9y' :sub:`n-3` )/24 + - ... + + + A k-steps Adams-Bashforth method is of order k. + + There must be sufficient time for the :meth:`~org.hipparchus.ode.MultistepFieldIntegrator.setStarterIntegrator` to take + several steps between the the last reset event, and the end of integration, otherwise an exception may be thrown during + integration. The user can adjust the end date of integration, or the step size of the starter integrator to ensure a + sufficient number of steps can be completed before the end of integration. + + **Implementation details** + + We define scaled derivatives s :sub:`i` (n) at step n as: \[ \left\{\begin{align} s_1(n) &= h y'_n \text{ for first + derivative}\\ s_2(n) &= \frac{h^2}{2} y_n'' \text{ for second derivative}\\ s_3(n) &= \frac{h^3}{6} y_n''' \text{ for + third derivative}\\ &\cdots\\ s_k(n) &= \frac{h^k}{k!} y_n^{(k)} \text{ for } k^\mathrm{th} \text{ derivative} + \end{align}\right. \] + + The definitions above use the classical representation with several previous first derivatives. Lets define \[ q_n = [ + s_1(n-1) s_1(n-2) \ldots s_1(n-(k-1)) ]^T \] (we omit the k index in the notation for clarity). With these definitions, + Adams-Bashforth methods can be written: \[ \left\{\begin{align} k = 1: & y_{n+1} = y_n + s_1(n) \\ k = 2: & y_{n+1} = + y_n + \frac{3}{2} s_1(n) + [ \frac{-1}{2} ] q_n \\ k = 3: & y_{n+1} = y_n + \frac{23}{12} s_1(n) + [ \frac{-16}{12} + \frac{5}{12} ] q_n \\ k = 4: & y_{n+1} = y_n + \frac{55}{24} s_1(n) + [ \frac{-59}{24} \frac{37}{24} \frac{-9}{24} ] q_n + \\ & \cdots \end{align}\right. \] + + Instead of using the classical representation with first derivatives only (y :sub:`n` , s :sub:`1` (n) and q :sub:`n` ), + our implementation uses the Nordsieck vector with higher degrees scaled derivatives all taken at the same step (y + :sub:`n` , s :sub:`1` (n) and r :sub:`n` ) where r :sub:`n` is defined as: \[ r_n = [ s_2(n), s_3(n) \ldots s_k(n) ]^T + \] (here again we omit the k index in the notation for clarity) + + Taylor series formulas show that for any index offset i, s :sub:`1` (n-i) can be computed from s :sub:`1` (n), s + :sub:`2` (n) ... s :sub:`k` (n), the formula being exact for degree k polynomials. \[ s_1(n-i) = s_1(n) + \sum_{j\gt 0} + (j+1) (-i)^j s_{j+1}(n) \] The previous formula can be used with several values for i to compute the transform between + classical representation and Nordsieck vector. The transform between r :sub:`n` and q :sub:`n` resulting from the Taylor + series formulas above is: \[ q_n = s_1(n) u + P r_n \] where u is the [ 1 1 ... 1 ] :sup:`T` vector and P is the + (k-1)×(k-1) matrix built with the \((j+1) (-i)^j\) terms with i being the row number starting from 1 and j being the + column number starting from 1: \[ P=\begin{bmatrix} -2 & 3 & -4 & 5 & \ldots \\ -4 & 12 & -32 & 80 & \ldots \\ -6 & 27 & + -108 & 405 & \ldots \\ -8 & 48 & -256 & 1280 & \ldots \\ & & \ldots\\ \end{bmatrix} \] + + Using the Nordsieck vector has several advantages: + + - it greatly simplifies step interpolation as the interpolator mainly applies Taylor series formulas, + - it simplifies step changes that occur when discrete events that truncate the step are triggered, + - it allows to extend the methods in order to support adaptive stepsize. + + + The Nordsieck vector at step n+1 is computed from the Nordsieck vector at step n as follows: + + - y :sub:`n+1` = y :sub:`n` + s :sub:`1` (n) + u :sup:`T` r :sub:`n` + - s :sub:`1` (n+1) = h f(t :sub:`n+1` , y :sub:`n+1` ) + - r :sub:`n+1` = (s :sub:`1` (n) - s :sub:`1` (n+1)) P :sup:`-1` u + P :sup:`-1` A P r :sub:`n` + + + where A is a rows shifting matrix (the lower left part is an identity matrix): + + .. code-block: java + + [ 0 0 ... 0 0 | 0 ] + [ ---------------+---] + [ 1 0 ... 0 0 | 0 ] + A = [ 0 1 ... 0 0 | 0 ] + [ ... | 0 ] + [ 0 0 ... 1 0 | 0 ] + [ 0 0 ... 0 1 | 0 ] + + + The P :sup:`-1` u vector and the P :sup:`-1` A P matrix do not depend on the state, they only depend on k and therefore + are precomputed once for all. + """ METHOD_NAME: typing.ClassVar[str] = ... + """ + public static final :class:`~org.hipparchus.ode.nonstiff.https:.docs.oracle.com.javase.8.docs.api.java.lang.String` METHOD_NAME + + Name of integration scheme. + + Also see: + + - :meth:`~constant` + + + + """ @typing.overload def __init__(self, field: org.hipparchus.Field[_AdamsBashforthFieldIntegrator__T], int: int, double: float, double2: float, double3: float, double4: float): ... @typing.overload def __init__(self, field: org.hipparchus.Field[_AdamsBashforthFieldIntegrator__T], int: int, double: float, double2: float, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray]): ... class AdamsBashforthIntegrator(AdamsIntegrator): + """ + public classAdamsBashforthIntegrator extends :class:`~org.hipparchus.ode.nonstiff.AdamsIntegrator` + + This class implements explicit Adams-Bashforth integrators for Ordinary Differential Equations. + + Adams-Bashforth methods (in fact due to Adams alone) are explicit multistep ODE solvers. This implementation is a + variation of the classical one: it uses adaptive stepsize to implement error control, whereas classical implementations + are fixed step size. The value of state vector at step n+1 is a simple combination of the value at step n and of the + derivatives at steps n, n-1, n-2 ... Depending on the number k of previous steps one wants to use for computing the next + value, different formulas are available: + + - k = 1: y :sub:`n+1` = y :sub:`n` + h y' :sub:`n` + - k = 2: y :sub:`n+1` = y :sub:`n` + h (3y' :sub:`n` -y' :sub:`n-1` )/2 + - k = 3: y :sub:`n+1` = y :sub:`n` + h (23y' :sub:`n` -16y' :sub:`n-1` +5y' :sub:`n-2` )/12 + - k = 4: y :sub:`n+1` = y :sub:`n` + h (55y' :sub:`n` -59y' :sub:`n-1` +37y' :sub:`n-2` -9y' :sub:`n-3` )/24 + - ... + + + A k-steps Adams-Bashforth method is of order k. + + There must be sufficient time for the :meth:`~org.hipparchus.ode.MultistepIntegrator.setStarterIntegrator` to take + several steps between the the last reset event, and the end of integration, otherwise an exception may be thrown during + integration. The user can adjust the end date of integration, or the step size of the starter integrator to ensure a + sufficient number of steps can be completed before the end of integration. + + **Implementation details** + + We define scaled derivatives s :sub:`i` (n) at step n as: \[ \left\{\begin{align} s_1(n) &= h y'_n \text{ for first + derivative}\\ s_2(n) &= \frac{h^2}{2} y_n'' \text{ for second derivative}\\ s_3(n) &= \frac{h^3}{6} y_n''' \text{ for + third derivative}\\ &\cdots\\ s_k(n) &= \frac{h^k}{k!} y_n^{(k)} \text{ for } k^\mathrm{th} \text{ derivative} + \end{align}\right. \] + + The definitions above use the classical representation with several previous first derivatives. Lets define \[ q_n = [ + s_1(n-1) s_1(n-2) \ldots s_1(n-(k-1)) ]^T \] (we omit the k index in the notation for clarity). With these definitions, + Adams-Bashforth methods can be written: + \[ \left\{\begin{align} k = 1: & y_{n+1} = y_n + s_1(n) \\ k = 2: & y_{n+1} = y_n + \frac{3}{2} s_1(n) + [ \frac{-1}{2} + ] q_n \\ k = 3: & y_{n+1} = y_n + \frac{23}{12} s_1(n) + [ \frac{-16}{12} \frac{5}{12} ] q_n \\ k = 4: & y_{n+1} = y_n + + \frac{55}{24} s_1(n) + [ \frac{-59}{24} \frac{37}{24} \frac{-9}{24} ] q_n \\ & \cdots \end{align}\right. \] + + Instead of using the classical representation with first derivatives only (y :sub:`n` , s :sub:`1` (n) and q :sub:`n` ), + our implementation uses the Nordsieck vector with higher degrees scaled derivatives all taken at the same step (y + :sub:`n` , s :sub:`1` (n) and r :sub:`n` ) where r :sub:`n` is defined as: \[ r_n = [ s_2(n), s_3(n) \ldots s_k(n) ]^T + \] (here again we omit the k index in the notation for clarity) + + Taylor series formulas show that for any index offset i, s :sub:`1` (n-i) can be computed from s :sub:`1` (n), s + :sub:`2` (n) ... s :sub:`k` (n), the formula being exact for degree k polynomials. \[ s_1(n-i) = s_1(n) + \sum_{j\gt 0} + (j+1) (-i)^j s_{j+1}(n) \] The previous formula can be used with several values for i to compute the transform between + classical representation and Nordsieck vector. The transform between r :sub:`n` and q :sub:`n` resulting from the Taylor + series formulas above is: \[ q_n = s_1(n) u + P r_n \] where u is the [ 1 1 ... 1 ] :sup:`T` vector and P is the + (k-1)×(k-1) matrix built with the \((j+1) (-i)^j\) terms with i being the row number starting from 1 and j being the + column number starting from 1: \[ P=\begin{bmatrix} -2 & 3 & -4 & 5 & \ldots \\ -4 & 12 & -32 & 80 & \ldots \\ -6 & 27 & + -108 & 405 & \ldots \\ -8 & 48 & -256 & 1280 & \ldots \\ & & \ldots\\ \end{bmatrix} \] + + Using the Nordsieck vector has several advantages: + + - it greatly simplifies step interpolation as the interpolator mainly applies Taylor series formulas, + - it simplifies step changes that occur when discrete events that truncate the step are triggered, + - it allows to extend the methods in order to support adaptive stepsize. + + + The Nordsieck vector at step n+1 is computed from the Nordsieck vector at step n as follows: + + - y :sub:`n+1` = y :sub:`n` + s :sub:`1` (n) + u :sup:`T` r :sub:`n` + - s :sub:`1` (n+1) = h f(t :sub:`n+1` , y :sub:`n+1` ) + - r :sub:`n+1` = (s :sub:`1` (n) - s :sub:`1` (n+1)) P :sup:`-1` u + P :sup:`-1` A P r :sub:`n` + + + where A is a rows shifting matrix (the lower left part is an identity matrix): + + .. code-block: java + + [ 0 0 ... 0 0 | 0 ] + [ ---------------+---] + [ 1 0 ... 0 0 | 0 ] + A = [ 0 1 ... 0 0 | 0 ] + [ ... | 0 ] + [ 0 0 ... 1 0 | 0 ] + [ 0 0 ... 0 1 | 0 ] + + + The P :sup:`-1` u vector and the P :sup:`-1` A P matrix do not depend on the state, they only depend on k and therefore + are precomputed once for all. + """ METHOD_NAME: typing.ClassVar[str] = ... + """ + public static final :class:`~org.hipparchus.ode.nonstiff.https:.docs.oracle.com.javase.8.docs.api.java.lang.String` METHOD_NAME + + Name of integration scheme. + + Also see: + + - :meth:`~constant` + + + + """ @typing.overload def __init__(self, int: int, double: float, double2: float, double3: float, double4: float): ... @typing.overload @@ -131,34 +964,400 @@ class AdamsBashforthIntegrator(AdamsIntegrator): _AdamsMoultonFieldIntegrator__T = typing.TypeVar('_AdamsMoultonFieldIntegrator__T', bound=org.hipparchus.CalculusFieldElement) # <T> class AdamsMoultonFieldIntegrator(AdamsFieldIntegrator[_AdamsMoultonFieldIntegrator__T], typing.Generic[_AdamsMoultonFieldIntegrator__T]): + """ + public classAdamsMoultonFieldIntegrator<T extends :class:`~org.hipparchus.ode.nonstiff.https:.www.hipparchus.org.hipparchus`<T>> extends :class:`~org.hipparchus.ode.nonstiff.AdamsFieldIntegrator`<T> + + This class implements implicit Adams-Moulton integrators for Ordinary Differential Equations. + + Adams-Moulton methods (in fact due to Adams alone) are implicit multistep ODE solvers. This implementation is a + variation of the classical one: it uses adaptive stepsize to implement error control, whereas classical implementations + are fixed step size. The value of state vector at step n+1 is a simple combination of the value at step n and of the + derivatives at steps n+1, n, n-1 ... Since y' :sub:`n+1` is needed to compute y :sub:`n+1` , another method must be used + to compute a first estimate of y :sub:`n+1` , then compute y' :sub:`n+1` , then compute a final estimate of y :sub:`n+1` + using the following formulas. Depending on the number k of previous steps one wants to use for computing the next value, + different formulas are available for the final estimate: + + - k = 1: y :sub:`n+1` = y :sub:`n` + h y' :sub:`n+1` + - k = 2: y :sub:`n+1` = y :sub:`n` + h (y' :sub:`n+1` +y' :sub:`n` )/2 + - k = 3: y :sub:`n+1` = y :sub:`n` + h (5y' :sub:`n+1` +8y' :sub:`n` -y' :sub:`n-1` )/12 + - k = 4: y :sub:`n+1` = y :sub:`n` + h (9y' :sub:`n+1` +19y' :sub:`n` -5y' :sub:`n-1` +y' :sub:`n-2` )/24 + - ... + + + A k-steps Adams-Moulton method is of order k+1. + + There must be sufficient time for the :meth:`~org.hipparchus.ode.MultistepFieldIntegrator.setStarterIntegrator` to take + several steps between the the last reset event, and the end of integration, otherwise an exception may be thrown during + integration. The user can adjust the end date of integration, or the step size of the starter integrator to ensure a + sufficient number of steps can be completed before the end of integration. + + **Implementation details** + + We define scaled derivatives s :sub:`i` (n) at step n as: \[ \left\{\begin{align} s_1(n) &= h y'_n \text{ for first + derivative}\\ s_2(n) &= \frac{h^2}{2} y_n'' \text{ for second derivative}\\ s_3(n) &= \frac{h^3}{6} y_n''' \text{ for + third derivative}\\ &\cdots\\ s_k(n) &= \frac{h^k}{k!} y_n^{(k)} \text{ for } k^\mathrm{th} \text{ derivative} + \end{align}\right. \] + + The definitions above use the classical representation with several previous first derivatives. Lets define \[ q_n = [ + s_1(n-1) s_1(n-2) \ldots s_1(n-(k-1)) ]^T \] (we omit the k index in the notation for clarity). With these definitions, + Adams-Moulton methods can be written: + + - k = 1: y :sub:`n+1` = y :sub:`n` + s :sub:`1` (n+1) + - k = 2: y :sub:`n+1` = y :sub:`n` + 1/2 s :sub:`1` (n+1) + [ 1/2 ] q :sub:`n+1` + - k = 3: y :sub:`n+1` = y :sub:`n` + 5/12 s :sub:`1` (n+1) + [ 8/12 -1/12 ] q :sub:`n+1` + - k = 4: y :sub:`n+1` = y :sub:`n` + 9/24 s :sub:`1` (n+1) + [ 19/24 -5/24 1/24 ] q :sub:`n+1` + - ... + + + Instead of using the classical representation with first derivatives only (y :sub:`n` , s :sub:`1` (n+1) and q + :sub:`n+1` ), our implementation uses the Nordsieck vector with higher degrees scaled derivatives all taken at the same + step (y :sub:`n` , s :sub:`1` (n) and r :sub:`n` ) where r :sub:`n` is defined as: \[ r_n = [ s_2(n), s_3(n) \ldots + s_k(n) ]^T \] (here again we omit the k index in the notation for clarity) + + Taylor series formulas show that for any index offset i, s :sub:`1` (n-i) can be computed from s :sub:`1` (n), s + :sub:`2` (n) ... s :sub:`k` (n), the formula being exact for degree k polynomials. \[ s_1(n-i) = s_1(n) + \sum_{j\gt 0} + (j+1) (-i)^j s_{j+1}(n) \] The previous formula can be used with several values for i to compute the transform between + classical representation and Nordsieck vector. The transform between r :sub:`n` and q :sub:`n` resulting from the Taylor + series formulas above is: \[ q_n = s_1(n) u + P r_n \] where u is the [ 1 1 ... 1 ] :sup:`T` vector and P is the + (k-1)×(k-1) matrix built with the \((j+1) (-i)^j\) terms with i being the row number starting from 1 and j being the + column number starting from 1: \[ P=\begin{bmatrix} -2 & 3 & -4 & 5 & \ldots \\ -4 & 12 & -32 & 80 & \ldots \\ -6 & 27 & + -108 & 405 & \ldots \\ -8 & 48 & -256 & 1280 & \ldots \\ & & \ldots\\ \end{bmatrix} \] + + Using the Nordsieck vector has several advantages: + + - it greatly simplifies step interpolation as the interpolator mainly applies Taylor series formulas, + - it simplifies step changes that occur when discrete events that truncate the step are triggered, + - it allows to extend the methods in order to support adaptive stepsize. + + + The predicted Nordsieck vector at step n+1 is computed from the Nordsieck vector at step n as follows: + + - Y :sub:`n+1` = y :sub:`n` + s :sub:`1` (n) + u :sup:`T` r :sub:`n` + - S :sub:`1` (n+1) = h f(t :sub:`n+1` , Y :sub:`n+1` ) + - R :sub:`n+1` = (s :sub:`1` (n) - S :sub:`1` (n+1)) P :sup:`-1` u + P :sup:`-1` A P r :sub:`n` + + where A is a rows shifting matrix (the lower left part is an identity matrix): + + .. code-block: java + + [ 0 0 ... 0 0 | 0 ] + [ ---------------+---] + [ 1 0 ... 0 0 | 0 ] + A = [ 0 1 ... 0 0 | 0 ] + [ ... | 0 ] + [ 0 0 ... 1 0 | 0 ] + [ 0 0 ... 0 1 | 0 ] + + From this predicted vector, the corrected vector is computed as follows: + + - y :sub:`n+1` = y :sub:`n` + S :sub:`1` (n+1) + [ -1 +1 -1 +1 ... ±1 ] r :sub:`n+1` + - s :sub:`1` (n+1) = h f(t :sub:`n+1` , y :sub:`n+1` ) + - r :sub:`n+1` = R :sub:`n+1` + (s :sub:`1` (n+1) - S :sub:`1` (n+1)) P :sup:`-1` u + + + where the upper case Y :sub:`n+1` , S :sub:`1` (n+1) and R :sub:`n+1` represent the predicted states whereas the lower + case y :sub:`n+1` , s :sub:`n+1` and r :sub:`n+1` represent the corrected states. + + The P :sup:`-1` u vector and the P :sup:`-1` A P matrix do not depend on the state, they only depend on k and therefore + are precomputed once for all. + """ METHOD_NAME: typing.ClassVar[str] = ... + """ + public static final :class:`~org.hipparchus.ode.nonstiff.https:.docs.oracle.com.javase.8.docs.api.java.lang.String` METHOD_NAME + + Name of integration scheme. + + Also see: + + - :meth:`~constant` + + + + """ @typing.overload def __init__(self, field: org.hipparchus.Field[_AdamsMoultonFieldIntegrator__T], int: int, double: float, double2: float, double3: float, double4: float): ... @typing.overload def __init__(self, field: org.hipparchus.Field[_AdamsMoultonFieldIntegrator__T], int: int, double: float, double2: float, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray]): ... class AdamsMoultonIntegrator(AdamsIntegrator): + """ + public classAdamsMoultonIntegrator extends :class:`~org.hipparchus.ode.nonstiff.AdamsIntegrator` + + This class implements implicit Adams-Moulton integrators for Ordinary Differential Equations. + + Adams-Moulton methods (in fact due to Adams alone) are implicit multistep ODE solvers. This implementation is a + variation of the classical one: it uses adaptive stepsize to implement error control, whereas classical implementations + are fixed step size. The value of state vector at step n+1 is a simple combination of the value at step n and of the + derivatives at steps n+1, n, n-1 ... Since y' :sub:`n+1` is needed to compute y :sub:`n+1` , another method must be used + to compute a first estimate of y :sub:`n+1` , then compute y' :sub:`n+1` , then compute a final estimate of y :sub:`n+1` + using the following formulas. Depending on the number k of previous steps one wants to use for computing the next value, + different formulas are available for the final estimate: + + - k = 1: y :sub:`n+1` = y :sub:`n` + h y' :sub:`n+1` + - k = 2: y :sub:`n+1` = y :sub:`n` + h (y' :sub:`n+1` +y' :sub:`n` )/2 + - k = 3: y :sub:`n+1` = y :sub:`n` + h (5y' :sub:`n+1` +8y' :sub:`n` -y' :sub:`n-1` )/12 + - k = 4: y :sub:`n+1` = y :sub:`n` + h (9y' :sub:`n+1` +19y' :sub:`n` -5y' :sub:`n-1` +y' :sub:`n-2` )/24 + - ... + + + A k-steps Adams-Moulton method is of order k+1. + + There must be sufficient time for the :meth:`~org.hipparchus.ode.MultistepIntegrator.setStarterIntegrator` to take + several steps between the the last reset event, and the end of integration, otherwise an exception may be thrown during + integration. The user can adjust the end date of integration, or the step size of the starter integrator to ensure a + sufficient number of steps can be completed before the end of integration. + + **Implementation details** + + We define scaled derivatives s :sub:`i` (n) at step n as: \[ \left\{\begin{align} s_1(n) &= h y'_n \text{ for first + derivative}\\ s_2(n) &= \frac{h^2}{2} y_n'' \text{ for second derivative}\\ s_3(n) &= \frac{h^3}{6} y_n''' \text{ for + third derivative}\\ &\cdots\\ s_k(n) &= \frac{h^k}{k!} y_n^{(k)} \text{ for } k^\mathrm{th} \text{ derivative} + \end{align}\right. \] + + The definitions above use the classical representation with several previous first derivatives. Lets define \[ q_n = [ + s_1(n-1) s_1(n-2) \ldots s_1(n-(k-1)) ]^T \] (we omit the k index in the notation for clarity). With these definitions, + Adams-Moulton methods can be written: + + - k = 1: y :sub:`n+1` = y :sub:`n` + s :sub:`1` (n+1) + - k = 2: y :sub:`n+1` = y :sub:`n` + 1/2 s :sub:`1` (n+1) + [ 1/2 ] q :sub:`n+1` + - k = 3: y :sub:`n+1` = y :sub:`n` + 5/12 s :sub:`1` (n+1) + [ 8/12 -1/12 ] q :sub:`n+1` + - k = 4: y :sub:`n+1` = y :sub:`n` + 9/24 s :sub:`1` (n+1) + [ 19/24 -5/24 1/24 ] q :sub:`n+1` + - ... + + + Instead of using the classical representation with first derivatives only (y :sub:`n` , s :sub:`1` (n+1) and q + :sub:`n+1` ), our implementation uses the Nordsieck vector with higher degrees scaled derivatives all taken at the same + step (y :sub:`n` , s :sub:`1` (n) and r :sub:`n` ) where r :sub:`n` is defined as: \[ r_n = [ s_2(n), s_3(n) \ldots + s_k(n) ]^T \] (here again we omit the k index in the notation for clarity) + + Taylor series formulas show that for any index offset i, s :sub:`1` (n-i) can be computed from s :sub:`1` (n), s + :sub:`2` (n) ... s :sub:`k` (n), the formula being exact for degree k polynomials. \[ s_1(n-i) = s_1(n) + \sum_{j\gt 0} + (j+1) (-i)^j s_{j+1}(n) \] The previous formula can be used with several values for i to compute the transform between + classical representation and Nordsieck vector. The transform between r :sub:`n` and q :sub:`n` resulting from the Taylor + series formulas above is: \[ q_n = s_1(n) u + P r_n \] where u is the [ 1 1 ... 1 ] :sup:`T` vector and P is the + (k-1)×(k-1) matrix built with the \((j+1) (-i)^j\) terms with i being the row number starting from 1 and j being the + column number starting from 1: \[ P=\begin{bmatrix} -2 & 3 & -4 & 5 & \ldots \\ -4 & 12 & -32 & 80 & \ldots \\ -6 & 27 & + -108 & 405 & \ldots \\ -8 & 48 & -256 & 1280 & \ldots \\ & & \ldots\\ \end{bmatrix} \] + + Using the Nordsieck vector has several advantages: + + - it greatly simplifies step interpolation as the interpolator mainly applies Taylor series formulas, + - it simplifies step changes that occur when discrete events that truncate the step are triggered, + - it allows to extend the methods in order to support adaptive stepsize. + + + The predicted Nordsieck vector at step n+1 is computed from the Nordsieck vector at step n as follows: + + - Y :sub:`n+1` = y :sub:`n` + s :sub:`1` (n) + u :sup:`T` r :sub:`n` + - S :sub:`1` (n+1) = h f(t :sub:`n+1` , Y :sub:`n+1` ) + - R :sub:`n+1` = (s :sub:`1` (n) - S :sub:`1` (n+1)) P :sup:`-1` u + P :sup:`-1` A P r :sub:`n` + + where A is a rows shifting matrix (the lower left part is an identity matrix): + + .. code-block: java + + [ 0 0 ... 0 0 | 0 ] + [ ---------------+---] + [ 1 0 ... 0 0 | 0 ] + A = [ 0 1 ... 0 0 | 0 ] + [ ... | 0 ] + [ 0 0 ... 1 0 | 0 ] + [ 0 0 ... 0 1 | 0 ] + + From this predicted vector, the corrected vector is computed as follows: + + - y :sub:`n+1` = y :sub:`n` + S :sub:`1` (n+1) + [ -1 +1 -1 +1 ... ±1 ] r :sub:`n+1` + - s :sub:`1` (n+1) = h f(t :sub:`n+1` , y :sub:`n+1` ) + - r :sub:`n+1` = R :sub:`n+1` + (s :sub:`1` (n+1) - S :sub:`1` (n+1)) P :sup:`-1` u + + + where the upper case Y :sub:`n+1` , S :sub:`1` (n+1) and R :sub:`n+1` represent the predicted states whereas the lower + case y :sub:`n+1` , s :sub:`n+1` and r :sub:`n+1` represent the corrected states. + + The P :sup:`-1` u vector and the P :sup:`-1` A P matrix do not depend on the state, they only depend on k and therefore + are precomputed once for all. + """ METHOD_NAME: typing.ClassVar[str] = ... + """ + public static final :class:`~org.hipparchus.ode.nonstiff.https:.docs.oracle.com.javase.8.docs.api.java.lang.String` METHOD_NAME + + Name of integration scheme. + + Also see: + + - :meth:`~constant` + + + + """ @typing.overload def __init__(self, int: int, double: float, double2: float, double3: float, double4: float): ... @typing.overload def __init__(self, int: int, double: float, double2: float, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray]): ... class ExplicitRungeKuttaIntegrator(ButcherArrayProvider, org.hipparchus.ode.ODEIntegrator): + """ + public interfaceExplicitRungeKuttaIntegratorextends :class:`~org.hipparchus.ode.nonstiff.ButcherArrayProvider`, :class:`~org.hipparchus.ode.ODEIntegrator` + + This interface implements the part of Runge-Kutta integrators for Ordinary Differential Equations common to fixed- and + adaptive steps. + + These methods are explicit Runge-Kutta methods, their Butcher arrays are as follows : + + .. code-block: java + + 0 | + c2 | a21 + c3 | a31 a32 + ... | ... + cs | as1 as2 ... ass-1 + |-------------------------- + | b1 b2 ... bs-1 bs + + + Since: + 3.1 + + Also see: + + - :class:`~org.hipparchus.ode.nonstiff.ButcherArrayProvider` + - :class:`~org.hipparchus.ode.nonstiff.RungeKuttaIntegrator` + - :class:`~org.hipparchus.ode.nonstiff.EmbeddedRungeKuttaIntegrator` + """ @staticmethod - def applyExternalButcherWeights(doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[typing.MutableSequence[float]], jpype.JArray], double3: float, doubleArray3: typing.Union[typing.List[float], jpype.JArray]) -> typing.MutableSequence[float]: ... + def applyExternalButcherWeights(doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[typing.MutableSequence[float]], jpype.JArray], double3: float, doubleArray3: typing.Union[typing.List[float], jpype.JArray]) -> typing.MutableSequence[float]: + """ + Apply external weights of Butcher array, assuming internal ones have been applied. + + Parameters: + yDotK (double[]): output of stages + y0 (double[][]): initial value of the state vector at t0 + h (double): step size + b (double[]): external weights of Butcher array + + Returns: + state vector + + + """ + ... @staticmethod - def applyInternalButcherWeights(expandableODE: org.hipparchus.ode.ExpandableODE, double: float, doubleArray: typing.Union[typing.List[float], jpype.JArray], double3: float, doubleArray2: typing.Union[typing.List[typing.MutableSequence[float]], jpype.JArray], doubleArray3: typing.Union[typing.List[float], jpype.JArray], doubleArray4: typing.Union[typing.List[typing.MutableSequence[float]], jpype.JArray]) -> None: ... - def getNumberOfStages(self) -> int: ... - def singleStep(self, ordinaryDifferentialEquation: org.hipparchus.ode.OrdinaryDifferentialEquation, double: float, doubleArray: typing.Union[typing.List[float], jpype.JArray], double3: float) -> typing.MutableSequence[float]: ... + def applyInternalButcherWeights(expandableODE: org.hipparchus.ode.ExpandableODE, double: float, doubleArray: typing.Union[typing.List[float], jpype.JArray], double3: float, doubleArray2: typing.Union[typing.List[typing.MutableSequence[float]], jpype.JArray], doubleArray3: typing.Union[typing.List[float], jpype.JArray], doubleArray4: typing.Union[typing.List[typing.MutableSequence[float]], jpype.JArray]) -> None: + """ + Apply internal weights of Butcher array, with corresponding times. + + Parameters: + equations (:class:`~org.hipparchus.ode.ExpandableODE`): differential equations to integrate + t0 (double): initial time + y0 (double[]): initial value of the state vector at t0 + h (double): step size + a (double[][]): internal weights of Butcher array + c (double[]): times of Butcher array + yDotK (double[][]): array where to store result + + + """ + ... + def getNumberOfStages(self) -> int: + """ + Getter for the number of stages corresponding to the Butcher array. + + Returns: + number of stages + + + """ + ... + def singleStep(self, ordinaryDifferentialEquation: org.hipparchus.ode.OrdinaryDifferentialEquation, double: float, doubleArray: typing.Union[typing.List[float], jpype.JArray], double3: float) -> typing.MutableSequence[float]: + """ + Fast computation of a single step of ODE integration. + + This method is intended for the limited use case of very fast computation of only one step without using any of the rich + features of general integrators that may take some time to set up (i.e. no step handlers, no events handlers, no + additional states, no interpolators, no error control, no evaluations count, no sanity checks ...). It handles the + strict minimum of computation, so it can be embedded in outer loops. + + This method is *not* used at all by the :meth:`~org.hipparchus.ode.ODEIntegrator.integrate` method. It also completely + ignores the step set at construction time, and uses only a single step to go from :code:`t0` to :code:`t`. + + As this method does not use any of the state-dependent features of the integrator, it should be reasonably thread-safe + *if and only if* the provided differential equations are themselves thread-safe. + + Parameters: + equations (:class:`~org.hipparchus.ode.OrdinaryDifferentialEquation`): differential equations to integrate + t0 (double): initial time + y0 (double[]): initial value of the state vector at t0 + t (double): target time for the integration (can be set to a value smaller than :code:`t0` for backward integration) + + Returns: + state vector at :code:`t` + + + """ + ... _FieldExplicitRungeKuttaIntegrator__T = typing.TypeVar('_FieldExplicitRungeKuttaIntegrator__T', bound=org.hipparchus.CalculusFieldElement) # <T> class FieldExplicitRungeKuttaIntegrator(FieldButcherArrayProvider[_FieldExplicitRungeKuttaIntegrator__T], org.hipparchus.ode.FieldODEIntegrator[_FieldExplicitRungeKuttaIntegrator__T], typing.Generic[_FieldExplicitRungeKuttaIntegrator__T]): + """ + public interfaceFieldExplicitRungeKuttaIntegrator<T extends :class:`~org.hipparchus.ode.nonstiff.https:.www.hipparchus.org.hipparchus`<T>>extends :class:`~org.hipparchus.ode.nonstiff.FieldButcherArrayProvider`<T>, :class:`~org.hipparchus.ode.FieldODEIntegrator`<T> + + This interface implements the part of Runge-Kutta Field integrators for Ordinary Differential Equations common to fixed- + and adaptive steps. + + These methods are explicit Runge-Kutta methods, their Butcher arrays are as follows : + + .. code-block: java + + 0 | + c2 | a21 + c3 | a31 a32 + ... | ... + cs | as1 as2 ... ass-1 + |-------------------------- + | b1 b2 ... bs-1 bs + + + Since: + 3.1 + + Also see: + + - :class:`~org.hipparchus.ode.nonstiff.FieldButcherArrayProvider` + - :class:`~org.hipparchus.ode.nonstiff.RungeKuttaFieldIntegrator` + - :class:`~org.hipparchus.ode.nonstiff.EmbeddedRungeKuttaFieldIntegrator` + """ _applyExternalButcherWeights_0__T = typing.TypeVar('_applyExternalButcherWeights_0__T', bound=org.hipparchus.CalculusFieldElement) # <T> _applyExternalButcherWeights_1__T = typing.TypeVar('_applyExternalButcherWeights_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload @staticmethod - def applyExternalButcherWeights(tArray: typing.Union[typing.List[_applyExternalButcherWeights_0__T], jpype.JArray], tArray2: typing.Union[typing.List[typing.MutableSequence[_applyExternalButcherWeights_0__T]], jpype.JArray], t3: _applyExternalButcherWeights_0__T, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> typing.MutableSequence[_applyExternalButcherWeights_0__T]: ... + def applyExternalButcherWeights(tArray: typing.Union[typing.List[_applyExternalButcherWeights_0__T], jpype.JArray], tArray2: typing.Union[typing.List[typing.MutableSequence[_applyExternalButcherWeights_0__T]], jpype.JArray], t3: _applyExternalButcherWeights_0__T, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> typing.MutableSequence[_applyExternalButcherWeights_0__T]: + """ + Apply external weights of Butcher array, assuming internal ones have been applied. + + Parameters: + yDotK (T[]): output of stages + y0 (T[][]): initial value of the state vector at t0 + h (T): step size + b (T[]): external weights of Butcher array + + Returns: + state vector + + Apply external weights of Butcher array, assuming internal ones have been applied. Version with real Butcher array + (non-Field version). + + Parameters: + yDotK (T[]): output of stages + y0 (T[][]): initial value of the state vector at t0 + h (T): step size + b (double[]): external weights of Butcher array + + Returns: + state vector + + + """ + ... @typing.overload @staticmethod def applyExternalButcherWeights(tArray: typing.Union[typing.List[_applyExternalButcherWeights_1__T], jpype.JArray], tArray2: typing.Union[typing.List[typing.MutableSequence[_applyExternalButcherWeights_1__T]], jpype.JArray], t3: _applyExternalButcherWeights_1__T, tArray3: typing.Union[typing.List[_applyExternalButcherWeights_1__T], jpype.JArray]) -> typing.MutableSequence[_applyExternalButcherWeights_1__T]: ... @@ -166,7 +1365,33 @@ class FieldExplicitRungeKuttaIntegrator(FieldButcherArrayProvider[_FieldExplicit _applyInternalButcherWeights_1__T = typing.TypeVar('_applyInternalButcherWeights_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload @staticmethod - def applyInternalButcherWeights(fieldExpandableODE: org.hipparchus.ode.FieldExpandableODE[_applyInternalButcherWeights_0__T], t: _applyInternalButcherWeights_0__T, tArray: typing.Union[typing.List[_applyInternalButcherWeights_0__T], jpype.JArray], t3: _applyInternalButcherWeights_0__T, doubleArray: typing.Union[typing.List[typing.MutableSequence[float]], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray], tArray2: typing.Union[typing.List[typing.MutableSequence[_applyInternalButcherWeights_0__T]], jpype.JArray]) -> None: ... + def applyInternalButcherWeights(fieldExpandableODE: org.hipparchus.ode.FieldExpandableODE[_applyInternalButcherWeights_0__T], t: _applyInternalButcherWeights_0__T, tArray: typing.Union[typing.List[_applyInternalButcherWeights_0__T], jpype.JArray], t3: _applyInternalButcherWeights_0__T, doubleArray: typing.Union[typing.List[typing.MutableSequence[float]], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray], tArray2: typing.Union[typing.List[typing.MutableSequence[_applyInternalButcherWeights_0__T]], jpype.JArray]) -> None: + """ + Apply internal weights of Butcher array, with corresponding times. + + Parameters: + equations (:class:`~org.hipparchus.ode.FieldExpandableODE`<T> equations): differential equations to integrate + t0 (T): initial time + y0 (T[]): initial value of the state vector at t0 + h (T): step size + a (T[][]): internal weights of Butcher array + c (T[]): times of Butcher array + yDotK (T[][]): array where to store result + + Apply internal weights of Butcher array, with corresponding times. Version with real Butcher array (non-Field). + + Parameters: + equations (:class:`~org.hipparchus.ode.FieldExpandableODE`<T> equations): differential equations to integrate + t0 (T): initial time + y0 (T[]): initial value of the state vector at t0 + h (T): step size + a (double[][]): internal weights of Butcher array + c (double[]): times of Butcher array + yDotK (T[][]): array where to store result + + + """ + ... @typing.overload @staticmethod def applyInternalButcherWeights(fieldExpandableODE: org.hipparchus.ode.FieldExpandableODE[_applyInternalButcherWeights_1__T], t: _applyInternalButcherWeights_1__T, tArray: typing.Union[typing.List[_applyInternalButcherWeights_1__T], jpype.JArray], t3: _applyInternalButcherWeights_1__T, tArray2: typing.Union[typing.List[typing.MutableSequence[_applyInternalButcherWeights_1__T]], jpype.JArray], tArray3: typing.Union[typing.List[_applyInternalButcherWeights_1__T], jpype.JArray], tArray4: typing.Union[typing.List[typing.MutableSequence[_applyInternalButcherWeights_1__T]], jpype.JArray]) -> None: ... @@ -174,19 +1399,140 @@ class FieldExplicitRungeKuttaIntegrator(FieldButcherArrayProvider[_FieldExplicit _fraction_1__T = typing.TypeVar('_fraction_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload @staticmethod - def fraction(field: org.hipparchus.Field[_fraction_0__T], double: float, double2: float) -> _fraction_0__T: ... + def fraction(field: org.hipparchus.Field[_fraction_0__T], double: float, double2: float) -> _fraction_0__T: + """ + Create a fraction from integers. + + Parameters: + field (:class:`~org.hipparchus.ode.nonstiff.https:.www.hipparchus.org.hipparchus`<T> field): field to which elements belong + p (int): numerator + q (int): denominator + + Returns: + p/q computed in the instance field + + Create a fraction from doubles. + + Parameters: + field (:class:`~org.hipparchus.ode.nonstiff.https:.www.hipparchus.org.hipparchus`<T> field): field to which elements belong + p (double): numerator + q (double): denominator + + Returns: + p/q computed in the instance field + + + """ + ... @typing.overload @staticmethod def fraction(field: org.hipparchus.Field[_fraction_1__T], int: int, int2: int) -> _fraction_1__T: ... - def getNumberOfStages(self) -> int: ... - def getRealA(self) -> typing.MutableSequence[typing.MutableSequence[float]]: ... - def getRealB(self) -> typing.MutableSequence[float]: ... - def getRealC(self) -> typing.MutableSequence[float]: ... - def isUsingFieldCoefficients(self) -> bool: ... + def getNumberOfStages(self) -> int: + """ + Getter for the number of stages corresponding to the Butcher array. + + Returns: + number of stages + + + """ + ... + def getRealA(self) -> typing.MutableSequence[typing.MutableSequence[float]]: + """ + Get the internal weights from Butcher array (without the first empty row). Real version (non-Field). + + Returns: + internal weights from Butcher array (without the first empty row) + + + """ + ... + def getRealB(self) -> typing.MutableSequence[float]: + """ + Get the external weights for the high order method from Butcher array. Real version (non-Field). + + Returns: + external weights for the high order method from Butcher array + + + """ + ... + def getRealC(self) -> typing.MutableSequence[float]: + """ + Get the time steps from Butcher array (without the first zero). Real version (non-Field). + + Returns: + time steps from Butcher array (without the first zero). + + + """ + ... + def isUsingFieldCoefficients(self) -> bool: + """ + Getter for the flag between real or Field coefficients in the Butcher array. + + Returns: + flag + + + """ + ... def singleStep(self, fieldOrdinaryDifferentialEquation: org.hipparchus.ode.FieldOrdinaryDifferentialEquation[_FieldExplicitRungeKuttaIntegrator__T], t: _FieldExplicitRungeKuttaIntegrator__T, tArray: typing.Union[typing.List[_FieldExplicitRungeKuttaIntegrator__T], jpype.JArray], t3: _FieldExplicitRungeKuttaIntegrator__T) -> typing.MutableSequence[_FieldExplicitRungeKuttaIntegrator__T]: ... class GraggBulirschStoerIntegrator(AdaptiveStepsizeIntegrator): + """ + public classGraggBulirschStoerIntegrator extends :class:`~org.hipparchus.ode.nonstiff.AdaptiveStepsizeIntegrator` + + This class implements a Gragg-Bulirsch-Stoer integrator for Ordinary Differential Equations. + + The Gragg-Bulirsch-Stoer algorithm is one of the most efficient ones currently available for smooth problems. It uses + Richardson extrapolation to estimate what would be the solution if the step size could be decreased down to zero. + + This method changes both the step size and the order during integration, in order to minimize computation cost. It is + particularly well suited when a very high precision is needed. The limit where this method becomes more efficient than + high-order embedded Runge-Kutta methods like :class:`~org.hipparchus.ode.nonstiff.DormandPrince853Integrator` depends on + the problem. Results given in the Hairer, Norsett and Wanner book show for example that this limit occurs for accuracy + around 1e-6 when integrating Saltzam-Lorenz equations (the authors note this problem is *extremely sensitive to the + errors in the first integration steps*), and around 1e-11 for a two dimensional celestial mechanics problems with seven + bodies (pleiades problem, involving quasi-collisions for which *automatic step size control is essential*). + + This implementation is basically a reimplementation in Java of the `odex + <http://www.unige.ch/math/folks/hairer/prog/nonstiff/odex.f>` fortran code by E. Hairer and G. Wanner. The + redistribution policy for this code is available `here <http://www.unige.ch/~hairer/prog/licence.txt>`, for convenience, + it is reproduced below. + + Copyright (c) 2004, Ernst Hairer + + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the + following conditions are met: + + - Redistributions of source code must retain the above copyright notice, this list of conditions and the following + disclaimer. + - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the distribution. + + + **THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.** + """ METHOD_NAME: typing.ClassVar[str] = ... + """ + public static final :class:`~org.hipparchus.ode.nonstiff.https:.docs.oracle.com.javase.8.docs.api.java.lang.String` METHOD_NAME + + Name of integration scheme. + + Also see: + + - :meth:`~constant` + + + + """ @typing.overload def __init__(self, double: float, double2: float, double3: float, double4: float): ... @typing.overload @@ -195,48 +1541,463 @@ class GraggBulirschStoerIntegrator(AdaptiveStepsizeIntegrator): def integrate(self, ordinaryDifferentialEquation: org.hipparchus.ode.OrdinaryDifferentialEquation, oDEState: org.hipparchus.ode.ODEState, double: float) -> org.hipparchus.ode.ODEStateAndDerivative: ... @typing.overload def integrate(self, expandableODE: org.hipparchus.ode.ExpandableODE, oDEState: org.hipparchus.ode.ODEState, double: float) -> org.hipparchus.ode.ODEStateAndDerivative: ... - def setControlFactors(self, double: float, double2: float, double3: float, double4: float) -> None: ... - def setInterpolationControl(self, boolean: bool, int: int) -> None: ... - def setOrderControl(self, int: int, double: float, double2: float) -> None: ... - def setStabilityCheck(self, boolean: bool, int: int, int2: int, double: float) -> None: ... + def setControlFactors(self, double: float, double2: float, double3: float, double4: float) -> None: + """ + Set the step size control factors. + + The new step size hNew is computed from the old one h by: + + .. code-block: java + + hNew = h * stepControl2 / (err/stepControl1)^(1/(2k + 1)) + + + where err is the scaled error and k the iteration number of the extrapolation scheme (counting from 0). The default + values are 0.65 for stepControl1 and 0.94 for stepControl2. + + The step size is subject to the restriction: + + .. code-block: java + + stepControl3^(1/(2k + 1))/stepControl4 <= hNew/h <= 1/stepControl3^(1/(2k + 1)) + + + The default values are 0.02 for stepControl3 and 4.0 for stepControl4. + + Parameters: + control1 (double): first stepsize control factor (the factor is reset to default if lower than 0.0001 or greater than 0.9999) + control2 (double): second stepsize control factor (the factor is reset to default if lower than 0.0001 or greater than 0.9999) + control3 (double): third stepsize control factor (the factor is reset to default if lower than 0.0001 or greater than 0.9999) + control4 (double): fourth stepsize control factor (the factor is reset to default if lower than 1.0001 or greater than 999.9) + + + """ + ... + def setInterpolationControl(self, boolean: bool, int: int) -> None: + """ + Set the interpolation order control parameter. The interpolation order for dense output is 2k - mudif + 1. The default + value for mudif is 4 and the interpolation error is used in stepsize control by default. + + Parameters: + useInterpolationErrorForControl (boolean): if true, interpolation error is used for stepsize control + mudifControlParameter (int): interpolation order control parameter (the parameter is reset to default if <= 0 or >= 7) + + + """ + ... + def setOrderControl(self, int: int, double: float, double2: float) -> None: + """ + Set the order control parameters. + + The Gragg-Bulirsch-Stoer method changes both the step size and the order during integration, in order to minimize + computation cost. Each extrapolation step increases the order by 2, so the maximal order that will be used is always + even, it is twice the maximal number of columns in the extrapolation table. + + .. code-block: java + + order is decreased if w(k - 1) <= w(k) * orderControl1 + order is increased if w(k) <= w(k - 1) * orderControl2 + + + where w is the table of work per unit step for each order (number of function calls divided by the step length), and k + is the current order. + + The default maximal order after construction is 18 (i.e. the maximal number of columns is 9). The default values are 0.8 + for orderControl1 and 0.9 for orderControl2. + + Parameters: + maximalOrder (int): maximal order in the extrapolation table (the maximal order is reset to default if order <= 6 or odd) + control1 (double): first order control factor (the factor is reset to default if lower than 0.0001 or greater than 0.9999) + control2 (double): second order control factor (the factor is reset to default if lower than 0.0001 or greater than 0.9999) + + + """ + ... + def setStabilityCheck(self, boolean: bool, int: int, int2: int, double: float) -> None: + """ + Set the stability check controls. + + The stability check is performed on the first few iterations of the extrapolation scheme. If this test fails, the step + is rejected and the stepsize is reduced. + + By default, the test is performed, at most during two iterations at each step, and at most once for each of these + iterations. The default stepsize reduction factor is 0.5. + + Parameters: + performStabilityCheck (boolean): if true, stability check will be performed, if false, the check will be skipped + maxNumIter (int): maximal number of iterations for which checks are performed (the number of iterations is reset to default if negative or + null) + maxNumChecks (int): maximal number of checks for each iteration (the number of checks is reset to default if negative or null) + stepsizeReductionFactor (double): stepsize reduction factor in case of failure (the factor is reset to default if lower than 0.0001 or greater than + 0.9999) + + + """ + ... _EmbeddedRungeKuttaFieldIntegrator__T = typing.TypeVar('_EmbeddedRungeKuttaFieldIntegrator__T', bound=org.hipparchus.CalculusFieldElement) # <T> class EmbeddedRungeKuttaFieldIntegrator(AdaptiveStepsizeFieldIntegrator[_EmbeddedRungeKuttaFieldIntegrator__T], FieldExplicitRungeKuttaIntegrator[_EmbeddedRungeKuttaFieldIntegrator__T], typing.Generic[_EmbeddedRungeKuttaFieldIntegrator__T]): - def getMaxGrowth(self) -> _EmbeddedRungeKuttaFieldIntegrator__T: ... - def getMinReduction(self) -> _EmbeddedRungeKuttaFieldIntegrator__T: ... - def getNumberOfStages(self) -> int: ... - def getOrder(self) -> int: ... - def getSafety(self) -> _EmbeddedRungeKuttaFieldIntegrator__T: ... + """ + public abstract classEmbeddedRungeKuttaFieldIntegrator<T extends :class:`~org.hipparchus.ode.nonstiff.https:.www.hipparchus.org.hipparchus`<T>> extends :class:`~org.hipparchus.ode.nonstiff.AdaptiveStepsizeFieldIntegrator`<T> + implements :class:`~org.hipparchus.ode.nonstiff.FieldExplicitRungeKuttaIntegrator`<T> + + This class implements the common part of all embedded Runge-Kutta integrators for Ordinary Differential Equations. + + These methods are embedded explicit Runge-Kutta methods with two sets of coefficients allowing to estimate the error, + their Butcher arrays are as follows : + + .. code-block: java + + 0 | + c2 | a21 + c3 | a31 a32 + ... | ... + cs | as1 as2 ... ass-1 + |-------------------------- + | b1 b2 ... bs-1 bs + | b'1 b'2 ... b's-1 b's + + + In fact, we rather use the array defined by ej = bj - b'j to compute directly the error rather than computing two + estimates and then comparing them. + + Some methods are qualified as *fsal* (first same as last) methods. This means the last evaluation of the derivatives in + one step is the same as the first in the next step. Then, this evaluation can be reused from one step to the next one + and the cost of such a method is really s-1 evaluations despite the method still has s stages. This behaviour is true + only for successful steps, if the step is rejected after the error estimation phase, no evaluation is saved. For an + *fsal* method, we have cs = 1 and asi = bi for all i. + """ + def getMaxGrowth(self) -> _EmbeddedRungeKuttaFieldIntegrator__T: + """ + Get the maximal growth factor for stepsize control. + + Returns: + maximal growth factor + + + """ + ... + def getMinReduction(self) -> _EmbeddedRungeKuttaFieldIntegrator__T: + """ + Get the minimal reduction factor for stepsize control. + + Returns: + minimal reduction factor + + + """ + ... + def getNumberOfStages(self) -> int: + """ + Getter for the number of stages corresponding to the Butcher array. + + Specified by: + :meth:`~org.hipparchus.ode.nonstiff.FieldExplicitRungeKuttaIntegrator.getNumberOfStages` in + interface :class:`~org.hipparchus.ode.nonstiff.FieldExplicitRungeKuttaIntegrator` + + Returns: + number of stages + + + """ + ... + def getOrder(self) -> int: + """ + Get the order of the method. + + Returns: + order of the method + + + """ + ... + def getSafety(self) -> _EmbeddedRungeKuttaFieldIntegrator__T: + """ + Get the safety factor for stepsize control. + + Returns: + safety factor + + + """ + ... def integrate(self, fieldExpandableODE: org.hipparchus.ode.FieldExpandableODE[_EmbeddedRungeKuttaFieldIntegrator__T], fieldODEState: org.hipparchus.ode.FieldODEState[_EmbeddedRungeKuttaFieldIntegrator__T], t: _EmbeddedRungeKuttaFieldIntegrator__T) -> org.hipparchus.ode.FieldODEStateAndDerivative[_EmbeddedRungeKuttaFieldIntegrator__T]: ... - def isUsingFieldCoefficients(self) -> bool: ... - def setMaxGrowth(self, t: _EmbeddedRungeKuttaFieldIntegrator__T) -> None: ... - def setMinReduction(self, t: _EmbeddedRungeKuttaFieldIntegrator__T) -> None: ... - def setSafety(self, t: _EmbeddedRungeKuttaFieldIntegrator__T) -> None: ... - def setUsingFieldCoefficients(self, boolean: bool) -> None: ... + def isUsingFieldCoefficients(self) -> bool: + """ + Getter for the flag between real or Field coefficients in the Butcher array. + + Specified by: + :meth:`~org.hipparchus.ode.nonstiff.FieldExplicitRungeKuttaIntegrator.isUsingFieldCoefficients` in + interface :class:`~org.hipparchus.ode.nonstiff.FieldExplicitRungeKuttaIntegrator` + + Returns: + flag + + + """ + ... + def setMaxGrowth(self, t: _EmbeddedRungeKuttaFieldIntegrator__T) -> None: + """ + Set the maximal growth factor for stepsize control. + + Parameters: + maxGrowth (:class:`~org.hipparchus.ode.nonstiff.EmbeddedRungeKuttaFieldIntegrator`): maximal growth factor + + + """ + ... + def setMinReduction(self, t: _EmbeddedRungeKuttaFieldIntegrator__T) -> None: + """ + Set the minimal reduction factor for stepsize control. + + Parameters: + minReduction (:class:`~org.hipparchus.ode.nonstiff.EmbeddedRungeKuttaFieldIntegrator`): minimal reduction factor + + + """ + ... + def setSafety(self, t: _EmbeddedRungeKuttaFieldIntegrator__T) -> None: + """ + Set the safety factor for stepsize control. + + Parameters: + safety (:class:`~org.hipparchus.ode.nonstiff.EmbeddedRungeKuttaFieldIntegrator`): safety factor + + + """ + ... + def setUsingFieldCoefficients(self, boolean: bool) -> None: + """ + Setter for the flag between real or Field coefficients in the Butcher array. + + Parameters: + usingFieldCoefficients (boolean): new value for flag + + + """ + ... class EmbeddedRungeKuttaIntegrator(AdaptiveStepsizeIntegrator, ExplicitRungeKuttaIntegrator): - def getMaxGrowth(self) -> float: ... - def getMinReduction(self) -> float: ... - def getOrder(self) -> int: ... - def getSafety(self) -> float: ... + """ + public abstract classEmbeddedRungeKuttaIntegrator extends :class:`~org.hipparchus.ode.nonstiff.AdaptiveStepsizeIntegrator` + implements :class:`~org.hipparchus.ode.nonstiff.ExplicitRungeKuttaIntegrator` + + This class implements the common part of all embedded Runge-Kutta integrators for Ordinary Differential Equations. + + These methods are embedded explicit Runge-Kutta methods with two sets of coefficients allowing to estimate the error, + their Butcher arrays are as follows : + + .. code-block: java + + 0 | + c2 | a21 + c3 | a31 a32 + ... | ... + cs | as1 as2 ... ass-1 + |-------------------------- + | b1 b2 ... bs-1 bs + | b'1 b'2 ... b's-1 b's + + + In fact, we rather use the array defined by ej = bj - b'j to compute directly the error rather than computing two + estimates and then comparing them. + + Some methods are qualified as *fsal* (first same as last) methods. This means the last evaluation of the derivatives in + one step is the same as the first in the next step. Then, this evaluation can be reused from one step to the next one + and the cost of such a method is really s-1 evaluations despite the method still has s stages. This behaviour is true + only for successful steps, if the step is rejected after the error estimation phase, no evaluation is saved. For an + *fsal* method, we have cs = 1 and asi = bi for all i. + """ + def getMaxGrowth(self) -> float: + """ + Get the maximal growth factor for stepsize control. + + Returns: + maximal growth factor + + + """ + ... + def getMinReduction(self) -> float: + """ + Get the minimal reduction factor for stepsize control. + + Returns: + minimal reduction factor + + + """ + ... + def getOrder(self) -> int: + """ + Get the order of the method. + + Returns: + order of the method + + + """ + ... + def getSafety(self) -> float: + """ + Get the safety factor for stepsize control. + + Returns: + safety factor + + + """ + ... @typing.overload def integrate(self, ordinaryDifferentialEquation: org.hipparchus.ode.OrdinaryDifferentialEquation, oDEState: org.hipparchus.ode.ODEState, double: float) -> org.hipparchus.ode.ODEStateAndDerivative: ... @typing.overload def integrate(self, expandableODE: org.hipparchus.ode.ExpandableODE, oDEState: org.hipparchus.ode.ODEState, double: float) -> org.hipparchus.ode.ODEStateAndDerivative: ... - def setMaxGrowth(self, double: float) -> None: ... - def setMinReduction(self, double: float) -> None: ... - def setSafety(self, double: float) -> None: ... + def setMaxGrowth(self, double: float) -> None: + """ + Set the maximal growth factor for stepsize control. + + Parameters: + maxGrowth (double): maximal growth factor + + + """ + ... + def setMinReduction(self, double: float) -> None: + """ + Set the minimal reduction factor for stepsize control. + + Parameters: + minReduction (double): minimal reduction factor + + + """ + ... + def setSafety(self, double: float) -> None: + """ + Set the safety factor for stepsize control. + + Parameters: + safety (double): safety factor + + + """ + ... _RungeKuttaFieldIntegrator__T = typing.TypeVar('_RungeKuttaFieldIntegrator__T', bound=org.hipparchus.CalculusFieldElement) # <T> class RungeKuttaFieldIntegrator(org.hipparchus.ode.AbstractFieldIntegrator[_RungeKuttaFieldIntegrator__T], FieldExplicitRungeKuttaIntegrator[_RungeKuttaFieldIntegrator__T], typing.Generic[_RungeKuttaFieldIntegrator__T]): - def getDefaultStep(self) -> _RungeKuttaFieldIntegrator__T: ... - def getNumberOfStages(self) -> int: ... + """ + public abstract classRungeKuttaFieldIntegrator<T extends :class:`~org.hipparchus.ode.nonstiff.https:.www.hipparchus.org.hipparchus`<T>> extends :class:`~org.hipparchus.ode.AbstractFieldIntegrator`<T> + implements :class:`~org.hipparchus.ode.nonstiff.FieldExplicitRungeKuttaIntegrator`<T> + + This class implements the common part of all fixed step Runge-Kutta integrators for Ordinary Differential Equations. + + These methods are explicit Runge-Kutta methods, their Butcher arrays are as follows : + + .. code-block: java + + 0 | + c2 | a21 + c3 | a31 a32 + ... | ... + cs | as1 as2 ... ass-1 + |-------------------------- + | b1 b2 ... bs-1 bs + + + Also see: + + - :class:`~org.hipparchus.ode.nonstiff.EulerFieldIntegrator` + - :class:`~org.hipparchus.ode.nonstiff.ClassicalRungeKuttaFieldIntegrator` + - :class:`~org.hipparchus.ode.nonstiff.GillFieldIntegrator` + - :class:`~org.hipparchus.ode.nonstiff.MidpointFieldIntegrator` + """ + def getDefaultStep(self) -> _RungeKuttaFieldIntegrator__T: + """ + Getter for the default, positive step-size assigned at constructor level. + + Returns: + step + + + """ + ... + def getNumberOfStages(self) -> int: + """ + Getter for the number of stages corresponding to the Butcher array. + + Specified by: + :meth:`~org.hipparchus.ode.nonstiff.FieldExplicitRungeKuttaIntegrator.getNumberOfStages` in + interface :class:`~org.hipparchus.ode.nonstiff.FieldExplicitRungeKuttaIntegrator` + + Returns: + number of stages + + + """ + ... def integrate(self, fieldExpandableODE: org.hipparchus.ode.FieldExpandableODE[_RungeKuttaFieldIntegrator__T], fieldODEState: org.hipparchus.ode.FieldODEState[_RungeKuttaFieldIntegrator__T], t: _RungeKuttaFieldIntegrator__T) -> org.hipparchus.ode.FieldODEStateAndDerivative[_RungeKuttaFieldIntegrator__T]: ... - def isUsingFieldCoefficients(self) -> bool: ... - def setUsingFieldCoefficients(self, boolean: bool) -> None: ... + def isUsingFieldCoefficients(self) -> bool: + """ + Getter for the flag between real or Field coefficients in the Butcher array. + + Specified by: + :meth:`~org.hipparchus.ode.nonstiff.FieldExplicitRungeKuttaIntegrator.isUsingFieldCoefficients` in + interface :class:`~org.hipparchus.ode.nonstiff.FieldExplicitRungeKuttaIntegrator` + + Returns: + flag + + + """ + ... + def setUsingFieldCoefficients(self, boolean: bool) -> None: + """ + Setter for the flag between real or Field coefficients in the Butcher array. + + Parameters: + usingFieldCoefficients (boolean): new value for flag + + + """ + ... class RungeKuttaIntegrator(org.hipparchus.ode.AbstractIntegrator, ExplicitRungeKuttaIntegrator): - def getDefaultStep(self) -> float: ... + """ + public abstract classRungeKuttaIntegrator extends :class:`~org.hipparchus.ode.AbstractIntegrator` + implements :class:`~org.hipparchus.ode.nonstiff.ExplicitRungeKuttaIntegrator` + + This class implements the common part of all fixed step Runge-Kutta integrators for Ordinary Differential Equations. + + These methods are explicit Runge-Kutta methods, their Butcher arrays are as follows : + + .. code-block: java + + 0 | + c2 | a21 + c3 | a31 a32 + ... | ... + cs | as1 as2 ... ass-1 + |-------------------------- + | b1 b2 ... bs-1 bs + + + Also see: + + - :class:`~org.hipparchus.ode.nonstiff.EulerIntegrator` + - :class:`~org.hipparchus.ode.nonstiff.ClassicalRungeKuttaIntegrator` + - :class:`~org.hipparchus.ode.nonstiff.GillIntegrator` + - :class:`~org.hipparchus.ode.nonstiff.MidpointIntegrator` + """ + def getDefaultStep(self) -> float: + """ + Getter for the default, positive step-size assigned at constructor level. + + Returns: + step + + + """ + ... @typing.overload def integrate(self, ordinaryDifferentialEquation: org.hipparchus.ode.OrdinaryDifferentialEquation, oDEState: org.hipparchus.ode.ODEState, double: float) -> org.hipparchus.ode.ODEStateAndDerivative: ... @typing.overload @@ -244,162 +2005,1358 @@ class RungeKuttaIntegrator(org.hipparchus.ode.AbstractIntegrator, ExplicitRungeK _ClassicalRungeKuttaFieldIntegrator__T = typing.TypeVar('_ClassicalRungeKuttaFieldIntegrator__T', bound=org.hipparchus.CalculusFieldElement) # <T> class ClassicalRungeKuttaFieldIntegrator(RungeKuttaFieldIntegrator[_ClassicalRungeKuttaFieldIntegrator__T], typing.Generic[_ClassicalRungeKuttaFieldIntegrator__T]): + """ + public classClassicalRungeKuttaFieldIntegrator<T extends :class:`~org.hipparchus.ode.nonstiff.https:.www.hipparchus.org.hipparchus`<T>> extends :class:`~org.hipparchus.ode.nonstiff.RungeKuttaFieldIntegrator`<T> + + This class implements the classical fourth order Runge-Kutta integrator for Ordinary Differential Equations (it is the + most often used Runge-Kutta method). + + This method is an explicit Runge-Kutta method, its Butcher-array is the following one : + + .. code-block: java + + 0 | 0 0 0 0 + 1/2 | 1/2 0 0 0 + 1/2 | 0 1/2 0 0 + 1 | 0 0 1 0 + |-------------------- + | 1/6 1/3 1/3 1/6 + + + Also see: + + - :class:`~org.hipparchus.ode.nonstiff.EulerFieldIntegrator` + - :class:`~org.hipparchus.ode.nonstiff.GillFieldIntegrator` + - :class:`~org.hipparchus.ode.nonstiff.MidpointFieldIntegrator` + - :class:`~org.hipparchus.ode.nonstiff.ThreeEighthesFieldIntegrator` + - :class:`~org.hipparchus.ode.nonstiff.LutherFieldIntegrator` + """ METHOD_NAME: typing.ClassVar[str] = ... + """ + public static final :class:`~org.hipparchus.ode.nonstiff.https:.docs.oracle.com.javase.8.docs.api.java.lang.String` METHOD_NAME + + Name of integration scheme. + + Also see: + + - :meth:`~constant` + + + + """ def __init__(self, field: org.hipparchus.Field[_ClassicalRungeKuttaFieldIntegrator__T], t: _ClassicalRungeKuttaFieldIntegrator__T): ... - def getA(self) -> typing.MutableSequence[typing.MutableSequence[_ClassicalRungeKuttaFieldIntegrator__T]]: ... - def getB(self) -> typing.MutableSequence[_ClassicalRungeKuttaFieldIntegrator__T]: ... - def getC(self) -> typing.MutableSequence[_ClassicalRungeKuttaFieldIntegrator__T]: ... + def getA(self) -> typing.MutableSequence[typing.MutableSequence[_ClassicalRungeKuttaFieldIntegrator__T]]: + """ + Get the internal weights from Butcher array (without the first empty row). + + Returns: + internal weights from Butcher array (without the first empty row) + + + """ + ... + def getB(self) -> typing.MutableSequence[_ClassicalRungeKuttaFieldIntegrator__T]: + """ + Get the external weights for the high order method from Butcher array. + + Returns: + external weights for the high order method from Butcher array + + + """ + ... + def getC(self) -> typing.MutableSequence[_ClassicalRungeKuttaFieldIntegrator__T]: + """ + Get the time steps from Butcher array (without the first zero). + + Returns: + time steps from Butcher array (without the first zero + + + """ + ... class ClassicalRungeKuttaIntegrator(RungeKuttaIntegrator): + """ + public classClassicalRungeKuttaIntegrator extends :class:`~org.hipparchus.ode.nonstiff.RungeKuttaIntegrator` + + This class implements the classical fourth order Runge-Kutta integrator for Ordinary Differential Equations (it is the + most often used Runge-Kutta method). + + This method is an explicit Runge-Kutta method, its Butcher-array is the following one : + + .. code-block: java + + 0 | 0 0 0 0 + 1/2 | 1/2 0 0 0 + 1/2 | 0 1/2 0 0 + 1 | 0 0 1 0 + |-------------------- + | 1/6 1/3 1/3 1/6 + + + Also see: + + - :class:`~org.hipparchus.ode.nonstiff.EulerIntegrator` + - :class:`~org.hipparchus.ode.nonstiff.GillIntegrator` + - :class:`~org.hipparchus.ode.nonstiff.MidpointIntegrator` + - :class:`~org.hipparchus.ode.nonstiff.ThreeEighthesIntegrator` + - :class:`~org.hipparchus.ode.nonstiff.LutherIntegrator` + """ METHOD_NAME: typing.ClassVar[str] = ... + """ + public static final :class:`~org.hipparchus.ode.nonstiff.https:.docs.oracle.com.javase.8.docs.api.java.lang.String` METHOD_NAME + + Name of integration scheme. + + Also see: + + - :meth:`~constant` + + + + """ def __init__(self, double: float): ... - def getA(self) -> typing.MutableSequence[typing.MutableSequence[float]]: ... - def getB(self) -> typing.MutableSequence[float]: ... - def getC(self) -> typing.MutableSequence[float]: ... + def getA(self) -> typing.MutableSequence[typing.MutableSequence[float]]: + """ + Get the internal weights from Butcher array (without the first empty row). + + Returns: + internal weights from Butcher array (without the first empty row) + + + """ + ... + def getB(self) -> typing.MutableSequence[float]: + """ + Get the external weights for the high order method from Butcher array. + + Returns: + external weights for the high order method from Butcher array + + + """ + ... + def getC(self) -> typing.MutableSequence[float]: + """ + Get the time steps from Butcher array (without the first zero). + + Returns: + time steps from Butcher array (without the first zero + + + """ + ... _DormandPrince54FieldIntegrator__T = typing.TypeVar('_DormandPrince54FieldIntegrator__T', bound=org.hipparchus.CalculusFieldElement) # <T> class DormandPrince54FieldIntegrator(EmbeddedRungeKuttaFieldIntegrator[_DormandPrince54FieldIntegrator__T], typing.Generic[_DormandPrince54FieldIntegrator__T]): + """ + public classDormandPrince54FieldIntegrator<T extends :class:`~org.hipparchus.ode.nonstiff.https:.www.hipparchus.org.hipparchus`<T>> extends :class:`~org.hipparchus.ode.nonstiff.EmbeddedRungeKuttaFieldIntegrator`<T> + + This class implements the 5(4) Dormand-Prince integrator for Ordinary Differential Equations. + + This integrator is an embedded Runge-Kutta integrator of order 5(4) used in local extrapolation mode (i.e. the solution + is computed using the high order formula) with stepsize control (and automatic step initialization) and continuous + output. This method uses 7 functions evaluations per step. However, since this is an *fsal*, the last evaluation of one + step is the same as the first evaluation of the next step and hence can be avoided. So the cost is really 6 functions + evaluations per step. + + This method has been published (whithout the continuous output that was added by Shampine in 1986) in the following + article : + + .. code-block: java + + A family of embedded Runge-Kutta formulae + J. R. Dormand and P. J. Prince + Journal of Computational and Applied Mathematics + volume 6, no 1, 1980, pp. 19-26 + """ METHOD_NAME: typing.ClassVar[str] = ... + """ + public static final :class:`~org.hipparchus.ode.nonstiff.https:.docs.oracle.com.javase.8.docs.api.java.lang.String` METHOD_NAME + + Name of integration scheme. + + Also see: + + - :meth:`~constant` + + + + """ @typing.overload def __init__(self, field: org.hipparchus.Field[_DormandPrince54FieldIntegrator__T], double: float, double2: float, double3: float, double4: float): ... @typing.overload def __init__(self, field: org.hipparchus.Field[_DormandPrince54FieldIntegrator__T], double: float, double2: float, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray]): ... - def getA(self) -> typing.MutableSequence[typing.MutableSequence[_DormandPrince54FieldIntegrator__T]]: ... - def getB(self) -> typing.MutableSequence[_DormandPrince54FieldIntegrator__T]: ... - def getC(self) -> typing.MutableSequence[_DormandPrince54FieldIntegrator__T]: ... - def getOrder(self) -> int: ... + def getA(self) -> typing.MutableSequence[typing.MutableSequence[_DormandPrince54FieldIntegrator__T]]: + """ + Get the internal weights from Butcher array (without the first empty row). + + Returns: + internal weights from Butcher array (without the first empty row) + + + """ + ... + def getB(self) -> typing.MutableSequence[_DormandPrince54FieldIntegrator__T]: + """ + Get the external weights for the high order method from Butcher array. + + Returns: + external weights for the high order method from Butcher array + + + """ + ... + def getC(self) -> typing.MutableSequence[_DormandPrince54FieldIntegrator__T]: + """ + Get the time steps from Butcher array (without the first zero). + + Returns: + time steps from Butcher array (without the first zero + + + """ + ... + def getOrder(self) -> int: + """ + Get the order of the method. + + Specified by: + :meth:`~org.hipparchus.ode.nonstiff.EmbeddedRungeKuttaFieldIntegrator.getOrder` in + class :class:`~org.hipparchus.ode.nonstiff.EmbeddedRungeKuttaFieldIntegrator` + + Returns: + order of the method + + + """ + ... class DormandPrince54Integrator(EmbeddedRungeKuttaIntegrator): + """ + public classDormandPrince54Integrator extends :class:`~org.hipparchus.ode.nonstiff.EmbeddedRungeKuttaIntegrator` + + This class implements the 5(4) Dormand-Prince integrator for Ordinary Differential Equations. + + This integrator is an embedded Runge-Kutta integrator of order 5(4) used in local extrapolation mode (i.e. the solution + is computed using the high order formula) with stepsize control (and automatic step initialization) and continuous + output. This method uses 7 functions evaluations per step. However, since this is an *fsal*, the last evaluation of one + step is the same as the first evaluation of the next step and hence can be avoided. So the cost is really 6 functions + evaluations per step. + + This method has been published (whithout the continuous output that was added by Shampine in 1986) in the following + article : + + .. code-block: java + + A family of embedded Runge-Kutta formulae + J. R. Dormand and P. J. Prince + Journal of Computational and Applied Mathematics + volume 6, no 1, 1980, pp. 19-26 + """ METHOD_NAME: typing.ClassVar[str] = ... + """ + public static final :class:`~org.hipparchus.ode.nonstiff.https:.docs.oracle.com.javase.8.docs.api.java.lang.String` METHOD_NAME + + Name of integration scheme. + + Also see: + + - :meth:`~constant` + + + + """ @typing.overload def __init__(self, double: float, double2: float, double3: float, double4: float): ... @typing.overload def __init__(self, double: float, double2: float, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray]): ... - def getA(self) -> typing.MutableSequence[typing.MutableSequence[float]]: ... - def getB(self) -> typing.MutableSequence[float]: ... - def getC(self) -> typing.MutableSequence[float]: ... - def getOrder(self) -> int: ... + def getA(self) -> typing.MutableSequence[typing.MutableSequence[float]]: + """ + Get the internal weights from Butcher array (without the first empty row). + + Returns: + internal weights from Butcher array (without the first empty row) + + + """ + ... + def getB(self) -> typing.MutableSequence[float]: + """ + Get the external weights for the high order method from Butcher array. + + Returns: + external weights for the high order method from Butcher array + + + """ + ... + def getC(self) -> typing.MutableSequence[float]: + """ + Get the time steps from Butcher array (without the first zero). + + Returns: + time steps from Butcher array (without the first zero + + + """ + ... + def getOrder(self) -> int: + """ + Get the order of the method. + + Specified by: + :meth:`~org.hipparchus.ode.nonstiff.EmbeddedRungeKuttaIntegrator.getOrder` in + class :class:`~org.hipparchus.ode.nonstiff.EmbeddedRungeKuttaIntegrator` + + Returns: + order of the method + + + """ + ... _DormandPrince853FieldIntegrator__T = typing.TypeVar('_DormandPrince853FieldIntegrator__T', bound=org.hipparchus.CalculusFieldElement) # <T> class DormandPrince853FieldIntegrator(EmbeddedRungeKuttaFieldIntegrator[_DormandPrince853FieldIntegrator__T], typing.Generic[_DormandPrince853FieldIntegrator__T]): + """ + public classDormandPrince853FieldIntegrator<T extends :class:`~org.hipparchus.ode.nonstiff.https:.www.hipparchus.org.hipparchus`<T>> extends :class:`~org.hipparchus.ode.nonstiff.EmbeddedRungeKuttaFieldIntegrator`<T> + + This class implements the 8(5,3) Dormand-Prince integrator for Ordinary Differential Equations. + + This integrator is an embedded Runge-Kutta integrator of order 8(5,3) used in local extrapolation mode (i.e. the + solution is computed using the high order formula) with stepsize control (and automatic step initialization) and + continuous output. This method uses 12 functions evaluations per step for integration and 4 evaluations for + interpolation. However, since the first interpolation evaluation is the same as the first integration evaluation of the + next step, we have included it in the integrator rather than in the interpolator and specified the method was an *fsal*. + Hence, despite we have 13 stages here, the cost is really 12 evaluations per step even if no interpolation is done, and + the overcost of interpolation is only 3 evaluations. + + This method is based on an 8(6) method by Dormand and Prince (i.e. order 8 for the integration and order 6 for error + estimation) modified by Hairer and Wanner to use a 5th order error estimator with 3rd order correction. This + modification was introduced because the original method failed in some cases (wrong steps can be accepted when step size + is too large, for example in the Brusselator problem) and also had *severe difficulties when applied to problems with + discontinuities*. This modification is explained in the second edition of the first volume (Nonstiff Problems) of the + reference book by Hairer, Norsett and Wanner: *Solving Ordinary Differential Equations* (Springer-Verlag, ISBN + 3-540-56670-8). + """ METHOD_NAME: typing.ClassVar[str] = ... + """ + public static final :class:`~org.hipparchus.ode.nonstiff.https:.docs.oracle.com.javase.8.docs.api.java.lang.String` METHOD_NAME + + Name of integration scheme. + + Also see: + + - :meth:`~constant` + + + + """ @typing.overload def __init__(self, field: org.hipparchus.Field[_DormandPrince853FieldIntegrator__T], double: float, double2: float, double3: float, double4: float): ... @typing.overload def __init__(self, field: org.hipparchus.Field[_DormandPrince853FieldIntegrator__T], double: float, double2: float, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray]): ... - def getA(self) -> typing.MutableSequence[typing.MutableSequence[_DormandPrince853FieldIntegrator__T]]: ... - def getB(self) -> typing.MutableSequence[_DormandPrince853FieldIntegrator__T]: ... - def getC(self) -> typing.MutableSequence[_DormandPrince853FieldIntegrator__T]: ... - def getOrder(self) -> int: ... + def getA(self) -> typing.MutableSequence[typing.MutableSequence[_DormandPrince853FieldIntegrator__T]]: + """ + Get the internal weights from Butcher array (without the first empty row). + + Returns: + internal weights from Butcher array (without the first empty row) + + + """ + ... + def getB(self) -> typing.MutableSequence[_DormandPrince853FieldIntegrator__T]: + """ + Get the external weights for the high order method from Butcher array. + + Returns: + external weights for the high order method from Butcher array + + + """ + ... + def getC(self) -> typing.MutableSequence[_DormandPrince853FieldIntegrator__T]: + """ + Get the time steps from Butcher array (without the first zero). + + Returns: + time steps from Butcher array (without the first zero + + + """ + ... + def getOrder(self) -> int: + """ + Get the order of the method. + + Specified by: + :meth:`~org.hipparchus.ode.nonstiff.EmbeddedRungeKuttaFieldIntegrator.getOrder` in + class :class:`~org.hipparchus.ode.nonstiff.EmbeddedRungeKuttaFieldIntegrator` + + Returns: + order of the method + + + """ + ... class DormandPrince853Integrator(EmbeddedRungeKuttaIntegrator): + """ + public classDormandPrince853Integrator extends :class:`~org.hipparchus.ode.nonstiff.EmbeddedRungeKuttaIntegrator` + + This class implements the 8(5,3) Dormand-Prince integrator for Ordinary Differential Equations. + + This integrator is an embedded Runge-Kutta integrator of order 8(5,3) used in local extrapolation mode (i.e. the + solution is computed using the high order formula) with stepsize control (and automatic step initialization) and + continuous output. This method uses 12 functions evaluations per step for integration and 4 evaluations for + interpolation. However, since the first interpolation evaluation is the same as the first integration evaluation of the + next step, we have included it in the integrator rather than in the interpolator and specified the method was an *fsal*. + Hence, despite we have 13 stages here, the cost is really 12 evaluations per step even if no interpolation is done, and + the overcost of interpolation is only 3 evaluations. + + This method is based on an 8(6) method by Dormand and Prince (i.e. order 8 for the integration and order 6 for error + estimation) modified by Hairer and Wanner to use a 5th order error estimator with 3rd order correction. This + modification was introduced because the original method failed in some cases (wrong steps can be accepted when step size + is too large, for example in the Brusselator problem) and also had *severe difficulties when applied to problems with + discontinuities*. This modification is explained in the second edition of the first volume (Nonstiff Problems) of the + reference book by Hairer, Norsett and Wanner: *Solving Ordinary Differential Equations* (Springer-Verlag, ISBN + 3-540-56670-8). + """ METHOD_NAME: typing.ClassVar[str] = ... + """ + public static final :class:`~org.hipparchus.ode.nonstiff.https:.docs.oracle.com.javase.8.docs.api.java.lang.String` METHOD_NAME + + Name of integration scheme. + + Also see: + + - :meth:`~constant` + + + + """ @typing.overload def __init__(self, double: float, double2: float, double3: float, double4: float): ... @typing.overload def __init__(self, double: float, double2: float, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray]): ... - def getA(self) -> typing.MutableSequence[typing.MutableSequence[float]]: ... - def getB(self) -> typing.MutableSequence[float]: ... - def getC(self) -> typing.MutableSequence[float]: ... - def getOrder(self) -> int: ... + def getA(self) -> typing.MutableSequence[typing.MutableSequence[float]]: + """ + Get the internal weights from Butcher array (without the first empty row). + + Returns: + internal weights from Butcher array (without the first empty row) + + + """ + ... + def getB(self) -> typing.MutableSequence[float]: + """ + Get the external weights for the high order method from Butcher array. + + Returns: + external weights for the high order method from Butcher array + + + """ + ... + def getC(self) -> typing.MutableSequence[float]: + """ + Get the time steps from Butcher array (without the first zero). + + Returns: + time steps from Butcher array (without the first zero + + + """ + ... + def getOrder(self) -> int: + """ + Get the order of the method. + + Specified by: + :meth:`~org.hipparchus.ode.nonstiff.EmbeddedRungeKuttaIntegrator.getOrder` in + class :class:`~org.hipparchus.ode.nonstiff.EmbeddedRungeKuttaIntegrator` + + Returns: + order of the method + + + """ + ... _EulerFieldIntegrator__T = typing.TypeVar('_EulerFieldIntegrator__T', bound=org.hipparchus.CalculusFieldElement) # <T> class EulerFieldIntegrator(RungeKuttaFieldIntegrator[_EulerFieldIntegrator__T], typing.Generic[_EulerFieldIntegrator__T]): + """ + public classEulerFieldIntegrator<T extends :class:`~org.hipparchus.ode.nonstiff.https:.www.hipparchus.org.hipparchus`<T>> extends :class:`~org.hipparchus.ode.nonstiff.RungeKuttaFieldIntegrator`<T> + + This class implements a simple Euler integrator for Ordinary Differential Equations. + + The Euler algorithm is the simplest one that can be used to integrate ordinary differential equations. It is a simple + inversion of the forward difference expression : :code:`f'=(f(t+h)-f(t))/h` which leads to :code:`f(t+h)=f(t)+hf'`. The + interpolation scheme used for dense output is the linear scheme already used for integration. + + This algorithm looks cheap because it needs only one function evaluation per step. However, as it uses linear estimates, + it needs very small steps to achieve high accuracy, and small steps lead to numerical errors and instabilities. + + This algorithm is almost never used and has been included in this package only as a comparison reference for more useful + integrators. + + Also see: + + - :class:`~org.hipparchus.ode.nonstiff.MidpointFieldIntegrator` + - :class:`~org.hipparchus.ode.nonstiff.ClassicalRungeKuttaFieldIntegrator` + - :class:`~org.hipparchus.ode.nonstiff.GillFieldIntegrator` + - :class:`~org.hipparchus.ode.nonstiff.ThreeEighthesFieldIntegrator` + - :class:`~org.hipparchus.ode.nonstiff.LutherFieldIntegrator` + """ METHOD_NAME: typing.ClassVar[str] = ... + """ + public static final :class:`~org.hipparchus.ode.nonstiff.https:.docs.oracle.com.javase.8.docs.api.java.lang.String` METHOD_NAME + + Name of integration scheme. + + Also see: + + - :meth:`~constant` + + + + """ def __init__(self, field: org.hipparchus.Field[_EulerFieldIntegrator__T], t: _EulerFieldIntegrator__T): ... - def getA(self) -> typing.MutableSequence[typing.MutableSequence[_EulerFieldIntegrator__T]]: ... - def getB(self) -> typing.MutableSequence[_EulerFieldIntegrator__T]: ... - def getC(self) -> typing.MutableSequence[_EulerFieldIntegrator__T]: ... + def getA(self) -> typing.MutableSequence[typing.MutableSequence[_EulerFieldIntegrator__T]]: + """ + Get the internal weights from Butcher array (without the first empty row). + + Returns: + internal weights from Butcher array (without the first empty row) + + + """ + ... + def getB(self) -> typing.MutableSequence[_EulerFieldIntegrator__T]: + """ + Get the external weights for the high order method from Butcher array. + + Returns: + external weights for the high order method from Butcher array + + + """ + ... + def getC(self) -> typing.MutableSequence[_EulerFieldIntegrator__T]: + """ + Get the time steps from Butcher array (without the first zero). + + Returns: + time steps from Butcher array (without the first zero + + + """ + ... class EulerIntegrator(RungeKuttaIntegrator): + """ + public classEulerIntegrator extends :class:`~org.hipparchus.ode.nonstiff.RungeKuttaIntegrator` + + This class implements a simple Euler integrator for Ordinary Differential Equations. + + The Euler algorithm is the simplest one that can be used to integrate ordinary differential equations. It is a simple + inversion of the forward difference expression : :code:`f'=(f(t+h)-f(t))/h` which leads to :code:`f(t+h)=f(t)+hf'`. The + interpolation scheme used for dense output is the linear scheme already used for integration. + + This algorithm looks cheap because it needs only one function evaluation per step. However, as it uses linear estimates, + it needs very small steps to achieve high accuracy, and small steps lead to numerical errors and instabilities. + + This algorithm is almost never used and has been included in this package only as a comparison reference for more useful + integrators. + + Also see: + + - :class:`~org.hipparchus.ode.nonstiff.MidpointIntegrator` + - :class:`~org.hipparchus.ode.nonstiff.ClassicalRungeKuttaIntegrator` + - :class:`~org.hipparchus.ode.nonstiff.GillIntegrator` + - :class:`~org.hipparchus.ode.nonstiff.ThreeEighthesIntegrator` + - :class:`~org.hipparchus.ode.nonstiff.LutherIntegrator` + """ METHOD_NAME: typing.ClassVar[str] = ... + """ + public static final :class:`~org.hipparchus.ode.nonstiff.https:.docs.oracle.com.javase.8.docs.api.java.lang.String` METHOD_NAME + + Name of integration scheme. + + Also see: + + - :meth:`~constant` + + + + """ def __init__(self, double: float): ... - def getA(self) -> typing.MutableSequence[typing.MutableSequence[float]]: ... - def getB(self) -> typing.MutableSequence[float]: ... - def getC(self) -> typing.MutableSequence[float]: ... + def getA(self) -> typing.MutableSequence[typing.MutableSequence[float]]: + """ + Get the internal weights from Butcher array (without the first empty row). + + Returns: + internal weights from Butcher array (without the first empty row) + + + """ + ... + def getB(self) -> typing.MutableSequence[float]: + """ + Get the external weights for the high order method from Butcher array. + + Returns: + external weights for the high order method from Butcher array + + + """ + ... + def getC(self) -> typing.MutableSequence[float]: + """ + Get the time steps from Butcher array (without the first zero). + + Returns: + time steps from Butcher array (without the first zero + + + """ + ... _GillFieldIntegrator__T = typing.TypeVar('_GillFieldIntegrator__T', bound=org.hipparchus.CalculusFieldElement) # <T> class GillFieldIntegrator(RungeKuttaFieldIntegrator[_GillFieldIntegrator__T], typing.Generic[_GillFieldIntegrator__T]): + """ + public classGillFieldIntegrator<T extends :class:`~org.hipparchus.ode.nonstiff.https:.www.hipparchus.org.hipparchus`<T>> extends :class:`~org.hipparchus.ode.nonstiff.RungeKuttaFieldIntegrator`<T> + + This class implements the Gill fourth order Runge-Kutta integrator for Ordinary Differential Equations . + + This method is an explicit Runge-Kutta method, its Butcher-array is the following one : + + .. code-block: java + + 0 | 0 0 0 0 + 1/2 | 1/2 0 0 0 + 1/2 | (q-1)/2 (2-q)/2 0 0 + 1 | 0 -q/2 (2+q)/2 0 + |------------------------------- + | 1/6 (2-q)/6 (2+q)/6 1/6 + + + where q = sqrt(2) + + Also see: + + - :class:`~org.hipparchus.ode.nonstiff.EulerFieldIntegrator` + - :class:`~org.hipparchus.ode.nonstiff.ClassicalRungeKuttaFieldIntegrator` + - :class:`~org.hipparchus.ode.nonstiff.MidpointFieldIntegrator` + - :class:`~org.hipparchus.ode.nonstiff.ThreeEighthesFieldIntegrator` + - :class:`~org.hipparchus.ode.nonstiff.LutherFieldIntegrator` + """ METHOD_NAME: typing.ClassVar[str] = ... + """ + public static final :class:`~org.hipparchus.ode.nonstiff.https:.docs.oracle.com.javase.8.docs.api.java.lang.String` METHOD_NAME + + Name of integration scheme. + + Also see: + + - :meth:`~constant` + + + + """ def __init__(self, field: org.hipparchus.Field[_GillFieldIntegrator__T], t: _GillFieldIntegrator__T): ... - def getA(self) -> typing.MutableSequence[typing.MutableSequence[_GillFieldIntegrator__T]]: ... - def getB(self) -> typing.MutableSequence[_GillFieldIntegrator__T]: ... - def getC(self) -> typing.MutableSequence[_GillFieldIntegrator__T]: ... + def getA(self) -> typing.MutableSequence[typing.MutableSequence[_GillFieldIntegrator__T]]: + """ + Get the internal weights from Butcher array (without the first empty row). + + Returns: + internal weights from Butcher array (without the first empty row) + + + """ + ... + def getB(self) -> typing.MutableSequence[_GillFieldIntegrator__T]: + """ + Get the external weights for the high order method from Butcher array. + + Returns: + external weights for the high order method from Butcher array + + + """ + ... + def getC(self) -> typing.MutableSequence[_GillFieldIntegrator__T]: + """ + Get the time steps from Butcher array (without the first zero). + + Returns: + time steps from Butcher array (without the first zero + + + """ + ... class GillIntegrator(RungeKuttaIntegrator): + """ + public classGillIntegrator extends :class:`~org.hipparchus.ode.nonstiff.RungeKuttaIntegrator` + + This class implements the Gill fourth order Runge-Kutta integrator for Ordinary Differential Equations . + + This method is an explicit Runge-Kutta method, its Butcher-array is the following one : + + .. code-block: java + + 0 | 0 0 0 0 + 1/2 | 1/2 0 0 0 + 1/2 | (q-1)/2 (2-q)/2 0 0 + 1 | 0 -q/2 (2+q)/2 0 + |------------------------------- + | 1/6 (2-q)/6 (2+q)/6 1/6 + + + where q = sqrt(2) + + Also see: + + - :class:`~org.hipparchus.ode.nonstiff.EulerIntegrator` + - :class:`~org.hipparchus.ode.nonstiff.ClassicalRungeKuttaIntegrator` + - :class:`~org.hipparchus.ode.nonstiff.MidpointIntegrator` + - :class:`~org.hipparchus.ode.nonstiff.ThreeEighthesIntegrator` + - :class:`~org.hipparchus.ode.nonstiff.LutherIntegrator` + """ METHOD_NAME: typing.ClassVar[str] = ... + """ + public static final :class:`~org.hipparchus.ode.nonstiff.https:.docs.oracle.com.javase.8.docs.api.java.lang.String` METHOD_NAME + + Name of integration scheme. + + Also see: + + - :meth:`~constant` + + + + """ def __init__(self, double: float): ... - def getA(self) -> typing.MutableSequence[typing.MutableSequence[float]]: ... - def getB(self) -> typing.MutableSequence[float]: ... - def getC(self) -> typing.MutableSequence[float]: ... + def getA(self) -> typing.MutableSequence[typing.MutableSequence[float]]: + """ + Get the internal weights from Butcher array (without the first empty row). + + Returns: + internal weights from Butcher array (without the first empty row) + + + """ + ... + def getB(self) -> typing.MutableSequence[float]: + """ + Get the external weights for the high order method from Butcher array. + + Returns: + external weights for the high order method from Butcher array + + + """ + ... + def getC(self) -> typing.MutableSequence[float]: + """ + Get the time steps from Butcher array (without the first zero). + + Returns: + time steps from Butcher array (without the first zero + + + """ + ... _HighamHall54FieldIntegrator__T = typing.TypeVar('_HighamHall54FieldIntegrator__T', bound=org.hipparchus.CalculusFieldElement) # <T> class HighamHall54FieldIntegrator(EmbeddedRungeKuttaFieldIntegrator[_HighamHall54FieldIntegrator__T], typing.Generic[_HighamHall54FieldIntegrator__T]): + """ + public classHighamHall54FieldIntegrator<T extends :class:`~org.hipparchus.ode.nonstiff.https:.www.hipparchus.org.hipparchus`<T>> extends :class:`~org.hipparchus.ode.nonstiff.EmbeddedRungeKuttaFieldIntegrator`<T> + + This class implements the 5(4) Higham and Hall integrator for Ordinary Differential Equations. + + This integrator is an embedded Runge-Kutta integrator of order 5(4) used in local extrapolation mode (i.e. the solution + is computed using the high order formula) with stepsize control (and automatic step initialization) and continuous + output. This method uses 7 functions evaluations per step. + """ METHOD_NAME: typing.ClassVar[str] = ... + """ + public static final :class:`~org.hipparchus.ode.nonstiff.https:.docs.oracle.com.javase.8.docs.api.java.lang.String` METHOD_NAME + + Name of integration scheme. + + Also see: + + - :meth:`~constant` + + + + """ @typing.overload def __init__(self, field: org.hipparchus.Field[_HighamHall54FieldIntegrator__T], double: float, double2: float, double3: float, double4: float): ... @typing.overload def __init__(self, field: org.hipparchus.Field[_HighamHall54FieldIntegrator__T], double: float, double2: float, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray]): ... - def getA(self) -> typing.MutableSequence[typing.MutableSequence[_HighamHall54FieldIntegrator__T]]: ... - def getB(self) -> typing.MutableSequence[_HighamHall54FieldIntegrator__T]: ... - def getC(self) -> typing.MutableSequence[_HighamHall54FieldIntegrator__T]: ... - def getOrder(self) -> int: ... + def getA(self) -> typing.MutableSequence[typing.MutableSequence[_HighamHall54FieldIntegrator__T]]: + """ + Get the internal weights from Butcher array (without the first empty row). + + Returns: + internal weights from Butcher array (without the first empty row) + + + """ + ... + def getB(self) -> typing.MutableSequence[_HighamHall54FieldIntegrator__T]: + """ + Get the external weights for the high order method from Butcher array. + + Returns: + external weights for the high order method from Butcher array + + + """ + ... + def getC(self) -> typing.MutableSequence[_HighamHall54FieldIntegrator__T]: + """ + Get the time steps from Butcher array (without the first zero). + + Returns: + time steps from Butcher array (without the first zero + + + """ + ... + def getOrder(self) -> int: + """ + Get the order of the method. + + Specified by: + :meth:`~org.hipparchus.ode.nonstiff.EmbeddedRungeKuttaFieldIntegrator.getOrder` in + class :class:`~org.hipparchus.ode.nonstiff.EmbeddedRungeKuttaFieldIntegrator` + + Returns: + order of the method + + + """ + ... class HighamHall54Integrator(EmbeddedRungeKuttaIntegrator): + """ + public classHighamHall54Integrator extends :class:`~org.hipparchus.ode.nonstiff.EmbeddedRungeKuttaIntegrator` + + This class implements the 5(4) Higham and Hall integrator for Ordinary Differential Equations. + + This integrator is an embedded Runge-Kutta integrator of order 5(4) used in local extrapolation mode (i.e. the solution + is computed using the high order formula) with stepsize control (and automatic step initialization) and continuous + output. This method uses 7 functions evaluations per step. + """ METHOD_NAME: typing.ClassVar[str] = ... + """ + public static final :class:`~org.hipparchus.ode.nonstiff.https:.docs.oracle.com.javase.8.docs.api.java.lang.String` METHOD_NAME + + Name of integration scheme. + + Also see: + + - :meth:`~constant` + + + + """ @typing.overload def __init__(self, double: float, double2: float, double3: float, double4: float): ... @typing.overload def __init__(self, double: float, double2: float, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray]): ... - def getA(self) -> typing.MutableSequence[typing.MutableSequence[float]]: ... - def getB(self) -> typing.MutableSequence[float]: ... - def getC(self) -> typing.MutableSequence[float]: ... - def getOrder(self) -> int: ... + def getA(self) -> typing.MutableSequence[typing.MutableSequence[float]]: + """ + Get the internal weights from Butcher array (without the first empty row). + + Returns: + internal weights from Butcher array (without the first empty row) + + + """ + ... + def getB(self) -> typing.MutableSequence[float]: + """ + Get the external weights for the high order method from Butcher array. + + Returns: + external weights for the high order method from Butcher array + + + """ + ... + def getC(self) -> typing.MutableSequence[float]: + """ + Get the time steps from Butcher array (without the first zero). + + Returns: + time steps from Butcher array (without the first zero + + + """ + ... + def getOrder(self) -> int: + """ + Get the order of the method. + + Specified by: + :meth:`~org.hipparchus.ode.nonstiff.EmbeddedRungeKuttaIntegrator.getOrder` in + class :class:`~org.hipparchus.ode.nonstiff.EmbeddedRungeKuttaIntegrator` + + Returns: + order of the method + + + """ + ... _LutherFieldIntegrator__T = typing.TypeVar('_LutherFieldIntegrator__T', bound=org.hipparchus.CalculusFieldElement) # <T> class LutherFieldIntegrator(RungeKuttaFieldIntegrator[_LutherFieldIntegrator__T], typing.Generic[_LutherFieldIntegrator__T]): + """ + public classLutherFieldIntegrator<T extends :class:`~org.hipparchus.ode.nonstiff.https:.www.hipparchus.org.hipparchus`<T>> extends :class:`~org.hipparchus.ode.nonstiff.RungeKuttaFieldIntegrator`<T> + + This class implements the Luther sixth order Runge-Kutta integrator for Ordinary Differential Equations. + + This method is described in H. A. Luther 1968 paper ` An explicit Sixth-Order Runge-Kutta Formula + <http://www.ams.org/journals/mcom/1968-22-102/S0025-5718-68-99876-1/S0025-5718-68-99876-1.pdf>`. + + This method is an explicit Runge-Kutta method, its Butcher-array is the following one : + + .. code-block: java + + 0 | 0 0 0 0 0 0 + 1 | 1 0 0 0 0 0 + 1/2 | 3/8 1/8 0 0 0 0 + 2/3 | 8/27 2/27 8/27 0 0 0 + (7-q)/14 | ( -21 + 9q)/392 ( -56 + 8q)/392 ( 336 - 48q)/392 ( -63 + 3q)/392 0 0 + (7+q)/14 | (-1155 - 255q)/1960 ( -280 - 40q)/1960 ( 0 - 320q)/1960 ( 63 + 363q)/1960 ( 2352 + 392q)/1960 0 + 1 | ( 330 + 105q)/180 ( 120 + 0q)/180 ( -200 + 280q)/180 ( 126 - 189q)/180 ( -686 - 126q)/180 ( 490 - 70q)/180 + |-------------------------------------------------------------------------------------------------------------------------------------------------- + | 1/20 0 16/45 0 49/180 49/180 1/20 + + + where q = √21 + + Also see: + + - :class:`~org.hipparchus.ode.nonstiff.EulerFieldIntegrator` + - :class:`~org.hipparchus.ode.nonstiff.ClassicalRungeKuttaFieldIntegrator` + - :class:`~org.hipparchus.ode.nonstiff.GillFieldIntegrator` + - :class:`~org.hipparchus.ode.nonstiff.MidpointFieldIntegrator` + - :class:`~org.hipparchus.ode.nonstiff.ThreeEighthesFieldIntegrator` + """ METHOD_NAME: typing.ClassVar[str] = ... + """ + public static final :class:`~org.hipparchus.ode.nonstiff.https:.docs.oracle.com.javase.8.docs.api.java.lang.String` METHOD_NAME + + Name of integration scheme. + + Also see: + + - :meth:`~constant` + + + + """ def __init__(self, field: org.hipparchus.Field[_LutherFieldIntegrator__T], t: _LutherFieldIntegrator__T): ... - def getA(self) -> typing.MutableSequence[typing.MutableSequence[_LutherFieldIntegrator__T]]: ... - def getB(self) -> typing.MutableSequence[_LutherFieldIntegrator__T]: ... - def getC(self) -> typing.MutableSequence[_LutherFieldIntegrator__T]: ... + def getA(self) -> typing.MutableSequence[typing.MutableSequence[_LutherFieldIntegrator__T]]: + """ + Get the internal weights from Butcher array (without the first empty row). + + Returns: + internal weights from Butcher array (without the first empty row) + + + """ + ... + def getB(self) -> typing.MutableSequence[_LutherFieldIntegrator__T]: + """ + Get the external weights for the high order method from Butcher array. + + Returns: + external weights for the high order method from Butcher array + + + """ + ... + def getC(self) -> typing.MutableSequence[_LutherFieldIntegrator__T]: + """ + Get the time steps from Butcher array (without the first zero). + + Returns: + time steps from Butcher array (without the first zero + + + """ + ... class LutherIntegrator(RungeKuttaIntegrator): + """ + public classLutherIntegrator extends :class:`~org.hipparchus.ode.nonstiff.RungeKuttaIntegrator` + + This class implements the Luther sixth order Runge-Kutta integrator for Ordinary Differential Equations. + + This method is described in H. A. Luther 1968 paper ` An explicit Sixth-Order Runge-Kutta Formula + <http://www.ams.org/journals/mcom/1968-22-102/S0025-5718-68-99876-1/S0025-5718-68-99876-1.pdf>`. + + This method is an explicit Runge-Kutta method, its Butcher-array is the following one : + + .. code-block: java + + 0 | 0 0 0 0 0 0 + 1 | 1 0 0 0 0 0 + 1/2 | 3/8 1/8 0 0 0 0 + 2/3 | 8/27 2/27 8/27 0 0 0 + (7-q)/14 | ( -21 + 9q)/392 ( -56 + 8q)/392 ( 336 - 48q)/392 ( -63 + 3q)/392 0 0 + (7+q)/14 | (-1155 - 255q)/1960 ( -280 - 40q)/1960 ( 0 - 320q)/1960 ( 63 + 363q)/1960 ( 2352 + 392q)/1960 0 + 1 | ( 330 + 105q)/180 ( 120 + 0q)/180 ( -200 + 280q)/180 ( 126 - 189q)/180 ( -686 - 126q)/180 ( 490 - 70q)/180 + |-------------------------------------------------------------------------------------------------------------------------------------------------- + | 1/20 0 16/45 0 49/180 49/180 1/20 + + + where q = √21 + + Also see: + + - :class:`~org.hipparchus.ode.nonstiff.EulerIntegrator` + - :class:`~org.hipparchus.ode.nonstiff.ClassicalRungeKuttaIntegrator` + - :class:`~org.hipparchus.ode.nonstiff.GillIntegrator` + - :class:`~org.hipparchus.ode.nonstiff.MidpointIntegrator` + - :class:`~org.hipparchus.ode.nonstiff.ThreeEighthesIntegrator` + """ METHOD_NAME: typing.ClassVar[str] = ... + """ + public static final :class:`~org.hipparchus.ode.nonstiff.https:.docs.oracle.com.javase.8.docs.api.java.lang.String` METHOD_NAME + + Name of integration scheme. + + Also see: + + - :meth:`~constant` + + + + """ def __init__(self, double: float): ... - def getA(self) -> typing.MutableSequence[typing.MutableSequence[float]]: ... - def getB(self) -> typing.MutableSequence[float]: ... - def getC(self) -> typing.MutableSequence[float]: ... + def getA(self) -> typing.MutableSequence[typing.MutableSequence[float]]: + """ + Get the internal weights from Butcher array (without the first empty row). + + Returns: + internal weights from Butcher array (without the first empty row) + + + """ + ... + def getB(self) -> typing.MutableSequence[float]: + """ + Get the external weights for the high order method from Butcher array. + + Returns: + external weights for the high order method from Butcher array + + + """ + ... + def getC(self) -> typing.MutableSequence[float]: + """ + Get the time steps from Butcher array (without the first zero). + + Returns: + time steps from Butcher array (without the first zero + + + """ + ... _MidpointFieldIntegrator__T = typing.TypeVar('_MidpointFieldIntegrator__T', bound=org.hipparchus.CalculusFieldElement) # <T> class MidpointFieldIntegrator(RungeKuttaFieldIntegrator[_MidpointFieldIntegrator__T], typing.Generic[_MidpointFieldIntegrator__T]): + """ + public classMidpointFieldIntegrator<T extends :class:`~org.hipparchus.ode.nonstiff.https:.www.hipparchus.org.hipparchus`<T>> extends :class:`~org.hipparchus.ode.nonstiff.RungeKuttaFieldIntegrator`<T> + + This class implements a second order Runge-Kutta integrator for Ordinary Differential Equations. + + This method is an explicit Runge-Kutta method, its Butcher-array is the following one : + + .. code-block: java + + 0 | 0 0 + 1/2 | 1/2 0 + |---------- + | 0 1 + + + Also see: + + - :class:`~org.hipparchus.ode.nonstiff.EulerFieldIntegrator` + - :class:`~org.hipparchus.ode.nonstiff.ClassicalRungeKuttaFieldIntegrator` + - :class:`~org.hipparchus.ode.nonstiff.GillFieldIntegrator` + - :class:`~org.hipparchus.ode.nonstiff.ThreeEighthesFieldIntegrator` + - :class:`~org.hipparchus.ode.nonstiff.LutherFieldIntegrator` + """ METHOD_NAME: typing.ClassVar[str] = ... + """ + public static final :class:`~org.hipparchus.ode.nonstiff.https:.docs.oracle.com.javase.8.docs.api.java.lang.String` METHOD_NAME + + Name of integration scheme. + + Also see: + + - :meth:`~constant` + + + + """ def __init__(self, field: org.hipparchus.Field[_MidpointFieldIntegrator__T], t: _MidpointFieldIntegrator__T): ... - def getA(self) -> typing.MutableSequence[typing.MutableSequence[_MidpointFieldIntegrator__T]]: ... - def getB(self) -> typing.MutableSequence[_MidpointFieldIntegrator__T]: ... - def getC(self) -> typing.MutableSequence[_MidpointFieldIntegrator__T]: ... + def getA(self) -> typing.MutableSequence[typing.MutableSequence[_MidpointFieldIntegrator__T]]: + """ + Get the internal weights from Butcher array (without the first empty row). + + Returns: + internal weights from Butcher array (without the first empty row) + + + """ + ... + def getB(self) -> typing.MutableSequence[_MidpointFieldIntegrator__T]: + """ + Get the external weights for the high order method from Butcher array. + + Returns: + external weights for the high order method from Butcher array + + + """ + ... + def getC(self) -> typing.MutableSequence[_MidpointFieldIntegrator__T]: + """ + Get the time steps from Butcher array (without the first zero). + + Returns: + time steps from Butcher array (without the first zero + + + """ + ... class MidpointIntegrator(RungeKuttaIntegrator): + """ + public classMidpointIntegrator extends :class:`~org.hipparchus.ode.nonstiff.RungeKuttaIntegrator` + + This class implements a second order Runge-Kutta integrator for Ordinary Differential Equations. + + This method is an explicit Runge-Kutta method, its Butcher-array is the following one : + + .. code-block: java + + 0 | 0 0 + 1/2 | 1/2 0 + |---------- + | 0 1 + + + Also see: + + - :class:`~org.hipparchus.ode.nonstiff.EulerIntegrator` + - :class:`~org.hipparchus.ode.nonstiff.ClassicalRungeKuttaIntegrator` + - :class:`~org.hipparchus.ode.nonstiff.GillIntegrator` + - :class:`~org.hipparchus.ode.nonstiff.ThreeEighthesIntegrator` + - :class:`~org.hipparchus.ode.nonstiff.LutherIntegrator` + """ METHOD_NAME: typing.ClassVar[str] = ... + """ + public static final :class:`~org.hipparchus.ode.nonstiff.https:.docs.oracle.com.javase.8.docs.api.java.lang.String` METHOD_NAME + + Name of integration scheme. + + Also see: + + - :meth:`~constant` + + + + """ def __init__(self, double: float): ... - def getA(self) -> typing.MutableSequence[typing.MutableSequence[float]]: ... - def getB(self) -> typing.MutableSequence[float]: ... - def getC(self) -> typing.MutableSequence[float]: ... + def getA(self) -> typing.MutableSequence[typing.MutableSequence[float]]: + """ + Get the internal weights from Butcher array (without the first empty row). + + Returns: + internal weights from Butcher array (without the first empty row) + + + """ + ... + def getB(self) -> typing.MutableSequence[float]: + """ + Get the external weights for the high order method from Butcher array. + + Returns: + external weights for the high order method from Butcher array + + + """ + ... + def getC(self) -> typing.MutableSequence[float]: + """ + Get the time steps from Butcher array (without the first zero). + + Returns: + time steps from Butcher array (without the first zero + + + """ + ... _ThreeEighthesFieldIntegrator__T = typing.TypeVar('_ThreeEighthesFieldIntegrator__T', bound=org.hipparchus.CalculusFieldElement) # <T> class ThreeEighthesFieldIntegrator(RungeKuttaFieldIntegrator[_ThreeEighthesFieldIntegrator__T], typing.Generic[_ThreeEighthesFieldIntegrator__T]): + """ + public classThreeEighthesFieldIntegrator<T extends :class:`~org.hipparchus.ode.nonstiff.https:.www.hipparchus.org.hipparchus`<T>> extends :class:`~org.hipparchus.ode.nonstiff.RungeKuttaFieldIntegrator`<T> + + This class implements the 3/8 fourth order Runge-Kutta integrator for Ordinary Differential Equations. + + This method is an explicit Runge-Kutta method, its Butcher-array is the following one : + + .. code-block: java + + 0 | 0 0 0 0 + 1/3 | 1/3 0 0 0 + 2/3 |-1/3 1 0 0 + 1 | 1 -1 1 0 + |-------------------- + | 1/8 3/8 3/8 1/8 + + + Also see: + + - :class:`~org.hipparchus.ode.nonstiff.EulerFieldIntegrator` + - :class:`~org.hipparchus.ode.nonstiff.ClassicalRungeKuttaFieldIntegrator` + - :class:`~org.hipparchus.ode.nonstiff.GillFieldIntegrator` + - :class:`~org.hipparchus.ode.nonstiff.MidpointFieldIntegrator` + - :class:`~org.hipparchus.ode.nonstiff.LutherFieldIntegrator` + """ METHOD_NAME: typing.ClassVar[str] = ... + """ + public static final :class:`~org.hipparchus.ode.nonstiff.https:.docs.oracle.com.javase.8.docs.api.java.lang.String` METHOD_NAME + + Name of integration scheme. + + Also see: + + - :meth:`~constant` + + + + """ def __init__(self, field: org.hipparchus.Field[_ThreeEighthesFieldIntegrator__T], t: _ThreeEighthesFieldIntegrator__T): ... - def getA(self) -> typing.MutableSequence[typing.MutableSequence[_ThreeEighthesFieldIntegrator__T]]: ... - def getB(self) -> typing.MutableSequence[_ThreeEighthesFieldIntegrator__T]: ... - def getC(self) -> typing.MutableSequence[_ThreeEighthesFieldIntegrator__T]: ... + def getA(self) -> typing.MutableSequence[typing.MutableSequence[_ThreeEighthesFieldIntegrator__T]]: + """ + Get the internal weights from Butcher array (without the first empty row). + + Returns: + internal weights from Butcher array (without the first empty row) + + + """ + ... + def getB(self) -> typing.MutableSequence[_ThreeEighthesFieldIntegrator__T]: + """ + Get the external weights for the high order method from Butcher array. + + Returns: + external weights for the high order method from Butcher array + + + """ + ... + def getC(self) -> typing.MutableSequence[_ThreeEighthesFieldIntegrator__T]: + """ + Get the time steps from Butcher array (without the first zero). + + Returns: + time steps from Butcher array (without the first zero + + + """ + ... class ThreeEighthesIntegrator(RungeKuttaIntegrator): + """ + public classThreeEighthesIntegrator extends :class:`~org.hipparchus.ode.nonstiff.RungeKuttaIntegrator` + + This class implements the 3/8 fourth order Runge-Kutta integrator for Ordinary Differential Equations. + + This method is an explicit Runge-Kutta method, its Butcher-array is the following one : + + .. code-block: java + + 0 | 0 0 0 0 + 1/3 | 1/3 0 0 0 + 2/3 |-1/3 1 0 0 + 1 | 1 -1 1 0 + |-------------------- + | 1/8 3/8 3/8 1/8 + + + Also see: + + - :class:`~org.hipparchus.ode.nonstiff.EulerIntegrator` + - :class:`~org.hipparchus.ode.nonstiff.ClassicalRungeKuttaIntegrator` + - :class:`~org.hipparchus.ode.nonstiff.GillIntegrator` + - :class:`~org.hipparchus.ode.nonstiff.MidpointIntegrator` + - :class:`~org.hipparchus.ode.nonstiff.LutherIntegrator` + """ METHOD_NAME: typing.ClassVar[str] = ... + """ + public static final :class:`~org.hipparchus.ode.nonstiff.https:.docs.oracle.com.javase.8.docs.api.java.lang.String` METHOD_NAME + + Name of integration scheme. + + Also see: + + - :meth:`~constant` + + + + """ def __init__(self, double: float): ... - def getA(self) -> typing.MutableSequence[typing.MutableSequence[float]]: ... - def getB(self) -> typing.MutableSequence[float]: ... - def getC(self) -> typing.MutableSequence[float]: ... + def getA(self) -> typing.MutableSequence[typing.MutableSequence[float]]: + """ + Get the internal weights from Butcher array (without the first empty row). + + Returns: + internal weights from Butcher array (without the first empty row) + + + """ + ... + def getB(self) -> typing.MutableSequence[float]: + """ + Get the external weights for the high order method from Butcher array. + + Returns: + external weights for the high order method from Butcher array + + + """ + ... + def getC(self) -> typing.MutableSequence[float]: + """ + Get the time steps from Butcher array (without the first zero). + + Returns: + time steps from Butcher array (without the first zero + + + """ + ... class __module_protocol__(Protocol): diff --git a/org-stubs/hipparchus/ode/sampling/__init__.pyi b/org-stubs/hipparchus/ode/sampling/__init__.pyi index 585b999..1e448ce 100644 --- a/org-stubs/hipparchus/ode/sampling/__init__.pyi +++ b/org-stubs/hipparchus/ode/sampling/__init__.pyi @@ -15,59 +15,403 @@ import typing _FieldODEFixedStepHandler__T = typing.TypeVar('_FieldODEFixedStepHandler__T', bound=org.hipparchus.CalculusFieldElement) # <T> class FieldODEFixedStepHandler(typing.Generic[_FieldODEFixedStepHandler__T]): + """ + public interfaceFieldODEFixedStepHandler<T extends :class:`~org.hipparchus.ode.sampling.https:.www.hipparchus.org.hipparchus`<T>> + + This interface represents a handler that should be called after each successful fixed step. + + This interface should be implemented by anyone who is interested in getting the solution of an ordinary differential + equation at fixed time steps. Objects implementing this interface should be wrapped within an instance of + :class:`~org.hipparchus.ode.sampling.FieldStepNormalizer` that itself is used as the general + :class:`~org.hipparchus.ode.sampling.FieldODEStepHandler` by the integrator. The + :class:`~org.hipparchus.ode.sampling.FieldStepNormalizer` object is called according to the integrator internal + algorithms and it calls objects implementing this interface as necessary at fixed time steps. + + Also see: + + - :class:`~org.hipparchus.ode.sampling.FieldODEStepHandler` + - :class:`~org.hipparchus.ode.sampling.FieldStepNormalizer` + - :class:`~org.hipparchus.ode.sampling.FieldODEStateInterpolator` + """ def handleStep(self, fieldODEStateAndDerivative: org.hipparchus.ode.FieldODEStateAndDerivative[_FieldODEFixedStepHandler__T], boolean: bool) -> None: ... def init(self, fieldODEStateAndDerivative: org.hipparchus.ode.FieldODEStateAndDerivative[_FieldODEFixedStepHandler__T], t: _FieldODEFixedStepHandler__T) -> None: ... _FieldODEStateInterpolator__T = typing.TypeVar('_FieldODEStateInterpolator__T', bound=org.hipparchus.CalculusFieldElement) # <T> class FieldODEStateInterpolator(typing.Generic[_FieldODEStateInterpolator__T]): + """ + public interfaceFieldODEStateInterpolator<T extends :class:`~org.hipparchus.ode.sampling.https:.www.hipparchus.org.hipparchus`<T>> + + This interface represents an interpolator over the last step during an ODE integration. + + The various ODE integrators provide objects implementing this interface to the step handlers. These objects are often + custom objects tightly bound to the integrator internal algorithms. The handlers can use these objects to retrieve the + state vector at intermediate times between the previous and the current grid points (this feature is often called dense + output). + + Also see: + + - :class:`~org.hipparchus.ode.FieldODEIntegrator` + - :class:`~org.hipparchus.ode.sampling.FieldODEStepHandler` + """ def getCurrentState(self) -> org.hipparchus.ode.FieldODEStateAndDerivative[_FieldODEStateInterpolator__T]: ... def getInterpolatedState(self, t: _FieldODEStateInterpolator__T) -> org.hipparchus.ode.FieldODEStateAndDerivative[_FieldODEStateInterpolator__T]: ... def getPreviousState(self) -> org.hipparchus.ode.FieldODEStateAndDerivative[_FieldODEStateInterpolator__T]: ... - def isCurrentStateInterpolated(self) -> bool: ... - def isForward(self) -> bool: ... - def isPreviousStateInterpolated(self) -> bool: ... + def isCurrentStateInterpolated(self) -> bool: + """ + Determines if the :meth:`~org.hipparchus.ode.sampling.FieldODEStateInterpolator.getCurrentState` is computed directly by + the integrator, or if it is calculated using + :meth:`~org.hipparchus.ode.sampling.FieldODEStateInterpolator.getInterpolatedState`. + + Typically the current state is directly computed by the integrator, but when events are detected the steps are shortened + so that events occur on step boundaries which means the current state may be computed by the interpolator. + + Returns: + :code:`true` if the current state was calculated by the interpolator and false if it was computed directly by the + integrator. + + + """ + ... + def isForward(self) -> bool: + """ + Check if the natural integration direction is forward. + + This method provides the integration direction as specified by the integrator itself, it avoid some nasty problems in + degenerated cases like null steps due to cancellation at step initialization, step control or discrete events + triggering. + + Returns: + true if the integration variable (time) increases during integration + + + """ + ... + def isPreviousStateInterpolated(self) -> bool: + """ + Determines if the :meth:`~org.hipparchus.ode.sampling.FieldODEStateInterpolator.getPreviousState` is computed directly + by the integrator, or if it is calculated using + :meth:`~org.hipparchus.ode.sampling.FieldODEStateInterpolator.getInterpolatedState`. + + Typically the previous state is directly computed by the integrator, but when events are detected the steps are + shortened so that events occur on step boundaries which means the previous state may be computed by the interpolator. + + Returns: + :code:`true` if the previous state was calculated by the interpolator and false if it was computed directly by the + integrator. + + + """ + ... _FieldODEStepHandler__T = typing.TypeVar('_FieldODEStepHandler__T', bound=org.hipparchus.CalculusFieldElement) # <T> class FieldODEStepHandler(typing.Generic[_FieldODEStepHandler__T]): + """ + public interfaceFieldODEStepHandler<T extends :class:`~org.hipparchus.ode.sampling.https:.www.hipparchus.org.hipparchus`<T>> + + This interface represents a handler that should be called after each successful step. + + The ODE integrators compute the evolution of the state vector at some grid points that depend on their own internal + algorithm. Once they have found a new grid point (possibly after having computed several evaluation of the derivative at + intermediate points), they provide it to objects implementing this interface. These objects typically either ignore the + intermediate steps and wait for the last one, store the points in an ephemeris, or forward them to specialized + processing or output methods. + + Also see: + + - :class:`~org.hipparchus.ode.FieldODEIntegrator` + - :class:`~org.hipparchus.ode.sampling.FieldODEStateInterpolator` + """ def finish(self, fieldODEStateAndDerivative: org.hipparchus.ode.FieldODEStateAndDerivative[_FieldODEStepHandler__T]) -> None: ... def handleStep(self, fieldODEStateInterpolator: FieldODEStateInterpolator[_FieldODEStepHandler__T]) -> None: ... def init(self, fieldODEStateAndDerivative: org.hipparchus.ode.FieldODEStateAndDerivative[_FieldODEStepHandler__T], t: _FieldODEStepHandler__T) -> None: ... class ODEFixedStepHandler: - def handleStep(self, oDEStateAndDerivative: org.hipparchus.ode.ODEStateAndDerivative, boolean: bool) -> None: ... - def init(self, oDEStateAndDerivative: org.hipparchus.ode.ODEStateAndDerivative, double: float) -> None: ... + """ + public interfaceODEFixedStepHandler + + This interface represents a handler that should be called after each successful fixed step. + + This interface should be implemented by anyone who is interested in getting the solution of an ordinary differential + equation at fixed time steps. Objects implementing this interface should be wrapped within an instance of + :class:`~org.hipparchus.ode.sampling.StepNormalizer` that itself is used as the general + :class:`~org.hipparchus.ode.sampling.ODEStepHandler` by the integrator. The + :class:`~org.hipparchus.ode.sampling.StepNormalizer` object is called according to the integrator internal algorithms + and it calls objects implementing this interface as necessary at fixed time steps. + + Also see: + + - :class:`~org.hipparchus.ode.sampling.ODEStepHandler` + - :class:`~org.hipparchus.ode.sampling.StepNormalizer` + """ + def handleStep(self, oDEStateAndDerivative: org.hipparchus.ode.ODEStateAndDerivative, boolean: bool) -> None: + """ + Handle the last accepted step + + Parameters: + state (:class:`~org.hipparchus.ode.ODEStateAndDerivative`): current state + isLast (boolean): true if the step is the last one + + + """ + ... + def init(self, oDEStateAndDerivative: org.hipparchus.ode.ODEStateAndDerivative, double: float) -> None: + """ + Initialize step handler at the start of an ODE integration. + + This method is called once at the start of the integration. It may be used by the step handler to initialize some + internal data if needed. + + The default implementation does nothing. + + Parameters: + initialState (:class:`~org.hipparchus.ode.ODEStateAndDerivative`): initial time, state vector and derivative + finalTime (double): target time for the integration + + + """ + ... class ODEStateInterpolator(java.io.Serializable): - def getCurrentState(self) -> org.hipparchus.ode.ODEStateAndDerivative: ... - def getInterpolatedState(self, double: float) -> org.hipparchus.ode.ODEStateAndDerivative: ... - def getPreviousState(self) -> org.hipparchus.ode.ODEStateAndDerivative: ... - def isCurrentStateInterpolated(self) -> bool: ... - def isForward(self) -> bool: ... - def isPreviousStateInterpolated(self) -> bool: ... + """ + public interfaceODEStateInterpolatorextends :class:`~org.hipparchus.ode.sampling.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + This interface represents an interpolator over the last step during an ODE integration. + + The various ODE integrators provide objects implementing this interface to the step handlers. These objects are often + custom objects tightly bound to the integrator internal algorithms. The handlers can use these objects to retrieve the + state vector at intermediate times between the previous and the current grid points (this feature is often called dense + output). + + Also see: + + - :class:`~org.hipparchus.ode.ODEIntegrator` + - :class:`~org.hipparchus.ode.sampling.ODEStepHandler` + """ + def getCurrentState(self) -> org.hipparchus.ode.ODEStateAndDerivative: + """ + Get the state at current grid point time. + + Returns: + state at current grid point time + + + """ + ... + def getInterpolatedState(self, double: float) -> org.hipparchus.ode.ODEStateAndDerivative: + """ + Get the state at interpolated time. + + Setting the time outside of the current step is allowed, but should be used with care since the accuracy of the + interpolator will probably be very poor far from this step. This allowance has been added to simplify implementation of + search algorithms near the step endpoints. + + Parameters: + time (double): time of the interpolated point + + Returns: + state at interpolated time + + + """ + ... + def getPreviousState(self) -> org.hipparchus.ode.ODEStateAndDerivative: + """ + Get the state at previous grid point time. + + Returns: + state at previous grid point time + + + """ + ... + def isCurrentStateInterpolated(self) -> bool: + """ + Determines if the :meth:`~org.hipparchus.ode.sampling.ODEStateInterpolator.getCurrentState` is computed directly by the + integrator, or if it is calculated using :meth:`~org.hipparchus.ode.sampling.ODEStateInterpolator.getInterpolatedState`. + + Typically the current state is directly computed by the integrator, but when events are detected the steps are shortened + so that events occur on step boundaries which means the current state may be computed by the interpolator. + + Returns: + :code:`true` if the current state was calculated by the interpolator and false if it was computed directly by the + integrator. + + + """ + ... + def isForward(self) -> bool: + """ + Check if the natural integration direction is forward. + + This method provides the integration direction as specified by the integrator itself, it avoid some nasty problems in + degenerated cases like null steps due to cancellation at step initialization, step control or discrete events + triggering. + + Returns: + true if the integration variable (time) increases during integration + + + """ + ... + def isPreviousStateInterpolated(self) -> bool: + """ + Determines if the :meth:`~org.hipparchus.ode.sampling.ODEStateInterpolator.getPreviousState` is computed directly by the + integrator, or if it is calculated using :meth:`~org.hipparchus.ode.sampling.ODEStateInterpolator.getInterpolatedState`. + + Typically the previous state is directly computed by the integrator, but when events are detected the steps are + shortened so that events occur on step boundaries which means the previous state may be computed by the interpolator. + + Returns: + :code:`true` if the previous state was calculated by the interpolator and false if it was computed directly by the + integrator. + + + """ + ... class ODEStepHandler: - def finish(self, oDEStateAndDerivative: org.hipparchus.ode.ODEStateAndDerivative) -> None: ... - def handleStep(self, oDEStateInterpolator: ODEStateInterpolator) -> None: ... - def init(self, oDEStateAndDerivative: org.hipparchus.ode.ODEStateAndDerivative, double: float) -> None: ... + """ + public interfaceODEStepHandler + + This interface represents a handler that should be called after each successful step. + + The ODE integrators compute the evolution of the state vector at some grid points that depend on their own internal + algorithm. Once they have found a new grid point (possibly after having computed several evaluation of the derivative at + intermediate points), they provide it to objects implementing this interface. These objects typically either ignore the + intermediate steps and wait for the last one, store the points in an ephemeris, or forward them to specialized + processing or output methods. + + Also see: + + - :class:`~org.hipparchus.ode.ODEIntegrator` + - :class:`~org.hipparchus.ode.sampling.ODEStateInterpolator` + """ + def finish(self, oDEStateAndDerivative: org.hipparchus.ode.ODEStateAndDerivative) -> None: + """ + Finalize integration. + + Parameters: + finalState (:class:`~org.hipparchus.ode.ODEStateAndDerivative`): state at integration end + + Since: + 2.0 + + + """ + ... + def handleStep(self, oDEStateInterpolator: ODEStateInterpolator) -> None: + """ + Handle the last accepted step. + + Parameters: + interpolator (:class:`~org.hipparchus.ode.sampling.ODEStateInterpolator`): interpolator for the last accepted step + + + """ + ... + def init(self, oDEStateAndDerivative: org.hipparchus.ode.ODEStateAndDerivative, double: float) -> None: + """ + Initialize step handler at the start of an ODE integration. + + This method is called once at the start of the integration. It may be used by the step handler to initialize some + internal data if needed. + + The default implementation does nothing + + Parameters: + initialState (:class:`~org.hipparchus.ode.ODEStateAndDerivative`): initial time, state vector and derivative + finalTime (double): target time for the integration + + + """ + ... class StepNormalizerBounds(java.lang.Enum['StepNormalizerBounds']): + """ + public enumStepNormalizerBounds extends :class:`~org.hipparchus.ode.sampling.https:.docs.oracle.com.javase.8.docs.api.java.lang.Enum`<:class:`~org.hipparchus.ode.sampling.StepNormalizerBounds`> + + :class:`~org.hipparchus.ode.sampling.StepNormalizer` bounds settings. They influence whether the underlying fixed step + size step handler is called for the first and last points. Note that if the last point coincides with a normalized + point, then the underlying fixed step size step handler is always called, regardless of these settings. + + Also see: + + - :class:`~org.hipparchus.ode.sampling.FieldStepNormalizer` + - :class:`~org.hipparchus.ode.sampling.StepNormalizer` + - :class:`~org.hipparchus.ode.sampling.StepNormalizerMode` + """ NEITHER: typing.ClassVar['StepNormalizerBounds'] = ... FIRST: typing.ClassVar['StepNormalizerBounds'] = ... LAST: typing.ClassVar['StepNormalizerBounds'] = ... BOTH: typing.ClassVar['StepNormalizerBounds'] = ... - def firstIncluded(self) -> bool: ... - def lastIncluded(self) -> bool: ... + def firstIncluded(self) -> bool: + """ + Returns a value indicating whether the first point should be passed to the underlying fixed step size step handler. + + Returns: + value indicating whether the first point should be passed to the underlying fixed step size step handler. + + + """ + ... + def lastIncluded(self) -> bool: + """ + Returns a value indicating whether the last point should be passed to the underlying fixed step size step handler. + + Returns: + value indicating whether the last point should be passed to the underlying fixed step size step handler. + + + """ + ... _valueOf_0__T = typing.TypeVar('_valueOf_0__T', bound=java.lang.Enum) # <T> @typing.overload @staticmethod def valueOf(class_: typing.Type[_valueOf_0__T], string: str) -> _valueOf_0__T: ... @typing.overload @staticmethod - def valueOf(string: str) -> 'StepNormalizerBounds': ... + def valueOf(string: str) -> 'StepNormalizerBounds': + """ + Returns the enum constant of this type with the specified name. The string must match *exactly* an identifier used to + declare an enum constant in this type. (Extraneous whitespace characters are not permitted.) + + Parameters: + name (:class:`~org.hipparchus.ode.sampling.https:.docs.oracle.com.javase.8.docs.api.java.lang.String`): the name of the enum constant to be returned. + + Returns: + the enum constant with the specified name + + Raises: + :class:`~org.hipparchus.ode.sampling.https:.docs.oracle.com.javase.8.docs.api.java.lang.IllegalArgumentException`: if this enum type has no constant with the specified name + :class:`~org.hipparchus.ode.sampling.https:.docs.oracle.com.javase.8.docs.api.java.lang.NullPointerException`: if the argument is null + + + """ + ... @staticmethod - def values() -> typing.MutableSequence['StepNormalizerBounds']: ... + def values() -> typing.MutableSequence['StepNormalizerBounds']: + """ + Returns an array containing the constants of this enum type, in the order they are declared. + + Returns: + an array containing the constants of this enum type, in the order they are declared + + + """ + ... class StepNormalizerMode(java.lang.Enum['StepNormalizerMode']): + """ + public enumStepNormalizerMode extends :class:`~org.hipparchus.ode.sampling.https:.docs.oracle.com.javase.8.docs.api.java.lang.Enum`<:class:`~org.hipparchus.ode.sampling.StepNormalizerMode`> + + :class:`~org.hipparchus.ode.sampling.StepNormalizer` modes. Determines how the step size is interpreted. + + Also see: + + - :class:`~org.hipparchus.ode.sampling.FieldStepNormalizer` + - :class:`~org.hipparchus.ode.sampling.StepNormalizer` + - :class:`~org.hipparchus.ode.sampling.StepNormalizerBounds` + """ INCREMENT: typing.ClassVar['StepNormalizerMode'] = ... MULTIPLES: typing.ClassVar['StepNormalizerMode'] = ... _valueOf_0__T = typing.TypeVar('_valueOf_0__T', bound=java.lang.Enum) # <T> @@ -76,35 +420,311 @@ class StepNormalizerMode(java.lang.Enum['StepNormalizerMode']): def valueOf(class_: typing.Type[_valueOf_0__T], string: str) -> _valueOf_0__T: ... @typing.overload @staticmethod - def valueOf(string: str) -> 'StepNormalizerMode': ... + def valueOf(string: str) -> 'StepNormalizerMode': + """ + Returns the enum constant of this type with the specified name. The string must match *exactly* an identifier used to + declare an enum constant in this type. (Extraneous whitespace characters are not permitted.) + + Parameters: + name (:class:`~org.hipparchus.ode.sampling.https:.docs.oracle.com.javase.8.docs.api.java.lang.String`): the name of the enum constant to be returned. + + Returns: + the enum constant with the specified name + + Raises: + :class:`~org.hipparchus.ode.sampling.https:.docs.oracle.com.javase.8.docs.api.java.lang.IllegalArgumentException`: if this enum type has no constant with the specified name + :class:`~org.hipparchus.ode.sampling.https:.docs.oracle.com.javase.8.docs.api.java.lang.NullPointerException`: if the argument is null + + + """ + ... @staticmethod - def values() -> typing.MutableSequence['StepNormalizerMode']: ... + def values() -> typing.MutableSequence['StepNormalizerMode']: + """ + Returns an array containing the constants of this enum type, in the order they are declared. + + Returns: + an array containing the constants of this enum type, in the order they are declared + + + """ + ... _AbstractFieldODEStateInterpolator__T = typing.TypeVar('_AbstractFieldODEStateInterpolator__T', bound=org.hipparchus.CalculusFieldElement) # <T> class AbstractFieldODEStateInterpolator(FieldODEStateInterpolator[_AbstractFieldODEStateInterpolator__T], typing.Generic[_AbstractFieldODEStateInterpolator__T]): + """ + public abstract classAbstractFieldODEStateInterpolator<T extends :class:`~org.hipparchus.ode.sampling.https:.www.hipparchus.org.hipparchus`<T>> extends :class:`~org.hipparchus.ode.sampling.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.ode.sampling.FieldODEStateInterpolator`<T> + + This abstract class represents an interpolator over the last step during an ODE integration. + + The various ODE integrators provide objects extending this class to the step handlers. The handlers can use these + objects to retrieve the state vector at intermediate times between the previous and the current grid points (dense + output). + + Also see: + + - :class:`~org.hipparchus.ode.FieldODEIntegrator` + - :class:`~org.hipparchus.ode.sampling.FieldODEStepHandler` + """ def getCurrentState(self) -> org.hipparchus.ode.FieldODEStateAndDerivative[_AbstractFieldODEStateInterpolator__T]: ... def getGlobalCurrentState(self) -> org.hipparchus.ode.FieldODEStateAndDerivative[_AbstractFieldODEStateInterpolator__T]: ... def getGlobalPreviousState(self) -> org.hipparchus.ode.FieldODEStateAndDerivative[_AbstractFieldODEStateInterpolator__T]: ... def getInterpolatedState(self, t: _AbstractFieldODEStateInterpolator__T) -> org.hipparchus.ode.FieldODEStateAndDerivative[_AbstractFieldODEStateInterpolator__T]: ... def getPreviousState(self) -> org.hipparchus.ode.FieldODEStateAndDerivative[_AbstractFieldODEStateInterpolator__T]: ... - def isCurrentStateInterpolated(self) -> bool: ... - def isForward(self) -> bool: ... - def isPreviousStateInterpolated(self) -> bool: ... + def isCurrentStateInterpolated(self) -> bool: + """ + Determines if the :meth:`~org.hipparchus.ode.sampling.FieldODEStateInterpolator.getCurrentState` is computed directly by + the integrator, or if it is calculated using + :meth:`~org.hipparchus.ode.sampling.FieldODEStateInterpolator.getInterpolatedState`. + + Typically the current state is directly computed by the integrator, but when events are detected the steps are shortened + so that events occur on step boundaries which means the current state may be computed by the interpolator. + + Specified by: + :meth:`~org.hipparchus.ode.sampling.FieldODEStateInterpolator.isCurrentStateInterpolated` in + interface :class:`~org.hipparchus.ode.sampling.FieldODEStateInterpolator` + + Returns: + :code:`true` if the current state was calculated by the interpolator and false if it was computed directly by the + integrator. + + + """ + ... + def isForward(self) -> bool: + """ + Check if the natural integration direction is forward. + + This method provides the integration direction as specified by the integrator itself, it avoid some nasty problems in + degenerated cases like null steps due to cancellation at step initialization, step control or discrete events + triggering. + + Specified by: + :meth:`~org.hipparchus.ode.sampling.FieldODEStateInterpolator.isForward` in + interface :class:`~org.hipparchus.ode.sampling.FieldODEStateInterpolator` + + Returns: + true if the integration variable (time) increases during integration + + + """ + ... + def isPreviousStateInterpolated(self) -> bool: + """ + Determines if the :meth:`~org.hipparchus.ode.sampling.FieldODEStateInterpolator.getPreviousState` is computed directly + by the integrator, or if it is calculated using + :meth:`~org.hipparchus.ode.sampling.FieldODEStateInterpolator.getInterpolatedState`. + + Typically the previous state is directly computed by the integrator, but when events are detected the steps are + shortened so that events occur on step boundaries which means the previous state may be computed by the interpolator. + + Specified by: + :meth:`~org.hipparchus.ode.sampling.FieldODEStateInterpolator.isPreviousStateInterpolated` in + interface :class:`~org.hipparchus.ode.sampling.FieldODEStateInterpolator` + + Returns: + :code:`true` if the previous state was calculated by the interpolator and false if it was computed directly by the + integrator. + + + """ + ... def restrictStep(self, fieldODEStateAndDerivative: org.hipparchus.ode.FieldODEStateAndDerivative[_AbstractFieldODEStateInterpolator__T], fieldODEStateAndDerivative2: org.hipparchus.ode.FieldODEStateAndDerivative[_AbstractFieldODEStateInterpolator__T]) -> 'AbstractFieldODEStateInterpolator'[_AbstractFieldODEStateInterpolator__T]: ... class AbstractODEStateInterpolator(ODEStateInterpolator): - def getCurrentState(self) -> org.hipparchus.ode.ODEStateAndDerivative: ... - def getGlobalCurrentState(self) -> org.hipparchus.ode.ODEStateAndDerivative: ... - def getGlobalPreviousState(self) -> org.hipparchus.ode.ODEStateAndDerivative: ... - def getInterpolatedState(self, double: float) -> org.hipparchus.ode.ODEStateAndDerivative: ... - def getPreviousState(self) -> org.hipparchus.ode.ODEStateAndDerivative: ... - def isCurrentStateInterpolated(self) -> bool: ... - def isForward(self) -> bool: ... - def isPreviousStateInterpolated(self) -> bool: ... - def restrictStep(self, oDEStateAndDerivative: org.hipparchus.ode.ODEStateAndDerivative, oDEStateAndDerivative2: org.hipparchus.ode.ODEStateAndDerivative) -> 'AbstractODEStateInterpolator': ... + """ + public abstract classAbstractODEStateInterpolator extends :class:`~org.hipparchus.ode.sampling.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.ode.sampling.ODEStateInterpolator` + + This abstract class represents an interpolator over the last step during an ODE integration. + + The various ODE integrators provide objects extending this class to the step handlers. The handlers can use these + objects to retrieve the state vector at intermediate times between the previous and the current grid points (dense + output). + + Also see: + + - :class:`~org.hipparchus.ode.ODEIntegrator` + - :class:`~org.hipparchus.ode.sampling.ODEStepHandler` + - :meth:`~serialized` + """ + def getCurrentState(self) -> org.hipparchus.ode.ODEStateAndDerivative: + """ + Get the state at current grid point time. + + Specified by: + :meth:`~org.hipparchus.ode.sampling.ODEStateInterpolator.getCurrentState` in + interface :class:`~org.hipparchus.ode.sampling.ODEStateInterpolator` + + Returns: + state at current grid point time + + + """ + ... + def getGlobalCurrentState(self) -> org.hipparchus.ode.ODEStateAndDerivative: + """ + Get the current global grid point state. + + Returns: + current global grid point state + + + """ + ... + def getGlobalPreviousState(self) -> org.hipparchus.ode.ODEStateAndDerivative: + """ + Get the previous global grid point state. + + Returns: + previous global grid point state + + + """ + ... + def getInterpolatedState(self, double: float) -> org.hipparchus.ode.ODEStateAndDerivative: + """ + Get the state at interpolated time. + + Setting the time outside of the current step is allowed, but should be used with care since the accuracy of the + interpolator will probably be very poor far from this step. This allowance has been added to simplify implementation of + search algorithms near the step endpoints. + + Specified by: + :meth:`~org.hipparchus.ode.sampling.ODEStateInterpolator.getInterpolatedState` in + interface :class:`~org.hipparchus.ode.sampling.ODEStateInterpolator` + + Parameters: + time (double): time of the interpolated point + + Returns: + state at interpolated time + + + """ + ... + def getPreviousState(self) -> org.hipparchus.ode.ODEStateAndDerivative: + """ + Get the state at previous grid point time. + + Specified by: + :meth:`~org.hipparchus.ode.sampling.ODEStateInterpolator.getPreviousState` in + interface :class:`~org.hipparchus.ode.sampling.ODEStateInterpolator` + + Returns: + state at previous grid point time + + + """ + ... + def isCurrentStateInterpolated(self) -> bool: + """ + Determines if the :meth:`~org.hipparchus.ode.sampling.ODEStateInterpolator.getCurrentState` is computed directly by the + integrator, or if it is calculated using :meth:`~org.hipparchus.ode.sampling.ODEStateInterpolator.getInterpolatedState`. + + Typically the current state is directly computed by the integrator, but when events are detected the steps are shortened + so that events occur on step boundaries which means the current state may be computed by the interpolator. + + Specified by: + :meth:`~org.hipparchus.ode.sampling.ODEStateInterpolator.isCurrentStateInterpolated` in + interface :class:`~org.hipparchus.ode.sampling.ODEStateInterpolator` + + Returns: + :code:`true` if the current state was calculated by the interpolator and false if it was computed directly by the + integrator. + + + """ + ... + def isForward(self) -> bool: + """ + Check if the natural integration direction is forward. + + This method provides the integration direction as specified by the integrator itself, it avoid some nasty problems in + degenerated cases like null steps due to cancellation at step initialization, step control or discrete events + triggering. + + Specified by: + :meth:`~org.hipparchus.ode.sampling.ODEStateInterpolator.isForward` in + interface :class:`~org.hipparchus.ode.sampling.ODEStateInterpolator` + + Returns: + true if the integration variable (time) increases during integration + + + """ + ... + def isPreviousStateInterpolated(self) -> bool: + """ + Determines if the :meth:`~org.hipparchus.ode.sampling.ODEStateInterpolator.getPreviousState` is computed directly by the + integrator, or if it is calculated using :meth:`~org.hipparchus.ode.sampling.ODEStateInterpolator.getInterpolatedState`. + + Typically the previous state is directly computed by the integrator, but when events are detected the steps are + shortened so that events occur on step boundaries which means the previous state may be computed by the interpolator. + + Specified by: + :meth:`~org.hipparchus.ode.sampling.ODEStateInterpolator.isPreviousStateInterpolated` in + interface :class:`~org.hipparchus.ode.sampling.ODEStateInterpolator` + + Returns: + :code:`true` if the previous state was calculated by the interpolator and false if it was computed directly by the + integrator. + + + """ + ... + def restrictStep(self, oDEStateAndDerivative: org.hipparchus.ode.ODEStateAndDerivative, oDEStateAndDerivative2: org.hipparchus.ode.ODEStateAndDerivative) -> 'AbstractODEStateInterpolator': + """ + Create a new restricted version of the instance. + + The instance is not changed at all. + + Parameters: + previousState (:class:`~org.hipparchus.ode.ODEStateAndDerivative`): start of the restricted step + currentState (:class:`~org.hipparchus.ode.ODEStateAndDerivative`): end of the restricted step + + Returns: + restricted version of the instance + + Also see: + + - :meth:`~org.hipparchus.ode.sampling.AbstractODEStateInterpolator.getPreviousState` + - :meth:`~org.hipparchus.ode.sampling.AbstractODEStateInterpolator.getCurrentState` + + + + """ + ... _FieldStepNormalizer__T = typing.TypeVar('_FieldStepNormalizer__T', bound=org.hipparchus.CalculusFieldElement) # <T> class FieldStepNormalizer(FieldODEStepHandler[_FieldStepNormalizer__T], typing.Generic[_FieldStepNormalizer__T]): + """ + public classFieldStepNormalizer<T extends :class:`~org.hipparchus.ode.sampling.https:.www.hipparchus.org.hipparchus`<T>> extends :class:`~org.hipparchus.ode.sampling.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.ode.sampling.FieldODEStepHandler`<T> + + This class wraps an object implementing :class:`~org.hipparchus.ode.sampling.FieldODEFixedStepHandler` into a + :class:`~org.hipparchus.ode.sampling.FieldODEStepHandler`. + + This wrapper allows to use fixed step handlers with general integrators which cannot guaranty their integration steps + will remain constant and therefore only accept general step handlers. + + The stepsize used is selected at construction time. The + :meth:`~org.hipparchus.ode.sampling.FieldODEFixedStepHandler.handleStep` method of the underlying + :class:`~org.hipparchus.ode.sampling.FieldODEFixedStepHandler` object is called at normalized times. The normalized + times can be influenced by the :class:`~org.hipparchus.ode.sampling.StepNormalizerMode` and + :class:`~org.hipparchus.ode.sampling.StepNormalizerBounds`. + + There is no constraint on the integrator, it can use any time step it needs (time steps longer or shorter than the fixed + time step and non-integer ratios are all allowed). + + Also see: + + - :class:`~org.hipparchus.ode.sampling.FieldODEStepHandler` + - :class:`~org.hipparchus.ode.sampling.FieldODEFixedStepHandler` + - :class:`~org.hipparchus.ode.sampling.StepNormalizerMode` + - :class:`~org.hipparchus.ode.sampling.StepNormalizerBounds` + """ @typing.overload def __init__(self, double: float, fieldODEFixedStepHandler: typing.Union[FieldODEFixedStepHandler[_FieldStepNormalizer__T], typing.Callable[[org.hipparchus.ode.FieldODEStateAndDerivative[org.hipparchus.CalculusFieldElement], bool], None]]): ... @typing.overload @@ -118,6 +738,32 @@ class FieldStepNormalizer(FieldODEStepHandler[_FieldStepNormalizer__T], typing.G def init(self, fieldODEStateAndDerivative: org.hipparchus.ode.FieldODEStateAndDerivative[_FieldStepNormalizer__T], t: _FieldStepNormalizer__T) -> None: ... class StepNormalizer(ODEStepHandler): + """ + public classStepNormalizer extends :class:`~org.hipparchus.ode.sampling.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.ode.sampling.ODEStepHandler` + + This class wraps an object implementing :class:`~org.hipparchus.ode.sampling.ODEFixedStepHandler` into a + :class:`~org.hipparchus.ode.sampling.ODEStepHandler`. + + This wrapper allows to use fixed step handlers with general integrators which cannot guaranty their integration steps + will remain constant and therefore only accept general step handlers. + + The stepsize used is selected at construction time. The + :meth:`~org.hipparchus.ode.sampling.ODEFixedStepHandler.handleStep` method of the underlying + :class:`~org.hipparchus.ode.sampling.ODEFixedStepHandler` object is called at normalized times. The normalized times can + be influenced by the :class:`~org.hipparchus.ode.sampling.StepNormalizerMode` and + :class:`~org.hipparchus.ode.sampling.StepNormalizerBounds`. + + There is no constraint on the integrator, it can use any time step it needs (time steps longer or shorter than the fixed + time step and non-integer ratios are all allowed). + + Also see: + + - :class:`~org.hipparchus.ode.sampling.ODEStepHandler` + - :class:`~org.hipparchus.ode.sampling.ODEFixedStepHandler` + - :class:`~org.hipparchus.ode.sampling.StepNormalizerMode` + - :class:`~org.hipparchus.ode.sampling.StepNormalizerBounds` + """ @typing.overload def __init__(self, double: float, oDEFixedStepHandler: typing.Union[ODEFixedStepHandler, typing.Callable]): ... @typing.overload @@ -126,9 +772,54 @@ class StepNormalizer(ODEStepHandler): def __init__(self, double: float, oDEFixedStepHandler: typing.Union[ODEFixedStepHandler, typing.Callable], stepNormalizerMode: StepNormalizerMode): ... @typing.overload def __init__(self, double: float, oDEFixedStepHandler: typing.Union[ODEFixedStepHandler, typing.Callable], stepNormalizerMode: StepNormalizerMode, stepNormalizerBounds: StepNormalizerBounds): ... - def finish(self, oDEStateAndDerivative: org.hipparchus.ode.ODEStateAndDerivative) -> None: ... - def handleStep(self, oDEStateInterpolator: ODEStateInterpolator) -> None: ... - def init(self, oDEStateAndDerivative: org.hipparchus.ode.ODEStateAndDerivative, double: float) -> None: ... + def finish(self, oDEStateAndDerivative: org.hipparchus.ode.ODEStateAndDerivative) -> None: + """ + Finalize integration. + + Specified by: + :meth:`~org.hipparchus.ode.sampling.ODEStepHandler.finish` in + interface :class:`~org.hipparchus.ode.sampling.ODEStepHandler` + + Parameters: + finalState (:class:`~org.hipparchus.ode.ODEStateAndDerivative`): state at integration end + + + """ + ... + def handleStep(self, oDEStateInterpolator: ODEStateInterpolator) -> None: + """ + Handle the last accepted step. + + Specified by: + :meth:`~org.hipparchus.ode.sampling.ODEStepHandler.handleStep` in + interface :class:`~org.hipparchus.ode.sampling.ODEStepHandler` + + Parameters: + interpolator (:class:`~org.hipparchus.ode.sampling.ODEStateInterpolator`): interpolator for the last accepted step + + + """ + ... + def init(self, oDEStateAndDerivative: org.hipparchus.ode.ODEStateAndDerivative, double: float) -> None: + """ + Initialize step handler at the start of an ODE integration. + + This method is called once at the start of the integration. It may be used by the step handler to initialize some + internal data if needed. + + The default implementation does nothing + + Specified by: + :meth:`~org.hipparchus.ode.sampling.ODEStepHandler.init` in + interface :class:`~org.hipparchus.ode.sampling.ODEStepHandler` + + Parameters: + initialState (:class:`~org.hipparchus.ode.ODEStateAndDerivative`): initial time, state vector and derivative + finalTime (double): target time for the integration + + + """ + ... class __module_protocol__(Protocol): diff --git a/org-stubs/hipparchus/optim/__init__.pyi b/org-stubs/hipparchus/optim/__init__.pyi index 0064928..738a9bb 100644 --- a/org-stubs/hipparchus/optim/__init__.pyi +++ b/org-stubs/hipparchus/optim/__init__.pyi @@ -21,11 +21,56 @@ import typing _BaseOptimizer__P = typing.TypeVar('_BaseOptimizer__P') # <P> class BaseOptimizer(typing.Generic[_BaseOptimizer__P]): + """ + public abstract classBaseOptimizer<P> extends :class:`~org.hipparchus.optim.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Base class for implementing optimizers. It contains the boiler-plate code for counting the number of evaluations of the + objective function and the number of iterations of the algorithm, and storing the convergence checker. *It is not a + "user" class.* + """ def getConvergenceChecker(self) -> 'ConvergenceChecker'[_BaseOptimizer__P]: ... - def getEvaluations(self) -> int: ... - def getIterations(self) -> int: ... - def getMaxEvaluations(self) -> int: ... - def getMaxIterations(self) -> int: ... + def getEvaluations(self) -> int: + """ + Gets the number of evaluations of the objective function. The number of evaluations corresponds to the last call to the + :code:`optimize` method. It is 0 if the method has not been called yet. + + Returns: + the number of evaluations of the objective function. + + + """ + ... + def getIterations(self) -> int: + """ + Gets the number of iterations performed by the algorithm. The number iterations corresponds to the last call to the + :code:`optimize` method. It is 0 if the method has not been called yet. + + Returns: + the number of evaluations of the objective function. + + + """ + ... + def getMaxEvaluations(self) -> int: + """ + Gets the maximal number of function evaluations. + + Returns: + the maximal number of function evaluations. + + + """ + ... + def getMaxIterations(self) -> int: + """ + Gets the maximal number of iterations. + + Returns: + the maximal number of iterations. + + + """ + ... @typing.overload def optimize(self) -> _BaseOptimizer__P: ... @typing.overload @@ -33,9 +78,58 @@ class BaseOptimizer(typing.Generic[_BaseOptimizer__P]): _ConvergenceChecker__P = typing.TypeVar('_ConvergenceChecker__P') # <P> class ConvergenceChecker(typing.Generic[_ConvergenceChecker__P]): - def converged(self, int: int, p: _ConvergenceChecker__P, p2: _ConvergenceChecker__P) -> bool: ... + """ + public interfaceConvergenceChecker<P> + + This interface specifies how to check if an optimization algorithm has converged. + + + Deciding if convergence has been reached is a problem-dependent issue. The user should provide a class implementing this + interface to allow the optimization algorithm to stop its search according to the problem at hand. + + + For convenience, three implementations that fit simple needs are already provided: + :class:`~org.hipparchus.optim.SimpleValueChecker`, :class:`~org.hipparchus.optim.SimpleVectorValueChecker` and + :class:`~org.hipparchus.optim.SimplePointChecker`. The first two consider that convergence is reached when the objective + function value does not change much anymore, it does not use the point set at all. The third one considers that + convergence is reached when the input point set does not change much anymore, it does not use objective function value + at all. + + Also see: + + - :class:`~org.hipparchus.optim.SimplePointChecker` + - :class:`~org.hipparchus.optim.SimpleValueChecker` + - :class:`~org.hipparchus.optim.SimpleVectorValueChecker` + """ + def converged(self, int: int, p: _ConvergenceChecker__P, p2: _ConvergenceChecker__P) -> bool: + """ + Check if the optimization algorithm has converged. + + Parameters: + iteration (int): Current iteration. + previous (:class:`~org.hipparchus.optim.ConvergenceChecker`): Best point in the previous iteration. + current (:class:`~org.hipparchus.optim.ConvergenceChecker`): Best point in the current iteration. + + Returns: + :code:`true` if the algorithm is considered to have converged. + + + """ + ... class LocalizedOptimFormats(java.lang.Enum['LocalizedOptimFormats'], org.hipparchus.exception.Localizable): + """ + public enumLocalizedOptimFormats extends :class:`~org.hipparchus.optim.https:.docs.oracle.com.javase.8.docs.api.java.lang.Enum`<:class:`~org.hipparchus.optim.LocalizedOptimFormats`> + implements :class:`~org.hipparchus.optim.https:.www.hipparchus.org.hipparchus` + + Enumeration for localized messages formats used in exceptions messages. + + The constants in this enumeration represent the available formats as localized strings. These formats are intended to be + localized using simple properties files, using the constant name as the key and the property value as the message + format. The source English format is provided in the constants themselves to serve both as a reminder for developers to + understand the parameters needed by each format, as a basis for translators to create localized properties files, and as + a default format if some translation is missing. + """ EQUAL_VERTICES_IN_SIMPLEX: typing.ClassVar['LocalizedOptimFormats'] = ... INVALID_IMPLEMENTATION: typing.ClassVar['LocalizedOptimFormats'] = ... NO_FEASIBLE_SOLUTION: typing.ClassVar['LocalizedOptimFormats'] = ... @@ -48,131 +142,788 @@ class LocalizedOptimFormats(java.lang.Enum['LocalizedOptimFormats'], org.hipparc UNABLE_TO_SOLVE_SINGULAR_PROBLEM: typing.ClassVar['LocalizedOptimFormats'] = ... UNBOUNDED_SOLUTION: typing.ClassVar['LocalizedOptimFormats'] = ... CONSTRAINTS_RANK: typing.ClassVar['LocalizedOptimFormats'] = ... - def getLocalizedString(self, locale: java.util.Locale) -> str: ... - def getSourceString(self) -> str: ... + def getLocalizedString(self, locale: java.util.Locale) -> str: + """ + + Specified by: + :meth:`~org.hipparchus.optim.https:.www.hipparchus.org.hipparchus` in + interface :class:`~org.hipparchus.optim.https:.www.hipparchus.org.hipparchus` + + + """ + ... + def getSourceString(self) -> str: + """ + + Specified by: + :meth:`~org.hipparchus.optim.https:.www.hipparchus.org.hipparchus` in + interface :class:`~org.hipparchus.optim.https:.www.hipparchus.org.hipparchus` + + + """ + ... _valueOf_0__T = typing.TypeVar('_valueOf_0__T', bound=java.lang.Enum) # <T> @typing.overload @staticmethod def valueOf(class_: typing.Type[_valueOf_0__T], string: str) -> _valueOf_0__T: ... @typing.overload @staticmethod - def valueOf(string: str) -> 'LocalizedOptimFormats': ... + def valueOf(string: str) -> 'LocalizedOptimFormats': + """ + Returns the enum constant of this type with the specified name. The string must match *exactly* an identifier used to + declare an enum constant in this type. (Extraneous whitespace characters are not permitted.) + + Parameters: + name (:class:`~org.hipparchus.optim.https:.docs.oracle.com.javase.8.docs.api.java.lang.String`): the name of the enum constant to be returned. + + Returns: + the enum constant with the specified name + + Raises: + :class:`~org.hipparchus.optim.https:.docs.oracle.com.javase.8.docs.api.java.lang.IllegalArgumentException`: if this enum type has no constant with the specified name + :class:`~org.hipparchus.optim.https:.docs.oracle.com.javase.8.docs.api.java.lang.NullPointerException`: if the argument is null + + + """ + ... @staticmethod - def values() -> typing.MutableSequence['LocalizedOptimFormats']: ... + def values() -> typing.MutableSequence['LocalizedOptimFormats']: + """ + Returns an array containing the constants of this enum type, in the order they are declared. + + Returns: + an array containing the constants of this enum type, in the order they are declared + + + """ + ... -class OptimizationData: ... +class OptimizationData: + """ + public interfaceOptimizationData + + Marker interface. Implementations will provide functionality (optional or required) needed by the optimizers, and those + will need to check the actual type of the arguments and perform the appropriate cast in order to access the data they + need. + """ + ... _OptimizationProblem__P = typing.TypeVar('_OptimizationProblem__P') # <P> class OptimizationProblem(typing.Generic[_OptimizationProblem__P]): + """ + public interfaceOptimizationProblem<P> + + Common settings for all optimization problems. Includes divergence and convergence criteria. + """ def getConvergenceChecker(self) -> ConvergenceChecker[_OptimizationProblem__P]: ... - def getEvaluationCounter(self) -> org.hipparchus.util.Incrementor: ... - def getIterationCounter(self) -> org.hipparchus.util.Incrementor: ... + def getEvaluationCounter(self) -> org.hipparchus.util.Incrementor: + """ + Get a independent Incrementor that counts up to the maximum number of evaluations and then throws an exception. + + Returns: + a counter for the evaluations. + + + """ + ... + def getIterationCounter(self) -> org.hipparchus.util.Incrementor: + """ + Get a independent Incrementor that counts up to the maximum number of iterations and then throws an exception. + + Returns: + a counter for the evaluations. + + + """ + ... class PointValuePair(org.hipparchus.util.Pair[typing.MutableSequence[float], float], java.io.Serializable): + """ + public classPointValuePair extends :class:`~org.hipparchus.optim.https:.www.hipparchus.org.hipparchus`<double[],:class:`~org.hipparchus.optim.https:.docs.oracle.com.javase.8.docs.api.java.lang.Double`> + implements :class:`~org.hipparchus.optim.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + This class holds a point and the value of an objective function at that point. + + Also see: + + - :class:`~org.hipparchus.optim.PointVectorValuePair` + - :class:`~org.hipparchus.optim.https:.www.hipparchus.org.hipparchus` + - :meth:`~serialized` + """ @typing.overload def __init__(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], double2: float): ... @typing.overload def __init__(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], double2: float, boolean: bool): ... - def getPoint(self) -> typing.MutableSequence[float]: ... - def getPointRef(self) -> typing.MutableSequence[float]: ... + def getPoint(self) -> typing.MutableSequence[float]: + """ + Gets the point. + + Returns: + a copy of the stored point. + + + """ + ... + def getPointRef(self) -> typing.MutableSequence[float]: + """ + Gets a reference to the point. + + Returns: + a reference to the internal array storing the point. + + + """ + ... class PointVectorValuePair(org.hipparchus.util.Pair[typing.MutableSequence[float], typing.MutableSequence[float]], java.io.Serializable): + """ + public classPointVectorValuePair extends :class:`~org.hipparchus.optim.https:.www.hipparchus.org.hipparchus`<double[],double[]> + implements :class:`~org.hipparchus.optim.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + This class holds a point and the vectorial value of an objective function at that point. + + Also see: + + - :class:`~org.hipparchus.optim.PointValuePair` + - :class:`~org.hipparchus.optim.https:.www.hipparchus.org.hipparchus` + - :meth:`~serialized` + """ @typing.overload def __init__(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray]): ... @typing.overload def __init__(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray], boolean: bool): ... - def getPoint(self) -> typing.MutableSequence[float]: ... - def getPointRef(self) -> typing.MutableSequence[float]: ... - def getValue(self) -> typing.MutableSequence[float]: ... - def getValueRef(self) -> typing.MutableSequence[float]: ... + def getPoint(self) -> typing.MutableSequence[float]: + """ + Gets the point. + + Returns: + a copy of the stored point. + + + """ + ... + def getPointRef(self) -> typing.MutableSequence[float]: + """ + Gets a reference to the point. + + Returns: + a reference to the internal array storing the point. + + + """ + ... + def getValue(self) -> typing.MutableSequence[float]: + """ + Gets the value of the objective function. + + Overrides: + :meth:`~org.hipparchus.optim.https:.www.hipparchus.org.hipparchus` in + class :class:`~org.hipparchus.optim.https:.www.hipparchus.org.hipparchus` + + Returns: + a copy of the stored value of the objective function. + + + """ + ... + def getValueRef(self) -> typing.MutableSequence[float]: + """ + Gets a reference to the value of the objective function. + + Returns: + a reference to the internal array storing the value of the objective function. + + + """ + ... _AbstractConvergenceChecker__P = typing.TypeVar('_AbstractConvergenceChecker__P') # <P> class AbstractConvergenceChecker(ConvergenceChecker[_AbstractConvergenceChecker__P], typing.Generic[_AbstractConvergenceChecker__P]): + """ + public abstract classAbstractConvergenceChecker<P> extends :class:`~org.hipparchus.optim.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.optim.ConvergenceChecker`<P> + + Base class for all convergence checker implementations. + """ def __init__(self, double: float, double2: float): ... - def converged(self, int: int, p: _AbstractConvergenceChecker__P, p2: _AbstractConvergenceChecker__P) -> bool: ... - def getAbsoluteThreshold(self) -> float: ... - def getRelativeThreshold(self) -> float: ... + def converged(self, int: int, p: _AbstractConvergenceChecker__P, p2: _AbstractConvergenceChecker__P) -> bool: + """ + Check if the optimization algorithm has converged. + + Specified by: + :meth:`~org.hipparchus.optim.ConvergenceChecker.converged` in + interface :class:`~org.hipparchus.optim.ConvergenceChecker` + + Parameters: + iteration (int): Current iteration. + previous (:class:`~org.hipparchus.optim.AbstractConvergenceChecker`): Best point in the previous iteration. + current (:class:`~org.hipparchus.optim.AbstractConvergenceChecker`): Best point in the current iteration. + + Returns: + :code:`true` if the algorithm is considered to have converged. + + + """ + ... + def getAbsoluteThreshold(self) -> float: + """ + Get absolute threshold. + + Returns: + the absolute threshold. + + + """ + ... + def getRelativeThreshold(self) -> float: + """ + Get relative threshold. + + Returns: + the relative threshold. + + + """ + ... _AbstractOptimizationProblem__P = typing.TypeVar('_AbstractOptimizationProblem__P') # <P> class AbstractOptimizationProblem(OptimizationProblem[_AbstractOptimizationProblem__P], typing.Generic[_AbstractOptimizationProblem__P]): + """ + public abstract classAbstractOptimizationProblem<P> extends :class:`~org.hipparchus.optim.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.optim.OptimizationProblem`<P> + + Base class for implementing optimization problems. It contains the boiler-plate code for counting the number of + evaluations of the objective function and the number of iterations of the algorithm, and storing the convergence + checker. + """ def getConvergenceChecker(self) -> ConvergenceChecker[_AbstractOptimizationProblem__P]: ... - def getEvaluationCounter(self) -> org.hipparchus.util.Incrementor: ... - def getIterationCounter(self) -> org.hipparchus.util.Incrementor: ... + def getEvaluationCounter(self) -> org.hipparchus.util.Incrementor: + """ + Get a independent Incrementor that counts up to the maximum number of evaluations and then throws an exception. + + Specified by: + :meth:`~org.hipparchus.optim.OptimizationProblem.getEvaluationCounter` in + interface :class:`~org.hipparchus.optim.OptimizationProblem` + + Returns: + a counter for the evaluations. + + + """ + ... + def getIterationCounter(self) -> org.hipparchus.util.Incrementor: + """ + Get a independent Incrementor that counts up to the maximum number of iterations and then throws an exception. + + Specified by: + :meth:`~org.hipparchus.optim.OptimizationProblem.getIterationCounter` in + interface :class:`~org.hipparchus.optim.OptimizationProblem` + + Returns: + a counter for the evaluations. + + + """ + ... _BaseMultivariateOptimizer__P = typing.TypeVar('_BaseMultivariateOptimizer__P') # <P> class BaseMultivariateOptimizer(BaseOptimizer[_BaseMultivariateOptimizer__P], typing.Generic[_BaseMultivariateOptimizer__P]): - def getLowerBound(self) -> typing.MutableSequence[float]: ... - def getStartPoint(self) -> typing.MutableSequence[float]: ... - def getUpperBound(self) -> typing.MutableSequence[float]: ... + """ + public abstract classBaseMultivariateOptimizer<P> extends :class:`~org.hipparchus.optim.BaseOptimizer`<P> + + Base class for implementing optimizers for multivariate functions. It contains the boiler-plate code for initial guess + and bounds specifications. *It is not a "user" class.* + """ + def getLowerBound(self) -> typing.MutableSequence[float]: + """ + Get lower bounds. + + Returns: + the lower bounds, or :code:`null` if not set. + + + """ + ... + def getStartPoint(self) -> typing.MutableSequence[float]: + """ + Gets the initial guess. + + Returns: + the initial guess, or :code:`null` if not set. + + + """ + ... + def getUpperBound(self) -> typing.MutableSequence[float]: + """ + Get upper bounds. + + Returns: + the upper bounds, or :code:`null` if not set. + + + """ + ... @typing.overload - def optimize(self, *optimizationData: OptimizationData) -> _BaseMultivariateOptimizer__P: ... + def optimize(self, *optimizationData: OptimizationData) -> _BaseMultivariateOptimizer__P: + """ + Stores data and performs the optimization. + + The list of parameters is open-ended so that sub-classes can extend it with arguments specific to their concrete + implementations. + + When the method is called multiple times, instance data is overwritten only when actually present in the list of + arguments: when not specified, data set in a previous call is retained (and thus is optional in subsequent calls). + + Important note: Subclasses *must* override :meth:`~org.hipparchus.optim.BaseOptimizer.parseOptimizationData` if they + need to register their own options; but then, they *must* also call :code:`super.parseOptimizationData(optData)` within + that method. + + Overrides: + :meth:`~org.hipparchus.optim.BaseOptimizer.optimize` in class :class:`~org.hipparchus.optim.BaseOptimizer` + + Parameters: + optData (:class:`~org.hipparchus.optim.OptimizationData`...): Optimization data. In addition to those documented in :meth:`~org.hipparchus.optim.BaseOptimizer.parseOptimizationData`, + this method will register the following data: + + - :class:`~org.hipparchus.optim.InitialGuess` + - :class:`~org.hipparchus.optim.SimpleBounds` + + + Returns: + a point/value pair that satisfies the convergence criteria. + + + """ + ... @typing.overload def optimize(self) -> _BaseMultivariateOptimizer__P: ... _ConvergenceCheckerAndMultiplexer__P = typing.TypeVar('_ConvergenceCheckerAndMultiplexer__P') # <P> class ConvergenceCheckerAndMultiplexer(ConvergenceChecker[_ConvergenceCheckerAndMultiplexer__P], typing.Generic[_ConvergenceCheckerAndMultiplexer__P]): + """ + public classConvergenceCheckerAndMultiplexer<P> extends :class:`~org.hipparchus.optim.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.optim.ConvergenceChecker`<P> + + Multiplexer for :class:`~org.hipparchus.optim.ConvergenceChecker`, checking *all* the checkers converged. + + The checkers are checked in the order of the initial list and the check loop is interrupted as soon as one checker fails + to converge (that is the remaining checkers may *not* be called in first iterations. + + Since: + 2.1 + """ def __init__(self, list: java.util.List[typing.Union[ConvergenceChecker[_ConvergenceCheckerAndMultiplexer__P], typing.Callable[[int, _ConvergenceCheckerAndMultiplexer__P, _ConvergenceCheckerAndMultiplexer__P], bool]]]): ... - def converged(self, int: int, p: _ConvergenceCheckerAndMultiplexer__P, p2: _ConvergenceCheckerAndMultiplexer__P) -> bool: ... + def converged(self, int: int, p: _ConvergenceCheckerAndMultiplexer__P, p2: _ConvergenceCheckerAndMultiplexer__P) -> bool: + """ + Check if the optimization algorithm has converged. + + Specified by: + :meth:`~org.hipparchus.optim.ConvergenceChecker.converged` in + interface :class:`~org.hipparchus.optim.ConvergenceChecker` + + Parameters: + iteration (int): Current iteration. + previous (:class:`~org.hipparchus.optim.ConvergenceCheckerAndMultiplexer`): Best point in the previous iteration. + current (:class:`~org.hipparchus.optim.ConvergenceCheckerAndMultiplexer`): Best point in the current iteration. + + Returns: + :code:`true` if the algorithm is considered to have converged. + + + """ + ... _ConvergenceCheckerOrMultiplexer__P = typing.TypeVar('_ConvergenceCheckerOrMultiplexer__P') # <P> class ConvergenceCheckerOrMultiplexer(ConvergenceChecker[_ConvergenceCheckerOrMultiplexer__P], typing.Generic[_ConvergenceCheckerOrMultiplexer__P]): + """ + public classConvergenceCheckerOrMultiplexer<P> extends :class:`~org.hipparchus.optim.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.optim.ConvergenceChecker`<P> + + Multiplexer for :class:`~org.hipparchus.optim.ConvergenceChecker`, checking *one* of the checkers converged. + + The checkers are checked in the order of the initial list and the check loop is interrupted as soon as one checker has + converged (that is the remaining checkers may *not* be called in the final iteration. + + Since: + 2.1 + """ def __init__(self, list: java.util.List[typing.Union[ConvergenceChecker[_ConvergenceCheckerOrMultiplexer__P], typing.Callable[[int, _ConvergenceCheckerOrMultiplexer__P, _ConvergenceCheckerOrMultiplexer__P], bool]]]): ... - def converged(self, int: int, p: _ConvergenceCheckerOrMultiplexer__P, p2: _ConvergenceCheckerOrMultiplexer__P) -> bool: ... + def converged(self, int: int, p: _ConvergenceCheckerOrMultiplexer__P, p2: _ConvergenceCheckerOrMultiplexer__P) -> bool: + """ + Check if the optimization algorithm has converged. + + Specified by: + :meth:`~org.hipparchus.optim.ConvergenceChecker.converged` in + interface :class:`~org.hipparchus.optim.ConvergenceChecker` + + Parameters: + iteration (int): Current iteration. + previous (:class:`~org.hipparchus.optim.ConvergenceCheckerOrMultiplexer`): Best point in the previous iteration. + current (:class:`~org.hipparchus.optim.ConvergenceCheckerOrMultiplexer`): Best point in the current iteration. + + Returns: + :code:`true` if the algorithm is considered to have converged. + + + """ + ... class InitialGuess(OptimizationData): + """ + public classInitialGuess extends :class:`~org.hipparchus.optim.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.optim.OptimizationData` + + Starting point (first guess) of the optimization procedure. + + + Immutable class. + """ def __init__(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]): ... - def getInitialGuess(self) -> typing.MutableSequence[float]: ... + def getInitialGuess(self) -> typing.MutableSequence[float]: + """ + Gets the initial guess. + + Returns: + the initial guess. + + + """ + ... class MaxEval(OptimizationData): + """ + public classMaxEval extends :class:`~org.hipparchus.optim.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.optim.OptimizationData` + + Maximum number of evaluations of the function to be optimized. + """ def __init__(self, int: int): ... - def getMaxEval(self) -> int: ... + def getMaxEval(self) -> int: + """ + Gets the maximum number of evaluations. + + Returns: + the allowed number of evaluations. + + + """ + ... @staticmethod - def unlimited() -> 'MaxEval': ... + def unlimited() -> 'MaxEval': + """ + Factory method that creates instance of this class that represents a virtually unlimited number of evaluations. + + Returns: + a new instance suitable for allowing + :meth:`~org.hipparchus.optim.https:.docs.oracle.com.javase.8.docs.api.java.lang.Integer.MAX_VALUE` evaluations. + + + """ + ... class MaxIter(OptimizationData): + """ + public classMaxIter extends :class:`~org.hipparchus.optim.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.optim.OptimizationData` + + Maximum number of iterations performed by an (iterative) algorithm. + """ def __init__(self, int: int): ... - def getMaxIter(self) -> int: ... + def getMaxIter(self) -> int: + """ + Gets the maximum number of evaluations. + + Returns: + the allowed number of evaluations. + + + """ + ... @staticmethod - def unlimited() -> 'MaxIter': ... + def unlimited() -> 'MaxIter': + """ + Factory method that creates instance of this class that represents a virtually unlimited number of iterations. + + Returns: + a new instance suitable for allowing + :meth:`~org.hipparchus.optim.https:.docs.oracle.com.javase.8.docs.api.java.lang.Integer.MAX_VALUE` evaluations. + + + """ + ... class SimpleBounds(OptimizationData): + """ + public classSimpleBounds extends :class:`~org.hipparchus.optim.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.optim.OptimizationData` + + Simple optimization constraints: lower and upper bounds. The valid range of the parameters is an interval that can be + infinite (in one or both directions). + + + Immutable class. + """ def __init__(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray]): ... - def getLower(self) -> typing.MutableSequence[float]: ... - def getUpper(self) -> typing.MutableSequence[float]: ... + def getLower(self) -> typing.MutableSequence[float]: + """ + Gets the lower bounds. + + Returns: + the lower bounds. + + + """ + ... + def getUpper(self) -> typing.MutableSequence[float]: + """ + Gets the upper bounds. + + Returns: + the upper bounds. + + + """ + ... @staticmethod - def unbounded(int: int) -> 'SimpleBounds': ... + def unbounded(int: int) -> 'SimpleBounds': + """ + Factory method that creates instance of this class that represents unbounded ranges. + + Parameters: + dim (int): Number of parameters. + + Returns: + a new instance suitable for passing to an optimizer that requires bounds specification. + + + """ + ... _BaseMultiStartMultivariateOptimizer__P = typing.TypeVar('_BaseMultiStartMultivariateOptimizer__P') # <P> class BaseMultiStartMultivariateOptimizer(BaseMultivariateOptimizer[_BaseMultiStartMultivariateOptimizer__P], typing.Generic[_BaseMultiStartMultivariateOptimizer__P]): + """ + public abstract classBaseMultiStartMultivariateOptimizer<P> extends :class:`~org.hipparchus.optim.BaseMultivariateOptimizer`<P> + + Base class multi-start optimizer for a multivariate function. + + + This class wraps an optimizer in order to use it several times in turn with different starting points (trying to avoid + being trapped in a local extremum when looking for a global one). *It is not a "user" class.* + """ def __init__(self, baseMultivariateOptimizer: BaseMultivariateOptimizer[_BaseMultiStartMultivariateOptimizer__P], int: int, randomVectorGenerator: typing.Union[org.hipparchus.random.RandomVectorGenerator, typing.Callable]): ... - def getEvaluations(self) -> int: ... - def getOptima(self) -> typing.MutableSequence[_BaseMultiStartMultivariateOptimizer__P]: ... + def getEvaluations(self) -> int: + """ + Gets the number of evaluations of the objective function. The number of evaluations corresponds to the last call to the + :code:`optimize` method. It is 0 if the method has not been called yet. + + Overrides: + :meth:`~org.hipparchus.optim.BaseOptimizer.getEvaluations` in class :class:`~org.hipparchus.optim.BaseOptimizer` + + Returns: + the number of evaluations of the objective function. + + + """ + ... + def getOptima(self) -> typing.MutableSequence[_BaseMultiStartMultivariateOptimizer__P]: + """ + 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`. + + Returns: + an array containing the optima sorted from best to worst. + + + """ + ... @typing.overload - def optimize(self, *optimizationData: OptimizationData) -> _BaseMultiStartMultivariateOptimizer__P: ... + def optimize(self, *optimizationData: OptimizationData) -> _BaseMultiStartMultivariateOptimizer__P: + """ + Stores data and performs the optimization. + + The list of parameters is open-ended so that sub-classes can extend it with arguments specific to their concrete + implementations. + + When the method is called multiple times, instance data is overwritten only when actually present in the list of + arguments: when not specified, data set in a previous call is retained (and thus is optional in subsequent calls). + + Important note: Subclasses *must* override :meth:`~org.hipparchus.optim.BaseOptimizer.parseOptimizationData` if they + need to register their own options; but then, they *must* also call :code:`super.parseOptimizationData(optData)` within + that method. + + Overrides: + :meth:`~org.hipparchus.optim.BaseMultivariateOptimizer.optimize` in + class :class:`~org.hipparchus.optim.BaseMultivariateOptimizer` + + Parameters: + optData (:class:`~org.hipparchus.optim.OptimizationData`...): Optimization data. In addition to those documented in :meth:`~org.hipparchus.optim.BaseOptimizer.parseOptimizationData`, + this method will register the following data: + + - :class:`~org.hipparchus.optim.InitialGuess` + - :class:`~org.hipparchus.optim.SimpleBounds` + + + Returns: + a point/value pair that satisfies the convergence criteria. + + Raises: + :class:`~org.hipparchus.optim.https:.www.hipparchus.org.hipparchus`: if :code:`optData` does not contain an instance of :class:`~org.hipparchus.optim.MaxEval` or + :class:`~org.hipparchus.optim.InitialGuess`. + + + """ + ... @typing.overload def optimize(self) -> _BaseMultiStartMultivariateOptimizer__P: ... _SimplePointChecker__P = typing.TypeVar('_SimplePointChecker__P', bound=org.hipparchus.util.Pair) # <P> class SimplePointChecker(AbstractConvergenceChecker[_SimplePointChecker__P], typing.Generic[_SimplePointChecker__P]): + """ + public classSimplePointChecker<P extends :class:`~org.hipparchus.optim.https:.www.hipparchus.org.hipparchus`<double[],? extends :class:`~org.hipparchus.optim.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object`>> extends :class:`~org.hipparchus.optim.AbstractConvergenceChecker`<P> + + Simple implementation of the :class:`~org.hipparchus.optim.ConvergenceChecker` interface using only point coordinates. + Convergence is considered to have been reached if either the relative difference between each point coordinate are + smaller than a threshold or if either the absolute difference between the point coordinates are smaller than another + threshold. + + + The :meth:`~org.hipparchus.optim.SimplePointChecker.converged` method will also return :code:`true` if the number of + iterations has been set (see :meth:`~org.hipparchus.optim.SimplePointChecker.%3Cinit%3E`). + """ @typing.overload def __init__(self, double: float, double2: float): ... @typing.overload def __init__(self, double: float, double2: float, int: int): ... - def converged(self, int: int, p: _SimplePointChecker__P, p2: _SimplePointChecker__P) -> bool: ... + def converged(self, int: int, p: _SimplePointChecker__P, p2: _SimplePointChecker__P) -> bool: + """ + Check if the optimization algorithm has converged considering the last two points. This method may be called several + times from the same algorithm iteration with different points. This can be detected by checking the iteration number at + each call if needed. Each time this method is called, the previous and current point correspond to points with the same + role at each iteration, so they can be compared. As an example, simplex-based algorithms call this method for all points + of the simplex, not only for the best or worst ones. + + Specified by: + :meth:`~org.hipparchus.optim.ConvergenceChecker.converged` in + interface :class:`~org.hipparchus.optim.ConvergenceChecker` + + Specified by: + :meth:`~org.hipparchus.optim.AbstractConvergenceChecker.converged` in + class :class:`~org.hipparchus.optim.AbstractConvergenceChecker` + + Parameters: + iteration (int): Index of current iteration + previous (:class:`~org.hipparchus.optim.SimplePointChecker`): Best point in the previous iteration. + current (:class:`~org.hipparchus.optim.SimplePointChecker`): Best point in the current iteration. + + Returns: + :code:`true` if the arguments satify the convergence criterion. + + + """ + ... class SimpleValueChecker(AbstractConvergenceChecker[PointValuePair]): + """ + public classSimpleValueChecker extends :class:`~org.hipparchus.optim.AbstractConvergenceChecker`<:class:`~org.hipparchus.optim.PointValuePair`> + + Simple implementation of the :class:`~org.hipparchus.optim.ConvergenceChecker` interface using only objective function + values. Convergence is considered to have been reached if either the relative difference between the objective function + values is smaller than a threshold or if either the absolute difference between the objective function values is smaller + than another threshold. + + + The :meth:`~org.hipparchus.optim.SimpleValueChecker.converged` method will also return :code:`true` if the number of + iterations has been set (see :meth:`~org.hipparchus.optim.SimpleValueChecker.%3Cinit%3E`). + """ @typing.overload def __init__(self, double: float, double2: float): ... @typing.overload def __init__(self, double: float, double2: float, int: int): ... - def converged(self, int: int, pointValuePair: PointValuePair, pointValuePair2: PointValuePair) -> bool: ... + def converged(self, int: int, pointValuePair: PointValuePair, pointValuePair2: PointValuePair) -> bool: + """ + Check if the optimization algorithm has converged considering the last two points. This method may be called several + time from the same algorithm iteration with different points. This can be detected by checking the iteration number at + each call if needed. Each time this method is called, the previous and current point correspond to points with the same + role at each iteration, so they can be compared. As an example, simplex-based algorithms call this method for all points + of the simplex, not only for the best or worst ones. + + Specified by: + :meth:`~org.hipparchus.optim.ConvergenceChecker.converged` in + interface :class:`~org.hipparchus.optim.ConvergenceChecker` + + Specified by: + :meth:`~org.hipparchus.optim.AbstractConvergenceChecker.converged` in + class :class:`~org.hipparchus.optim.AbstractConvergenceChecker` + + Parameters: + iteration (int): Index of current iteration + previous (:class:`~org.hipparchus.optim.PointValuePair`): Best point in the previous iteration. + current (:class:`~org.hipparchus.optim.PointValuePair`): Best point in the current iteration. + + Returns: + :code:`true` if the algorithm has converged. + + + """ + ... class SimpleVectorValueChecker(AbstractConvergenceChecker[PointVectorValuePair]): + """ + public classSimpleVectorValueChecker extends :class:`~org.hipparchus.optim.AbstractConvergenceChecker`<:class:`~org.hipparchus.optim.PointVectorValuePair`> + + Simple implementation of the :class:`~org.hipparchus.optim.ConvergenceChecker` interface using only objective function + values. Convergence is considered to have been reached if either the relative difference between the objective function + values is smaller than a threshold or if either the absolute difference between the objective function values is smaller + than another threshold for all vectors elements. + + + The :meth:`~org.hipparchus.optim.SimpleVectorValueChecker.converged` method will also return :code:`true` if the number + of iterations has been set (see :meth:`~org.hipparchus.optim.SimpleVectorValueChecker.%3Cinit%3E`). + """ @typing.overload def __init__(self, double: float, double2: float): ... @typing.overload def __init__(self, double: float, double2: float, int: int): ... - def converged(self, int: int, pointVectorValuePair: PointVectorValuePair, pointVectorValuePair2: PointVectorValuePair) -> bool: ... + def converged(self, int: int, pointVectorValuePair: PointVectorValuePair, pointVectorValuePair2: PointVectorValuePair) -> bool: + """ + Check if the optimization algorithm has converged considering the last two points. This method may be called several + times from the same algorithm iteration with different points. This can be detected by checking the iteration number at + each call if needed. Each time this method is called, the previous and current point correspond to points with the same + role at each iteration, so they can be compared. As an example, simplex-based algorithms call this method for all points + of the simplex, not only for the best or worst ones. + + Specified by: + :meth:`~org.hipparchus.optim.ConvergenceChecker.converged` in + interface :class:`~org.hipparchus.optim.ConvergenceChecker` + + Specified by: + :meth:`~org.hipparchus.optim.AbstractConvergenceChecker.converged` in + class :class:`~org.hipparchus.optim.AbstractConvergenceChecker` + + Parameters: + iteration (int): Index of current iteration + previous (:class:`~org.hipparchus.optim.PointVectorValuePair`): Best point in the previous iteration. + current (:class:`~org.hipparchus.optim.PointVectorValuePair`): Best point in the current iteration. + + Returns: + :code:`true` if the arguments satify the convergence criterion. + + + """ + ... class __module_protocol__(Protocol): diff --git a/org-stubs/hipparchus/optim/linear/__init__.pyi b/org-stubs/hipparchus/optim/linear/__init__.pyi index 0703434..154ddd0 100644 --- a/org-stubs/hipparchus/optim/linear/__init__.pyi +++ b/org-stubs/hipparchus/optim/linear/__init__.pyi @@ -18,6 +18,32 @@ import typing class LinearConstraint(java.io.Serializable): + """ + public classLinearConstraint extends :class:`~org.hipparchus.optim.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.optim.linear.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + A linear constraint for a linear optimization problem. + + * A linear constraint has one of the forms: + + - c :sub:`1` x :sub:`1` + ... c :sub:`n` x :sub:`n` = v + - c :sub:`1` x :sub:`1` + ... c :sub:`n` x :sub:`n` <= v + - c :sub:`1` x :sub:`1` + ... c :sub:`n` x :sub:`n` >= v + - l :sub:`1` x :sub:`1` + ... l :sub:`n` x :sub:`n` + l :sub:`cst` = r :sub:`1` x :sub:`1` + ... r :sub:`n` x :sub:`n` + r + :sub:`cst` + - l :sub:`1` x :sub:`1` + ... l :sub:`n` x :sub:`n` + l :sub:`cst` <= r :sub:`1` x :sub:`1` + ... r :sub:`n` x :sub:`n` + + r :sub:`cst` + - l :sub:`1` x :sub:`1` + ... l :sub:`n` x :sub:`n` + l :sub:`cst` >= r :sub:`1` x :sub:`1` + ... r :sub:`n` x :sub:`n` + + r :sub:`cst` + + + The c :sub:`i` , l :sub:`i` or r :sub:`i` are the coefficients of the constraints, the x :sub:`i` are the coordinates of + the current point and v is the value of the constraint. + + Also see: + + - :meth:`~serialized` + """ @typing.overload def __init__(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], double2: float, relationship: 'Relationship', doubleArray2: typing.Union[typing.List[float], jpype.JArray], double4: float): ... @typing.overload @@ -26,13 +52,64 @@ class LinearConstraint(java.io.Serializable): def __init__(self, realVector: org.hipparchus.linear.RealVector, double: float, relationship: 'Relationship', realVector2: org.hipparchus.linear.RealVector, double2: float): ... @typing.overload def __init__(self, realVector: org.hipparchus.linear.RealVector, relationship: 'Relationship', double: float): ... - def equals(self, object: typing.Any) -> bool: ... - def getCoefficients(self) -> org.hipparchus.linear.RealVector: ... - def getRelationship(self) -> 'Relationship': ... - def getValue(self) -> float: ... - def hashCode(self) -> int: ... + def equals(self, object: typing.Any) -> bool: + """ + + Overrides: + :meth:`~org.hipparchus.optim.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.equals` in + class :class:`~org.hipparchus.optim.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + + """ + ... + def getCoefficients(self) -> org.hipparchus.linear.RealVector: + """ + Gets the coefficients of the constraint (left hand side). + + Returns: + the coefficients of the constraint (left hand side). + + + """ + ... + def getRelationship(self) -> 'Relationship': + """ + Gets the relationship between left and right hand sides. + + Returns: + the relationship between left and right hand sides. + + + """ + ... + def getValue(self) -> float: + """ + Gets the value of the constraint (right hand side). + + Returns: + the value of the constraint (right hand side). + + + """ + ... + def hashCode(self) -> int: + """ + + Overrides: + :meth:`~org.hipparchus.optim.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.hashCode` in + class :class:`~org.hipparchus.optim.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + + """ + ... class LinearConstraintSet(org.hipparchus.optim.OptimizationData): + """ + public classLinearConstraintSet extends :class:`~org.hipparchus.optim.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.optim.OptimizationData` + + Class that represents a set of :class:`~org.hipparchus.optim.linear.LinearConstraint`. + """ @typing.overload def __init__(self, collection: typing.Union[java.util.Collection[LinearConstraint], typing.Sequence[LinearConstraint], typing.Set[LinearConstraint]]): ... @typing.overload @@ -40,30 +117,130 @@ class LinearConstraintSet(org.hipparchus.optim.OptimizationData): def getConstraints(self) -> java.util.Collection[LinearConstraint]: ... class LinearObjectiveFunction(org.hipparchus.analysis.MultivariateFunction, org.hipparchus.optim.OptimizationData, java.io.Serializable): + """ + public classLinearObjectiveFunction extends :class:`~org.hipparchus.optim.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.optim.linear.https:.www.hipparchus.org.hipparchus`, :class:`~org.hipparchus.optim.OptimizationData`, :class:`~org.hipparchus.optim.linear.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + An objective function for a linear optimization problem. + + A linear objective function has one the form: \[ c_1 x_1 + \ldots c_n x_n + d \] The c :sub:`i` and d are the + coefficients of the equation, the x :sub:`i` are the coordinates of the current point. + + Also see: + + - :meth:`~serialized` + """ @typing.overload def __init__(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], double2: float): ... @typing.overload def __init__(self, realVector: org.hipparchus.linear.RealVector, double: float): ... - def equals(self, object: typing.Any) -> bool: ... - def getCoefficients(self) -> org.hipparchus.linear.RealVector: ... - def getConstantTerm(self) -> float: ... - def hashCode(self) -> int: ... + def equals(self, object: typing.Any) -> bool: + """ + + Overrides: + :meth:`~org.hipparchus.optim.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.equals` in + class :class:`~org.hipparchus.optim.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + + """ + ... + def getCoefficients(self) -> org.hipparchus.linear.RealVector: + """ + Gets the coefficients of the linear equation being optimized. + + Returns: + coefficients of the linear equation being optimized. + + + """ + ... + def getConstantTerm(self) -> float: + """ + Gets the constant of the linear equation being optimized. + + Returns: + constant of the linear equation being optimized. + + + """ + ... + def hashCode(self) -> int: + """ + + Overrides: + :meth:`~org.hipparchus.optim.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.hashCode` in + class :class:`~org.hipparchus.optim.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + + """ + ... @typing.overload - def value(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> float: ... + def value(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> float: + """ + Computes the value of the linear equation at the current point. + + Specified by: + :meth:`~org.hipparchus.optim.linear.https:.www.hipparchus.org.hipparchus` in + interface :class:`~org.hipparchus.optim.linear.https:.www.hipparchus.org.hipparchus` + + Parameters: + point (double[]): Point at which linear equation must be evaluated. + + Returns: + the value of the linear equation at the current point. + + Computes the value of the linear equation at the current point. + + Parameters: + point (:class:`~org.hipparchus.optim.linear.https:.www.hipparchus.org.hipparchus`): Point at which linear equation must be evaluated. + + Returns: + the value of the linear equation at the current point. + + + """ + ... @typing.overload def value(self, realVector: org.hipparchus.linear.RealVector) -> float: ... class LinearOptimizer(org.hipparchus.optim.nonlinear.scalar.MultivariateOptimizer): + """ + public abstract classLinearOptimizer extends :class:`~org.hipparchus.optim.nonlinear.scalar.MultivariateOptimizer` + + Base class for implementing linear optimizers. + """ @typing.overload def optimize(self) -> typing.Any: ... @typing.overload def optimize(self, *optimizationData: org.hipparchus.optim.OptimizationData) -> org.hipparchus.optim.PointValuePair: ... class NonNegativeConstraint(org.hipparchus.optim.OptimizationData): + """ + public classNonNegativeConstraint extends :class:`~org.hipparchus.optim.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.optim.OptimizationData` + + A constraint for a linear optimization problem indicating whether all variables must be restricted to non-negative + values. + """ def __init__(self, boolean: bool): ... - def isRestrictedToNonNegative(self) -> bool: ... + def isRestrictedToNonNegative(self) -> bool: + """ + Indicates whether all the variables must be restricted to non-negative values. + + Returns: + :code:`true` if all the variables must be positive. + + + """ + ... class PivotSelectionRule(java.lang.Enum['PivotSelectionRule'], org.hipparchus.optim.OptimizationData): + """ + public enumPivotSelectionRule extends :class:`~org.hipparchus.optim.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.Enum`<:class:`~org.hipparchus.optim.linear.PivotSelectionRule`> + implements :class:`~org.hipparchus.optim.OptimizationData` + + Pivot selection rule to the use for a Simplex solver. + """ DANTZIG: typing.ClassVar['PivotSelectionRule'] = ... BLAND: typing.ClassVar['PivotSelectionRule'] = ... _valueOf_0__T = typing.TypeVar('_valueOf_0__T', bound=java.lang.Enum) # <T> @@ -72,32 +249,173 @@ class PivotSelectionRule(java.lang.Enum['PivotSelectionRule'], org.hipparchus.op def valueOf(class_: typing.Type[_valueOf_0__T], string: str) -> _valueOf_0__T: ... @typing.overload @staticmethod - def valueOf(string: str) -> 'PivotSelectionRule': ... + def valueOf(string: str) -> 'PivotSelectionRule': + """ + Returns the enum constant of this type with the specified name. The string must match *exactly* an identifier used to + declare an enum constant in this type. (Extraneous whitespace characters are not permitted.) + + Parameters: + name (:class:`~org.hipparchus.optim.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.String`): the name of the enum constant to be returned. + + Returns: + the enum constant with the specified name + + Raises: + :class:`~org.hipparchus.optim.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.IllegalArgumentException`: if this enum type has no constant with the specified name + :class:`~org.hipparchus.optim.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.NullPointerException`: if the argument is null + + + """ + ... @staticmethod - def values() -> typing.MutableSequence['PivotSelectionRule']: ... + def values() -> typing.MutableSequence['PivotSelectionRule']: + """ + Returns an array containing the constants of this enum type, in the order they are declared. + + Returns: + an array containing the constants of this enum type, in the order they are declared + + + """ + ... class Relationship(java.lang.Enum['Relationship']): + """ + public enumRelationship extends :class:`~org.hipparchus.optim.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.Enum`<:class:`~org.hipparchus.optim.linear.Relationship`> + + Types of relationships between two cells in a Solver :class:`~org.hipparchus.optim.linear.LinearConstraint`. + """ EQ: typing.ClassVar['Relationship'] = ... LEQ: typing.ClassVar['Relationship'] = ... GEQ: typing.ClassVar['Relationship'] = ... - def oppositeRelationship(self) -> 'Relationship': ... - def toString(self) -> str: ... + def oppositeRelationship(self) -> 'Relationship': + """ + Gets the relationship obtained when multiplying all coefficients by -1. + + Returns: + the opposite relationship. + + + """ + ... + def toString(self) -> str: + """ + + Overrides: + :meth:`~org.hipparchus.optim.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.Enum.toString` in + class :class:`~org.hipparchus.optim.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.Enum` + + + """ + ... _valueOf_0__T = typing.TypeVar('_valueOf_0__T', bound=java.lang.Enum) # <T> @typing.overload @staticmethod def valueOf(class_: typing.Type[_valueOf_0__T], string: str) -> _valueOf_0__T: ... @typing.overload @staticmethod - def valueOf(string: str) -> 'Relationship': ... + def valueOf(string: str) -> 'Relationship': + """ + Returns the enum constant of this type with the specified name. The string must match *exactly* an identifier used to + declare an enum constant in this type. (Extraneous whitespace characters are not permitted.) + + Parameters: + name (:class:`~org.hipparchus.optim.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.String`): the name of the enum constant to be returned. + + Returns: + the enum constant with the specified name + + Raises: + :class:`~org.hipparchus.optim.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.IllegalArgumentException`: if this enum type has no constant with the specified name + :class:`~org.hipparchus.optim.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.NullPointerException`: if the argument is null + + + """ + ... @staticmethod - def values() -> typing.MutableSequence['Relationship']: ... + def values() -> typing.MutableSequence['Relationship']: + """ + Returns an array containing the constants of this enum type, in the order they are declared. + + Returns: + an array containing the constants of this enum type, in the order they are declared + + + """ + ... class SolutionCallback(org.hipparchus.optim.OptimizationData): + """ + public classSolutionCallback extends :class:`~org.hipparchus.optim.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.optim.OptimizationData` + + A callback object that can be provided to a linear optimizer to keep track of the best solution found. + """ def __init__(self): ... - def getSolution(self) -> org.hipparchus.optim.PointValuePair: ... - def isSolutionOptimal(self) -> bool: ... + def getSolution(self) -> org.hipparchus.optim.PointValuePair: + """ + Retrieve the best solution found so far. + + **Note:** the returned solution may not be optimal, e.g. in case the optimizer did reach the iteration limits. + + Returns: + the best solution found so far by the optimizer, or :code:`null` if no feasible solution could be found + + + """ + ... + def isSolutionOptimal(self) -> bool: + """ + Returns if the found solution is optimal. + + Returns: + :code:`true` if the solution is optimal, :code:`false` otherwise + + + """ + ... class SimplexSolver(LinearOptimizer): + """ + public classSimplexSolver extends :class:`~org.hipparchus.optim.linear.LinearOptimizer` + + Solves a linear problem using the "Two-Phase Simplex" method. + + The :class:`~org.hipparchus.optim.linear.SimplexSolver` supports the following + :class:`~org.hipparchus.optim.OptimizationData` data provided as arguments to + :meth:`~org.hipparchus.optim.linear.SimplexSolver.optimize`: + + - objective function: :class:`~org.hipparchus.optim.linear.LinearObjectiveFunction` - mandatory + - linear constraints :class:`~org.hipparchus.optim.linear.LinearConstraintSet` - mandatory + - type of optimization: :class:`~org.hipparchus.optim.nonlinear.scalar.GoalType` - optional, default: + :meth:`~org.hipparchus.optim.nonlinear.scalar.GoalType.MINIMIZE` + - whether to allow negative values as solution: :class:`~org.hipparchus.optim.linear.NonNegativeConstraint` - optional, + default: true + - pivot selection rule: :class:`~org.hipparchus.optim.linear.PivotSelectionRule` - optional, default + :meth:`~org.hipparchus.optim.linear.PivotSelectionRule.DANTZIG` + - callback for the best solution: :class:`~org.hipparchus.optim.linear.SolutionCallback` - optional + - maximum number of iterations: :class:`~org.hipparchus.optim.MaxIter` - optional, default: + :meth:`~org.hipparchus.optim.linear.https:.docs.oracle.com.javase.8.docs.api.java.lang.Integer.MAX_VALUE` + + + **Note:** Depending on the problem definition, the default convergence criteria may be too strict, resulting in + :class:`~org.hipparchus.optim.linear.https:.www.hipparchus.org.hipparchus` or + :class:`~org.hipparchus.optim.linear.https:.www.hipparchus.org.hipparchus`. In such a case it is advised to adjust these + criteria with more appropriate values, e.g. relaxing the epsilon value. + + Default convergence criteria: + + - Algorithm convergence: 1e-6 + - Floating-point comparisons: 10 ulp + - Cut-Off value: 1e-10 + + + The cut-off value has been introduced to handle the case of very small pivot elements in the Simplex tableau, as these + may lead to numerical instabilities and degeneracy. Potential pivot elements smaller than this value will be treated as + if they were zero and are thus not considered by the pivot selection mechanism. The default value is safe for many + problems, but may need to be adjusted in case of very small coefficients used in either the + :class:`~org.hipparchus.optim.linear.LinearConstraint` or :class:`~org.hipparchus.optim.linear.LinearObjectiveFunction`. + """ @typing.overload def __init__(self): ... @typing.overload diff --git a/org-stubs/hipparchus/optim/nonlinear/scalar/__init__.pyi b/org-stubs/hipparchus/optim/nonlinear/scalar/__init__.pyi index 033c389..9c1962b 100644 --- a/org-stubs/hipparchus/optim/nonlinear/scalar/__init__.pyi +++ b/org-stubs/hipparchus/optim/nonlinear/scalar/__init__.pyi @@ -19,6 +19,12 @@ import typing class GoalType(java.lang.Enum['GoalType'], org.hipparchus.optim.OptimizationData): + """ + public enumGoalType extends :class:`~org.hipparchus.optim.nonlinear.scalar.https:.docs.oracle.com.javase.8.docs.api.java.lang.Enum`<:class:`~org.hipparchus.optim.nonlinear.scalar.GoalType`> + implements :class:`~org.hipparchus.optim.OptimizationData` + + Goal type for an optimization problem (minimization or maximization of a scalar function. + """ MAXIMIZE: typing.ClassVar['GoalType'] = ... MINIMIZE: typing.ClassVar['GoalType'] = ... _valueOf_0__T = typing.TypeVar('_valueOf_0__T', bound=java.lang.Enum) # <T> @@ -27,54 +33,379 @@ class GoalType(java.lang.Enum['GoalType'], org.hipparchus.optim.OptimizationData def valueOf(class_: typing.Type[_valueOf_0__T], string: str) -> _valueOf_0__T: ... @typing.overload @staticmethod - def valueOf(string: str) -> 'GoalType': ... + def valueOf(string: str) -> 'GoalType': + """ + Returns the enum constant of this type with the specified name. The string must match *exactly* an identifier used to + declare an enum constant in this type. (Extraneous whitespace characters are not permitted.) + + Parameters: + name (:class:`~org.hipparchus.optim.nonlinear.scalar.https:.docs.oracle.com.javase.8.docs.api.java.lang.String`): the name of the enum constant to be returned. + + Returns: + the enum constant with the specified name + + Raises: + :class:`~org.hipparchus.optim.nonlinear.scalar.https:.docs.oracle.com.javase.8.docs.api.java.lang.IllegalArgumentException`: if this enum type has no constant with the specified name + :class:`~org.hipparchus.optim.nonlinear.scalar.https:.docs.oracle.com.javase.8.docs.api.java.lang.NullPointerException`: if the argument is null + + + """ + ... @staticmethod - def values() -> typing.MutableSequence['GoalType']: ... + def values() -> typing.MutableSequence['GoalType']: + """ + Returns an array containing the constants of this enum type, in the order they are declared. + + Returns: + an array containing the constants of this enum type, in the order they are declared + + + """ + ... class LeastSquaresConverter(org.hipparchus.analysis.MultivariateFunction): + """ + public classLeastSquaresConverter extends :class:`~org.hipparchus.optim.nonlinear.scalar.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.optim.nonlinear.scalar.https:.www.hipparchus.org.hipparchus` + + This class converts :class:`~org.hipparchus.optim.nonlinear.scalar.https:.www.hipparchus.org.hipparchus` to + :class:`~org.hipparchus.optim.nonlinear.scalar.https:.www.hipparchus.org.hipparchus` when the goal is to minimize them. + + + This class is mostly used when the vectorial objective function represents a theoretical result computed from a point + set applied to a model and the models point must be adjusted to fit the theoretical result to some reference + observations. The observations may be obtained for example from physical measurements whether the model is built from + theoretical considerations. + + + This class computes a possibly weighted squared sum of the residuals, which is a scalar value. The residuals are the + difference between the theoretical model (i.e. the output of the vectorial objective function) and the observations. The + class implements the :class:`~org.hipparchus.optim.nonlinear.scalar.https:.www.hipparchus.org.hipparchus` interface and + can therefore be minimized by any optimizer supporting scalar objectives functions.This is one way to perform a least + square estimation. There are other ways to do this without using this converter, as some optimization algorithms + directly support vectorial objective functions. + + + This class support combination of residuals with or without weights and correlations. + + Also see: + + - :class:`~org.hipparchus.optim.nonlinear.scalar.https:.www.hipparchus.org.hipparchus` + - :class:`~org.hipparchus.optim.nonlinear.scalar.https:.www.hipparchus.org.hipparchus` + """ @typing.overload def __init__(self, multivariateVectorFunction: typing.Union[org.hipparchus.analysis.MultivariateVectorFunction, typing.Callable], doubleArray: typing.Union[typing.List[float], jpype.JArray]): ... @typing.overload def __init__(self, multivariateVectorFunction: typing.Union[org.hipparchus.analysis.MultivariateVectorFunction, typing.Callable], doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray]): ... @typing.overload def __init__(self, multivariateVectorFunction: typing.Union[org.hipparchus.analysis.MultivariateVectorFunction, typing.Callable], doubleArray: typing.Union[typing.List[float], jpype.JArray], realMatrix: org.hipparchus.linear.RealMatrix): ... - def value(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> float: ... + def value(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> float: + """ + + Specified by: + :meth:`~org.hipparchus.optim.nonlinear.scalar.https:.www.hipparchus.org.hipparchus` in + interface :class:`~org.hipparchus.optim.nonlinear.scalar.https:.www.hipparchus.org.hipparchus` + + + """ + ... class LineSearch: + """ + public classLineSearch extends :class:`~org.hipparchus.optim.nonlinear.scalar.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Class for finding the minimum of the objective function along a given direction. + """ def __init__(self, multivariateOptimizer: 'MultivariateOptimizer', double: float, double2: float, double3: float): ... - def search(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray]) -> org.hipparchus.optim.univariate.UnivariatePointValuePair: ... + def search(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray]) -> org.hipparchus.optim.univariate.UnivariatePointValuePair: + """ + Finds the number :code:`alpha` that optimizes :code:`f(startPoint + alpha * direction)`. + + Parameters: + startPoint (double[]): Starting point. + direction (double[]): Search direction. + + Returns: + the optimum. + + Raises: + :class:`~org.hipparchus.optim.nonlinear.scalar.https:.www.hipparchus.org.hipparchus`: if the number of evaluations is exceeded. + + + """ + ... class MultiStartMultivariateOptimizer(org.hipparchus.optim.BaseMultiStartMultivariateOptimizer[org.hipparchus.optim.PointValuePair]): + """ + public classMultiStartMultivariateOptimizer extends :class:`~org.hipparchus.optim.BaseMultiStartMultivariateOptimizer`<:class:`~org.hipparchus.optim.PointValuePair`> + + Multi-start optimizer. This class wraps an optimizer in order to use it several times in turn with different starting + points (trying to avoid being trapped in a local extremum when looking for a global one). + """ def __init__(self, multivariateOptimizer: 'MultivariateOptimizer', int: int, randomVectorGenerator: typing.Union[org.hipparchus.random.RandomVectorGenerator, typing.Callable]): ... - def getOptima(self) -> typing.MutableSequence[org.hipparchus.optim.PointValuePair]: ... + def getOptima(self) -> typing.MutableSequence[org.hipparchus.optim.PointValuePair]: + """ + 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`. + + Specified by: + :meth:`~org.hipparchus.optim.BaseMultiStartMultivariateOptimizer.getOptima` in + class :class:`~org.hipparchus.optim.BaseMultiStartMultivariateOptimizer` + + Returns: + an array containing the optima sorted from best to worst. + + + """ + ... class MultivariateFunctionMappingAdapter(org.hipparchus.analysis.MultivariateFunction): + """ + public classMultivariateFunctionMappingAdapter extends :class:`~org.hipparchus.optim.nonlinear.scalar.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.optim.nonlinear.scalar.https:.www.hipparchus.org.hipparchus` + + + Adapter for mapping bounded :class:`~org.hipparchus.optim.nonlinear.scalar.https:.www.hipparchus.org.hipparchus` to + unbounded ones. + + This adapter can be used to wrap functions subject to simple bounds on parameters so they can be used by optimizers that + do *not* directly support simple bounds. + + The principle is that the user function that will be wrapped will see its parameters bounded as required, i.e when its + :code:`value` method is called with argument array :code:`point`, the elements array will fulfill requirement + :code:`lower[i] <= point[i] <= upper[i]` for all i. Some of the components may be unbounded or bounded only on one side + if the corresponding bound is set to an infinite value. The optimizer will not manage the user function by itself, but + it will handle this adapter and it is this adapter that will take care the bounds are fulfilled. The adapter + :meth:`~org.hipparchus.optim.nonlinear.scalar.MultivariateFunctionMappingAdapter.value` method will be called by the + optimizer with unbound parameters, and the adapter will map the unbounded value to the bounded range using appropriate + functions like :class:`~org.hipparchus.optim.nonlinear.scalar.https:.www.hipparchus.org.hipparchus` for double bounded + elements for example. + + As the optimizer sees only unbounded parameters, it should be noted that the start point or simplex expected by the + optimizer should be unbounded, so the user is responsible for converting his bounded point to unbounded by calling + :meth:`~org.hipparchus.optim.nonlinear.scalar.MultivariateFunctionMappingAdapter.boundedToUnbounded` before providing + them to the optimizer. For the same reason, the point returned by the + :meth:`~org.hipparchus.optim.BaseMultivariateOptimizer.optimize` method is unbounded. So to convert this point to + bounded, users must call + :meth:`~org.hipparchus.optim.nonlinear.scalar.MultivariateFunctionMappingAdapter.unboundedToBounded` by themselves! + + This adapter is only a poor man solution to simple bounds optimization constraints that can be used with simple + optimizers like :class:`~org.hipparchus.optim.nonlinear.scalar.noderiv.SimplexOptimizer`. A better solution is to use an + optimizer that directly supports simple bounds like + :class:`~org.hipparchus.optim.nonlinear.scalar.noderiv.CMAESOptimizer` or + :class:`~org.hipparchus.optim.nonlinear.scalar.noderiv.BOBYQAOptimizer`. One caveat of this poor-man's solution is that + behavior near the bounds may be numerically unstable as bounds are mapped from infinite values. Another caveat is that + convergence values are evaluated by the optimizer with respect to unbounded variables, so there will be scales + differences when converted to bounded variables. + + Also see: + + - :class:`~org.hipparchus.optim.nonlinear.scalar.MultivariateFunctionPenaltyAdapter` + """ def __init__(self, multivariateFunction: typing.Union[org.hipparchus.analysis.MultivariateFunction, typing.Callable], doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray]): ... - def boundedToUnbounded(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> typing.MutableSequence[float]: ... - def unboundedToBounded(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> typing.MutableSequence[float]: ... - def value(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> float: ... + def boundedToUnbounded(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> typing.MutableSequence[float]: + """ + Maps an array from bounded to unbounded. + + Parameters: + point (double[]): Bounded values. + + Returns: + the unbounded values. + + + """ + ... + def unboundedToBounded(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> typing.MutableSequence[float]: + """ + Maps an array from unbounded to bounded. + + Parameters: + point (double[]): Unbounded values. + + Returns: + the bounded values. + + + """ + ... + def value(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> float: + """ + Compute the underlying function value from an unbounded point. + + This method simply bounds the unbounded point using the mappings set up at construction and calls the underlying + function using the bounded point. + + Specified by: + :meth:`~org.hipparchus.optim.nonlinear.scalar.https:.www.hipparchus.org.hipparchus` in + interface :class:`~org.hipparchus.optim.nonlinear.scalar.https:.www.hipparchus.org.hipparchus` + + Parameters: + point (double[]): unbounded value + + Returns: + underlying function value + + Also see: + + - :meth:`~org.hipparchus.optim.nonlinear.scalar.MultivariateFunctionMappingAdapter.unboundedToBounded` + + + + """ + ... class MultivariateFunctionPenaltyAdapter(org.hipparchus.analysis.MultivariateFunction): + """ + public classMultivariateFunctionPenaltyAdapter extends :class:`~org.hipparchus.optim.nonlinear.scalar.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.optim.nonlinear.scalar.https:.www.hipparchus.org.hipparchus` + + + Adapter extending bounded :class:`~org.hipparchus.optim.nonlinear.scalar.https:.www.hipparchus.org.hipparchus` to an + unbouded domain using a penalty function. + + This adapter can be used to wrap functions subject to simple bounds on parameters so they can be used by optimizers that + do *not* directly support simple bounds. + + The principle is that the user function that will be wrapped will see its parameters bounded as required, i.e when its + :code:`value` method is called with argument array :code:`point`, the elements array will fulfill requirement + :code:`lower[i] <= point[i] <= upper[i]` for all i. Some of the components may be unbounded or bounded only on one side + if the corresponding bound is set to an infinite value. The optimizer will not manage the user function by itself, but + it will handle this adapter and it is this adapter that will take care the bounds are fulfilled. The adapter + :meth:`~org.hipparchus.optim.nonlinear.scalar.MultivariateFunctionPenaltyAdapter.value` method will be called by the + optimizer with unbound parameters, and the adapter will check if the parameters is within range or not. If it is in + range, then the underlying user function will be called, and if it is not the value of a penalty function will be + returned instead. + + This adapter is only a poor-man's solution to simple bounds optimization constraints that can be used with simple + optimizers like :class:`~org.hipparchus.optim.nonlinear.scalar.noderiv.SimplexOptimizer`. A better solution is to use an + optimizer that directly supports simple bounds like + :class:`~org.hipparchus.optim.nonlinear.scalar.noderiv.CMAESOptimizer` or + :class:`~org.hipparchus.optim.nonlinear.scalar.noderiv.BOBYQAOptimizer`. One caveat of this poor-man's solution is that + if start point or start simplex is completely outside of the allowed range, only the penalty function is used, and the + optimizer may converge without ever entering the range. + + Also see: + + - :class:`~org.hipparchus.optim.nonlinear.scalar.MultivariateFunctionMappingAdapter` + """ def __init__(self, multivariateFunction: typing.Union[org.hipparchus.analysis.MultivariateFunction, typing.Callable], doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray], double3: float, doubleArray3: typing.Union[typing.List[float], jpype.JArray]): ... - def value(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> float: ... + def value(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> float: + """ + Computes the underlying function value from an unbounded point. + + This method simply returns the value of the underlying function if the unbounded point already fulfills the bounds, and + compute a replacement value using the offset and scale if bounds are violated, without calling the function at all. + + Specified by: + :meth:`~org.hipparchus.optim.nonlinear.scalar.https:.www.hipparchus.org.hipparchus` in + interface :class:`~org.hipparchus.optim.nonlinear.scalar.https:.www.hipparchus.org.hipparchus` + + Parameters: + point (double[]): unbounded point + + Returns: + either underlying function value or penalty function value + + + """ + ... class MultivariateOptimizer(org.hipparchus.optim.BaseMultivariateOptimizer[org.hipparchus.optim.PointValuePair]): - def computeObjectiveValue(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> float: ... - def getGoalType(self) -> GoalType: ... + """ + public abstract classMultivariateOptimizer extends :class:`~org.hipparchus.optim.BaseMultivariateOptimizer`<:class:`~org.hipparchus.optim.PointValuePair`> + + Base class for a multivariate scalar function optimizer. + """ + def computeObjectiveValue(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> float: + """ + Computes the objective function value. This method *must* be called by subclasses to enforce the evaluation counter + limit. + + Parameters: + params (double[]): Point at which the objective function must be evaluated. + + Returns: + the objective function value at the specified point. + + Raises: + :class:`~org.hipparchus.optim.nonlinear.scalar.https:.www.hipparchus.org.hipparchus`: if the maximal number of evaluations is exceeded. + + + """ + ... + def getGoalType(self) -> GoalType: + """ + Get optimization type. + + Returns: + the optimization type. + + + """ + ... @typing.overload def optimize(self) -> typing.Any: ... @typing.overload def optimize(self, *optimizationData: org.hipparchus.optim.OptimizationData) -> org.hipparchus.optim.PointValuePair: ... class ObjectiveFunction(org.hipparchus.optim.OptimizationData): + """ + public classObjectiveFunction extends :class:`~org.hipparchus.optim.nonlinear.scalar.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.optim.OptimizationData` + + Scalar function to be optimized. + """ def __init__(self, multivariateFunction: typing.Union[org.hipparchus.analysis.MultivariateFunction, typing.Callable]): ... - def getObjectiveFunction(self) -> org.hipparchus.analysis.MultivariateFunction: ... + def getObjectiveFunction(self) -> org.hipparchus.analysis.MultivariateFunction: + """ + Gets the function to be optimized. + + Returns: + the objective function. + + + """ + ... class ObjectiveFunctionGradient(org.hipparchus.optim.OptimizationData): + """ + public classObjectiveFunctionGradient extends :class:`~org.hipparchus.optim.nonlinear.scalar.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.optim.OptimizationData` + + Gradient of the scalar function to be optimized. + """ def __init__(self, multivariateVectorFunction: typing.Union[org.hipparchus.analysis.MultivariateVectorFunction, typing.Callable]): ... - def getObjectiveFunctionGradient(self) -> org.hipparchus.analysis.MultivariateVectorFunction: ... + def getObjectiveFunctionGradient(self) -> org.hipparchus.analysis.MultivariateVectorFunction: + """ + Gets the gradient of the function to be optimized. + + Returns: + the objective function gradient. + + + """ + ... class GradientMultivariateOptimizer(MultivariateOptimizer): + """ + public abstract classGradientMultivariateOptimizer extends :class:`~org.hipparchus.optim.nonlinear.scalar.MultivariateOptimizer` + + Base class for implementing optimizers for multivariate scalar differentiable functions. It contains boiler-plate code + for dealing with gradient evaluation. + """ @typing.overload def optimize(self) -> typing.Any: ... @typing.overload diff --git a/org-stubs/hipparchus/optim/nonlinear/scalar/gradient/__init__.pyi b/org-stubs/hipparchus/optim/nonlinear/scalar/gradient/__init__.pyi index e9a5be3..aa80214 100644 --- a/org-stubs/hipparchus/optim/nonlinear/scalar/gradient/__init__.pyi +++ b/org-stubs/hipparchus/optim/nonlinear/scalar/gradient/__init__.pyi @@ -14,9 +14,49 @@ import typing class Preconditioner: - def precondition(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray]) -> typing.MutableSequence[float]: ... + """ + public interfacePreconditioner + + This interface represents a preconditioner for differentiable scalar objective function optimizers. + """ + def precondition(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray]) -> typing.MutableSequence[float]: + """ + Precondition a search direction. + + The returned preconditioned search direction must be computed fast or the algorithm performances will drop drastically. + A classical approach is to compute only the diagonal elements of the hessian and to divide the raw search direction by + these elements if they are all positive. If at least one of them is negative, it is safer to return a clone of the raw + search direction as if the hessian was the identity matrix. The rationale for this simplified choice is that a negative + diagonal element means the current point is far from the optimum and preconditioning will not be efficient anyway in + this case. + + Parameters: + point (double[]): current point at which the search direction was computed + r (double[]): raw search direction (i.e. opposite of the gradient) + + Returns: + approximation of H :sup:`-1` r where H is the objective function hessian + + + """ + ... class NonLinearConjugateGradientOptimizer(org.hipparchus.optim.nonlinear.scalar.GradientMultivariateOptimizer): + """ + public classNonLinearConjugateGradientOptimizer extends :class:`~org.hipparchus.optim.nonlinear.scalar.GradientMultivariateOptimizer` + + Non-linear conjugate gradient optimizer. + + + This class supports both the Fletcher-Reeves and the Polak-Ribière update formulas for the conjugate search directions. + It also supports optional preconditioning. + + + Constraints are not supported: the call to + :meth:`~org.hipparchus.optim.nonlinear.scalar.gradient.NonLinearConjugateGradientOptimizer.optimize` will throw + :class:`~org.hipparchus.optim.nonlinear.scalar.gradient.https:.www.hipparchus.org.hipparchus` if bounds are passed to + it. + """ @typing.overload def __init__(self, formula: 'NonLinearConjugateGradientOptimizer.Formula', convergenceChecker: typing.Union[org.hipparchus.optim.ConvergenceChecker[org.hipparchus.optim.PointValuePair], typing.Callable[[int, org.hipparchus.optim.PointValuePair, org.hipparchus.optim.PointValuePair], bool]]): ... @typing.overload diff --git a/org-stubs/hipparchus/optim/nonlinear/scalar/noderiv/__init__.pyi b/org-stubs/hipparchus/optim/nonlinear/scalar/noderiv/__init__.pyi index 8f19532..b220868 100644 --- a/org-stubs/hipparchus/optim/nonlinear/scalar/noderiv/__init__.pyi +++ b/org-stubs/hipparchus/optim/nonlinear/scalar/noderiv/__init__.pyi @@ -17,24 +17,178 @@ import typing class AbstractSimplex(org.hipparchus.optim.OptimizationData): - def build(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> None: ... + """ + public abstract classAbstractSimplex extends :class:`~org.hipparchus.optim.nonlinear.scalar.noderiv.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.optim.OptimizationData` + + This class implements the simplex concept. It is intended to be used in conjunction with + :class:`~org.hipparchus.optim.nonlinear.scalar.noderiv.SimplexOptimizer`. + + + The initial configuration of the simplex is set by the constructors + :meth:`~org.hipparchus.optim.nonlinear.scalar.noderiv.AbstractSimplex.%3Cinit%3E` or + :meth:`~org.hipparchus.optim.nonlinear.scalar.noderiv.AbstractSimplex.%3Cinit%3E`. The other + :meth:`~org.hipparchus.optim.nonlinear.scalar.noderiv.AbstractSimplex.%3Cinit%3E` will set all steps to 1, thus building + a default configuration from a unit hypercube. + + + Users *must* call the :meth:`~org.hipparchus.optim.nonlinear.scalar.noderiv.AbstractSimplex.build` method in order to + create the data structure that will be acted on by the other methods of this class. + + Also see: + + - :class:`~org.hipparchus.optim.nonlinear.scalar.noderiv.SimplexOptimizer` + """ + def build(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> None: + """ + Build an initial simplex. + + Parameters: + startPoint (double[]): First point of the simplex. + + Raises: + :class:`~org.hipparchus.optim.nonlinear.scalar.noderiv.https:.www.hipparchus.org.hipparchus`: if the start point does not match simplex dimension. + + + """ + ... def evaluate(self, multivariateFunction: typing.Union[org.hipparchus.analysis.MultivariateFunction, typing.Callable], comparator: typing.Union[java.util.Comparator[org.hipparchus.optim.PointValuePair], typing.Callable[[org.hipparchus.optim.PointValuePair, org.hipparchus.optim.PointValuePair], int]]) -> None: ... - def getDimension(self) -> int: ... - def getPoint(self, int: int) -> org.hipparchus.optim.PointValuePair: ... - def getPoints(self) -> typing.MutableSequence[org.hipparchus.optim.PointValuePair]: ... - def getSize(self) -> int: ... + def getDimension(self) -> int: + """ + Get simplex dimension. + + Returns: + the dimension of the simplex. + + + """ + ... + def getPoint(self, int: int) -> org.hipparchus.optim.PointValuePair: + """ + Get the simplex point stored at the requested :code:`index`. + + Parameters: + index (int): Location. + + Returns: + the point at location :code:`index`. + + + """ + ... + def getPoints(self) -> typing.MutableSequence[org.hipparchus.optim.PointValuePair]: + """ + Get the points of the simplex. + + Returns: + all the simplex points. + + + """ + ... + def getSize(self) -> int: + """ + Get simplex size. After calling the :meth:`~org.hipparchus.optim.nonlinear.scalar.noderiv.AbstractSimplex.build` method, + this method will will be equivalent to :code:`getDimension() + 1`. + + Returns: + the size of the simplex. + + + """ + ... def iterate(self, multivariateFunction: typing.Union[org.hipparchus.analysis.MultivariateFunction, typing.Callable], comparator: typing.Union[java.util.Comparator[org.hipparchus.optim.PointValuePair], typing.Callable[[org.hipparchus.optim.PointValuePair, org.hipparchus.optim.PointValuePair], int]]) -> None: ... class BOBYQAOptimizer(org.hipparchus.optim.nonlinear.scalar.MultivariateOptimizer): + """ + public classBOBYQAOptimizer extends :class:`~org.hipparchus.optim.nonlinear.scalar.MultivariateOptimizer` + + Powell's BOBYQA algorithm. This implementation is translated and adapted from the Fortran version available `here + <http://plato.asu.edu/ftp/other_software/bobyqa.zip>`. See ` this paper + <http://www.optimization-online.org/DB_HTML/2010/05/2616.html>` for an introduction. + + + BOBYQA is particularly well suited for high dimensional problems where derivatives are not available. In most cases it + outperforms the :class:`~org.hipparchus.optim.nonlinear.scalar.noderiv.PowellOptimizer` significantly. Stochastic + algorithms like :class:`~org.hipparchus.optim.nonlinear.scalar.noderiv.CMAESOptimizer` succeed more often than BOBYQA, + but are more expensive. BOBYQA could also be considered as a replacement of any derivative-based optimizer when the + derivatives are approximated by finite differences. + """ MINIMUM_PROBLEM_DIMENSION: typing.ClassVar[int] = ... + """ + public static final int MINIMUM_PROBLEM_DIMENSION + + Minimum dimension of the problem: 2 + + Also see: + + - :meth:`~constant` + + + + """ DEFAULT_INITIAL_RADIUS: typing.ClassVar[float] = ... + """ + public static final double DEFAULT_INITIAL_RADIUS + + Default value for :code:`initialTrustRegionRadius`: 10.0 . + + Also see: + + - :meth:`~constant` + + + + """ DEFAULT_STOPPING_RADIUS: typing.ClassVar[float] = ... + """ + public static final double DEFAULT_STOPPING_RADIUS + + Default value for :code:`stoppingTrustRegionRadius`: 1.0E-8 . + + Also see: + + - :meth:`~constant` + + + + """ @typing.overload def __init__(self, int: int): ... @typing.overload def __init__(self, int: int, double: float, double2: float): ... class CMAESOptimizer(org.hipparchus.optim.nonlinear.scalar.MultivariateOptimizer): + """ + public classCMAESOptimizer extends :class:`~org.hipparchus.optim.nonlinear.scalar.MultivariateOptimizer` + + An implementation of the active Covariance Matrix Adaptation Evolution Strategy (CMA-ES) for non-linear, non-convex, + non-smooth, global function minimization. + + The CMA-Evolution Strategy (CMA-ES) is a reliable stochastic optimization method which should be applied if + derivative-based methods, e.g. quasi-Newton BFGS or conjugate gradient, fail due to a rugged search landscape (e.g. + noise, local optima, outlier, etc.) of the objective function. Like a quasi-Newton method, the CMA-ES learns and applies + a variable metric on the underlying search space. Unlike a quasi-Newton method, the CMA-ES neither estimates nor uses + gradients, making it considerably more reliable in terms of finding a good, or even close to optimal, solution. + + In general, on smooth objective functions the CMA-ES is roughly ten times slower than BFGS (counting objective function + evaluations, no gradients provided). For up to \(n=10\) variables also the derivative-free simplex direct search method + (Nelder and Mead) can be faster, but it is far less reliable than CMA-ES. + + The CMA-ES is particularly well suited for non-separable and/or badly conditioned problems. To observe the advantage of + CMA compared to a conventional evolution strategy, it will usually take about \(30 n\) function evaluations. On + difficult problems the complete optimization (a single run) is expected to take *roughly* between \(30 n\) and \(300 + n^2\) function evaluations. + + This implementation is translated and adapted from the Matlab version of the CMA-ES algorithm as implemented in module + :code:`cmaes.m` version 3.51. + + For more information, please refer to the following links: + + - `Matlab code <http://www.lri.fr/~hansen/cmaes.m>` + - `Introduction to CMA-ES <http://www.lri.fr/~hansen/cmaesintro.html>` + - `Wikipedia <http://en.wikipedia.org/wiki/CMA-ES>` + """ def __init__(self, int: int, double: float, boolean: bool, int2: int, int3: int, randomGenerator: org.hipparchus.random.RandomGenerator, boolean2: bool, convergenceChecker: typing.Union[org.hipparchus.optim.ConvergenceChecker[org.hipparchus.optim.PointValuePair], typing.Callable[[int, org.hipparchus.optim.PointValuePair, org.hipparchus.optim.PointValuePair], bool]]): ... def getStatisticsDHistory(self) -> java.util.List[org.hipparchus.linear.RealMatrix]: ... def getStatisticsFitnessHistory(self) -> java.util.List[float]: ... @@ -52,6 +206,26 @@ class CMAESOptimizer(org.hipparchus.optim.nonlinear.scalar.MultivariateOptimizer def getSigma(self) -> typing.MutableSequence[float]: ... class PowellOptimizer(org.hipparchus.optim.nonlinear.scalar.MultivariateOptimizer): + """ + public classPowellOptimizer extends :class:`~org.hipparchus.optim.nonlinear.scalar.MultivariateOptimizer` + + Powell's algorithm. This code is translated and adapted from the Python version of this algorithm (as implemented in + module :code:`optimize.py` v0.5 of *SciPy*). + + + The default stopping criterion is based on the differences of the function value between two successive iterations. It + is however possible to define a custom convergence checker that might terminate the algorithm earlier. + + + Line search is performed by the :class:`~org.hipparchus.optim.nonlinear.scalar.LineSearch` class. + + + Constraints are not supported: the call to :meth:`~org.hipparchus.optim.nonlinear.scalar.MultivariateOptimizer.optimize` + optimize} will throw :class:`~org.hipparchus.optim.nonlinear.scalar.noderiv.https:.www.hipparchus.org.hipparchus` if + bounds are passed to it. In order to impose simple constraints, the objective function must be wrapped in an adapter + like :class:`~org.hipparchus.optim.nonlinear.scalar.MultivariateFunctionMappingAdapter` or + :class:`~org.hipparchus.optim.nonlinear.scalar.MultivariateFunctionPenaltyAdapter`. + """ @typing.overload def __init__(self, double: float, double2: float): ... @typing.overload @@ -62,6 +236,43 @@ class PowellOptimizer(org.hipparchus.optim.nonlinear.scalar.MultivariateOptimize def __init__(self, double: float, double2: float, convergenceChecker: typing.Union[org.hipparchus.optim.ConvergenceChecker[org.hipparchus.optim.PointValuePair], typing.Callable[[int, org.hipparchus.optim.PointValuePair, org.hipparchus.optim.PointValuePair], bool]]): ... class SimplexOptimizer(org.hipparchus.optim.nonlinear.scalar.MultivariateOptimizer): + """ + public classSimplexOptimizer extends :class:`~org.hipparchus.optim.nonlinear.scalar.MultivariateOptimizer` + + This class implements simplex-based direct search optimization. + + Direct search methods only use objective function values, they do not need derivatives and don't either try to compute + approximation of the derivatives. According to a 1996 paper by Margaret H. Wright (`Direct Search Methods: Once Scorned, + Now Respectable <http://cm.bell-labs.com/cm/cs/doc/96/4-02.ps.gz>`), they are used when either the computation of the + derivative is impossible (noisy functions, unpredictable discontinuities) or difficult (complexity, computation cost). + In the first cases, rather than an optimum, a *not too bad* point is desired. In the latter cases, an optimum is desired + but cannot be reasonably found. In all cases direct search methods can be useful. + + Simplex-based direct search methods are based on comparison of the objective function values at the vertices of a + simplex (which is a set of n+1 points in dimension n) that is updated by the algorithms steps. + + The simplex update procedure (:class:`~org.hipparchus.optim.nonlinear.scalar.noderiv.NelderMeadSimplex` or + :class:`~org.hipparchus.optim.nonlinear.scalar.noderiv.MultiDirectionalSimplex`) must be passed to the :code:`optimize` + method. + + Each call to :code:`optimize` will re-use the start configuration of the current simplex and move it such that its first + vertex is at the provided start point of the optimization. If the :code:`optimize` method is called to solve a different + problem and the number of parameters change, the simplex must be re-initialized to one with the appropriate dimensions. + + Convergence is checked by providing the *worst* points of previous and current simplex to the convergence checker, not + the best ones. + + This simplex optimizer implementation does not directly support constrained optimization with simple bounds; so, for + such optimizations, either a more dedicated algorithm must be used like + :class:`~org.hipparchus.optim.nonlinear.scalar.noderiv.CMAESOptimizer` or + :class:`~org.hipparchus.optim.nonlinear.scalar.noderiv.BOBYQAOptimizer`, or the objective function must be wrapped in an + adapter like :class:`~org.hipparchus.optim.nonlinear.scalar.MultivariateFunctionMappingAdapter` or + :class:`~org.hipparchus.optim.nonlinear.scalar.MultivariateFunctionPenaltyAdapter`. + + + The call to :meth:`~org.hipparchus.optim.nonlinear.scalar.noderiv.SimplexOptimizer.optimize` will throw + :class:`~org.hipparchus.optim.nonlinear.scalar.noderiv.https:.www.hipparchus.org.hipparchus` if bounds are passed to it. + """ @typing.overload def __init__(self, double: float, double2: float): ... @typing.overload @@ -69,9 +280,45 @@ class SimplexOptimizer(org.hipparchus.optim.nonlinear.scalar.MultivariateOptimiz @typing.overload def optimize(self) -> typing.Any: ... @typing.overload - def optimize(self, *optimizationData: org.hipparchus.optim.OptimizationData) -> org.hipparchus.optim.PointValuePair: ... + def optimize(self, *optimizationData: org.hipparchus.optim.OptimizationData) -> org.hipparchus.optim.PointValuePair: + """ + Stores data and performs the optimization. + + The list of parameters is open-ended so that sub-classes can extend it with arguments specific to their concrete + implementations. + + When the method is called multiple times, instance data is overwritten only when actually present in the list of + arguments: when not specified, data set in a previous call is retained (and thus is optional in subsequent calls). + + Important note: Subclasses *must* override :meth:`~org.hipparchus.optim.BaseOptimizer.parseOptimizationData` if they + need to register their own options; but then, they *must* also call :code:`super.parseOptimizationData(optData)` within + that method. + + Overrides: + :meth:`~org.hipparchus.optim.nonlinear.scalar.MultivariateOptimizer.optimize` in + class :class:`~org.hipparchus.optim.nonlinear.scalar.MultivariateOptimizer` + + Parameters: + optData (:class:`~org.hipparchus.optim.OptimizationData`...): Optimization data. In addition to those documented in + :meth:`~org.hipparchus.optim.nonlinear.scalar.MultivariateOptimizer.parseOptimizationData`, this method will register + the following data: + + - :class:`~org.hipparchus.optim.nonlinear.scalar.noderiv.AbstractSimplex` + + + Returns: + a point/value pair that satisfies the convergence criteria. + + + """ + ... class MultiDirectionalSimplex(AbstractSimplex): + """ + public classMultiDirectionalSimplex extends :class:`~org.hipparchus.optim.nonlinear.scalar.noderiv.AbstractSimplex` + + This class implements the multi-directional direct search method. + """ @typing.overload def __init__(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]): ... @typing.overload @@ -91,6 +338,11 @@ class MultiDirectionalSimplex(AbstractSimplex): def iterate(self, multivariateFunction: typing.Union[org.hipparchus.analysis.MultivariateFunction, typing.Callable], comparator: typing.Union[java.util.Comparator[org.hipparchus.optim.PointValuePair], typing.Callable[[org.hipparchus.optim.PointValuePair, org.hipparchus.optim.PointValuePair], int]]) -> None: ... class NelderMeadSimplex(AbstractSimplex): + """ + public classNelderMeadSimplex extends :class:`~org.hipparchus.optim.nonlinear.scalar.noderiv.AbstractSimplex` + + This class implements the Nelder-Mead simplex algorithm. + """ @typing.overload def __init__(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]): ... @typing.overload diff --git a/org-stubs/hipparchus/optim/nonlinear/vector/constrained/__init__.pyi b/org-stubs/hipparchus/optim/nonlinear/vector/constrained/__init__.pyi index 3dfc5ee..173a12d 100644 --- a/org-stubs/hipparchus/optim/nonlinear/vector/constrained/__init__.pyi +++ b/org-stubs/hipparchus/optim/nonlinear/vector/constrained/__init__.pyi @@ -14,66 +14,629 @@ import typing class ADMMQPConvergenceChecker(org.hipparchus.optim.ConvergenceChecker['LagrangeSolution'], org.hipparchus.optim.OptimizationData): + """ + public classADMMQPConvergenceChecker extends :class:`~org.hipparchus.optim.nonlinear.vector.constrained.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.optim.ConvergenceChecker`<:class:`~org.hipparchus.optim.nonlinear.vector.constrained.LagrangeSolution`>, :class:`~org.hipparchus.optim.OptimizationData` + + Convergence Checker for ADMM QP Optimizer. + + Since: + 3.1 + """ @typing.overload - def converged(self, double: float, double2: float, double3: float, double4: float) -> bool: ... + def converged(self, double: float, double2: float, double3: float, double4: float) -> bool: + """ + Evaluate convergence. + + Parameters: + rp (double): primal residual + rd (double): dual residual + maxPrimal (double): primal vectors max + maxDual (double): dual vectors max + + Returns: + true of convergence has been reached + + + """ + ... @typing.overload - def converged(self, int: int, lagrangeSolution: 'LagrangeSolution', lagrangeSolution2: 'LagrangeSolution') -> bool: ... - def maxDual(self, realVector: org.hipparchus.linear.RealVector, realVector2: org.hipparchus.linear.RealVector) -> float: ... - def maxPrimal(self, realVector: org.hipparchus.linear.RealVector, realVector2: org.hipparchus.linear.RealVector) -> float: ... - def residualDual(self, realVector: org.hipparchus.linear.RealVector, realVector2: org.hipparchus.linear.RealVector) -> float: ... - def residualPrime(self, realVector: org.hipparchus.linear.RealVector, realVector2: org.hipparchus.linear.RealVector) -> float: ... + def converged(self, int: int, lagrangeSolution: 'LagrangeSolution', lagrangeSolution2: 'LagrangeSolution') -> bool: + """ + Check if the optimization algorithm has converged. + + Specified by: + :meth:`~org.hipparchus.optim.ConvergenceChecker.converged` in + interface :class:`~org.hipparchus.optim.ConvergenceChecker` + + Parameters: + i (int): Current iteration. + previous (:class:`~org.hipparchus.optim.nonlinear.vector.constrained.LagrangeSolution`): Best point in the previous iteration. + current (:class:`~org.hipparchus.optim.nonlinear.vector.constrained.LagrangeSolution`): Best point in the current iteration. + + Returns: + :code:`true` if the algorithm is considered to have converged. + + """ + ... + def maxDual(self, realVector: org.hipparchus.linear.RealVector, realVector2: org.hipparchus.linear.RealVector) -> float: + """ + Compute dual vectors max. + + Parameters: + x (:class:`~org.hipparchus.optim.nonlinear.vector.constrained.https:.www.hipparchus.org.hipparchus`): primal problem solution + y (:class:`~org.hipparchus.optim.nonlinear.vector.constrained.https:.www.hipparchus.org.hipparchus`): dual problem solution + + Returns: + dual vectors max + + + """ + ... + def maxPrimal(self, realVector: org.hipparchus.linear.RealVector, realVector2: org.hipparchus.linear.RealVector) -> float: + """ + Compute primal vectors max. + + Parameters: + x (:class:`~org.hipparchus.optim.nonlinear.vector.constrained.https:.www.hipparchus.org.hipparchus`): primal problem solution + z (:class:`~org.hipparchus.optim.nonlinear.vector.constrained.https:.www.hipparchus.org.hipparchus`): auxiliary variable + + Returns: + primal vectors max + + + """ + ... + def residualDual(self, realVector: org.hipparchus.linear.RealVector, realVector2: org.hipparchus.linear.RealVector) -> float: + """ + Compute dual residual. + + Parameters: + x (:class:`~org.hipparchus.optim.nonlinear.vector.constrained.https:.www.hipparchus.org.hipparchus`): primal problem solution + y (:class:`~org.hipparchus.optim.nonlinear.vector.constrained.https:.www.hipparchus.org.hipparchus`): dual problem solution + + Returns: + dual residual + + + """ + ... + def residualPrime(self, realVector: org.hipparchus.linear.RealVector, realVector2: org.hipparchus.linear.RealVector) -> float: + """ + Compute primal residual. + + Parameters: + x (:class:`~org.hipparchus.optim.nonlinear.vector.constrained.https:.www.hipparchus.org.hipparchus`): primal problem solution + z (:class:`~org.hipparchus.optim.nonlinear.vector.constrained.https:.www.hipparchus.org.hipparchus`): auxiliary variable + + Returns: + primal residual + + + """ + ... class ADMMQPModifiedRuizEquilibrium: + """ + public classADMMQPModifiedRuizEquilibrium extends :class:`~org.hipparchus.optim.nonlinear.vector.constrained.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + TBD. + + Since: + 3.1 + """ def __init__(self, realMatrix: org.hipparchus.linear.RealMatrix, realMatrix2: org.hipparchus.linear.RealMatrix, realVector: org.hipparchus.linear.RealVector): ... - def getScaledA(self) -> org.hipparchus.linear.RealMatrix: ... - def getScaledH(self) -> org.hipparchus.linear.RealMatrix: ... - def getScaledLUb(self, realVector: org.hipparchus.linear.RealVector) -> org.hipparchus.linear.RealVector: ... - def getScaledQ(self) -> org.hipparchus.linear.RealVector: ... - def normalize(self, double: float, int: int) -> None: ... - def unscaleX(self, realVector: org.hipparchus.linear.RealVector) -> org.hipparchus.linear.RealVector: ... - def unscaleY(self, realVector: org.hipparchus.linear.RealVector) -> org.hipparchus.linear.RealVector: ... - def unscaleZ(self, realVector: org.hipparchus.linear.RealVector) -> org.hipparchus.linear.RealVector: ... + def getScaledA(self) -> org.hipparchus.linear.RealMatrix: + """ + Get scaled constraints coefficients matrix. + + Returns: + scaled constraints coefficients matrix + + + """ + ... + def getScaledH(self) -> org.hipparchus.linear.RealMatrix: + """ + Get scaled square matrix of weights for quadratic terms. + + Returns: + scaled square matrix of weights for quadratic terms + + + """ + ... + def getScaledLUb(self, realVector: org.hipparchus.linear.RealVector) -> org.hipparchus.linear.RealVector: + """ + Get scaled upper bound + + Parameters: + lb1 (:class:`~org.hipparchus.optim.nonlinear.vector.constrained.https:.www.hipparchus.org.hipparchus`): unscaled lower bound + + Returns: + scaled lower bound + + + """ + ... + def getScaledQ(self) -> org.hipparchus.linear.RealVector: + """ + Get scaled vector of weights for linear terms. + + Returns: + scaled vector of weights for linear terms + + + """ + ... + def normalize(self, double: float, int: int) -> None: + """ + Normalize matrices. + + Parameters: + epsilon (double): TBD + maxIteration (int): TBD + + + """ + ... + def unscaleX(self, realVector: org.hipparchus.linear.RealVector) -> org.hipparchus.linear.RealVector: + """ + Unscale solution vector. + + Parameters: + x (:class:`~org.hipparchus.optim.nonlinear.vector.constrained.https:.www.hipparchus.org.hipparchus`): scaled solution vector + + Returns: + unscaled solution vector + + + """ + ... + def unscaleY(self, realVector: org.hipparchus.linear.RealVector) -> org.hipparchus.linear.RealVector: + """ + Unscale Y vector. + + Parameters: + y (:class:`~org.hipparchus.optim.nonlinear.vector.constrained.https:.www.hipparchus.org.hipparchus`): scaled Y vector + + Returns: + unscaled Y vector + + + """ + ... + def unscaleZ(self, realVector: org.hipparchus.linear.RealVector) -> org.hipparchus.linear.RealVector: + """ + Unscale Z vector. + + Parameters: + z (:class:`~org.hipparchus.optim.nonlinear.vector.constrained.https:.www.hipparchus.org.hipparchus`): scaled Z vector + + Returns: + unscaled Z vector + + + """ + ... class ADMMQPOption(org.hipparchus.optim.OptimizationData): + """ + public classADMMQPOption extends :class:`~org.hipparchus.optim.nonlinear.vector.constrained.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.optim.OptimizationData` + + Container for :class:`~org.hipparchus.optim.nonlinear.vector.constrained.ADMMQPOptimizer` settings. + + Since: + 3.1 + """ DEFAULT_EPS: typing.ClassVar[float] = ... + """ + public static final double DEFAULT_EPS + + Default Absolute and Relative Tolerance for convergence. + + Also see: + + - :meth:`~constant` + + + + """ DEFAULT_EPS_INFEASIBLE: typing.ClassVar[float] = ... + """ + public static final double DEFAULT_EPS_INFEASIBLE + + Default Absolute and Relative Tolerance for Infeasible Criteria. + + Also see: + + - :meth:`~constant` + + + + """ DEFAULT_SIGMA: typing.ClassVar[float] = ... + """ + public static final double DEFAULT_SIGMA + + Default Value of regularization term sigma for Karush–Kuhn–Tucker solver. + + Also see: + + - :meth:`~constant` + + + + """ DEFAULT_ALPHA: typing.ClassVar[float] = ... + """ + public static final double DEFAULT_ALPHA + + Default Value of Alpha filter for ADMM iteration. + + Also see: + + - :meth:`~constant` + + + + """ DEFAULT_SCALING: typing.ClassVar[bool] = ... + """ + public static final boolean DEFAULT_SCALING + + Default Value for Enabling Problem Scaling. + + Also see: + + - :meth:`~constant` + + + + """ DEFAULT_SCALING_MAX_ITERATION: typing.ClassVar[int] = ... + """ + public static final int DEFAULT_SCALING_MAX_ITERATION + + Default Value for the Max Iteration for the scaling. + + Also see: + + - :meth:`~constant` + + + + """ DEFAULT_RHO_UPDATE: typing.ClassVar[bool] = ... + """ + public static final boolean DEFAULT_RHO_UPDATE + + Default Value for adapting the weight during iterations. + + Also see: + + - :meth:`~constant` + + + + """ DEFAULT_RHO_MAX: typing.ClassVar[float] = ... + """ + public static final double DEFAULT_RHO_MAX + + Default Max Value for the Weight for ADMM iteration. + + Also see: + + - :meth:`~constant` + + + + """ DEFAULT_RHO_MIN: typing.ClassVar[float] = ... + """ + public static final double DEFAULT_RHO_MIN + + Default Min Value for the Weight for ADMM iteration. + + Also see: + + - :meth:`~constant` + + + + """ DEFAULT_MAX_RHO_ITERATION: typing.ClassVar[int] = ... + """ + public static final int DEFAULT_MAX_RHO_ITERATION + + Default Max number of weight changes. + + Also see: + + - :meth:`~constant` + + + + """ DEFAULT_POLISHING: typing.ClassVar[bool] = ... + """ + public static final boolean DEFAULT_POLISHING + + Default Value for enabling polishing the solution. + + Also see: + + - :meth:`~constant` + + + + """ DEFAULT_POLISHING_ITERATION: typing.ClassVar[int] = ... + """ + public static final int DEFAULT_POLISHING_ITERATION + + Default Value for Iteration of polishing Algorithm. + + Also see: + + - :meth:`~constant` + + + + """ def __init__(self): ... - def getAlpha(self) -> float: ... - def getEps(self) -> float: ... - def getEpsInfeasible(self) -> float: ... - def getMaxRhoIteration(self) -> int: ... - def getPolishIteration(self) -> int: ... - def getRhoMax(self) -> float: ... - def getRhoMin(self) -> float: ... - def getScaleMaxIteration(self) -> int: ... - def getSigma(self) -> float: ... - def isPolishing(self) -> bool: ... - def isScaling(self) -> bool: ... - def setAlpha(self, double: float) -> None: ... - def setEps(self, double: float) -> None: ... - def setEpsInfeasible(self, double: float) -> None: ... - def setMaxRhoIteration(self, int: int) -> None: ... - def setPolishing(self, boolean: bool) -> None: ... - def setPolishingIteration(self, int: int) -> None: ... - def setRhoMax(self, double: float) -> None: ... - def setRhoMin(self, double: float) -> None: ... - def setScaleMaxIteration(self, int: int) -> None: ... - def setScaling(self, boolean: bool) -> None: ... - def setSigma(self, double: float) -> None: ... - def setUpdateRho(self, boolean: bool) -> None: ... - def updateRho(self) -> bool: ... + def getAlpha(self) -> float: + """ + Get value of alpha filter for ADMM iteration. + + Returns: + value of alpha filter for ADMM iteration + + + """ + ... + def getEps(self) -> float: + """ + Get absolute and Relative Tolerance for convergence. + + Returns: + absolute and Relative Tolerance for convergence + + + """ + ... + def getEpsInfeasible(self) -> float: + """ + Get absolute and Relative Tolerance for infeasible criteria. + + Returns: + absolute and Relative Tolerance for infeasible criteria + + + """ + ... + def getMaxRhoIteration(self) -> int: + """ + Get max number of weight changes. + + Returns: + max number of weight changes + + + """ + ... + def getPolishIteration(self) -> int: + """ + Get number of iterations of polishing algorithm. + + Returns: + number of iterations of polishing algorithm + + + """ + ... + def getRhoMax(self) -> float: + """ + Get max Value for the Weight for ADMM iteration. + + Returns: + max Value for the Weight for ADMM iteration + + + """ + ... + def getRhoMin(self) -> float: + """ + Get min Value for the Weight for ADMM iteration. + + Returns: + min Value for the Weight for ADMM iteration + + + """ + ... + def getScaleMaxIteration(self) -> int: + """ + Get max iteration for the scaling. + + Returns: + max iteration for the scaling + + + """ + ... + def getSigma(self) -> float: + """ + Get value of regularization term sigma for Karush–Kuhn–Tucker solver. + + Returns: + value of regularization term sigma for Karush–Kuhn–Tucker solver + + + """ + ... + def isPolishing(self) -> bool: + """ + Check if polishing is enabled. + + Returns: + true if polishing is enabled + + + """ + ... + def isScaling(self) -> bool: + """ + Check if scaling is enabled. + + Returns: + true if scaling is enabled + + + """ + ... + def setAlpha(self, double: float) -> None: + """ + Set value of alpha filter for ADMM iteration. + + Parameters: + alpha (double): value of alpha filter for ADMM iteration + + + """ + ... + def setEps(self, double: float) -> None: + """ + Set absolute and Relative Tolerance for convergence. + + Parameters: + eps (double): absolute and Relative Tolerance for convergence + + + """ + ... + def setEpsInfeasible(self, double: float) -> None: + """ + Set absolute and Relative Tolerance for infeasible criteria. + + Parameters: + epsInfeasible (double): absolute and Relative Tolerance for infeasible criteria + + + """ + ... + def setMaxRhoIteration(self, int: int) -> None: + """ + Set max number of weight changes. + + Parameters: + maxRhoIteration (int): max number of weight changes + + + """ + ... + def setPolishing(self, boolean: bool) -> None: + """ + Set polishing enabling flag. + + Parameters: + polishing (boolean): if true, polishing is enabled + + + """ + ... + def setPolishingIteration(self, int: int) -> None: + """ + Set number of iterations of polishing algorithm. + + Parameters: + polishingIteration (int): number of iterations of polishing algorithm + + + """ + ... + def setRhoMax(self, double: float) -> None: + """ + Set max Value for the Weight for ADMM iteration. + + Parameters: + rhoMax (double): max Value for the Weight for ADMM iteration + + + """ + ... + def setRhoMin(self, double: float) -> None: + """ + Set min Value for the Weight for ADMM iteration. + + Parameters: + rhoMin (double): min Value for the Weight for ADMM iteration + + + """ + ... + def setScaleMaxIteration(self, int: int) -> None: + """ + Set max iteration for the scaling. + + Parameters: + scaleMaxIteration (int): max iteration for the scaling + + + """ + ... + def setScaling(self, boolean: bool) -> None: + """ + Set scaling enabling flag. + + Parameters: + scaling (boolean): if true, scaling is enabled + + + """ + ... + def setSigma(self, double: float) -> None: + """ + Set value of regularization term sigma for Karush–Kuhn–Tucker solver. + + Parameters: + sigma (double): value of regularization term sigma for Karush–Kuhn–Tucker solver + + + """ + ... + def setUpdateRho(self, boolean: bool) -> None: + """ + Set weight updating flag. + + Parameters: + updateRho (boolean): if true, weight is updated during iterations + + + """ + ... + def updateRho(self) -> bool: + """ + Check if weight updating is enabled. + + Returns: + true if weight is updated during iterations + + + """ + ... class ConstraintOptimizer(org.hipparchus.optim.BaseMultivariateOptimizer['LagrangeSolution']): + """ + public abstract classConstraintOptimizer extends :class:`~org.hipparchus.optim.BaseMultivariateOptimizer`<:class:`~org.hipparchus.optim.nonlinear.vector.constrained.LagrangeSolution`> + + Abstract Constraint Optimizer. + + Since: + 3.1 + """ def __init__(self): ... @typing.overload def optimize(self) -> typing.Any: ... @@ -82,78 +645,664 @@ class ConstraintOptimizer(org.hipparchus.optim.BaseMultivariateOptimizer['Lagran _KarushKuhnTuckerSolver__T = typing.TypeVar('_KarushKuhnTuckerSolver__T') # <T> class KarushKuhnTuckerSolver(org.hipparchus.optim.OptimizationData, typing.Generic[_KarushKuhnTuckerSolver__T]): - def iterate(self, *realVector: org.hipparchus.linear.RealVector) -> _KarushKuhnTuckerSolver__T: ... - def solve(self, realVector: org.hipparchus.linear.RealVector, realVector2: org.hipparchus.linear.RealVector) -> _KarushKuhnTuckerSolver__T: ... + """ + public interfaceKarushKuhnTuckerSolver<T>extends :class:`~org.hipparchus.optim.OptimizationData` + + Karush–Kuhn–Tucker Solver. + + Solve Equation: + \[\begin{align} |H A^{T}| & = B_1\\ |A R| & = B_2 \end{align}\] + + Since: + 3.1 + """ + def iterate(self, *realVector: org.hipparchus.linear.RealVector) -> _KarushKuhnTuckerSolver__T: + """ + Iterate Karush–Kuhn–Tucker equation from given list of Vector + + Parameters: + b (:class:`~org.hipparchus.optim.nonlinear.vector.constrained.https:.www.hipparchus.org.hipparchus`...): list of vectors + + Returns: + Tuple with the solution x,Lambda,value + + + """ + ... + def solve(self, realVector: org.hipparchus.linear.RealVector, realVector2: org.hipparchus.linear.RealVector) -> _KarushKuhnTuckerSolver__T: + """ + Solve Karush–Kuhn–Tucker equation from given right hand value. + + Parameters: + b1 (:class:`~org.hipparchus.optim.nonlinear.vector.constrained.https:.www.hipparchus.org.hipparchus`): first right hand vector + b2 (:class:`~org.hipparchus.optim.nonlinear.vector.constrained.https:.www.hipparchus.org.hipparchus`): second right hand vector + + Returns: + Tuple with the solution x,Lambda,value + + + """ + ... class LagrangeSolution: + """ + public classLagrangeSolution extends :class:`~org.hipparchus.optim.nonlinear.vector.constrained.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Container for Lagrange t-uple. + + Since: + 3.1 + """ def __init__(self, realVector: org.hipparchus.linear.RealVector, realVector2: org.hipparchus.linear.RealVector, double: float): ... - def getLambda(self) -> org.hipparchus.linear.RealVector: ... - def getValue(self) -> float: ... - def getX(self) -> org.hipparchus.linear.RealVector: ... + def getLambda(self) -> org.hipparchus.linear.RealVector: + """ + Returns Lambda Multiplier + + Returns: + X Lambda Multiplier + + + """ + ... + def getValue(self) -> float: + """ + Returns min(max) evaluated function at x + + Returns: + min(max) evaluated function at x + + + """ + ... + def getX(self) -> org.hipparchus.linear.RealVector: + """ + Returns X solution + + Returns: + X solution + + + """ + ... class SQPOption(org.hipparchus.optim.OptimizationData): + """ + public classSQPOption extends :class:`~org.hipparchus.optim.nonlinear.vector.constrained.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.optim.OptimizationData` + + Parameter for SQP Algorithm. + + Since: + 3.1 + """ DEFAULT_CONV_CRITERIA: typing.ClassVar[int] = ... + """ + public static final int DEFAULT_CONV_CRITERIA + + Default convergence criteria. + + Also see: + + - :meth:`~constant` + + + + """ DEFAULT_EPSILON: typing.ClassVar[float] = ... + """ + public static final double DEFAULT_EPSILON + + Default tolerance for convergence and active constraint. + + Also see: + + - :meth:`~constant` + + + + """ DEFAULT_RHO: typing.ClassVar[float] = ... + """ + public static final double DEFAULT_RHO + + Default weight for augmented QP subproblem. + + Also see: + + - :meth:`~constant` + + + + """ DEFAULT_SIGMA_MAX: typing.ClassVar[float] = ... + """ + public static final double DEFAULT_SIGMA_MAX + + Default max value admitted for additional variable in QP subproblem. + + Also see: + + - :meth:`~constant` + + + + """ DEFAULT_QP_MAX_LOOP: typing.ClassVar[int] = ... + """ + public static final int DEFAULT_QP_MAX_LOOP + + Default max iteration admitted for QP subproblem. + + Also see: + + - :meth:`~constant` + + + + """ DEFAULT_MU: typing.ClassVar[float] = ... + """ + public static final double DEFAULT_MU + + Default parameter for evaluation of Armijo condition for descend direction. + + Also see: + + - :meth:`~constant` + + + + """ DEFAULT_B: typing.ClassVar[float] = ... + """ + public static final double DEFAULT_B + + Default parameter for quadratic line search. + + Also see: + + - :meth:`~constant` + + + + """ DEFAULT_USE_FUNCTION_HESSIAN: typing.ClassVar[bool] = ... + """ + public static final boolean DEFAULT_USE_FUNCTION_HESSIAN + + Default flag for using BFGS update formula. + + Also see: + + - :meth:`~constant` + + + + """ DEFAULT_MAX_LINE_SEARCH_ITERATION: typing.ClassVar[int] = ... + """ + public static final int DEFAULT_MAX_LINE_SEARCH_ITERATION + + Default max iteration before reset hessian. + + Also see: + + - :meth:`~constant` + + + + """ def __init__(self): ... - def getB(self) -> float: ... - def getConvCriteria(self) -> int: ... - def getEps(self) -> float: ... - def getMaxLineSearchIteration(self) -> int: ... - def getMu(self) -> float: ... - def getQpMaxLoop(self) -> int: ... - def getRhoCons(self) -> float: ... - def getSigmaMax(self) -> float: ... - def setB(self, double: float) -> None: ... - def setConvCriteria(self, int: int) -> None: ... - def setEps(self, double: float) -> None: ... - def setMaxLineSearchIteration(self, int: int) -> None: ... - def setMu(self, double: float) -> None: ... - def setQpMaxLoop(self, int: int) -> None: ... - def setRhoCons(self, double: float) -> None: ... - def setSigmaMax(self, double: float) -> None: ... - def setUseFunHessian(self, boolean: bool) -> None: ... - def useFunHessian(self) -> bool: ... + def getB(self) -> float: + """ + Get parameter for quadratic line search. + + Returns: + parameter for quadratic line search + + + """ + ... + def getConvCriteria(self) -> int: + """ + Get convergence criteria. + + Returns: + convergence criteria + + + """ + ... + def getEps(self) -> float: + """ + Get tolerance for convergence and active constraint evaluation. + + Returns: + tolerance for convergence and active constraint evaluation + + + """ + ... + def getMaxLineSearchIteration(self) -> int: + """ + Get max Iteration for the line search + + Returns: + max Iteration for the line search + + + """ + ... + def getMu(self) -> float: + """ + Get parameter for evaluation of Armijo condition for descend direction. + + Returns: + parameter for evaluation of Armijo condition for descend direction + + + """ + ... + def getQpMaxLoop(self) -> int: + """ + Get max iteration admitted for QP subproblem evaluation. + + Returns: + max iteration admitted for QP subproblem evaluation + + + """ + ... + def getRhoCons(self) -> float: + """ + Get weight for augmented QP subproblem. + + Returns: + weight for augmented QP subproblem + + + """ + ... + def getSigmaMax(self) -> float: + """ + Get max value admitted for the solution of the additional variable in QP subproblem. + + Returns: + max value admitted for the solution of the additional variable in QP subproblem + + + """ + ... + def setB(self, double: float) -> None: + """ + Set parameter for quadratic line search. + + Parameters: + b (double): parameter for quadratic line search + + + """ + ... + def setConvCriteria(self, int: int) -> None: + """ + Set convergence criteria. + + Parameters: + convCriteria (int): convergence criteria + + + """ + ... + def setEps(self, double: float) -> None: + """ + Set tolerance for convergence and active constraint evaluation. + + Parameters: + eps (double): tolerance for convergence and active constraint evaluation + + + """ + ... + def setMaxLineSearchIteration(self, int: int) -> None: + """ + Set max Iteration for the line search + + Parameters: + maxLineSearchIteration (int): max Iteration for the line search + + + """ + ... + def setMu(self, double: float) -> None: + """ + Set parameter for evaluation of Armijo condition for descend direction. + + Parameters: + mu (double): parameter for evaluation of Armijo condition for descend direction + + + """ + ... + def setQpMaxLoop(self, int: int) -> None: + """ + Set max iteration admitted for QP subproblem evaluation. + + Parameters: + qpMaxLoop (int): max iteration admitted for QP subproblem evaluation + + + """ + ... + def setRhoCons(self, double: float) -> None: + """ + Set weight for augmented QP subproblem. + + Parameters: + rhoCons (double): weight for augmented QP subproblem + + + """ + ... + def setSigmaMax(self, double: float) -> None: + """ + Set max value admitted for the solution of the additional variable in QP subproblem. + + Parameters: + sigmaMax (double): max value admitted for the solution of the additional variable in QP subproblem + + + """ + ... + def setUseFunHessian(self, boolean: bool) -> None: + """ + Enable or Disable using direct the function Hessian. + + Parameters: + useFunHessian (boolean): enable or Disable using direct the function Hessian + + + """ + ... + def useFunHessian(self) -> bool: + """ + Check if using direct the function Hessian is enabled or disabled. + + Returns: + true if using direct the function Hessian is enabled + + + """ + ... class TwiceDifferentiableFunction(org.hipparchus.analysis.MultivariateFunction): + """ + public abstract classTwiceDifferentiableFunction extends :class:`~org.hipparchus.optim.nonlinear.vector.constrained.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.optim.nonlinear.vector.constrained.https:.www.hipparchus.org.hipparchus` + + A MultivariateFunction that also has a defined gradient and Hessian. + + Since: + 3.1 + """ def __init__(self): ... - def dim(self) -> int: ... + def dim(self) -> int: + """ + Returns the dimensionality of the function domain. If dim() returns (n) then this function expects an n-vector as its + input. + + Returns: + the expected dimension of the function's domain + + + """ + ... @typing.overload - def gradient(self, realVector: org.hipparchus.linear.RealVector) -> org.hipparchus.linear.RealVector: ... + def gradient(self, realVector: org.hipparchus.linear.RealVector) -> org.hipparchus.linear.RealVector: + """ + Returns the gradient of this function at (x) + + Parameters: + x (:class:`~org.hipparchus.optim.nonlinear.vector.constrained.https:.www.hipparchus.org.hipparchus`): a point to evaluate this gradient at + + Returns: + the gradient of this function at (x) + + Returns the gradient of this function at (x) + + Parameters: + x (double[]): a point to evaluate this gradient at + + Returns: + the gradient of this function at (x) + + + """ + ... @typing.overload def gradient(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> org.hipparchus.linear.RealVector: ... @typing.overload - def hessian(self, realVector: org.hipparchus.linear.RealVector) -> org.hipparchus.linear.RealMatrix: ... + def hessian(self, realVector: org.hipparchus.linear.RealVector) -> org.hipparchus.linear.RealMatrix: + """ + The Hessian of this function at (x) + + Parameters: + x (:class:`~org.hipparchus.optim.nonlinear.vector.constrained.https:.www.hipparchus.org.hipparchus`): a point to evaluate this Hessian at + + Returns: + the Hessian of this function at (x) + + The Hessian of this function at (x) + + Parameters: + x (double[]): a point to evaluate this Hessian at + + Returns: + the Hessian of this function at (x) + + + """ + ... @typing.overload def hessian(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> org.hipparchus.linear.RealMatrix: ... @typing.overload - def value(self, realVector: org.hipparchus.linear.RealVector) -> float: ... + def value(self, realVector: org.hipparchus.linear.RealVector) -> float: + """ + Returns the value of this function at (x) + + Parameters: + x (:class:`~org.hipparchus.optim.nonlinear.vector.constrained.https:.www.hipparchus.org.hipparchus`): a point to evaluate this function at. + + Returns: + the value of this function at (x) + + Returns the value of this function at (x) + + Specified by: + :meth:`~org.hipparchus.optim.nonlinear.vector.constrained.https:.www.hipparchus.org.hipparchus` in + interface :class:`~org.hipparchus.optim.nonlinear.vector.constrained.https:.www.hipparchus.org.hipparchus` + + Parameters: + x (double[]): a point to evaluate this function at. + + Returns: + the value of this function at (x) + + + """ + ... @typing.overload def value(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> float: ... class VectorDifferentiableFunction(org.hipparchus.analysis.MultivariateVectorFunction): - def dim(self) -> int: ... - def dimY(self) -> int: ... - def gradient(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> org.hipparchus.linear.RealMatrix: ... - def jacobian(self, realVector: org.hipparchus.linear.RealVector) -> org.hipparchus.linear.RealMatrix: ... + """ + public interfaceVectorDifferentiableFunctionextends :class:`~org.hipparchus.optim.nonlinear.vector.constrained.https:.www.hipparchus.org.hipparchus` + + A MultivariateFunction that also has a defined gradient and Hessian. + + Since: + 3.1 + """ + def dim(self) -> int: + """ + Returns the dimensionality of the function domain. If dim() returns (n) then this function expects an n-vector as its + input. + + Returns: + the expected dimension of the function's domain + + + """ + ... + def dimY(self) -> int: + """ + Returns the dimensionality of the function eval. + + Returns: + the expected dimension of the function's eval + + + """ + ... + def gradient(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> org.hipparchus.linear.RealMatrix: + """ + Returns the gradient of this function at (x) + + Parameters: + x (double[]): a point to evaluate this gradient at + + Returns: + the gradient of this function at (x) + + + """ + ... + def jacobian(self, realVector: org.hipparchus.linear.RealVector) -> org.hipparchus.linear.RealMatrix: + """ + Returns the gradient of this function at (x) + + Parameters: + x (:class:`~org.hipparchus.optim.nonlinear.vector.constrained.https:.www.hipparchus.org.hipparchus`): a point to evaluate this gradient at + + Returns: + the gradient of this function at (x) + + + """ + ... @typing.overload - def value(self, realVector: org.hipparchus.linear.RealVector) -> org.hipparchus.linear.RealVector: ... + def value(self, realVector: org.hipparchus.linear.RealVector) -> org.hipparchus.linear.RealVector: + """ + Returns the value of this function at (x) + + Parameters: + x (:class:`~org.hipparchus.optim.nonlinear.vector.constrained.https:.www.hipparchus.org.hipparchus`): a point to evaluate this function at. + + Returns: + the value of this function at (x) + + Returns the value of this function at (x) + + Specified by: + :meth:`~org.hipparchus.optim.nonlinear.vector.constrained.https:.www.hipparchus.org.hipparchus` in + interface :class:`~org.hipparchus.optim.nonlinear.vector.constrained.https:.www.hipparchus.org.hipparchus` + + Parameters: + x (double[]): a point to evaluate this function at. + + Returns: + the value of this function at (x) + + + """ + ... @typing.overload def value(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> typing.MutableSequence[float]: ... class ADMMQPKKT(KarushKuhnTuckerSolver['ADMMQPSolution']): - def initialize(self, realMatrix: org.hipparchus.linear.RealMatrix, realMatrix2: org.hipparchus.linear.RealMatrix, realVector: org.hipparchus.linear.RealVector, int: int, realVector2: org.hipparchus.linear.RealVector, realVector3: org.hipparchus.linear.RealVector, double: float, double2: float, double3: float) -> None: ... - def iterate(self, *realVector: org.hipparchus.linear.RealVector) -> 'ADMMQPSolution': ... - def solve(self, realVector: org.hipparchus.linear.RealVector, realVector2: org.hipparchus.linear.RealVector) -> 'ADMMQPSolution': ... - def updateSigmaRho(self, double: float, int: int, double2: float) -> None: ... + """ + public classADMMQPKKT extends :class:`~org.hipparchus.optim.nonlinear.vector.constrained.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.optim.nonlinear.vector.constrained.KarushKuhnTuckerSolver`<:class:`~org.hipparchus.optim.nonlinear.vector.constrained.ADMMQPSolution`> + + Alternative Direction Method of Multipliers Solver. + + Since: + 3.1 + """ + def initialize(self, realMatrix: org.hipparchus.linear.RealMatrix, realMatrix2: org.hipparchus.linear.RealMatrix, realVector: org.hipparchus.linear.RealVector, int: int, realVector2: org.hipparchus.linear.RealVector, realVector3: org.hipparchus.linear.RealVector, double: float, double2: float, double3: float) -> None: + """ + Initialize problem + + Parameters: + newH (:class:`~org.hipparchus.optim.nonlinear.vector.constrained.https:.www.hipparchus.org.hipparchus`): square matrix of weights for quadratic term + newA (:class:`~org.hipparchus.optim.nonlinear.vector.constrained.https:.www.hipparchus.org.hipparchus`): constraints coefficients matrix + newQ (:class:`~org.hipparchus.optim.nonlinear.vector.constrained.https:.www.hipparchus.org.hipparchus`): TBD + me (int): number of equality constraints + newLb (:class:`~org.hipparchus.optim.nonlinear.vector.constrained.https:.www.hipparchus.org.hipparchus`): lower bound + newUb (:class:`~org.hipparchus.optim.nonlinear.vector.constrained.https:.www.hipparchus.org.hipparchus`): upper bound + rho (double): step size + newSigma (double): regularization term sigma for Karush–Kuhn–Tucker solver + newAlpha (double): alpha filter for ADMM iteration + + + """ + ... + def iterate(self, *realVector: org.hipparchus.linear.RealVector) -> 'ADMMQPSolution': + """ + Iterate Karush–Kuhn–Tucker equation from given list of Vector + + Specified by: + :meth:`~org.hipparchus.optim.nonlinear.vector.constrained.KarushKuhnTuckerSolver.iterate` in + interface :class:`~org.hipparchus.optim.nonlinear.vector.constrained.KarushKuhnTuckerSolver` + + Parameters: + previousSol (:class:`~org.hipparchus.optim.nonlinear.vector.constrained.https:.www.hipparchus.org.hipparchus`...): list of vectors + + Returns: + Tuple with the solution x,Lambda,value + + + """ + ... + def solve(self, realVector: org.hipparchus.linear.RealVector, realVector2: org.hipparchus.linear.RealVector) -> 'ADMMQPSolution': + """ + Solve Karush–Kuhn–Tucker equation from given right hand value. + + Specified by: + :meth:`~org.hipparchus.optim.nonlinear.vector.constrained.KarushKuhnTuckerSolver.solve` in + interface :class:`~org.hipparchus.optim.nonlinear.vector.constrained.KarushKuhnTuckerSolver` + + Parameters: + b1 (:class:`~org.hipparchus.optim.nonlinear.vector.constrained.https:.www.hipparchus.org.hipparchus`): first right hand vector + b2 (:class:`~org.hipparchus.optim.nonlinear.vector.constrained.https:.www.hipparchus.org.hipparchus`): second right hand vector + + Returns: + Tuple with the solution x,Lambda,value + + + """ + ... + def updateSigmaRho(self, double: float, int: int, double2: float) -> None: + """ + Update steps + + Parameters: + newSigma (double): new regularization term sigma for Karush–Kuhn–Tucker solver + me (int): number of equality constraints + rho (double): new step size + + + """ + ... class ADMMQPSolution(LagrangeSolution): + """ + public classADMMQPSolution extends :class:`~org.hipparchus.optim.nonlinear.vector.constrained.LagrangeSolution` + + Internal Solution for ADMM QP Optimizer. + + Since: + 3.1 + """ @typing.overload def __init__(self, realVector: org.hipparchus.linear.RealVector, realVector2: org.hipparchus.linear.RealVector): ... @typing.overload @@ -162,65 +1311,439 @@ class ADMMQPSolution(LagrangeSolution): def __init__(self, realVector: org.hipparchus.linear.RealVector, realVector2: org.hipparchus.linear.RealVector, realVector3: org.hipparchus.linear.RealVector, realVector4: org.hipparchus.linear.RealVector): ... @typing.overload def __init__(self, realVector: org.hipparchus.linear.RealVector, realVector2: org.hipparchus.linear.RealVector, realVector3: org.hipparchus.linear.RealVector, realVector4: org.hipparchus.linear.RealVector, double: float): ... - def getV(self) -> org.hipparchus.linear.RealVector: ... - def getZ(self) -> org.hipparchus.linear.RealVector: ... + def getV(self) -> org.hipparchus.linear.RealVector: + """ + Returns V tilde auxiliary Variable + + Returns: + V tilde auxiliary Variable + + + """ + ... + def getZ(self) -> org.hipparchus.linear.RealVector: + """ + Returns Z auxiliary Variable + + Returns: + Z auxiliary Variable + + + """ + ... class AbstractSQPOptimizer(ConstraintOptimizer): - def getEqConstraint(self) -> 'EqualityConstraint': ... - def getIqConstraint(self) -> 'InequalityConstraint': ... - def getObj(self) -> TwiceDifferentiableFunction: ... - def getSettings(self) -> SQPOption: ... + """ + public abstract classAbstractSQPOptimizer extends :class:`~org.hipparchus.optim.nonlinear.vector.constrained.ConstraintOptimizer` + + Abstract class for Sequential Quadratic Programming solvers + + Since: + 3.1 + """ + def getEqConstraint(self) -> 'EqualityConstraint': + """ + Getter for equality constraint. + + Returns: + equality constraint + + + """ + ... + def getIqConstraint(self) -> 'InequalityConstraint': + """ + Getter for inequality constraint. + + Returns: + inequality constraint + + + """ + ... + def getObj(self) -> TwiceDifferentiableFunction: + """ + Getter for objective function. + + Returns: + objective function + + + """ + ... + def getSettings(self) -> SQPOption: + """ + Getter for settings. + + Returns: + settings + + + """ + ... @typing.overload def optimize(self) -> typing.Any: ... @typing.overload - def optimize(self, *optimizationData: org.hipparchus.optim.OptimizationData) -> LagrangeSolution: ... + def optimize(self, *optimizationData: org.hipparchus.optim.OptimizationData) -> LagrangeSolution: + """ + Description copied from class: :meth:`~org.hipparchus.optim.nonlinear.vector.constrained.ConstraintOptimizer.optimize` + Stores data and performs the optimization. + + The list of parameters is open-ended so that sub-classes can extend it with arguments specific to their concrete + implementations. + + When the method is called multiple times, instance data is overwritten only when actually present in the list of + arguments: when not specified, data set in a previous call is retained (and thus is optional in subsequent calls). + + Important note: Subclasses *must* override :meth:`~org.hipparchus.optim.BaseOptimizer.parseOptimizationData` if they + need to register their own options; but then, they *must* also call :code:`super.parseOptimizationData(optData)` within + that method. + + Overrides: + :meth:`~org.hipparchus.optim.nonlinear.vector.constrained.ConstraintOptimizer.optimize` in + class :class:`~org.hipparchus.optim.nonlinear.vector.constrained.ConstraintOptimizer` + + Parameters: + optData (:class:`~org.hipparchus.optim.OptimizationData`...): Optimization data. In addition to those documented in :meth:`~org.hipparchus.optim.BaseOptimizer.parseOptimizationData`, + this method will register the following data: + + - :class:`~org.hipparchus.optim.InitialGuess` + - :class:`~org.hipparchus.optim.SimpleBounds` + + + Returns: + a point/value pair that satisfies the convergence criteria. + + + """ + ... class Constraint(VectorDifferentiableFunction, org.hipparchus.optim.OptimizationData): - def getLowerBound(self) -> org.hipparchus.linear.RealVector: ... - def getUpperBound(self) -> org.hipparchus.linear.RealVector: ... - def overshoot(self, realVector: org.hipparchus.linear.RealVector) -> float: ... + """ + public interfaceConstraintextends :class:`~org.hipparchus.optim.nonlinear.vector.constrained.VectorDifferentiableFunction`, :class:`~org.hipparchus.optim.OptimizationData` + + Generic constraint. + + Since: + 3.1 + """ + def getLowerBound(self) -> org.hipparchus.linear.RealVector: + """ + Get Lower Bound for :meth:`~org.hipparchus.optim.nonlinear.vector.constrained.VectorDifferentiableFunction.value`. + + Returns: + Lower Bound for :meth:`~org.hipparchus.optim.nonlinear.vector.constrained.VectorDifferentiableFunction.value` + + + """ + ... + def getUpperBound(self) -> org.hipparchus.linear.RealVector: + """ + Get Upper Bound for :meth:`~org.hipparchus.optim.nonlinear.vector.constrained.VectorDifferentiableFunction.value`. + + Returns: + Upper Bound for :meth:`~org.hipparchus.optim.nonlinear.vector.constrained.VectorDifferentiableFunction.value` + + + """ + ... + def overshoot(self, realVector: org.hipparchus.linear.RealVector) -> float: + """ + Check how much a point overshoots the constraint. + + The overshoots is zero if the point fulfills the constraint, and positive if the + :meth:`~org.hipparchus.optim.nonlinear.vector.constrained.VectorDifferentiableFunction.value` of the constraint is on + the wrong side of :meth:`~org.hipparchus.optim.nonlinear.vector.constrained.Constraint.getLowerBound` or + :meth:`~org.hipparchus.optim.nonlinear.vector.constrained.Constraint.getUpperBound` boundaries. + + Parameters: + y (:class:`~org.hipparchus.optim.nonlinear.vector.constrained.https:.www.hipparchus.org.hipparchus`): constraint value (y = :meth:`~org.hipparchus.optim.nonlinear.vector.constrained.VectorDifferentiableFunction.value`(x)) + + Returns: + L¹-norm of constraint overshoot + + + """ + ... class QPOptimizer(ConstraintOptimizer): + """ + public classQPOptimizer extends :class:`~org.hipparchus.optim.nonlinear.vector.constrained.ConstraintOptimizer` + + Quadratic programming Optimizater. + + Since: + 3.1 + """ def __init__(self): ... class QuadraticFunction(TwiceDifferentiableFunction): + """ + public classQuadraticFunction extends :class:`~org.hipparchus.optim.nonlinear.vector.constrained.TwiceDifferentiableFunction` + + Given P, Q, d, implements \(\frac{1}{2}x^T P X + Q^T x + d\). The gradient is P x + Q^T, and the Hessian is P + + Since: + 3.1 + """ @typing.overload def __init__(self, doubleArray: typing.Union[typing.List[typing.MutableSequence[float]], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray], double3: float): ... @typing.overload def __init__(self, realMatrix: org.hipparchus.linear.RealMatrix, realVector: org.hipparchus.linear.RealVector, double: float): ... - def dim(self) -> int: ... - def getD(self) -> float: ... - def getP(self) -> org.hipparchus.linear.RealMatrix: ... - def getQ(self) -> org.hipparchus.linear.RealVector: ... + def dim(self) -> int: + """ + Returns the dimensionality of the function domain. If dim() returns (n) then this function expects an n-vector as its + input. + + Specified by: + :meth:`~org.hipparchus.optim.nonlinear.vector.constrained.TwiceDifferentiableFunction.dim` in + class :class:`~org.hipparchus.optim.nonlinear.vector.constrained.TwiceDifferentiableFunction` + + Returns: + the expected dimension of the function's domain + + + """ + ... + def getD(self) -> float: + """ + Get constant term. + + Returns: + constant term + + + """ + ... + def getP(self) -> org.hipparchus.linear.RealMatrix: + """ + Get square matrix of weights for quadratic terms. + + Returns: + square matrix of weights for quadratic terms + + + """ + ... + def getQ(self) -> org.hipparchus.linear.RealVector: + """ + Get vector of weights for linear terms. + + Returns: + vector of weights for linear terms + + + """ + ... @typing.overload - def gradient(self, realVector: org.hipparchus.linear.RealVector) -> org.hipparchus.linear.RealVector: ... + def gradient(self, realVector: org.hipparchus.linear.RealVector) -> org.hipparchus.linear.RealVector: + """ + Returns the gradient of this function at (x) + + Specified by: + :meth:`~org.hipparchus.optim.nonlinear.vector.constrained.TwiceDifferentiableFunction.gradient` in + class :class:`~org.hipparchus.optim.nonlinear.vector.constrained.TwiceDifferentiableFunction` + + Parameters: + x (:class:`~org.hipparchus.optim.nonlinear.vector.constrained.https:.www.hipparchus.org.hipparchus`): a point to evaluate this gradient at + + Returns: + the gradient of this function at (x) + + + """ + ... @typing.overload def gradient(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> org.hipparchus.linear.RealVector: ... @typing.overload - def hessian(self, realVector: org.hipparchus.linear.RealVector) -> org.hipparchus.linear.RealMatrix: ... + def hessian(self, realVector: org.hipparchus.linear.RealVector) -> org.hipparchus.linear.RealMatrix: + """ + The Hessian of this function at (x) + + Specified by: + :meth:`~org.hipparchus.optim.nonlinear.vector.constrained.TwiceDifferentiableFunction.hessian` in + class :class:`~org.hipparchus.optim.nonlinear.vector.constrained.TwiceDifferentiableFunction` + + Parameters: + x (:class:`~org.hipparchus.optim.nonlinear.vector.constrained.https:.www.hipparchus.org.hipparchus`): a point to evaluate this Hessian at + + Returns: + the Hessian of this function at (x) + + + """ + ... @typing.overload def hessian(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> org.hipparchus.linear.RealMatrix: ... @typing.overload - def value(self, realVector: org.hipparchus.linear.RealVector) -> float: ... + def value(self, realVector: org.hipparchus.linear.RealVector) -> float: + """ + Returns the value of this function at (x) + + Specified by: + :meth:`~org.hipparchus.optim.nonlinear.vector.constrained.TwiceDifferentiableFunction.value` in + class :class:`~org.hipparchus.optim.nonlinear.vector.constrained.TwiceDifferentiableFunction` + + Parameters: + x (:class:`~org.hipparchus.optim.nonlinear.vector.constrained.https:.www.hipparchus.org.hipparchus`): a point to evaluate this function at. + + Returns: + the value of this function at (x) + + + """ + ... @typing.overload def value(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> float: ... class ADMMQPOptimizer(QPOptimizer): + """ + public classADMMQPOptimizer extends :class:`~org.hipparchus.optim.nonlinear.vector.constrained.QPOptimizer` + + Alternating Direction Method of Multipliers Quadratic Programming Optimizer. \[ min \frac{1}{2} X^T Q X + G X a\\ A X = + B_1\\ B X \ge B_2\\ l_b \le C X \le u_b \] Algorithm based on paper:"An Operator Splitting Solver for Quadratic + Programs(Bartolomeo Stellato, Goran Banjac, Paul Goulart, Alberto Bemporad, Stephen Boyd,February 13 2020)" + + Since: + 3.1 + """ def __init__(self): ... - def doOptimize(self) -> LagrangeSolution: ... + def doOptimize(self) -> LagrangeSolution: + """ + Performs the bulk of the optimization algorithm. + + Overrides: + :meth:`~org.hipparchus.optim.nonlinear.vector.constrained.QPOptimizer.doOptimize` in + class :class:`~org.hipparchus.optim.nonlinear.vector.constrained.QPOptimizer` + + Returns: + the point/value pair giving the optimal value of the objective function. + + + """ + ... def getConvergenceChecker(self) -> org.hipparchus.optim.ConvergenceChecker[LagrangeSolution]: ... - def isConverged(self) -> bool: ... + def isConverged(self) -> bool: + """ + Check if convergence has been reached. + + Returns: + true if convergence has been reached + + + """ + ... @typing.overload def optimize(self) -> typing.Any: ... @typing.overload - def optimize(self, *optimizationData: org.hipparchus.optim.OptimizationData) -> LagrangeSolution: ... + def optimize(self, *optimizationData: org.hipparchus.optim.OptimizationData) -> LagrangeSolution: + """ + Stores data and performs the optimization. + + The list of parameters is open-ended so that sub-classes can extend it with arguments specific to their concrete + implementations. + + When the method is called multiple times, instance data is overwritten only when actually present in the list of + arguments: when not specified, data set in a previous call is retained (and thus is optional in subsequent calls). + + Important note: Subclasses *must* override :meth:`~org.hipparchus.optim.BaseOptimizer.parseOptimizationData` if they + need to register their own options; but then, they *must* also call :code:`super.parseOptimizationData(optData)` within + that method. + + Overrides: + :meth:`~org.hipparchus.optim.nonlinear.vector.constrained.ConstraintOptimizer.optimize` in + class :class:`~org.hipparchus.optim.nonlinear.vector.constrained.ConstraintOptimizer` + + Parameters: + optData (:class:`~org.hipparchus.optim.OptimizationData`...): Optimization data. In addition to those documented in :meth:`~org.hipparchus.optim.BaseOptimizer.parseOptimizationData`, + this method will register the following data: + + - :class:`~org.hipparchus.optim.InitialGuess` + - :class:`~org.hipparchus.optim.SimpleBounds` + + + Returns: + a point/value pair that satisfies the convergence criteria. + + + """ + ... class BoundedConstraint(Constraint): + """ + public abstract classBoundedConstraint extends :class:`~org.hipparchus.optim.nonlinear.vector.constrained.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.optim.nonlinear.vector.constrained.Constraint` + + Constraint with lower and upper bounds: \(l \le f(x) \le u\). + + Since: + 3.1 + """ def __init__(self, realVector: org.hipparchus.linear.RealVector, realVector2: org.hipparchus.linear.RealVector): ... - def dimY(self) -> int: ... - def getLowerBound(self) -> org.hipparchus.linear.RealVector: ... - def getUpperBound(self) -> org.hipparchus.linear.RealVector: ... - def overshoot(self, realVector: org.hipparchus.linear.RealVector) -> float: ... + def dimY(self) -> int: + """ + Returns the dimensionality of the function eval. + + Specified by: + :meth:`~org.hipparchus.optim.nonlinear.vector.constrained.VectorDifferentiableFunction.dimY` in + interface :class:`~org.hipparchus.optim.nonlinear.vector.constrained.VectorDifferentiableFunction` + + Returns: + the expected dimension of the function's eval + + + """ + ... + def getLowerBound(self) -> org.hipparchus.linear.RealVector: + """ + Get Lower Bound for :meth:`~org.hipparchus.optim.nonlinear.vector.constrained.VectorDifferentiableFunction.value`. + + Specified by: + :meth:`~org.hipparchus.optim.nonlinear.vector.constrained.Constraint.getLowerBound` in + interface :class:`~org.hipparchus.optim.nonlinear.vector.constrained.Constraint` + + Returns: + Lower Bound for :meth:`~org.hipparchus.optim.nonlinear.vector.constrained.VectorDifferentiableFunction.value` + + + """ + ... + def getUpperBound(self) -> org.hipparchus.linear.RealVector: + """ + Get Upper Bound for :meth:`~org.hipparchus.optim.nonlinear.vector.constrained.VectorDifferentiableFunction.value`. + + Specified by: + :meth:`~org.hipparchus.optim.nonlinear.vector.constrained.Constraint.getUpperBound` in + interface :class:`~org.hipparchus.optim.nonlinear.vector.constrained.Constraint` + + Returns: + Upper Bound for :meth:`~org.hipparchus.optim.nonlinear.vector.constrained.VectorDifferentiableFunction.value` + + + """ + ... + def overshoot(self, realVector: org.hipparchus.linear.RealVector) -> float: + """ + Check how much a point overshoots the constraint. + + The overshoots is zero if the point fulfills the constraint, and positive if the + :meth:`~org.hipparchus.optim.nonlinear.vector.constrained.VectorDifferentiableFunction.value` of the constraint is on + the wrong side of :meth:`~org.hipparchus.optim.nonlinear.vector.constrained.Constraint.getLowerBound` or + :meth:`~org.hipparchus.optim.nonlinear.vector.constrained.Constraint.getUpperBound` boundaries. + + Specified by: + :meth:`~org.hipparchus.optim.nonlinear.vector.constrained.Constraint.overshoot` in + interface :class:`~org.hipparchus.optim.nonlinear.vector.constrained.Constraint` + + Parameters: + y (:class:`~org.hipparchus.optim.nonlinear.vector.constrained.https:.www.hipparchus.org.hipparchus`): constraint value (y = :meth:`~org.hipparchus.optim.nonlinear.vector.constrained.VectorDifferentiableFunction.value`(x)) + + Returns: + L¹-norm of constraint overshoot + + + """ + ... class SQPOptimizerGM(AbstractSQPOptimizer): def __init__(self): ... @@ -231,45 +1754,263 @@ class SQPOptimizerS(AbstractSQPOptimizer): def doOptimize(self) -> LagrangeSolution: ... class EqualityConstraint(BoundedConstraint): + """ + public abstract classEqualityConstraint extends :class:`~org.hipparchus.optim.nonlinear.vector.constrained.BoundedConstraint` + + Equality Constraint. + + Since: + 3.1 + """ def __init__(self, realVector: org.hipparchus.linear.RealVector): ... class InequalityConstraint(BoundedConstraint): + """ + public abstract classInequalityConstraint extends :class:`~org.hipparchus.optim.nonlinear.vector.constrained.BoundedConstraint` + + Inequality Constraint with lower bound only: \(l \le f(x)\). + + Since: + 3.1 + """ def __init__(self, realVector: org.hipparchus.linear.RealVector): ... class LinearBoundedConstraint(BoundedConstraint, org.hipparchus.optim.OptimizationData): + """ + public classLinearBoundedConstraint extends :class:`~org.hipparchus.optim.nonlinear.vector.constrained.BoundedConstraint` + implements :class:`~org.hipparchus.optim.OptimizationData` + + A set of linear inequality constraints expressed as ub>Ax>lb. + + Since: + 3.1 + """ @typing.overload def __init__(self, doubleArray: typing.Union[typing.List[typing.MutableSequence[float]], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray], doubleArray3: typing.Union[typing.List[float], jpype.JArray]): ... @typing.overload def __init__(self, realMatrix: org.hipparchus.linear.RealMatrix, realVector: org.hipparchus.linear.RealVector, realVector2: org.hipparchus.linear.RealVector): ... - def dim(self) -> int: ... - def jacobian(self, realVector: org.hipparchus.linear.RealVector) -> org.hipparchus.linear.RealMatrix: ... + def dim(self) -> int: + """ + Returns the dimensionality of the function domain. If dim() returns (n) then this function expects an n-vector as its + input. + + Specified by: + :meth:`~org.hipparchus.optim.nonlinear.vector.constrained.VectorDifferentiableFunction.dim` in + interface :class:`~org.hipparchus.optim.nonlinear.vector.constrained.VectorDifferentiableFunction` + + Returns: + the expected dimension of the function's domain + + + """ + ... + def jacobian(self, realVector: org.hipparchus.linear.RealVector) -> org.hipparchus.linear.RealMatrix: + """ + Returns the gradient of this function at (x) + + Specified by: + :meth:`~org.hipparchus.optim.nonlinear.vector.constrained.VectorDifferentiableFunction.jacobian` in + interface :class:`~org.hipparchus.optim.nonlinear.vector.constrained.VectorDifferentiableFunction` + + Parameters: + x (:class:`~org.hipparchus.optim.nonlinear.vector.constrained.https:.www.hipparchus.org.hipparchus`): a point to evaluate this gradient at + + Returns: + the gradient of this function at (x) + + + """ + ... @typing.overload - def value(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> typing.MutableSequence[float]: ... + def value(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> typing.MutableSequence[float]: + """ + Returns the value of this function at (x) + + Specified by: + :meth:`~org.hipparchus.optim.nonlinear.vector.constrained.https:.www.hipparchus.org.hipparchus` in + interface :class:`~org.hipparchus.optim.nonlinear.vector.constrained.https:.www.hipparchus.org.hipparchus` + + Specified by: + :meth:`~org.hipparchus.optim.nonlinear.vector.constrained.VectorDifferentiableFunction.value` in + interface :class:`~org.hipparchus.optim.nonlinear.vector.constrained.VectorDifferentiableFunction` + + Parameters: + x (double[]): a point to evaluate this function at. + + Returns: + the value of this function at (x) + + Returns the value of this function at (x) + + Specified by: + :meth:`~org.hipparchus.optim.nonlinear.vector.constrained.VectorDifferentiableFunction.value` in + interface :class:`~org.hipparchus.optim.nonlinear.vector.constrained.VectorDifferentiableFunction` + + Parameters: + x (:class:`~org.hipparchus.optim.nonlinear.vector.constrained.https:.www.hipparchus.org.hipparchus`): a point to evaluate this function at. + + Returns: + the value of this function at (x) + + + """ + ... @typing.overload def value(self, realVector: org.hipparchus.linear.RealVector) -> org.hipparchus.linear.RealVector: ... class LinearEqualityConstraint(EqualityConstraint, org.hipparchus.optim.OptimizationData): + """ + public classLinearEqualityConstraint extends :class:`~org.hipparchus.optim.nonlinear.vector.constrained.EqualityConstraint` + implements :class:`~org.hipparchus.optim.OptimizationData` + + A set of linear equality constraints given as Ax = b. + + Since: + 3.1 + """ @typing.overload def __init__(self, doubleArray: typing.Union[typing.List[typing.MutableSequence[float]], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray]): ... @typing.overload def __init__(self, realMatrix: org.hipparchus.linear.RealMatrix, realVector: org.hipparchus.linear.RealVector): ... - def dim(self) -> int: ... - def getA(self) -> org.hipparchus.linear.RealMatrix: ... - def jacobian(self, realVector: org.hipparchus.linear.RealVector) -> org.hipparchus.linear.RealMatrix: ... + def dim(self) -> int: + """ + Description copied from + interface: :meth:`~org.hipparchus.optim.nonlinear.vector.constrained.VectorDifferentiableFunction.dim` + Returns the dimensionality of the function domain. If dim() returns (n) then this function expects an n-vector as its + input. + + Specified by: + :meth:`~org.hipparchus.optim.nonlinear.vector.constrained.VectorDifferentiableFunction.dim` in + interface :class:`~org.hipparchus.optim.nonlinear.vector.constrained.VectorDifferentiableFunction` + + Returns: + the expected dimension of the function's domain + + + """ + ... + def getA(self) -> org.hipparchus.linear.RealMatrix: + """ + Get the matrix of linear weights. + + Returns: + matrix of linear weights + + + """ + ... + def jacobian(self, realVector: org.hipparchus.linear.RealVector) -> org.hipparchus.linear.RealMatrix: + """ + Description copied from + interface: :meth:`~org.hipparchus.optim.nonlinear.vector.constrained.VectorDifferentiableFunction.jacobian` + Returns the gradient of this function at (x) + + Specified by: + :meth:`~org.hipparchus.optim.nonlinear.vector.constrained.VectorDifferentiableFunction.jacobian` in + interface :class:`~org.hipparchus.optim.nonlinear.vector.constrained.VectorDifferentiableFunction` + + Parameters: + x (:class:`~org.hipparchus.optim.nonlinear.vector.constrained.https:.www.hipparchus.org.hipparchus`): a point to evaluate this gradient at + + Returns: + the gradient of this function at (x) + + + """ + ... @typing.overload - def value(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> typing.MutableSequence[float]: ... + def value(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> typing.MutableSequence[float]: + """ + Description copied from + interface: :meth:`~org.hipparchus.optim.nonlinear.vector.constrained.VectorDifferentiableFunction.value` + Returns the value of this function at (x) + + Specified by: + :meth:`~org.hipparchus.optim.nonlinear.vector.constrained.VectorDifferentiableFunction.value` in + interface :class:`~org.hipparchus.optim.nonlinear.vector.constrained.VectorDifferentiableFunction` + + Parameters: + x (:class:`~org.hipparchus.optim.nonlinear.vector.constrained.https:.www.hipparchus.org.hipparchus`): a point to evaluate this function at. + + Returns: + the value of this function at (x) + + + """ + ... @typing.overload def value(self, realVector: org.hipparchus.linear.RealVector) -> org.hipparchus.linear.RealVector: ... class LinearInequalityConstraint(InequalityConstraint, org.hipparchus.optim.OptimizationData): + """ + public classLinearInequalityConstraint extends :class:`~org.hipparchus.optim.nonlinear.vector.constrained.InequalityConstraint` + implements :class:`~org.hipparchus.optim.OptimizationData` + + Set of linear inequality constraints expressed as \( A x \gt B\). + + Since: + 3.1 + """ @typing.overload def __init__(self, doubleArray: typing.Union[typing.List[typing.MutableSequence[float]], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray]): ... @typing.overload def __init__(self, realMatrix: org.hipparchus.linear.RealMatrix, realVector: org.hipparchus.linear.RealVector): ... - def dim(self) -> int: ... - def jacobian(self, realVector: org.hipparchus.linear.RealVector) -> org.hipparchus.linear.RealMatrix: ... + def dim(self) -> int: + """ + Description copied from + interface: :meth:`~org.hipparchus.optim.nonlinear.vector.constrained.VectorDifferentiableFunction.dim` + Returns the dimensionality of the function domain. If dim() returns (n) then this function expects an n-vector as its + input. + + Specified by: + :meth:`~org.hipparchus.optim.nonlinear.vector.constrained.VectorDifferentiableFunction.dim` in + interface :class:`~org.hipparchus.optim.nonlinear.vector.constrained.VectorDifferentiableFunction` + + Returns: + the expected dimension of the function's domain + + + """ + ... + def jacobian(self, realVector: org.hipparchus.linear.RealVector) -> org.hipparchus.linear.RealMatrix: + """ + Description copied from + interface: :meth:`~org.hipparchus.optim.nonlinear.vector.constrained.VectorDifferentiableFunction.jacobian` + Returns the gradient of this function at (x) + + Specified by: + :meth:`~org.hipparchus.optim.nonlinear.vector.constrained.VectorDifferentiableFunction.jacobian` in + interface :class:`~org.hipparchus.optim.nonlinear.vector.constrained.VectorDifferentiableFunction` + + Parameters: + x (:class:`~org.hipparchus.optim.nonlinear.vector.constrained.https:.www.hipparchus.org.hipparchus`): a point to evaluate this gradient at + + Returns: + the gradient of this function at (x) + + + """ + ... @typing.overload - def value(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> typing.MutableSequence[float]: ... + def value(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> typing.MutableSequence[float]: + """ + Description copied from + interface: :meth:`~org.hipparchus.optim.nonlinear.vector.constrained.VectorDifferentiableFunction.value` + Returns the value of this function at (x) + + Specified by: + :meth:`~org.hipparchus.optim.nonlinear.vector.constrained.VectorDifferentiableFunction.value` in + interface :class:`~org.hipparchus.optim.nonlinear.vector.constrained.VectorDifferentiableFunction` + + Parameters: + x (:class:`~org.hipparchus.optim.nonlinear.vector.constrained.https:.www.hipparchus.org.hipparchus`): a point to evaluate this function at. + + Returns: + the value of this function at (x) + + + """ + ... @typing.overload def value(self, realVector: org.hipparchus.linear.RealVector) -> org.hipparchus.linear.RealVector: ... diff --git a/org-stubs/hipparchus/optim/nonlinear/vector/leastsquares/__init__.pyi b/org-stubs/hipparchus/optim/nonlinear/vector/leastsquares/__init__.pyi index fdc0f2c..e3a270c 100644 --- a/org-stubs/hipparchus/optim/nonlinear/vector/leastsquares/__init__.pyi +++ b/org-stubs/hipparchus/optim/nonlinear/vector/leastsquares/__init__.pyi @@ -15,38 +15,225 @@ import typing class EvaluationRmsChecker(org.hipparchus.optim.ConvergenceChecker['LeastSquaresProblem.Evaluation']): + """ + public classEvaluationRmsChecker extends :class:`~org.hipparchus.optim.nonlinear.vector.leastsquares.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.optim.ConvergenceChecker`<:class:`~org.hipparchus.optim.nonlinear.vector.leastsquares.LeastSquaresProblem.Evaluation`> + + Check if an optimization has converged based on the change in computed RMS. + """ @typing.overload def __init__(self, double: float): ... @typing.overload def __init__(self, double: float, double2: float): ... - def converged(self, int: int, evaluation: 'LeastSquaresProblem.Evaluation', evaluation2: 'LeastSquaresProblem.Evaluation') -> bool: ... + def converged(self, int: int, evaluation: 'LeastSquaresProblem.Evaluation', evaluation2: 'LeastSquaresProblem.Evaluation') -> bool: + """ + Check if the optimization algorithm has converged. + + Specified by: + :meth:`~org.hipparchus.optim.ConvergenceChecker.converged` in + interface :class:`~org.hipparchus.optim.ConvergenceChecker` + + Parameters: + iteration (int): Current iteration. + previous (:class:`~org.hipparchus.optim.nonlinear.vector.leastsquares.LeastSquaresProblem.Evaluation`): Best point in the previous iteration. + current (:class:`~org.hipparchus.optim.nonlinear.vector.leastsquares.LeastSquaresProblem.Evaluation`): Best point in the current iteration. + + Returns: + :code:`true` if the algorithm is considered to have converged. + + + """ + ... class LeastSquaresBuilder: + """ + public classLeastSquaresBuilder extends :class:`~org.hipparchus.optim.nonlinear.vector.leastsquares.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + A mutable builder for :class:`~org.hipparchus.optim.nonlinear.vector.leastsquares.LeastSquaresProblem`s. + + Also see: + + - :class:`~org.hipparchus.optim.nonlinear.vector.leastsquares.LeastSquaresFactory` + """ def __init__(self): ... - def build(self) -> 'LeastSquaresProblem': ... + def build(self) -> 'LeastSquaresProblem': + """ + Construct a :class:`~org.hipparchus.optim.nonlinear.vector.leastsquares.LeastSquaresProblem` from the data in this + builder. + + Returns: + a new :class:`~org.hipparchus.optim.nonlinear.vector.leastsquares.LeastSquaresProblem`. + + + """ + ... def checker(self, convergenceChecker: typing.Union[org.hipparchus.optim.ConvergenceChecker['LeastSquaresProblem.Evaluation'], typing.Callable[[int, 'LeastSquaresProblem.Evaluation', 'LeastSquaresProblem.Evaluation'], bool]]) -> 'LeastSquaresBuilder': ... def checkerPair(self, convergenceChecker: typing.Union[org.hipparchus.optim.ConvergenceChecker[org.hipparchus.optim.PointVectorValuePair], typing.Callable[[int, org.hipparchus.optim.PointVectorValuePair, org.hipparchus.optim.PointVectorValuePair], bool]]) -> 'LeastSquaresBuilder': ... - def lazyEvaluation(self, boolean: bool) -> 'LeastSquaresBuilder': ... - def maxEvaluations(self, int: int) -> 'LeastSquaresBuilder': ... - def maxIterations(self, int: int) -> 'LeastSquaresBuilder': ... + def lazyEvaluation(self, boolean: bool) -> 'LeastSquaresBuilder': + """ + Configure whether evaluation will be lazy or not. + + Parameters: + newValue (boolean): Whether to perform lazy evaluation. + + Returns: + this object. + + + """ + ... + def maxEvaluations(self, int: int) -> 'LeastSquaresBuilder': + """ + Configure the max evaluations. + + Parameters: + newMaxEvaluations (int): the maximum number of evaluations permitted. + + Returns: + this + + + """ + ... + def maxIterations(self, int: int) -> 'LeastSquaresBuilder': + """ + Configure the max iterations. + + Parameters: + newMaxIterations (int): the maximum number of iterations permitted. + + Returns: + this + + + """ + ... @typing.overload - def model(self, multivariateVectorFunction: typing.Union[org.hipparchus.analysis.MultivariateVectorFunction, typing.Callable], multivariateMatrixFunction: typing.Union[org.hipparchus.analysis.MultivariateMatrixFunction, typing.Callable]) -> 'LeastSquaresBuilder': ... + def model(self, multivariateVectorFunction: typing.Union[org.hipparchus.analysis.MultivariateVectorFunction, typing.Callable], multivariateMatrixFunction: typing.Union[org.hipparchus.analysis.MultivariateMatrixFunction, typing.Callable]) -> 'LeastSquaresBuilder': + """ + Configure the model function. + + Parameters: + value (:class:`~org.hipparchus.optim.nonlinear.vector.leastsquares.https:.www.hipparchus.org.hipparchus`): the model function value + jacobian (:class:`~org.hipparchus.optim.nonlinear.vector.leastsquares.https:.www.hipparchus.org.hipparchus`): the Jacobian of :code:`value` + + Returns: + this + + """ + ... @typing.overload - def model(self, multivariateJacobianFunction: typing.Union['MultivariateJacobianFunction', typing.Callable]) -> 'LeastSquaresBuilder': ... - def parameterValidator(self, parameterValidator: typing.Union['ParameterValidator', typing.Callable]) -> 'LeastSquaresBuilder': ... + def model(self, multivariateJacobianFunction: typing.Union['MultivariateJacobianFunction', typing.Callable]) -> 'LeastSquaresBuilder': + """ + Configure the model function. + + Parameters: + newModel (:class:`~org.hipparchus.optim.nonlinear.vector.leastsquares.MultivariateJacobianFunction`): the model function value and Jacobian + + Returns: + this + + + """ + ... + def parameterValidator(self, parameterValidator: typing.Union['ParameterValidator', typing.Callable]) -> 'LeastSquaresBuilder': + """ + Configure the validator of the model parameters. + + Parameters: + newValidator (:class:`~org.hipparchus.optim.nonlinear.vector.leastsquares.ParameterValidator`): Parameter validator. + + Returns: + this object. + + + """ + ... @typing.overload - def start(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> 'LeastSquaresBuilder': ... + def start(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> 'LeastSquaresBuilder': + """ + Configure the initial guess. + + Parameters: + newStart (:class:`~org.hipparchus.optim.nonlinear.vector.leastsquares.https:.www.hipparchus.org.hipparchus`): the initial guess. + + Returns: + this + + Configure the initial guess. + + Parameters: + newStart (double[]): the initial guess. + + Returns: + this + + + """ + ... @typing.overload def start(self, realVector: org.hipparchus.linear.RealVector) -> 'LeastSquaresBuilder': ... @typing.overload - def target(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> 'LeastSquaresBuilder': ... + def target(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> 'LeastSquaresBuilder': + """ + Configure the observed data. + + Parameters: + newTarget (:class:`~org.hipparchus.optim.nonlinear.vector.leastsquares.https:.www.hipparchus.org.hipparchus`): the observed data. + + Returns: + this + + Configure the observed data. + + Parameters: + newTarget (double[]): the observed data. + + Returns: + this + + + """ + ... @typing.overload def target(self, realVector: org.hipparchus.linear.RealVector) -> 'LeastSquaresBuilder': ... - def weight(self, realMatrix: org.hipparchus.linear.RealMatrix) -> 'LeastSquaresBuilder': ... + def weight(self, realMatrix: org.hipparchus.linear.RealMatrix) -> 'LeastSquaresBuilder': + """ + Configure the weight matrix. + + Parameters: + newWeight (:class:`~org.hipparchus.optim.nonlinear.vector.leastsquares.https:.www.hipparchus.org.hipparchus`): the weight matrix + + Returns: + this + + + """ + ... class LeastSquaresFactory: + """ + public classLeastSquaresFactory extends :class:`~org.hipparchus.optim.nonlinear.vector.leastsquares.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + A Factory for creating :class:`~org.hipparchus.optim.nonlinear.vector.leastsquares.LeastSquaresProblem`s. + """ @staticmethod - def countEvaluations(leastSquaresProblem: 'LeastSquaresProblem', incrementor: org.hipparchus.util.Incrementor) -> 'LeastSquaresProblem': ... + def countEvaluations(leastSquaresProblem: 'LeastSquaresProblem', incrementor: org.hipparchus.util.Incrementor) -> 'LeastSquaresProblem': + """ + Count the evaluations of a particular problem. The :code:`counter` will be incremented every time + :meth:`~org.hipparchus.optim.nonlinear.vector.leastsquares.LeastSquaresProblem.evaluate` is called on the *returned* + problem. + + Parameters: + problem (:class:`~org.hipparchus.optim.nonlinear.vector.leastsquares.LeastSquaresProblem`): the problem to track. + counter (:class:`~org.hipparchus.optim.nonlinear.vector.leastsquares.https:.www.hipparchus.org.hipparchus`): the counter to increment. + + Returns: + a least squares problem that tracks evaluations + + + """ + ... @typing.overload @staticmethod def create(multivariateVectorFunction: typing.Union[org.hipparchus.analysis.MultivariateVectorFunction, typing.Callable], multivariateMatrixFunction: typing.Union[org.hipparchus.analysis.MultivariateMatrixFunction, typing.Callable], doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray], realMatrix: org.hipparchus.linear.RealMatrix, convergenceChecker: typing.Union[org.hipparchus.optim.ConvergenceChecker['LeastSquaresProblem.Evaluation'], typing.Callable[[int, 'LeastSquaresProblem.Evaluation', 'LeastSquaresProblem.Evaluation'], bool]], int: int, int2: int) -> 'LeastSquaresProblem': ... @@ -62,17 +249,121 @@ class LeastSquaresFactory: @staticmethod def evaluationChecker(convergenceChecker: typing.Union[org.hipparchus.optim.ConvergenceChecker[org.hipparchus.optim.PointVectorValuePair], typing.Callable[[int, org.hipparchus.optim.PointVectorValuePair, org.hipparchus.optim.PointVectorValuePair], bool]]) -> org.hipparchus.optim.ConvergenceChecker['LeastSquaresProblem.Evaluation']: ... @staticmethod - def model(multivariateVectorFunction: typing.Union[org.hipparchus.analysis.MultivariateVectorFunction, typing.Callable], multivariateMatrixFunction: typing.Union[org.hipparchus.analysis.MultivariateMatrixFunction, typing.Callable]) -> 'MultivariateJacobianFunction': ... + def model(multivariateVectorFunction: typing.Union[org.hipparchus.analysis.MultivariateVectorFunction, typing.Callable], multivariateMatrixFunction: typing.Union[org.hipparchus.analysis.MultivariateMatrixFunction, typing.Callable]) -> 'MultivariateJacobianFunction': + """ + Combine a :class:`~org.hipparchus.optim.nonlinear.vector.leastsquares.https:.www.hipparchus.org.hipparchus` with a + :class:`~org.hipparchus.optim.nonlinear.vector.leastsquares.https:.www.hipparchus.org.hipparchus` to produce a + :class:`~org.hipparchus.optim.nonlinear.vector.leastsquares.MultivariateJacobianFunction`. + + Parameters: + value (:class:`~org.hipparchus.optim.nonlinear.vector.leastsquares.https:.www.hipparchus.org.hipparchus`): the vector value function + jacobian (:class:`~org.hipparchus.optim.nonlinear.vector.leastsquares.https:.www.hipparchus.org.hipparchus`): the Jacobian function + + Returns: + a function that computes both at the same time + + + """ + ... @staticmethod - def weightDiagonal(leastSquaresProblem: 'LeastSquaresProblem', realVector: org.hipparchus.linear.RealVector) -> 'LeastSquaresProblem': ... + def weightDiagonal(leastSquaresProblem: 'LeastSquaresProblem', realVector: org.hipparchus.linear.RealVector) -> 'LeastSquaresProblem': + """ + Apply a diagonal weight matrix to the :class:`~org.hipparchus.optim.nonlinear.vector.leastsquares.LeastSquaresProblem`. + + Parameters: + problem (:class:`~org.hipparchus.optim.nonlinear.vector.leastsquares.LeastSquaresProblem`): the unweighted problem + weights (:class:`~org.hipparchus.optim.nonlinear.vector.leastsquares.https:.www.hipparchus.org.hipparchus`): the diagonal of the weight matrix + + Returns: + a new :class:`~org.hipparchus.optim.nonlinear.vector.leastsquares.LeastSquaresProblem` with the weights applied. The + original :code:`problem` is not modified. + + + """ + ... @staticmethod - def weightMatrix(leastSquaresProblem: 'LeastSquaresProblem', realMatrix: org.hipparchus.linear.RealMatrix) -> 'LeastSquaresProblem': ... + def weightMatrix(leastSquaresProblem: 'LeastSquaresProblem', realMatrix: org.hipparchus.linear.RealMatrix) -> 'LeastSquaresProblem': + """ + Apply a dense weight matrix to the :class:`~org.hipparchus.optim.nonlinear.vector.leastsquares.LeastSquaresProblem`. + + Parameters: + problem (:class:`~org.hipparchus.optim.nonlinear.vector.leastsquares.LeastSquaresProblem`): the unweighted problem + weights (:class:`~org.hipparchus.optim.nonlinear.vector.leastsquares.https:.www.hipparchus.org.hipparchus`): the matrix of weights + + Returns: + a new :class:`~org.hipparchus.optim.nonlinear.vector.leastsquares.LeastSquaresProblem` with the weights applied. The + original :code:`problem` is not modified. + + + """ + ... class LeastSquaresProblem(org.hipparchus.optim.OptimizationProblem['LeastSquaresProblem.Evaluation']): - def evaluate(self, realVector: org.hipparchus.linear.RealVector) -> 'LeastSquaresProblem.Evaluation': ... - def getObservationSize(self) -> int: ... - def getParameterSize(self) -> int: ... - def getStart(self) -> org.hipparchus.linear.RealVector: ... + """ + public interfaceLeastSquaresProblemextends :class:`~org.hipparchus.optim.OptimizationProblem`<:class:`~org.hipparchus.optim.nonlinear.vector.leastsquares.LeastSquaresProblem.Evaluation`> + + The data necessary to define a non-linear least squares problem. + + Includes the observed values, computed model function, and convergence/divergence criteria. Weights are implicit in + :meth:`~org.hipparchus.optim.nonlinear.vector.leastsquares.LeastSquaresProblem.Evaluation.getResiduals` and + :meth:`~org.hipparchus.optim.nonlinear.vector.leastsquares.LeastSquaresProblem.Evaluation.getJacobian`. + + Instances are typically either created progressively using a + :class:`~org.hipparchus.optim.nonlinear.vector.leastsquares.LeastSquaresBuilder` or created at once using a + :class:`~org.hipparchus.optim.nonlinear.vector.leastsquares.LeastSquaresFactory`. + + Also see: + + - :class:`~org.hipparchus.optim.nonlinear.vector.leastsquares.LeastSquaresBuilder` + - :class:`~org.hipparchus.optim.nonlinear.vector.leastsquares.LeastSquaresFactory` + - :class:`~org.hipparchus.optim.nonlinear.vector.leastsquares.LeastSquaresAdapter` + """ + def evaluate(self, realVector: org.hipparchus.linear.RealVector) -> 'LeastSquaresProblem.Evaluation': + """ + Evaluate the model at the specified point. + + Parameters: + point (:class:`~org.hipparchus.optim.nonlinear.vector.leastsquares.https:.www.hipparchus.org.hipparchus`): the parameter values. + + Returns: + the model's value and derivative at the given point. + + Raises: + :class:`~org.hipparchus.optim.nonlinear.vector.leastsquares.https:.www.hipparchus.org.hipparchus`: if the maximal number of evaluations (of the model vector function) is exceeded. + + + """ + ... + def getObservationSize(self) -> int: + """ + Get the number of observations (rows in the Jacobian) in this problem. + + Returns: + the number of scalar observations + + + """ + ... + def getParameterSize(self) -> int: + """ + Get the number of parameters (columns in the Jacobian) in this problem. + + Returns: + the number of scalar parameters + + + """ + ... + def getStart(self) -> org.hipparchus.linear.RealVector: + """ + Gets the initial guess. + + Returns: + the initial guess values. + + + """ + ... class Evaluation: def getChiSquare(self) -> float: ... def getCost(self) -> float: ... @@ -85,32 +376,275 @@ class LeastSquaresProblem(org.hipparchus.optim.OptimizationProblem['LeastSquares def getSigma(self, double: float) -> org.hipparchus.linear.RealVector: ... class MultivariateJacobianFunction: + """ + public interfaceMultivariateJacobianFunction + + A interface for functions that compute a vector of values and can compute their derivatives (Jacobian). + """ def value(self, realVector: org.hipparchus.linear.RealVector) -> org.hipparchus.util.Pair[org.hipparchus.linear.RealVector, org.hipparchus.linear.RealMatrix]: ... class ParameterValidator: - def validate(self, realVector: org.hipparchus.linear.RealVector) -> org.hipparchus.linear.RealVector: ... + """ + public interfaceParameterValidator + + Interface for validating a set of model parameters. + """ + def validate(self, realVector: org.hipparchus.linear.RealVector) -> org.hipparchus.linear.RealVector: + """ + Validates the set of parameters. + + Parameters: + params (:class:`~org.hipparchus.optim.nonlinear.vector.leastsquares.https:.www.hipparchus.org.hipparchus`): Input parameters. + + Returns: + the validated values. + + + """ + ... class AbstractEvaluation(LeastSquaresProblem.Evaluation): + """ + public abstract classAbstractEvaluation extends :class:`~org.hipparchus.optim.nonlinear.vector.leastsquares.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.optim.nonlinear.vector.leastsquares.LeastSquaresProblem.Evaluation` + + An implementation of :class:`~org.hipparchus.optim.nonlinear.vector.leastsquares.LeastSquaresProblem.Evaluation` that is + designed for extension. All of the methods implemented here use the methods that are left unimplemented. + """ def __init__(self, int: int): ... - def getChiSquare(self) -> float: ... - def getCost(self) -> float: ... - def getCovariances(self, double: float) -> org.hipparchus.linear.RealMatrix: ... - def getRMS(self) -> float: ... - def getReducedChiSquare(self, int: int) -> float: ... - def getSigma(self, double: float) -> org.hipparchus.linear.RealVector: ... + def getChiSquare(self) -> float: + """ + Get the sum of the squares of the residuals. + + Specified by: + :meth:`~org.hipparchus.optim.nonlinear.vector.leastsquares.LeastSquaresProblem.Evaluation.getChiSquare` in + interface :class:`~org.hipparchus.optim.nonlinear.vector.leastsquares.LeastSquaresProblem.Evaluation` + + Returns: + the cost. + + Also see: + + - :meth:`~org.hipparchus.optim.nonlinear.vector.leastsquares.LeastSquaresProblem.Evaluation.getResiduals` + - :meth:`~org.hipparchus.optim.nonlinear.vector.leastsquares.LeastSquaresProblem.Evaluation.getCost` + + + + """ + ... + def getCost(self) -> float: + """ + Get the cost. It is the square-root of the + :meth:`~org.hipparchus.optim.nonlinear.vector.leastsquares.LeastSquaresProblem.Evaluation.getChiSquare`. + + Specified by: + :meth:`~org.hipparchus.optim.nonlinear.vector.leastsquares.LeastSquaresProblem.Evaluation.getCost` in + interface :class:`~org.hipparchus.optim.nonlinear.vector.leastsquares.LeastSquaresProblem.Evaluation` + + Returns: + the cost. + + Also see: + + - :meth:`~org.hipparchus.optim.nonlinear.vector.leastsquares.LeastSquaresProblem.Evaluation.getResiduals` + - :meth:`~org.hipparchus.optim.nonlinear.vector.leastsquares.LeastSquaresProblem.Evaluation.getChiSquare` + + + + """ + ... + def getCovariances(self, double: float) -> org.hipparchus.linear.RealMatrix: + """ + Get the covariance matrix of the optimized parameters. + + + Note that this operation involves the inversion of the :code:`J :sup:`T` J` matrix, where :code:`J` is the Jacobian + matrix. The :code:`threshold` parameter is a way for the caller to specify that the result of this computation should be + considered meaningless, and thus trigger an exception. + + Specified by: + :meth:`~org.hipparchus.optim.nonlinear.vector.leastsquares.LeastSquaresProblem.Evaluation.getCovariances` in + interface :class:`~org.hipparchus.optim.nonlinear.vector.leastsquares.LeastSquaresProblem.Evaluation` + + Parameters: + threshold (double): Singularity threshold. + + Returns: + the covariance matrix. + + + """ + ... + def getRMS(self) -> float: + """ + Get the normalized cost. It is the square-root of the sum of squared of the residuals, divided by the number of + measurements. + + Specified by: + :meth:`~org.hipparchus.optim.nonlinear.vector.leastsquares.LeastSquaresProblem.Evaluation.getRMS` in + interface :class:`~org.hipparchus.optim.nonlinear.vector.leastsquares.LeastSquaresProblem.Evaluation` + + Returns: + the cost. + + + """ + ... + def getReducedChiSquare(self, int: int) -> float: + """ + Get the reduced chi-square. + + Specified by: + :meth:`~org.hipparchus.optim.nonlinear.vector.leastsquares.LeastSquaresProblem.Evaluation.getReducedChiSquare` in + interface :class:`~org.hipparchus.optim.nonlinear.vector.leastsquares.LeastSquaresProblem.Evaluation` + + Parameters: + numberOfFittedParameters (int): Number of fitted parameters. + + Returns: + the sum of the squares of the residuals divided by the number of degrees of freedom. + + + """ + ... + def getSigma(self, double: float) -> org.hipparchus.linear.RealVector: + """ + Get an estimate of the standard deviation of the parameters. The returned values are the square root of the diagonal + coefficients of the covariance matrix, :code:`sd(a[i]) ~= sqrt(C[i][i])`, where :code:`a[i]` is the optimized value of + the :code:`i`-th parameter, and :code:`C` is the covariance matrix. + + Specified by: + :meth:`~org.hipparchus.optim.nonlinear.vector.leastsquares.LeastSquaresProblem.Evaluation.getSigma` in + interface :class:`~org.hipparchus.optim.nonlinear.vector.leastsquares.LeastSquaresProblem.Evaluation` + + Parameters: + covarianceSingularityThreshold (double): Singularity threshold (see + :meth:`~org.hipparchus.optim.nonlinear.vector.leastsquares.LeastSquaresProblem.Evaluation.getCovariances`). + + Returns: + an estimate of the standard deviation of the optimized parameters + + + """ + ... class LeastSquaresAdapter(LeastSquaresProblem): + """ + public classLeastSquaresAdapter extends :class:`~org.hipparchus.optim.nonlinear.vector.leastsquares.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.optim.nonlinear.vector.leastsquares.LeastSquaresProblem` + + An adapter that delegates to another implementation of + :class:`~org.hipparchus.optim.nonlinear.vector.leastsquares.LeastSquaresProblem`. + """ def __init__(self, leastSquaresProblem: LeastSquaresProblem): ... - def evaluate(self, realVector: org.hipparchus.linear.RealVector) -> LeastSquaresProblem.Evaluation: ... + def evaluate(self, realVector: org.hipparchus.linear.RealVector) -> LeastSquaresProblem.Evaluation: + """ + Evaluate the model at the specified point. + + Specified by: + :meth:`~org.hipparchus.optim.nonlinear.vector.leastsquares.LeastSquaresProblem.evaluate` in + interface :class:`~org.hipparchus.optim.nonlinear.vector.leastsquares.LeastSquaresProblem` + + Parameters: + point (:class:`~org.hipparchus.optim.nonlinear.vector.leastsquares.https:.www.hipparchus.org.hipparchus`): the parameter values. + + Returns: + the model's value and derivative at the given point. + + + """ + ... def getConvergenceChecker(self) -> org.hipparchus.optim.ConvergenceChecker[LeastSquaresProblem.Evaluation]: ... - def getEvaluationCounter(self) -> org.hipparchus.util.Incrementor: ... - def getIterationCounter(self) -> org.hipparchus.util.Incrementor: ... - def getObservationSize(self) -> int: ... - def getParameterSize(self) -> int: ... - def getStart(self) -> org.hipparchus.linear.RealVector: ... + def getEvaluationCounter(self) -> org.hipparchus.util.Incrementor: + """ + Get a independent Incrementor that counts up to the maximum number of evaluations and then throws an exception. + + Specified by: + :meth:`~org.hipparchus.optim.OptimizationProblem.getEvaluationCounter` in + interface :class:`~org.hipparchus.optim.OptimizationProblem` + + Returns: + a counter for the evaluations. + + + """ + ... + def getIterationCounter(self) -> org.hipparchus.util.Incrementor: + """ + Get a independent Incrementor that counts up to the maximum number of iterations and then throws an exception. + + Specified by: + :meth:`~org.hipparchus.optim.OptimizationProblem.getIterationCounter` in + interface :class:`~org.hipparchus.optim.OptimizationProblem` + + Returns: + a counter for the evaluations. + + + """ + ... + def getObservationSize(self) -> int: + """ + Get the number of observations (rows in the Jacobian) in this problem. + + Specified by: + :meth:`~org.hipparchus.optim.nonlinear.vector.leastsquares.LeastSquaresProblem.getObservationSize` in + interface :class:`~org.hipparchus.optim.nonlinear.vector.leastsquares.LeastSquaresProblem` + + Returns: + the number of scalar observations + + + """ + ... + def getParameterSize(self) -> int: + """ + Get the number of parameters (columns in the Jacobian) in this problem. + + Specified by: + :meth:`~org.hipparchus.optim.nonlinear.vector.leastsquares.LeastSquaresProblem.getParameterSize` in + interface :class:`~org.hipparchus.optim.nonlinear.vector.leastsquares.LeastSquaresProblem` + + Returns: + the number of scalar parameters + + + """ + ... + def getStart(self) -> org.hipparchus.linear.RealVector: + """ + Gets the initial guess. + + Specified by: + :meth:`~org.hipparchus.optim.nonlinear.vector.leastsquares.LeastSquaresProblem.getStart` in + interface :class:`~org.hipparchus.optim.nonlinear.vector.leastsquares.LeastSquaresProblem` + + Returns: + the initial guess values. + + + """ + ... class LeastSquaresOptimizer: - def optimize(self, leastSquaresProblem: LeastSquaresProblem) -> 'LeastSquaresOptimizer.Optimum': ... + """ + public interfaceLeastSquaresOptimizer + + An algorithm that can be applied to a non-linear least squares problem. + """ + def optimize(self, leastSquaresProblem: LeastSquaresProblem) -> 'LeastSquaresOptimizer.Optimum': + """ + Solve the non-linear least squares problem. + + Parameters: + leastSquaresProblem (:class:`~org.hipparchus.optim.nonlinear.vector.leastsquares.LeastSquaresProblem`): the problem definition, including model function and convergence criteria. + + Returns: + The optimum. + + + """ + ... class Optimum(LeastSquaresProblem.Evaluation): def getEvaluations(self) -> int: ... def getIterations(self) -> int: ... @@ -118,55 +652,523 @@ class LeastSquaresOptimizer: def of(evaluation: LeastSquaresProblem.Evaluation, int: int, int2: int) -> 'LeastSquaresOptimizer.Optimum': ... class ValueAndJacobianFunction(MultivariateJacobianFunction): - def computeJacobian(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> org.hipparchus.linear.RealMatrix: ... - def computeValue(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> org.hipparchus.linear.RealVector: ... + """ + public interfaceValueAndJacobianFunctionextends :class:`~org.hipparchus.optim.nonlinear.vector.leastsquares.MultivariateJacobianFunction` + + A interface for functions that compute a vector of values and can compute their derivatives (Jacobian). + """ + def computeJacobian(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> org.hipparchus.linear.RealMatrix: + """ + Compute the Jacobian. + + Parameters: + params (double[]): Point. + + Returns: + the Jacobian at the given point. + + + """ + ... + def computeValue(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> org.hipparchus.linear.RealVector: + """ + Compute the value. + + Parameters: + params (double[]): Point. + + Returns: + the value at the given point. + + + """ + ... class GaussNewtonOptimizer(LeastSquaresOptimizer): + """ + public classGaussNewtonOptimizer extends :class:`~org.hipparchus.optim.nonlinear.vector.leastsquares.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.optim.nonlinear.vector.leastsquares.LeastSquaresOptimizer` + + Gauss-Newton least-squares solver. + + This class solve a least-square problem by solving the normal equations of the linearized problem at each iteration. + Either LU decomposition or Cholesky decomposition can be used to solve the normal equations, or QR decomposition or SVD + decomposition can be used to solve the linear system. Cholesky/LU decomposition is faster but QR decomposition is more + robust for difficult problems, and SVD can compute a solution for rank-deficient problems. + """ @typing.overload def __init__(self): ... @typing.overload def __init__(self, matrixDecomposer: typing.Union[org.hipparchus.linear.MatrixDecomposer, typing.Callable], boolean: bool): ... - def getDecomposer(self) -> org.hipparchus.linear.MatrixDecomposer: ... - def isFormNormalEquations(self) -> bool: ... - def optimize(self, leastSquaresProblem: LeastSquaresProblem) -> LeastSquaresOptimizer.Optimum: ... - def toString(self) -> str: ... - def withDecomposer(self, matrixDecomposer: typing.Union[org.hipparchus.linear.MatrixDecomposer, typing.Callable]) -> 'GaussNewtonOptimizer': ... - def withFormNormalEquations(self, boolean: bool) -> 'GaussNewtonOptimizer': ... + def getDecomposer(self) -> org.hipparchus.linear.MatrixDecomposer: + """ + Get the matrix decomposition algorithm. + + Returns: + the decomposition algorithm. + + + """ + ... + def isFormNormalEquations(self) -> bool: + """ + Get if the normal equations are explicitly formed. + + Returns: + if the normal equations should be explicitly formed. If :code:`true` then :code:`decomposer` is used to solve J :sup:`T` + Jx=J :sup:`T` r, otherwise :code:`decomposer` is used to solve Jx=r. + + + """ + ... + def optimize(self, leastSquaresProblem: LeastSquaresProblem) -> LeastSquaresOptimizer.Optimum: + """ + Solve the non-linear least squares problem. + + Specified by: + :meth:`~org.hipparchus.optim.nonlinear.vector.leastsquares.LeastSquaresOptimizer.optimize` in + interface :class:`~org.hipparchus.optim.nonlinear.vector.leastsquares.LeastSquaresOptimizer` + + Parameters: + lsp (:class:`~org.hipparchus.optim.nonlinear.vector.leastsquares.LeastSquaresProblem`): the problem definition, including model function and convergence criteria. + + Returns: + The optimum. + + + """ + ... + def toString(self) -> str: + """ + + Overrides: + + meth:`~org.hipparchus.optim.nonlinear.vector.leastsquares.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.toString` in + class :class:`~org.hipparchus.optim.nonlinear.vector.leastsquares.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + + """ + ... + def withDecomposer(self, matrixDecomposer: typing.Union[org.hipparchus.linear.MatrixDecomposer, typing.Callable]) -> 'GaussNewtonOptimizer': + """ + Configure the matrix decomposition algorithm. + + Parameters: + newDecomposer (:class:`~org.hipparchus.optim.nonlinear.vector.leastsquares.https:.www.hipparchus.org.hipparchus`): the decomposition algorithm to use. + + Returns: + a new instance. + + + """ + ... + def withFormNormalEquations(self, boolean: bool) -> 'GaussNewtonOptimizer': + """ + Configure if the normal equations should be explicitly formed. + + Parameters: + newFormNormalEquations (boolean): whether the normal equations should be explicitly formed. If :code:`true` then :code:`decomposer` is used to solve J + :sup:`T` Jx=J :sup:`T` r, otherwise :code:`decomposer` is used to solve Jx=r. If :code:`decomposer` can only solve + square systems then this parameter should be :code:`true`. + + Returns: + a new instance. + + + """ + ... class LevenbergMarquardtOptimizer(LeastSquaresOptimizer): + """ + public classLevenbergMarquardtOptimizer extends :class:`~org.hipparchus.optim.nonlinear.vector.leastsquares.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.optim.nonlinear.vector.leastsquares.LeastSquaresOptimizer` + + This class solves a least-squares problem using the Levenberg-Marquardt algorithm. + + This implementation *should* work even for over-determined systems (i.e. systems having more point than equations). + Over-determined systems are solved by ignoring the point which have the smallest impact according to their jacobian + column norm. Only the rank of the matrix and some loop bounds are changed to implement this. + + The resolution engine is a simple translation of the MINPACK `lmder <http://www.netlib.org/minpack/lmder.f>` routine + with minor changes. The changes include the over-determined resolution, the use of inherited convergence checker and the + Q.R. decomposition which has been rewritten following the algorithm described in the P. Lascaux and R. Theodor book + *Analyse numérique matricielle appliquée à l'art de l'ingénieur*, Masson 1986. + + The authors of the original fortran version are: + + - Argonne National Laboratory. MINPACK project. March 1980 + - Burton S. Garbow + - Kenneth E. Hillstrom + - Jorge J. More + + + The redistribution policy for MINPACK is available `here <http://www.netlib.org/minpack/disclaimer>`, for convenience, + it is reproduced below. + + Minpack Copyright Notice (1999) University of Chicago. All rights reserved + + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the + following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following + disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the distribution. + 3. The end-user documentation included with the redistribution, if any, must include the following acknowledgment: + :code:`This product includes software developed by the University of Chicago, as Operator of Argonne National + Laboratory.` Alternately, this acknowledgment may appear in the software itself, if and wherever such third-party + acknowledgments normally appear. + 4. **WARRANTY DISCLAIMER. THE SOFTWARE IS SUPPLIED "AS IS" WITHOUT WARRANTY OF ANY KIND. THE COPYRIGHT HOLDER, THE UNITED + STATES, THE UNITED STATES DEPARTMENT OF ENERGY, AND THEIR EMPLOYEES: (1) DISCLAIM ANY WARRANTIES, EXPRESS OR IMPLIED, + INCLUDING BUT NOT LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE OR + NON-INFRINGEMENT, (2) DO NOT ASSUME ANY LEGAL LIABILITY OR RESPONSIBILITY FOR THE ACCURACY, COMPLETENESS, OR USEFULNESS + OF THE SOFTWARE, (3) DO NOT REPRESENT THAT USE OF THE SOFTWARE WOULD NOT INFRINGE PRIVATELY OWNED RIGHTS, (4) DO NOT + WARRANT THAT THE SOFTWARE WILL FUNCTION UNINTERRUPTED, THAT IT IS ERROR-FREE OR THAT ANY ERRORS WILL BE CORRECTED.** + 5. **LIMITATION OF LIABILITY. IN NO EVENT WILL THE COPYRIGHT HOLDER, THE UNITED STATES, THE UNITED STATES DEPARTMENT OF + ENERGY, OR THEIR EMPLOYEES: BE LIABLE FOR ANY INDIRECT, INCIDENTAL, CONSEQUENTIAL, SPECIAL OR PUNITIVE DAMAGES OF ANY + KIND OR NATURE, INCLUDING BUT NOT LIMITED TO LOSS OF PROFITS OR LOSS OF DATA, FOR ANY REASON WHATSOEVER, WHETHER SUCH + LIABILITY IS ASSERTED ON THE BASIS OF CONTRACT, TORT (INCLUDING NEGLIGENCE OR STRICT LIABILITY), OR OTHERWISE, EVEN IF + ANY OF SAID PARTIES HAS BEEN WARNED OF THE POSSIBILITY OF SUCH LOSS OR DAMAGES.** + """ @typing.overload def __init__(self): ... @typing.overload def __init__(self, double: float, double2: float, double3: float, double4: float, double5: float): ... - def getCostRelativeTolerance(self) -> float: ... - def getInitialStepBoundFactor(self) -> float: ... - def getOrthoTolerance(self) -> float: ... - def getParameterRelativeTolerance(self) -> float: ... - def getRankingThreshold(self) -> float: ... - def optimize(self, leastSquaresProblem: LeastSquaresProblem) -> LeastSquaresOptimizer.Optimum: ... - def withCostRelativeTolerance(self, double: float) -> 'LevenbergMarquardtOptimizer': ... - def withInitialStepBoundFactor(self, double: float) -> 'LevenbergMarquardtOptimizer': ... - def withOrthoTolerance(self, double: float) -> 'LevenbergMarquardtOptimizer': ... - def withParameterRelativeTolerance(self, double: float) -> 'LevenbergMarquardtOptimizer': ... - def withRankingThreshold(self, double: float) -> 'LevenbergMarquardtOptimizer': ... + def getCostRelativeTolerance(self) -> float: + """ + Gets the value of a tuning parameter. + + Returns: + the parameter's value. + + Also see: + + - :meth:`~org.hipparchus.optim.nonlinear.vector.leastsquares.LevenbergMarquardtOptimizer.withCostRelativeTolerance` + + + + """ + ... + def getInitialStepBoundFactor(self) -> float: + """ + Gets the value of a tuning parameter. + + Returns: + the parameter's value. + + Also see: + + - :meth:`~org.hipparchus.optim.nonlinear.vector.leastsquares.LevenbergMarquardtOptimizer.withInitialStepBoundFactor` + + + + """ + ... + def getOrthoTolerance(self) -> float: + """ + Gets the value of a tuning parameter. + + Returns: + the parameter's value. + + Also see: + + - :meth:`~org.hipparchus.optim.nonlinear.vector.leastsquares.LevenbergMarquardtOptimizer.withOrthoTolerance` + + + + """ + ... + def getParameterRelativeTolerance(self) -> float: + """ + Gets the value of a tuning parameter. + + Returns: + the parameter's value. + + Also see: + + - :meth:`~org.hipparchus.optim.nonlinear.vector.leastsquares.LevenbergMarquardtOptimizer.withParameterRelativeTolerance` + + + + """ + ... + def getRankingThreshold(self) -> float: + """ + Gets the value of a tuning parameter. + + Returns: + the parameter's value. + + Also see: + + - :meth:`~org.hipparchus.optim.nonlinear.vector.leastsquares.LevenbergMarquardtOptimizer.withRankingThreshold` + + + + """ + ... + def optimize(self, leastSquaresProblem: LeastSquaresProblem) -> LeastSquaresOptimizer.Optimum: + """ + Solve the non-linear least squares problem. + + Specified by: + :meth:`~org.hipparchus.optim.nonlinear.vector.leastsquares.LeastSquaresOptimizer.optimize` in + interface :class:`~org.hipparchus.optim.nonlinear.vector.leastsquares.LeastSquaresOptimizer` + + Parameters: + problem (:class:`~org.hipparchus.optim.nonlinear.vector.leastsquares.LeastSquaresProblem`): the problem definition, including model function and convergence criteria. + + Returns: + The optimum. + + + """ + ... + def withCostRelativeTolerance(self, double: float) -> 'LevenbergMarquardtOptimizer': + """ + Build new instance with cost relative tolerance. + + Parameters: + newCostRelativeTolerance (double): Desired relative error in the sum of squares. + + Returns: + a new instance. + + + """ + ... + def withInitialStepBoundFactor(self, double: float) -> 'LevenbergMarquardtOptimizer': + """ + Build new instance with initial step bound factor. + + Parameters: + newInitialStepBoundFactor (double): Positive input variable used in determining the initial step bound. This bound is set to the product of + initialStepBoundFactor and the euclidean norm of :code:`diag * x` if non-zero, or else to + :code:`newInitialStepBoundFactor` itself. In most cases factor should lie in the interval :code:`(0.1, 100.0)`. + :code:`100` is a generally recommended value. of the matrix is reduced. + + Returns: + a new instance. + + + """ + ... + def withOrthoTolerance(self, double: float) -> 'LevenbergMarquardtOptimizer': + """ + Build new instance with ortho tolerance. + + Parameters: + newOrthoTolerance (double): Desired max cosine on the orthogonality between the function vector and the columns of the Jacobian. + + Returns: + a new instance. + + + """ + ... + def withParameterRelativeTolerance(self, double: float) -> 'LevenbergMarquardtOptimizer': + """ + Build new instance with parameter relative tolerance. + + Parameters: + newParRelativeTolerance (double): Desired relative error in the approximate solution parameters. + + Returns: + a new instance. + + + """ + ... + def withRankingThreshold(self, double: float) -> 'LevenbergMarquardtOptimizer': + """ + Build new instance with ranking threshold. + + Parameters: + newQRRankingThreshold (double): Desired threshold for QR ranking. If the squared norm of a column vector is smaller or equal to this threshold during QR + decomposition, it is considered to be a zero vector and hence the rank of the matrix is reduced. + + Returns: + a new instance. + + + """ + ... class SequentialGaussNewtonOptimizer(LeastSquaresOptimizer): + """ + public classSequentialGaussNewtonOptimizer extends :class:`~org.hipparchus.optim.nonlinear.vector.leastsquares.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.optim.nonlinear.vector.leastsquares.LeastSquaresOptimizer` + + Sequential Gauss-Newton least-squares solver. + + This class solve a least-square problem by solving the normal equations of the linearized problem at each iteration. + """ @typing.overload def __init__(self): ... @typing.overload def __init__(self, matrixDecomposer: typing.Union[org.hipparchus.linear.MatrixDecomposer, typing.Callable], boolean: bool, evaluation: LeastSquaresProblem.Evaluation): ... - def getDecomposer(self) -> org.hipparchus.linear.MatrixDecomposer: ... - def getOldEvaluation(self) -> LeastSquaresProblem.Evaluation: ... - def isFormNormalEquations(self) -> bool: ... - def optimize(self, leastSquaresProblem: LeastSquaresProblem) -> LeastSquaresOptimizer.Optimum: ... - def toString(self) -> str: ... + def getDecomposer(self) -> org.hipparchus.linear.MatrixDecomposer: + """ + Get the matrix decomposition algorithm. + + Returns: + the decomposition algorithm. + + + """ + ... + def getOldEvaluation(self) -> LeastSquaresProblem.Evaluation: + """ + Get the previous evaluation used by the optimizer. + + Returns: + the previous evaluation. + + + """ + ... + def isFormNormalEquations(self) -> bool: + """ + Get if the normal equations are explicitly formed. + + Returns: + if the normal equations should be explicitly formed. If :code:`true` then :code:`decomposer` is used to solve J :sup:`T` + Jx=J :sup:`T` r, otherwise :code:`decomposer` is used to solve Jx=r. + + + """ + ... + def optimize(self, leastSquaresProblem: LeastSquaresProblem) -> LeastSquaresOptimizer.Optimum: + """ + Solve the non-linear least squares problem. + + Specified by: + :meth:`~org.hipparchus.optim.nonlinear.vector.leastsquares.LeastSquaresOptimizer.optimize` in + interface :class:`~org.hipparchus.optim.nonlinear.vector.leastsquares.LeastSquaresOptimizer` + + Parameters: + lsp (:class:`~org.hipparchus.optim.nonlinear.vector.leastsquares.LeastSquaresProblem`): the problem definition, including model function and convergence criteria. + + Returns: + The optimum. + + + """ + ... + def toString(self) -> str: + """ + + Overrides: + + meth:`~org.hipparchus.optim.nonlinear.vector.leastsquares.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.toString` in + class :class:`~org.hipparchus.optim.nonlinear.vector.leastsquares.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + + """ + ... @typing.overload - def withAPrioriData(self, realVector: org.hipparchus.linear.RealVector, realMatrix: org.hipparchus.linear.RealMatrix) -> 'SequentialGaussNewtonOptimizer': ... + def withAPrioriData(self, realVector: org.hipparchus.linear.RealVector, realMatrix: org.hipparchus.linear.RealMatrix) -> 'SequentialGaussNewtonOptimizer': + """ + Configure from a priori state and covariance. + + This building method generates a fake evaluation and calls + :meth:`~org.hipparchus.optim.nonlinear.vector.leastsquares.SequentialGaussNewtonOptimizer.withEvaluation`, so either + :meth:`~org.hipparchus.optim.nonlinear.vector.leastsquares.SequentialGaussNewtonOptimizer.withAPrioriData` or + :meth:`~org.hipparchus.optim.nonlinear.vector.leastsquares.SequentialGaussNewtonOptimizer.withEvaluation` should be + called, but not both as the last one called will override the previous one. + + A Cholesky decomposition is used to compute the weighted jacobian from the a priori covariance. This method uses the + default thresholds of the decomposition. + + Parameters: + aPrioriState (:class:`~org.hipparchus.optim.nonlinear.vector.leastsquares.https:.www.hipparchus.org.hipparchus`): a priori state to use + aPrioriCovariance (:class:`~org.hipparchus.optim.nonlinear.vector.leastsquares.https:.www.hipparchus.org.hipparchus`): a priori covariance to use + + Returns: + a new instance. + + Also see: + + - :meth:`~org.hipparchus.optim.nonlinear.vector.leastsquares.SequentialGaussNewtonOptimizer.withAPrioriData` + + + Configure from a priori state and covariance. + + This building method generates a fake evaluation and calls + :meth:`~org.hipparchus.optim.nonlinear.vector.leastsquares.SequentialGaussNewtonOptimizer.withEvaluation`, so either + :meth:`~org.hipparchus.optim.nonlinear.vector.leastsquares.SequentialGaussNewtonOptimizer.withAPrioriData` or + :meth:`~org.hipparchus.optim.nonlinear.vector.leastsquares.SequentialGaussNewtonOptimizer.withEvaluation` should be + called, but not both as the last one called will override the previous one. + + A Cholesky decomposition is used to compute the weighted jacobian from the a priori covariance. + + Parameters: + aPrioriState (:class:`~org.hipparchus.optim.nonlinear.vector.leastsquares.https:.www.hipparchus.org.hipparchus`): a priori state to use + aPrioriCovariance (:class:`~org.hipparchus.optim.nonlinear.vector.leastsquares.https:.www.hipparchus.org.hipparchus`): a priori covariance to use + relativeSymmetryThreshold (double): Cholesky decomposition threshold above which off-diagonal elements are considered too different and matrix not symmetric + absolutePositivityThreshold (double): Cholesky decomposition threshold below which diagonal elements are considered null and matrix not positive definite + + Returns: + a new instance. + + Since: + 2.3 + + + """ + ... @typing.overload def withAPrioriData(self, realVector: org.hipparchus.linear.RealVector, realMatrix: org.hipparchus.linear.RealMatrix, double: float, double2: float) -> 'SequentialGaussNewtonOptimizer': ... - def withDecomposer(self, matrixDecomposer: typing.Union[org.hipparchus.linear.MatrixDecomposer, typing.Callable]) -> 'SequentialGaussNewtonOptimizer': ... - def withEvaluation(self, evaluation: LeastSquaresProblem.Evaluation) -> 'SequentialGaussNewtonOptimizer': ... - def withFormNormalEquations(self, boolean: bool) -> 'SequentialGaussNewtonOptimizer': ... + def withDecomposer(self, matrixDecomposer: typing.Union[org.hipparchus.linear.MatrixDecomposer, typing.Callable]) -> 'SequentialGaussNewtonOptimizer': + """ + Configure the matrix decomposition algorithm. + + Parameters: + newDecomposer (:class:`~org.hipparchus.optim.nonlinear.vector.leastsquares.https:.www.hipparchus.org.hipparchus`): the decomposition algorithm to use. + + Returns: + a new instance. + + + """ + ... + def withEvaluation(self, evaluation: LeastSquaresProblem.Evaluation) -> 'SequentialGaussNewtonOptimizer': + """ + Configure the previous evaluation used by the optimizer. + + This building method uses a complete evaluation to retrieve a priori data. Note that as + :meth:`~org.hipparchus.optim.nonlinear.vector.leastsquares.SequentialGaussNewtonOptimizer.withAPrioriData` generates a + fake evaluation and calls this method, either + :meth:`~org.hipparchus.optim.nonlinear.vector.leastsquares.SequentialGaussNewtonOptimizer.withAPrioriData` or + :meth:`~org.hipparchus.optim.nonlinear.vector.leastsquares.SequentialGaussNewtonOptimizer.withEvaluation` should be + called, but not both as the last one called will override the previous one. + + Parameters: + previousEvaluation (:class:`~org.hipparchus.optim.nonlinear.vector.leastsquares.LeastSquaresProblem.Evaluation`): the previous evaluation used by the optimizer. + + Returns: + a new instance. + + + """ + ... + def withFormNormalEquations(self, boolean: bool) -> 'SequentialGaussNewtonOptimizer': + """ + Configure if the normal equations should be explicitly formed. + + Parameters: + newFormNormalEquations (boolean): whether the normal equations should be explicitly formed. If :code:`true` then :code:`decomposer` is used to solve J + :sup:`T` Jx=J :sup:`T` r, otherwise :code:`decomposer` is used to solve Jx=r. If :code:`decomposer` can only solve + square systems then this parameter should be :code:`true`. + + Returns: + a new instance. + + + """ + ... class __module_protocol__(Protocol): diff --git a/org-stubs/hipparchus/optim/univariate/__init__.pyi b/org-stubs/hipparchus/optim/univariate/__init__.pyi index 527a593..67600fe 100644 --- a/org-stubs/hipparchus/optim/univariate/__init__.pyi +++ b/org-stubs/hipparchus/optim/univariate/__init__.pyi @@ -15,69 +15,430 @@ import typing class BracketFinder: + """ + public classBracketFinder extends :class:`~org.hipparchus.optim.univariate.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Provide an interval that brackets a local optimum of a function. This code is based on a Python implementation (from + *SciPy*, module :code:`optimize.py` v0.5). + """ @typing.overload def __init__(self): ... @typing.overload def __init__(self, double: float, int: int): ... - def getEvaluations(self) -> int: ... - def getFHi(self) -> float: ... - def getFLo(self) -> float: ... - def getFMid(self) -> float: ... - def getHi(self) -> float: ... - def getLo(self) -> float: ... - def getMaxEvaluations(self) -> int: ... - def getMid(self) -> float: ... - def search(self, univariateFunction: typing.Union[org.hipparchus.analysis.UnivariateFunction, typing.Callable], goalType: org.hipparchus.optim.nonlinear.scalar.GoalType, double: float, double2: float) -> None: ... + def getEvaluations(self) -> int: + """ + Get number of evaluations. + + Returns: + the number of evaluations + + + """ + ... + def getFHi(self) -> float: + """ + Get function value at :meth:`~org.hipparchus.optim.univariate.BracketFinder.getHi`. + + Returns: + function value at :meth:`~org.hipparchus.optim.univariate.BracketFinder.getHi` + + + """ + ... + def getFLo(self) -> float: + """ + Get function value at :meth:`~org.hipparchus.optim.univariate.BracketFinder.getLo`. + + Returns: + function value at :meth:`~org.hipparchus.optim.univariate.BracketFinder.getLo` + + + """ + ... + def getFMid(self) -> float: + """ + Get function value at :meth:`~org.hipparchus.optim.univariate.BracketFinder.getMid`. + + Returns: + function value at :meth:`~org.hipparchus.optim.univariate.BracketFinder.getMid` + + + """ + ... + def getHi(self) -> float: + """ + Get higher bound of the bracket. + + Returns: + the higher bound of the bracket + + Also see: + + - :meth:`~org.hipparchus.optim.univariate.BracketFinder.getFHi` + + + + """ + ... + def getLo(self) -> float: + """ + Get lower bound of the bracket. + + Returns: + the lower bound of the bracket + + Also see: + + - :meth:`~org.hipparchus.optim.univariate.BracketFinder.getFLo` + + + + """ + ... + def getMaxEvaluations(self) -> int: + """ + Get maximum number of evaluations. + + Returns: + the maximum number of evaluations + + + """ + ... + def getMid(self) -> float: + """ + Get a point in the middle of the bracket. + + Returns: + a point in the middle of the bracket + + Also see: + + - :meth:`~org.hipparchus.optim.univariate.BracketFinder.getFMid` + + + + """ + ... + def search(self, univariateFunction: typing.Union[org.hipparchus.analysis.UnivariateFunction, typing.Callable], goalType: org.hipparchus.optim.nonlinear.scalar.GoalType, double: float, double2: float) -> None: + """ + Search new points that bracket a local optimum of the function. + + Parameters: + func (:class:`~org.hipparchus.optim.univariate.https:.www.hipparchus.org.hipparchus`): Function whose optimum should be bracketed. + goal (:class:`~org.hipparchus.optim.nonlinear.scalar.GoalType`): :class:`~org.hipparchus.optim.nonlinear.scalar.GoalType`. + xA (double): Initial point. + xB (double): Initial point. + + Raises: + :class:`~org.hipparchus.optim.univariate.https:.www.hipparchus.org.hipparchus`: if the maximum number of evaluations is exceeded. + + + """ + ... class SearchInterval(org.hipparchus.optim.OptimizationData): + """ + public classSearchInterval extends :class:`~org.hipparchus.optim.univariate.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.optim.OptimizationData` + + Search interval and (optional) start value. + + + Immutable class. + """ @typing.overload def __init__(self, double: float, double2: float): ... @typing.overload def __init__(self, double: float, double2: float, double3: float): ... - def getMax(self) -> float: ... - def getMin(self) -> float: ... - def getStartValue(self) -> float: ... + def getMax(self) -> float: + """ + Gets the upper bound. + + Returns: + the upper bound. + + + """ + ... + def getMin(self) -> float: + """ + Gets the lower bound. + + Returns: + the lower bound. + + + """ + ... + def getStartValue(self) -> float: + """ + Gets the start value. + + Returns: + the start value. + + + """ + ... class SimpleUnivariateValueChecker(org.hipparchus.optim.AbstractConvergenceChecker['UnivariatePointValuePair']): + """ + public classSimpleUnivariateValueChecker extends :class:`~org.hipparchus.optim.AbstractConvergenceChecker`<:class:`~org.hipparchus.optim.univariate.UnivariatePointValuePair`> + + Simple implementation of the :class:`~org.hipparchus.optim.ConvergenceChecker` interface that uses only objective + function values. Convergence is considered to have been reached if either the relative difference between the objective + function values is smaller than a threshold or if either the absolute difference between the objective function values + is smaller than another threshold. + + + The :meth:`~org.hipparchus.optim.univariate.SimpleUnivariateValueChecker.converged` method will also return :code:`true` + if the number of iterations has been set (see + :meth:`~org.hipparchus.optim.univariate.SimpleUnivariateValueChecker.%3Cinit%3E`). + """ @typing.overload def __init__(self, double: float, double2: float): ... @typing.overload def __init__(self, double: float, double2: float, int: int): ... - def converged(self, int: int, univariatePointValuePair: 'UnivariatePointValuePair', univariatePointValuePair2: 'UnivariatePointValuePair') -> bool: ... + def converged(self, int: int, univariatePointValuePair: 'UnivariatePointValuePair', univariatePointValuePair2: 'UnivariatePointValuePair') -> bool: + """ + Check if the optimization algorithm has converged considering the last two points. This method may be called several + time from the same algorithm iteration with different points. This can be detected by checking the iteration number at + each call if needed. Each time this method is called, the previous and current point correspond to points with the same + role at each iteration, so they can be compared. As an example, simplex-based algorithms call this method for all points + of the simplex, not only for the best or worst ones. + + Specified by: + :meth:`~org.hipparchus.optim.ConvergenceChecker.converged` in + interface :class:`~org.hipparchus.optim.ConvergenceChecker` + + Specified by: + :meth:`~org.hipparchus.optim.AbstractConvergenceChecker.converged` in + class :class:`~org.hipparchus.optim.AbstractConvergenceChecker` + + Parameters: + iteration (int): Index of current iteration + previous (:class:`~org.hipparchus.optim.univariate.UnivariatePointValuePair`): Best point in the previous iteration. + current (:class:`~org.hipparchus.optim.univariate.UnivariatePointValuePair`): Best point in the current iteration. + + Returns: + :code:`true` if the algorithm has converged. + + + """ + ... class UnivariateObjectiveFunction(org.hipparchus.optim.OptimizationData): + """ + public classUnivariateObjectiveFunction extends :class:`~org.hipparchus.optim.univariate.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.optim.OptimizationData` + + Scalar function to be optimized. + """ def __init__(self, univariateFunction: typing.Union[org.hipparchus.analysis.UnivariateFunction, typing.Callable]): ... - def getObjectiveFunction(self) -> org.hipparchus.analysis.UnivariateFunction: ... + def getObjectiveFunction(self) -> org.hipparchus.analysis.UnivariateFunction: + """ + Gets the function to be optimized. + + Returns: + the objective function. + + + """ + ... class UnivariateOptimizer(org.hipparchus.optim.BaseOptimizer['UnivariatePointValuePair']): - def getGoalType(self) -> org.hipparchus.optim.nonlinear.scalar.GoalType: ... - def getMax(self) -> float: ... - def getMin(self) -> float: ... - def getStartValue(self) -> float: ... + """ + public abstract classUnivariateOptimizer extends :class:`~org.hipparchus.optim.BaseOptimizer`<:class:`~org.hipparchus.optim.univariate.UnivariatePointValuePair`> + + Base class for a univariate scalar function optimizer. + """ + def getGoalType(self) -> org.hipparchus.optim.nonlinear.scalar.GoalType: + """ + Get optimization type. + + Returns: + the optimization type + + + """ + ... + def getMax(self) -> float: + """ + Get upper bounds. + + Returns: + the upper bounds + + + """ + ... + def getMin(self) -> float: + """ + Get lower bounds. + + Returns: + the lower bounds + + + """ + ... + def getStartValue(self) -> float: + """ + Get initial guess. + + Returns: + the initial guess + + + """ + ... @typing.overload def optimize(self) -> typing.Any: ... @typing.overload def optimize(self, *optimizationData: org.hipparchus.optim.OptimizationData) -> 'UnivariatePointValuePair': ... class UnivariatePointValuePair(java.io.Serializable): + """ + public classUnivariatePointValuePair extends :class:`~org.hipparchus.optim.univariate.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.optim.univariate.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + This class holds a point and the value of an objective function at this point. This is a simple immutable container. + + Also see: + + - :meth:`~serialized` + """ def __init__(self, double: float, double2: float): ... - def getPoint(self) -> float: ... - def getValue(self) -> float: ... + def getPoint(self) -> float: + """ + Get the point. + + Returns: + the point. + + + """ + ... + def getValue(self) -> float: + """ + Get the value of the objective function. + + Returns: + the stored value of the objective function. + + + """ + ... class BrentOptimizer(UnivariateOptimizer): + """ + public classBrentOptimizer extends :class:`~org.hipparchus.optim.univariate.UnivariateOptimizer` + + For a function defined on some interval :code:`(lo, hi)`, this class finds an approximation :code:`x` to the point at + which the function attains its minimum. It implements Richard Brent's algorithm (from his book "Algorithms for + Minimization without Derivatives", p. 79) for finding minima of real univariate functions. + + + This code is an adaptation, partly based on the Python code from SciPy (module "optimize.py" v0.5); the original + algorithm is also modified + + - to use an initial guess provided by the user, + - to ensure that the best point encountered is the one returned. + """ @typing.overload def __init__(self, double: float, double2: float): ... @typing.overload def __init__(self, double: float, double2: float, convergenceChecker: typing.Union[org.hipparchus.optim.ConvergenceChecker[UnivariatePointValuePair], typing.Callable[[int, UnivariatePointValuePair, UnivariatePointValuePair], bool]]): ... class MultiStartUnivariateOptimizer(UnivariateOptimizer): + """ + public classMultiStartUnivariateOptimizer extends :class:`~org.hipparchus.optim.univariate.UnivariateOptimizer` + + Special implementation of the :class:`~org.hipparchus.optim.univariate.UnivariateOptimizer` interface adding multi-start + features to an existing optimizer. + + + This class wraps an optimizer in order to use it several times in turn with different starting points (trying to avoid + being trapped in a local extremum when looking for a global one). + """ def __init__(self, univariateOptimizer: UnivariateOptimizer, int: int, randomGenerator: org.hipparchus.random.RandomGenerator): ... - def getEvaluations(self) -> int: ... - def getOptima(self) -> typing.MutableSequence[UnivariatePointValuePair]: ... + def getEvaluations(self) -> int: + """ + Gets the number of evaluations of the objective function. The number of evaluations corresponds to the last call to the + :code:`optimize` method. It is 0 if the method has not been called yet. + + Overrides: + :meth:`~org.hipparchus.optim.BaseOptimizer.getEvaluations` in class :class:`~org.hipparchus.optim.BaseOptimizer` + + Returns: + the number of evaluations of the objective function. + + + """ + ... + def getOptima(self) -> typing.MutableSequence[UnivariatePointValuePair]: + """ + 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. + + Returns: + an array containing the optima. + + Raises: + :class:`~org.hipparchus.optim.univariate.https:.www.hipparchus.org.hipparchus`: if :meth:`~org.hipparchus.optim.univariate.MultiStartUnivariateOptimizer.optimize` has not been called. + + + """ + ... @typing.overload def optimize(self) -> typing.Any: ... @typing.overload - def optimize(self, *optimizationData: org.hipparchus.optim.OptimizationData) -> UnivariatePointValuePair: ... + def optimize(self, *optimizationData: org.hipparchus.optim.OptimizationData) -> UnivariatePointValuePair: + """ + Stores data and performs the optimization. + + The list of parameters is open-ended so that sub-classes can extend it with arguments specific to their concrete + implementations. + + When the method is called multiple times, instance data is overwritten only when actually present in the list of + arguments: when not specified, data set in a previous call is retained (and thus is optional in subsequent calls). + + Important note: Subclasses *must* override :meth:`~org.hipparchus.optim.BaseOptimizer.parseOptimizationData` if they + need to register their own options; but then, they *must* also call :code:`super.parseOptimizationData(optData)` within + that method. + + Overrides: + :meth:`~org.hipparchus.optim.univariate.UnivariateOptimizer.optimize` in + class :class:`~org.hipparchus.optim.univariate.UnivariateOptimizer` + + Parameters: + optData (:class:`~org.hipparchus.optim.OptimizationData`...): Optimization data. In addition to those documented in :meth:`~org.hipparchus.optim.BaseOptimizer.parseOptimizationData`, + this method will register the following data: + + - :class:`~org.hipparchus.optim.nonlinear.scalar.GoalType` + - :class:`~org.hipparchus.optim.univariate.SearchInterval` + - :class:`~org.hipparchus.optim.univariate.UnivariateObjectiveFunction` + + + Returns: + a point/value pair that satisfies the convergence criteria. + + Raises: + :class:`~org.hipparchus.optim.univariate.https:.www.hipparchus.org.hipparchus`: if :code:`optData` does not contain an instance of :class:`~org.hipparchus.optim.MaxEval` or + :class:`~org.hipparchus.optim.univariate.SearchInterval`. + + + """ + ... class __module_protocol__(Protocol): diff --git a/org-stubs/hipparchus/random/__init__.pyi b/org-stubs/hipparchus/random/__init__.pyi index 2a527e5..50a9ba8 100644 --- a/org-stubs/hipparchus/random/__init__.pyi +++ b/org-stubs/hipparchus/random/__init__.pyi @@ -16,203 +16,1540 @@ import typing class GaussMarkovGenerator: + """ + public classGaussMarkovGenerator extends :class:`~org.hipparchus.random.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + This class is a Gauss-Markov order 1 autoregressive process generator for scalars. + + Since: + 3.1 + """ def __init__(self, double: float, double2: float, randomGenerator: 'RandomGenerator'): ... - def getStationarySigma(self) -> float: ... - def getTau(self) -> float: ... - def next(self, double: float) -> float: ... + def getStationarySigma(self) -> float: + """ + Get the standard deviation of the stationary process. + + Returns: + standard deviation of the stationary process + + + """ + ... + def getTau(self) -> float: + """ + Get the correlation time. + + Returns: + correlation time + + + """ + ... + def next(self, double: float) -> float: + """ + Generate next step in the autoregressive process. + + Parameters: + deltaT (double): time step since previous estimate (unused at first call) + + Returns: + a random scalar obeying autoregressive model + + + """ + ... class NormalizedRandomGenerator: - def nextNormalizedDouble(self) -> float: ... + """ + public interfaceNormalizedRandomGenerator + + This interface represent a normalized random generator for scalars. Normalized generator provide null mean and unit + standard deviation scalars. + """ + def nextNormalizedDouble(self) -> float: + """ + Generate a random scalar with null mean and unit standard deviation. + + This method does **not** specify the shape of the distribution, it is the implementing class that provides it. The only + contract here is to generate numbers with null mean and unit standard deviation. + + Returns: + a random scalar with null mean and unit standard deviation + + + """ + ... class RandomGenerator: - def nextBoolean(self) -> bool: ... - @typing.overload - def nextBytes(self, byteArray: typing.Union[typing.List[int], jpype.JArray, bytes]) -> None: ... - @typing.overload - def nextBytes(self, byteArray: typing.Union[typing.List[int], jpype.JArray, bytes], int: int, int2: int) -> None: ... - def nextDouble(self) -> float: ... - def nextFloat(self) -> float: ... - def nextGaussian(self) -> float: ... - @typing.overload - def nextInt(self) -> int: ... - @typing.overload - def nextInt(self, int: int) -> int: ... - @typing.overload - def nextLong(self) -> int: ... - @typing.overload - def nextLong(self, long: int) -> int: ... - @typing.overload - def setSeed(self, int: int) -> None: ... + """ + public interfaceRandomGenerator + + Interface for generators of random number sequences. + """ + def nextBoolean(self) -> bool: + """ + Returns the next pseudorandom, uniformly distributed :code:`boolean` value from this random number generator's sequence. + + Returns: + the next pseudorandom, uniformly distributed :code:`boolean` value from this random number generator's sequence + + + """ + ... + @typing.overload + def nextBytes(self, byteArray: typing.Union[typing.List[int], jpype.JArray, bytes]) -> None: + """ + Generates random bytes and places them into a user-supplied byte array. The number of random bytes produced is equal to + the length of the byte array. + + Parameters: + bytes (byte[]): the non-null byte array in which to put the random bytes + + """ + ... + @typing.overload + def nextBytes(self, byteArray: typing.Union[typing.List[int], jpype.JArray, bytes], int: int, int2: int) -> None: + """ + Generates random bytes and places them into a user-supplied byte array. + + Parameters: + bytes (byte[]): the non-null byte array in which to put the random bytes + offset (int): the starting index for inserting the generated bytes into the array + len (int): the number of bytes to generate + + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if :code:`offset < 0` or :code:`offset + len >= bytes.length` + + + """ + ... + def nextDouble(self) -> float: + """ + Returns the next pseudorandom, uniformly distributed :code:`double` value between :code:`0.0` and :code:`1.0` from this + random number generator's sequence. + + Returns: + the next pseudorandom, uniformly distributed :code:`double` value between :code:`0.0` and :code:`1.0` from this random + number generator's sequence + + + """ + ... + def nextFloat(self) -> float: + """ + Returns the next pseudorandom, uniformly distributed :code:`float` value between :code:`0.0` and :code:`1.0` from this + random number generator's sequence. + + Returns: + the next pseudorandom, uniformly distributed :code:`float` value between :code:`0.0` and :code:`1.0` from this random + number generator's sequence + + + """ + ... + def nextGaussian(self) -> float: + """ + Returns the next pseudorandom, Gaussian ("normally") distributed :code:`double` value with mean :code:`0.0` and standard + deviation :code:`1.0` from this random number generator's sequence. + + Returns: + the next pseudorandom, Gaussian ("normally") distributed :code:`double` value with mean :code:`0.0` and standard + deviation :code:`1.0` from this random number generator's sequence + + + """ + ... + @typing.overload + def nextInt(self) -> int: + """ + Returns the next pseudorandom, uniformly distributed :code:`int` value from this random number generator's sequence. + + All 2 :sup:`32` possible :code:`int` values should be produced with (approximately) equal probability. + + Returns: + the next pseudorandom, uniformly distributed :code:`int` value from this random number generator's sequence + + """ + ... + @typing.overload + def nextInt(self, int: int) -> int: + """ + Returns a pseudorandom, uniformly distributed :code:`int` value between 0 (inclusive) and the specified value + (exclusive), drawn from this random number generator's sequence. + + Parameters: + n (int): the bound on the random number to be returned. Must be positive. + + Returns: + a pseudorandom, uniformly distributed :code:`int` value between 0 (inclusive) and n (exclusive). + + Raises: + :class:`~org.hipparchus.random.https:.docs.oracle.com.javase.8.docs.api.java.lang.IllegalArgumentException`: if n is not positive. + + + """ + ... + @typing.overload + def nextLong(self) -> int: + """ + Returns the next pseudorandom, uniformly distributed :code:`long` value from this random number generator's sequence. + All 2 :sup:`64` possible :code:`long` values should be produced with (approximately) equal probability. + + Returns: + the next pseudorandom, uniformly distributed :code:`long` value from this random number generator's sequence + + """ + ... + @typing.overload + def nextLong(self, long: int) -> int: + """ + Returns a pseudorandom, uniformly distributed :code:`int` value between 0 (inclusive) and the specified value + (exclusive), drawn from this random number generator's sequence. + + Parameters: + n (long): the bound on the random number to be returned. Must be positive. + + Returns: + a pseudorandom, uniformly distributed :code:`int` value between 0 (inclusive) and n (exclusive). + + Raises: + :class:`~org.hipparchus.random.https:.docs.oracle.com.javase.8.docs.api.java.lang.IllegalArgumentException`: if n is not positive. + + + """ + ... + @typing.overload + def setSeed(self, int: int) -> None: + """ + Sets the seed of the underlying random number generator using an :code:`int` seed. + + Sequences of values generated starting with the same seeds should be identical. + + Parameters: + seed (int): the seed value + + Sets the seed of the underlying random number generator using an :code:`int` array seed. + + Sequences of values generated starting with the same seeds should be identical. + + Parameters: + seed (int[]): the seed value + + Sets the seed of the underlying random number generator using a :code:`long` seed. + + Sequences of values generated starting with the same seeds should be identical. + + Parameters: + seed (long): the seed value + + + """ + ... @typing.overload def setSeed(self, intArray: typing.Union[typing.List[int], jpype.JArray]) -> None: ... @typing.overload def setSeed(self, long: int) -> None: ... class RandomVectorGenerator: - def nextVector(self) -> typing.MutableSequence[float]: ... + """ + public interfaceRandomVectorGenerator + + This interface represents a random generator for whole vectors. + """ + def nextVector(self) -> typing.MutableSequence[float]: + """ + Generate a random vector. + + Returns: + a random vector as an array of double. + + + """ + ... class CorrelatedRandomVectorGenerator(RandomVectorGenerator): + """ + public classCorrelatedRandomVectorGenerator extends :class:`~org.hipparchus.random.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.random.RandomVectorGenerator` + + A :class:`~org.hipparchus.random.RandomVectorGenerator` that generates vectors with with correlated components. + + Random vectors with correlated components are built by combining the uncorrelated components of another random vector in + such a way that the resulting correlations are the ones specified by a positive definite covariance matrix. + + The main use for correlated random vector generation is for Monte-Carlo simulation of physical problems with several + variables, for example to generate error vectors to be added to a nominal vector. A particularly interesting case is + when the generated vector should be drawn from a ` Multivariate Normal Distribution + <http://en.wikipedia.org/wiki/Multivariate_normal_distribution>`. The approach using a Cholesky decomposition is quite + usual in this case. However, it can be extended to other cases as long as the underlying random generator provides + :class:`~org.hipparchus.random.NormalizedRandomGenerator` like :class:`~org.hipparchus.random.GaussianRandomGenerator` + or :class:`~org.hipparchus.random.UniformRandomGenerator`. + + Sometimes, the covariance matrix for a given simulation is not strictly positive definite. This means that the + correlations are not all independent from each other. In this case, however, the non strictly positive elements found + during the Cholesky decomposition of the covariance matrix should not be negative either, they should be null. Another + non-conventional extension handling this case is used here. Rather than computing :code:`C = U :sup:`T` .U` where + :code:`C` is the covariance matrix and :code:`U` is an upper-triangular matrix, we compute :code:`C = B.B :sup:`T`` + where :code:`B` is a rectangular matrix having more rows than columns. The number of columns of :code:`B` is the rank of + the covariance matrix, and it is the dimension of the uncorrelated random vector that is needed to compute the component + of the correlated vector. This class handles this situation automatically. + """ @typing.overload def __init__(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], realMatrix: org.hipparchus.linear.RealMatrix, double2: float, normalizedRandomGenerator: typing.Union[NormalizedRandomGenerator, typing.Callable]): ... @typing.overload def __init__(self, realMatrix: org.hipparchus.linear.RealMatrix, double: float, normalizedRandomGenerator: typing.Union[NormalizedRandomGenerator, typing.Callable]): ... - def getGenerator(self) -> NormalizedRandomGenerator: ... - def getRank(self) -> int: ... - def getRootMatrix(self) -> org.hipparchus.linear.RealMatrix: ... - def nextVector(self) -> typing.MutableSequence[float]: ... + def getGenerator(self) -> NormalizedRandomGenerator: + """ + Get the underlying normalized components generator. + + Returns: + underlying uncorrelated components generator + + + """ + ... + def getRank(self) -> int: + """ + Get the rank of the covariance matrix. The rank is the number of independent rows in the covariance matrix, it is also + the number of columns of the root matrix. + + Returns: + rank of the square matrix. + + Also see: + + - :meth:`~org.hipparchus.random.CorrelatedRandomVectorGenerator.getRootMatrix` + + + + """ + ... + def getRootMatrix(self) -> org.hipparchus.linear.RealMatrix: + """ + Get the root of the covariance matrix. The root is the rectangular matrix :code:`B` such that the covariance matrix is + equal to :code:`B.B :sup:`T`` + + Returns: + root of the square matrix + + Also see: + + - :meth:`~org.hipparchus.random.CorrelatedRandomVectorGenerator.getRank` + + + + """ + ... + def nextVector(self) -> typing.MutableSequence[float]: + """ + Generate a correlated random vector. + + Specified by: + :meth:`~org.hipparchus.random.RandomVectorGenerator.nextVector` in + interface :class:`~org.hipparchus.random.RandomVectorGenerator` + + Returns: + a random vector as an array of double. The returned array is created at each call, the caller can do what it wants with + it. + + + """ + ... class GaussianRandomGenerator(NormalizedRandomGenerator): + """ + public classGaussianRandomGenerator extends :class:`~org.hipparchus.random.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.random.NormalizedRandomGenerator` + + This class is a gaussian normalized random generator for scalars. + + This class is a simple wrapper around the :meth:`~org.hipparchus.random.RandomGenerator.nextGaussian` method. + """ def __init__(self, randomGenerator: RandomGenerator): ... - def nextNormalizedDouble(self) -> float: ... + def nextNormalizedDouble(self) -> float: + """ + Generate a random scalar with null mean and unit standard deviation. + + Specified by: + :meth:`~org.hipparchus.random.NormalizedRandomGenerator.nextNormalizedDouble` in + interface :class:`~org.hipparchus.random.NormalizedRandomGenerator` + + Returns: + a random scalar with null mean and unit standard deviation + + + """ + ... class HaltonSequenceGenerator(RandomVectorGenerator): + """ + public classHaltonSequenceGenerator extends :class:`~org.hipparchus.random.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.random.RandomVectorGenerator` + + Implementation of a Halton sequence. + + A Halton sequence is a low-discrepancy sequence generating points in the interval [0, 1] according to + + .. code-block: java + + H(n) = d_0 / b + d_1 / b^2 .... d_j / b^j+1 + + with + + n = d_j * b^j-1 + ... d_1 * b + d_0 * b^0 + + For higher dimensions, subsequent prime numbers are used as base, e.g. { 2, 3, 5 } for a Halton sequence in R^3. + + Halton sequences are known to suffer from linear correlation for larger prime numbers, thus the individual digits are + usually scrambled. This implementation already comes with support for up to 40 dimensions with optimal weight numbers + from ` H. Chi: Scrambled quasirandom sequences and their applications + <http://etd.lib.fsu.edu/theses/available/etd-07062004-140409/unrestricted/dissertation1.pdf>`. + + The generator supports two modes: + + - sequential generation of points: :meth:`~org.hipparchus.random.HaltonSequenceGenerator.nextVector` + - random access to the i-th point in the sequence: :meth:`~org.hipparchus.random.HaltonSequenceGenerator.skipTo` + + + Also see: + + - `Halton sequence (Wikipedia) <http://en.wikipedia.org/wiki/Halton_sequence>` + - :class:`~org.hipparchus.random.https:.lirias.kuleuven.be.bitstream.123456789.131168.1.mcm2005_bartv.pdf` + """ @typing.overload def __init__(self, int: int): ... @typing.overload def __init__(self, int: int, intArray: typing.Union[typing.List[int], jpype.JArray], intArray2: typing.Union[typing.List[int], jpype.JArray]): ... - def getNextIndex(self) -> int: ... - def nextVector(self) -> typing.MutableSequence[float]: ... + def getNextIndex(self) -> int: + """ + Returns the index i of the next point in the Halton sequence that will be returned by calling + :meth:`~org.hipparchus.random.HaltonSequenceGenerator.nextVector`. + + Returns: + the index of the next point + + + """ + ... + def nextVector(self) -> typing.MutableSequence[float]: + """ + Generate a random vector. + + Specified by: + :meth:`~org.hipparchus.random.RandomVectorGenerator.nextVector` in + interface :class:`~org.hipparchus.random.RandomVectorGenerator` + + Returns: + a random vector as an array of double. + + + """ + ... def skipTo(self, int: int) -> typing.MutableSequence[float]: ... class RandomAdaptor(java.util.Random, RandomGenerator): + """ + public classRandomAdaptor extends :class:`~org.hipparchus.random.https:.docs.oracle.com.javase.8.docs.api.java.util.Random` + implements :class:`~org.hipparchus.random.RandomGenerator` + + Extension of :class:`~org.hipparchus.random.https:.docs.oracle.com.javase.8.docs.api.java.util.Random` wrapping a + :class:`~org.hipparchus.random.RandomGenerator`. + + Also see: + + - :meth:`~serialized` + """ def __init__(self, randomGenerator: RandomGenerator): ... - def nextBoolean(self) -> bool: ... - @typing.overload - def nextBytes(self, byteArray: typing.Union[typing.List[int], jpype.JArray, bytes]) -> None: ... - @typing.overload - def nextBytes(self, byteArray: typing.Union[typing.List[int], jpype.JArray, bytes], int: int, int2: int) -> None: ... + def nextBoolean(self) -> bool: + """ + Returns the next pseudorandom, uniformly distributed :code:`boolean` value from this random number generator's sequence. + + Specified by: + :code:`nextBoolean` in interface :code:`java.util.random.RandomGenerator` + + Specified by: + :meth:`~org.hipparchus.random.RandomGenerator.nextBoolean` in interface :class:`~org.hipparchus.random.RandomGenerator` + + Overrides: + :meth:`~org.hipparchus.random.https:.docs.oracle.com.javase.8.docs.api.java.util.Random.nextBoolean` in + class :class:`~org.hipparchus.random.https:.docs.oracle.com.javase.8.docs.api.java.util.Random` + + Returns: + the next pseudorandom, uniformly distributed :code:`boolean` value from this random number generator's sequence + + + """ + ... + @typing.overload + def nextBytes(self, byteArray: typing.Union[typing.List[int], jpype.JArray, bytes]) -> None: + """ + Generates random bytes and places them into a user-supplied byte array. The number of random bytes produced is equal to + the length of the byte array. + + Specified by: + :code:`nextBytes` in interface :code:`java.util.random.RandomGenerator` + + Specified by: + :meth:`~org.hipparchus.random.RandomGenerator.nextBytes` in interface :class:`~org.hipparchus.random.RandomGenerator` + + Overrides: + :meth:`~org.hipparchus.random.https:.docs.oracle.com.javase.8.docs.api.java.util.Random.nextBytes` in + class :class:`~org.hipparchus.random.https:.docs.oracle.com.javase.8.docs.api.java.util.Random` + + Parameters: + bytes (byte[]): the non-null byte array in which to put the random bytes + + """ + ... + @typing.overload + def nextBytes(self, byteArray: typing.Union[typing.List[int], jpype.JArray, bytes], int: int, int2: int) -> None: + """ + Generates random bytes and places them into a user-supplied byte array. + + Specified by: + :meth:`~org.hipparchus.random.RandomGenerator.nextBytes` in interface :class:`~org.hipparchus.random.RandomGenerator` + + Parameters: + bytes (byte[]): the non-null byte array in which to put the random bytes + offset (int): the starting index for inserting the generated bytes into the array + len (int): the number of bytes to generate + + + """ + ... @typing.overload def nextDouble(self, double: float) -> float: ... @typing.overload def nextDouble(self, double: float, double2: float) -> float: ... @typing.overload - def nextDouble(self) -> float: ... + def nextDouble(self) -> float: + """ + Returns the next pseudorandom, uniformly distributed :code:`double` value between :code:`0.0` and :code:`1.0` from this + random number generator's sequence. + + Specified by: + :code:`nextDouble` in interface :code:`java.util.random.RandomGenerator` + + Specified by: + :meth:`~org.hipparchus.random.RandomGenerator.nextDouble` in interface :class:`~org.hipparchus.random.RandomGenerator` + + Overrides: + :meth:`~org.hipparchus.random.https:.docs.oracle.com.javase.8.docs.api.java.util.Random.nextDouble` in + class :class:`~org.hipparchus.random.https:.docs.oracle.com.javase.8.docs.api.java.util.Random` + + Returns: + the next pseudorandom, uniformly distributed :code:`double` value between :code:`0.0` and :code:`1.0` from this random + number generator's sequence + + + """ + ... @typing.overload def nextFloat(self, float: float) -> float: ... @typing.overload def nextFloat(self, float: float, float2: float) -> float: ... @typing.overload - def nextFloat(self) -> float: ... + def nextFloat(self) -> float: + """ + Returns the next pseudorandom, uniformly distributed :code:`float` value between :code:`0.0` and :code:`1.0` from this + random number generator's sequence. + + Specified by: + :code:`nextFloat` in interface :code:`java.util.random.RandomGenerator` + + Specified by: + :meth:`~org.hipparchus.random.RandomGenerator.nextFloat` in interface :class:`~org.hipparchus.random.RandomGenerator` + + Overrides: + :meth:`~org.hipparchus.random.https:.docs.oracle.com.javase.8.docs.api.java.util.Random.nextFloat` in + class :class:`~org.hipparchus.random.https:.docs.oracle.com.javase.8.docs.api.java.util.Random` + + Returns: + the next pseudorandom, uniformly distributed :code:`float` value between :code:`0.0` and :code:`1.0` from this random + number generator's sequence + + + """ + ... @typing.overload def nextGaussian(self, double: float, double2: float) -> float: ... @typing.overload - def nextGaussian(self) -> float: ... + def nextGaussian(self) -> float: + """ + Returns the next pseudorandom, Gaussian ("normally") distributed :code:`double` value with mean :code:`0.0` and standard + deviation :code:`1.0` from this random number generator's sequence. + + Specified by: + :code:`nextGaussian` in interface :code:`java.util.random.RandomGenerator` + + Specified by: + :meth:`~org.hipparchus.random.RandomGenerator.nextGaussian` in + interface :class:`~org.hipparchus.random.RandomGenerator` + + Overrides: + :meth:`~org.hipparchus.random.https:.docs.oracle.com.javase.8.docs.api.java.util.Random.nextGaussian` in + class :class:`~org.hipparchus.random.https:.docs.oracle.com.javase.8.docs.api.java.util.Random` + + Returns: + the next pseudorandom, Gaussian ("normally") distributed :code:`double` value with mean :code:`0.0` and standard + deviation :code:`1.0` from this random number generator's sequence + + + """ + ... @typing.overload def nextInt(self, int: int, int2: int) -> int: ... @typing.overload - def nextInt(self) -> int: ... - @typing.overload - def nextInt(self, int: int) -> int: ... + def nextInt(self) -> int: + """ + Returns the next pseudorandom, uniformly distributed :code:`int` value from this random number generator's sequence. All + 2 :sup:`32` possible :code:`int` values should be produced with (approximately) equal probability. + + Specified by: + :code:`nextInt` in interface :code:`java.util.random.RandomGenerator` + + Specified by: + :meth:`~org.hipparchus.random.RandomGenerator.nextInt` in interface :class:`~org.hipparchus.random.RandomGenerator` + + Overrides: + :meth:`~org.hipparchus.random.https:.docs.oracle.com.javase.8.docs.api.java.util.Random.nextInt` in + class :class:`~org.hipparchus.random.https:.docs.oracle.com.javase.8.docs.api.java.util.Random` + + Returns: + the next pseudorandom, uniformly distributed :code:`int` value from this random number generator's sequence + + """ + ... + @typing.overload + def nextInt(self, int: int) -> int: + """ + Returns a pseudorandom, uniformly distributed :code:`int` value between 0 (inclusive) and the specified value + (exclusive), drawn from this random number generator's sequence. + + Specified by: + :code:`nextInt` in interface :code:`java.util.random.RandomGenerator` + + Specified by: + :meth:`~org.hipparchus.random.RandomGenerator.nextInt` in interface :class:`~org.hipparchus.random.RandomGenerator` + + Overrides: + :meth:`~org.hipparchus.random.https:.docs.oracle.com.javase.8.docs.api.java.util.Random.nextInt` in + class :class:`~org.hipparchus.random.https:.docs.oracle.com.javase.8.docs.api.java.util.Random` + + Parameters: + n (int): the bound on the random number to be returned. Must be positive. + + Returns: + a pseudorandom, uniformly distributed :code:`int` value between 0 (inclusive) and n (exclusive). + + Raises: + :class:`~org.hipparchus.random.https:.docs.oracle.com.javase.8.docs.api.java.lang.IllegalArgumentException`: if n is not positive. + + + """ + ... @typing.overload def nextLong(self, long: int, long2: int) -> int: ... @typing.overload - def nextLong(self) -> int: ... - @typing.overload - def nextLong(self, long: int) -> int: ... + def nextLong(self) -> int: + """ + Returns the next pseudorandom, uniformly distributed :code:`long` value from this random number generator's sequence. + All 2 :sup:`64` possible :code:`long` values should be produced with (approximately) equal probability. + + Specified by: + :code:`nextLong` in interface :code:`java.util.random.RandomGenerator` + + Specified by: + :meth:`~org.hipparchus.random.RandomGenerator.nextLong` in interface :class:`~org.hipparchus.random.RandomGenerator` + + Overrides: + :meth:`~org.hipparchus.random.https:.docs.oracle.com.javase.8.docs.api.java.util.Random.nextLong` in + class :class:`~org.hipparchus.random.https:.docs.oracle.com.javase.8.docs.api.java.util.Random` + + Returns: + the next pseudorandom, uniformly distributed :code:`long` value from this random number generator's sequence + + """ + ... + @typing.overload + def nextLong(self, long: int) -> int: + """ + Returns a pseudorandom, uniformly distributed :code:`int` value between 0 (inclusive) and the specified value + (exclusive), drawn from this random number generator's sequence. + + Specified by: + :code:`nextLong` in interface :code:`java.util.random.RandomGenerator` + + Specified by: + :meth:`~org.hipparchus.random.RandomGenerator.nextLong` in interface :class:`~org.hipparchus.random.RandomGenerator` + + Parameters: + n (long): the bound on the random number to be returned. Must be positive. + + Returns: + a pseudorandom, uniformly distributed :code:`int` value between 0 (inclusive) and n (exclusive). + + + """ + ... @staticmethod - def of(randomGenerator: RandomGenerator) -> java.util.Random: ... - @typing.overload - def setSeed(self, int: int) -> None: ... + def of(randomGenerator: RandomGenerator) -> java.util.Random: + """ + Factory method to create a :code:`Random` using the supplied :code:`RandomGenerator`. + + Parameters: + randomGenerator (:class:`~org.hipparchus.random.RandomGenerator`): wrapped RandomGenerator instance + + Returns: + a Random instance wrapping the RandomGenerator + + + """ + ... + @typing.overload + def setSeed(self, int: int) -> None: + """ + Sets the seed of the underlying random number generator using an :code:`int` seed. + + Sequences of values generated starting with the same seeds should be identical. + + Specified by: + :meth:`~org.hipparchus.random.RandomGenerator.setSeed` in interface :class:`~org.hipparchus.random.RandomGenerator` + + Parameters: + seed (int): the seed value + + Sets the seed of the underlying random number generator using an :code:`int` array seed. + + Sequences of values generated starting with the same seeds should be identical. + + Specified by: + :meth:`~org.hipparchus.random.RandomGenerator.setSeed` in interface :class:`~org.hipparchus.random.RandomGenerator` + + Parameters: + seed (int[]): the seed value + + Sets the seed of the underlying random number generator using a :code:`long` seed. + + Sequences of values generated starting with the same seeds should be identical. + + Specified by: + :meth:`~org.hipparchus.random.RandomGenerator.setSeed` in interface :class:`~org.hipparchus.random.RandomGenerator` + + Overrides: + :meth:`~org.hipparchus.random.https:.docs.oracle.com.javase.8.docs.api.java.util.Random.setSeed` in + class :class:`~org.hipparchus.random.https:.docs.oracle.com.javase.8.docs.api.java.util.Random` + + Parameters: + seed (long): the seed value + + + """ + ... @typing.overload def setSeed(self, intArray: typing.Union[typing.List[int], jpype.JArray]) -> None: ... @typing.overload def setSeed(self, long: int) -> None: ... class SobolSequenceGenerator(RandomVectorGenerator): + """ + public classSobolSequenceGenerator extends :class:`~org.hipparchus.random.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.random.RandomVectorGenerator` + + Implementation of a Sobol sequence. + + A Sobol sequence is a low-discrepancy sequence with the property that for all values of N, its subsequence (x1, ... xN) + has a low discrepancy. It can be used to generate pseudo-random points in a space S, which are equi-distributed. + + The implementation already comes with support for up to 1000 dimensions with direction numbers calculated from `Stephen + Joe and Frances Kuo <http://web.maths.unsw.edu.au/~fkuo/sobol/>`. + + The generator supports two modes: + + - sequential generation of points: :meth:`~org.hipparchus.random.SobolSequenceGenerator.nextVector` + - random access to the i-th point in the sequence: :meth:`~org.hipparchus.random.SobolSequenceGenerator.skipTo` + + + Also see: + + - `Sobol sequence (Wikipedia) <http://en.wikipedia.org/wiki/Sobol_sequence>` + - `Sobol sequence direction numbers <http://web.maths.unsw.edu.au/~fkuo/sobol/>` + """ @typing.overload def __init__(self, int: int): ... @typing.overload def __init__(self, int: int, inputStream: java.io.InputStream): ... - def getNextIndex(self) -> int: ... - def nextVector(self) -> typing.MutableSequence[float]: ... + def getNextIndex(self) -> int: + """ + Returns the index i of the next point in the Sobol sequence that will be returned by calling + :meth:`~org.hipparchus.random.SobolSequenceGenerator.nextVector`. + + Returns: + the index of the next point + + + """ + ... + def nextVector(self) -> typing.MutableSequence[float]: + """ + Generate a random vector. + + Specified by: + :meth:`~org.hipparchus.random.RandomVectorGenerator.nextVector` in + interface :class:`~org.hipparchus.random.RandomVectorGenerator` + + Returns: + a random vector as an array of double. + + + """ + ... def skipTo(self, int: int) -> typing.MutableSequence[float]: ... class StableRandomGenerator(NormalizedRandomGenerator): + """ + public classStableRandomGenerator extends :class:`~org.hipparchus.random.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.random.NormalizedRandomGenerator` + + + This class provides a stable normalized random generator. It samples from a stable distribution with location parameter + 0 and scale 1. + + The implementation uses the Chambers-Mallows-Stuck method as described in *Handbook of computational statistics: + concepts and methods* by James E. Gentle, Wolfgang Härdle, Yuichi Mori. + """ def __init__(self, randomGenerator: RandomGenerator, double: float, double2: float): ... - def nextNormalizedDouble(self) -> float: ... + def nextNormalizedDouble(self) -> float: + """ + Generate a random scalar with zero location and unit scale. + + Specified by: + :meth:`~org.hipparchus.random.NormalizedRandomGenerator.nextNormalizedDouble` in + interface :class:`~org.hipparchus.random.NormalizedRandomGenerator` + + Returns: + a random scalar with zero location and unit scale + + + """ + ... class SynchronizedRandomGenerator(RandomGenerator): + """ + public classSynchronizedRandomGenerator extends :class:`~org.hipparchus.random.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.random.RandomGenerator` + + Any :class:`~org.hipparchus.random.RandomGenerator` implementation can be thread-safe if it is used through an instance + of this class. This is achieved by enclosing calls to the methods of the actual generator inside the overridden + :code:`synchronized` methods of this class. + """ def __init__(self, randomGenerator: RandomGenerator): ... - def nextBoolean(self) -> bool: ... - @typing.overload - def nextBytes(self, byteArray: typing.Union[typing.List[int], jpype.JArray, bytes]) -> None: ... - @typing.overload - def nextBytes(self, byteArray: typing.Union[typing.List[int], jpype.JArray, bytes], int: int, int2: int) -> None: ... - def nextDouble(self) -> float: ... - def nextFloat(self) -> float: ... - def nextGaussian(self) -> float: ... - @typing.overload - def nextInt(self) -> int: ... - @typing.overload - def nextInt(self, int: int) -> int: ... - @typing.overload - def nextLong(self) -> int: ... - @typing.overload - def nextLong(self, long: int) -> int: ... - @typing.overload - def setSeed(self, int: int) -> None: ... + def nextBoolean(self) -> bool: + """ + Returns the next pseudorandom, uniformly distributed :code:`boolean` value from this random number generator's sequence. + + Specified by: + :meth:`~org.hipparchus.random.RandomGenerator.nextBoolean` in interface :class:`~org.hipparchus.random.RandomGenerator` + + Returns: + the next pseudorandom, uniformly distributed :code:`boolean` value from this random number generator's sequence + + + """ + ... + @typing.overload + def nextBytes(self, byteArray: typing.Union[typing.List[int], jpype.JArray, bytes]) -> None: + """ + Generates random bytes and places them into a user-supplied byte array. The number of random bytes produced is equal to + the length of the byte array. + + Specified by: + :meth:`~org.hipparchus.random.RandomGenerator.nextBytes` in interface :class:`~org.hipparchus.random.RandomGenerator` + + Parameters: + bytes (byte[]): the non-null byte array in which to put the random bytes + + """ + ... + @typing.overload + def nextBytes(self, byteArray: typing.Union[typing.List[int], jpype.JArray, bytes], int: int, int2: int) -> None: + """ + Generates random bytes and places them into a user-supplied byte array. + + Specified by: + :meth:`~org.hipparchus.random.RandomGenerator.nextBytes` in interface :class:`~org.hipparchus.random.RandomGenerator` + + Parameters: + bytes (byte[]): the non-null byte array in which to put the random bytes + offset (int): the starting index for inserting the generated bytes into the array + len (int): the number of bytes to generate + + + """ + ... + def nextDouble(self) -> float: + """ + Returns the next pseudorandom, uniformly distributed :code:`double` value between :code:`0.0` and :code:`1.0` from this + random number generator's sequence. + + Specified by: + :meth:`~org.hipparchus.random.RandomGenerator.nextDouble` in interface :class:`~org.hipparchus.random.RandomGenerator` + + Returns: + the next pseudorandom, uniformly distributed :code:`double` value between :code:`0.0` and :code:`1.0` from this random + number generator's sequence + + + """ + ... + def nextFloat(self) -> float: + """ + Returns the next pseudorandom, uniformly distributed :code:`float` value between :code:`0.0` and :code:`1.0` from this + random number generator's sequence. + + Specified by: + :meth:`~org.hipparchus.random.RandomGenerator.nextFloat` in interface :class:`~org.hipparchus.random.RandomGenerator` + + Returns: + the next pseudorandom, uniformly distributed :code:`float` value between :code:`0.0` and :code:`1.0` from this random + number generator's sequence + + + """ + ... + def nextGaussian(self) -> float: + """ + Returns the next pseudorandom, Gaussian ("normally") distributed :code:`double` value with mean :code:`0.0` and standard + deviation :code:`1.0` from this random number generator's sequence. + + Specified by: + :meth:`~org.hipparchus.random.RandomGenerator.nextGaussian` in + interface :class:`~org.hipparchus.random.RandomGenerator` + + Returns: + the next pseudorandom, Gaussian ("normally") distributed :code:`double` value with mean :code:`0.0` and standard + deviation :code:`1.0` from this random number generator's sequence + + + """ + ... + @typing.overload + def nextInt(self) -> int: + """ + Returns the next pseudorandom, uniformly distributed :code:`int` value from this random number generator's sequence. + + All 2 :sup:`32` possible :code:`int` values should be produced with (approximately) equal probability. + + Specified by: + :meth:`~org.hipparchus.random.RandomGenerator.nextInt` in interface :class:`~org.hipparchus.random.RandomGenerator` + + Returns: + the next pseudorandom, uniformly distributed :code:`int` value from this random number generator's sequence + + """ + ... + @typing.overload + def nextInt(self, int: int) -> int: + """ + Returns a pseudorandom, uniformly distributed :code:`int` value between 0 (inclusive) and the specified value + (exclusive), drawn from this random number generator's sequence. + + Specified by: + :meth:`~org.hipparchus.random.RandomGenerator.nextInt` in interface :class:`~org.hipparchus.random.RandomGenerator` + + Parameters: + n (int): the bound on the random number to be returned. Must be positive. + + Returns: + a pseudorandom, uniformly distributed :code:`int` value between 0 (inclusive) and n (exclusive). + + + """ + ... + @typing.overload + def nextLong(self) -> int: + """ + Returns the next pseudorandom, uniformly distributed :code:`long` value from this random number generator's sequence. + All 2 :sup:`64` possible :code:`long` values should be produced with (approximately) equal probability. + + Specified by: + :meth:`~org.hipparchus.random.RandomGenerator.nextLong` in interface :class:`~org.hipparchus.random.RandomGenerator` + + Returns: + the next pseudorandom, uniformly distributed :code:`long` value from this random number generator's sequence + + """ + ... + @typing.overload + def nextLong(self, long: int) -> int: + """ + Returns a pseudorandom, uniformly distributed :code:`int` value between 0 (inclusive) and the specified value + (exclusive), drawn from this random number generator's sequence. + + Specified by: + :meth:`~org.hipparchus.random.RandomGenerator.nextLong` in interface :class:`~org.hipparchus.random.RandomGenerator` + + Parameters: + n (long): the bound on the random number to be returned. Must be positive. + + Returns: + a pseudorandom, uniformly distributed :code:`int` value between 0 (inclusive) and n (exclusive). + + + """ + ... + @typing.overload + def setSeed(self, int: int) -> None: + """ + Sets the seed of the underlying random number generator using an :code:`int` seed. + + Sequences of values generated starting with the same seeds should be identical. + + Specified by: + :meth:`~org.hipparchus.random.RandomGenerator.setSeed` in interface :class:`~org.hipparchus.random.RandomGenerator` + + Parameters: + seed (int): the seed value + + Sets the seed of the underlying random number generator using an :code:`int` array seed. + + Sequences of values generated starting with the same seeds should be identical. + + Specified by: + :meth:`~org.hipparchus.random.RandomGenerator.setSeed` in interface :class:`~org.hipparchus.random.RandomGenerator` + + Parameters: + seed (int[]): the seed value + + Sets the seed of the underlying random number generator using a :code:`long` seed. + + Sequences of values generated starting with the same seeds should be identical. + + Specified by: + :meth:`~org.hipparchus.random.RandomGenerator.setSeed` in interface :class:`~org.hipparchus.random.RandomGenerator` + + Parameters: + seed (long): the seed value + + + """ + ... @typing.overload def setSeed(self, intArray: typing.Union[typing.List[int], jpype.JArray]) -> None: ... @typing.overload def setSeed(self, long: int) -> None: ... class UncorrelatedRandomVectorGenerator(RandomVectorGenerator): + """ + public classUncorrelatedRandomVectorGenerator extends :class:`~org.hipparchus.random.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.random.RandomVectorGenerator` + + A :class:`~org.hipparchus.random.RandomVectorGenerator` that generates vectors with uncorrelated components. + + Components of generated vectors follow (independent) Gaussian distributions, with parameters supplied in the + constructor. + """ @typing.overload def __init__(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray], normalizedRandomGenerator: typing.Union[NormalizedRandomGenerator, typing.Callable]): ... @typing.overload def __init__(self, int: int, normalizedRandomGenerator: typing.Union[NormalizedRandomGenerator, typing.Callable]): ... - def nextVector(self) -> typing.MutableSequence[float]: ... + def nextVector(self) -> typing.MutableSequence[float]: + """ + Generate an uncorrelated random vector. + + Specified by: + :meth:`~org.hipparchus.random.RandomVectorGenerator.nextVector` in + interface :class:`~org.hipparchus.random.RandomVectorGenerator` + + Returns: + a random vector as a newly built array of double + + + """ + ... class UniformRandomGenerator(NormalizedRandomGenerator): + """ + public classUniformRandomGenerator extends :class:`~org.hipparchus.random.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.random.NormalizedRandomGenerator` + + This class implements a normalized uniform random generator. + + Since it is a normalized random generator, it generates values from a uniform distribution with mean equal to 0 and + standard deviation equal to 1. Generated values fall in the range [-x0221A;3, +x0221A;3]. + """ def __init__(self, randomGenerator: RandomGenerator): ... - def nextNormalizedDouble(self) -> float: ... + def nextNormalizedDouble(self) -> float: + """ + Generate a random scalar with null mean and unit standard deviation. + + The number generated is uniformly distributed between \(-\sqrt{3}\) and \(+\sqrt{3}\). + + Specified by: + :meth:`~org.hipparchus.random.NormalizedRandomGenerator.nextNormalizedDouble` in + interface :class:`~org.hipparchus.random.NormalizedRandomGenerator` + + Returns: + a random scalar with null mean and unit standard deviation + + + """ + ... class UnitSphereRandomVectorGenerator(RandomVectorGenerator): + """ + public classUnitSphereRandomVectorGenerator extends :class:`~org.hipparchus.random.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.random.RandomVectorGenerator` + + Generate random vectors isotropically located on the surface of a sphere. + """ @typing.overload def __init__(self, int: int): ... @typing.overload def __init__(self, int: int, randomGenerator: RandomGenerator): ... - def nextVector(self) -> typing.MutableSequence[float]: ... + def nextVector(self) -> typing.MutableSequence[float]: + """ + Generate a random vector. + + Specified by: + :meth:`~org.hipparchus.random.RandomVectorGenerator.nextVector` in + interface :class:`~org.hipparchus.random.RandomVectorGenerator` + + Returns: + a random vector as an array of double. + + + """ + ... class AbstractWell(org.hipparchus.random.IntRandomGenerator, java.io.Serializable): - def nextInt(self) -> int: ... - def setSeed(self, intArray: typing.Union[typing.List[int], jpype.JArray]) -> None: ... + """ + public abstract classAbstractWell extends :class:`~org.hipparchus.random.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.random.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + This abstract class implements the WELL class of pseudo-random number generator from François Panneton, Pierre L'Ecuyer + and Makoto Matsumoto. + + This generator is described in a paper by François Panneton, Pierre L'Ecuyer and Makoto Matsumoto ` Improved + Long-Period Generators Based on Linear Recurrences Modulo 2 + <http://www.iro.umontreal.ca/~lecuyer/myftp/papers/wellrng.pdf>` ACM Transactions on Mathematical Software, 32, 1 + (2006). The errata for the paper are in ` wellrng-errata.txt + <http://www.iro.umontreal.ca/~lecuyer/myftp/papers/wellrng-errata.txt>`. + + Also see: + + - `WELL Random number generator <http://www.iro.umontreal.ca/~panneton/WELLRNG.html>` + - :meth:`~serialized` + """ + def nextInt(self) -> int: + """ + Returns the next pseudorandom, uniformly distributed :code:`int` value from this random number generator's sequence. + + All 2 :sup:`32` possible :code:`int` values should be produced with (approximately) equal probability. + + Returns: + the next pseudorandom, uniformly distributed :code:`int` value from this random number generator's sequence + + public int nextInt(int n) throws :class:`~org.hipparchus.random.https:.docs.oracle.com.javase.8.docs.api.java.lang.IllegalArgumentException` + + Returns a pseudorandom, uniformly distributed :code:`int` value between 0 (inclusive) and the specified value + (exclusive), drawn from this random number generator's sequence. + + Specified by: + :meth:`~org.hipparchus.random.RandomGenerator.nextInt` in interface :class:`~org.hipparchus.random.RandomGenerator` + + Parameters: + n (int): the bound on the random number to be returned. Must be positive. + + Returns: + a pseudorandom, uniformly distributed :code:`int` value between 0 (inclusive) and n (exclusive). + + Raises: + :class:`~org.hipparchus.random.https:.docs.oracle.com.javase.8.docs.api.java.lang.IllegalArgumentException`: if n is not positive. + + + """ + ... + def setSeed(self, intArray: typing.Union[typing.List[int], jpype.JArray]) -> None: + """ + Reinitialize the generator as if just built with the given int array seed. + + The state of the generator is exactly the same as a new generator built with the same seed. + + Specified by: + :meth:`~org.hipparchus.random.RandomGenerator.setSeed` in interface :class:`~org.hipparchus.random.RandomGenerator` + + Parameters: + seed (int[]): the initial seed (32 bits integers array). If null the seed of the generator will be the system time plus the system + identity hash code of the instance. + + Sets the seed of the underlying random number generator using an :code:`int` seed. + + Sequences of values generated starting with the same seeds should be identical. + + Specified by: + :meth:`~org.hipparchus.random.RandomGenerator.setSeed` in interface :class:`~org.hipparchus.random.RandomGenerator` + + Parameters: + seed (int): the seed value + + Sets the seed of the underlying random number generator using a :code:`long` seed. + + Sequences of values generated starting with the same seeds should be identical. + + Specified by: + :meth:`~org.hipparchus.random.RandomGenerator.setSeed` in interface :class:`~org.hipparchus.random.RandomGenerator` + + Parameters: + seed (long): the seed value + + + """ + ... class ISAACRandom(org.hipparchus.random.IntRandomGenerator, java.io.Serializable): + """ + public classISAACRandom extends :class:`~org.hipparchus.random.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.random.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + A fast cryptographic pseudo-random number generator. + + ISAAC (Indirection, Shift, Accumulate, Add, and Count) generates 32-bit random numbers. ISAAC has been designed to be + cryptographically secure and is inspired by RC4. Cycles are guaranteed to be at least 2 :sup:`40` values long, and they + are 2 :sup:`8295` values long on average. The results are uniformly distributed, unbiased, and unpredictable unless you + know the seed. + + This code is based (with minor changes and improvements) on the original implementation of the algorithm by Bob Jenkins. + + Also see: + + - ` ISAAC: a fast cryptographic pseudo-random number generator <http://burtleburtle.net/bob/rand/isaacafa.html>` + - :meth:`~serialized` + """ @typing.overload def __init__(self): ... @typing.overload def __init__(self, intArray: typing.Union[typing.List[int], jpype.JArray]): ... @typing.overload def __init__(self, long: int): ... - def nextInt(self) -> int: ... - def setSeed(self, intArray: typing.Union[typing.List[int], jpype.JArray]) -> None: ... + def nextInt(self) -> int: + """ + Returns the next pseudorandom, uniformly distributed :code:`int` value from this random number generator's sequence. + + All 2 :sup:`32` possible :code:`int` values should be produced with (approximately) equal probability. + + Specified by: + :meth:`~org.hipparchus.random.RandomGenerator.nextInt` in interface :class:`~org.hipparchus.random.RandomGenerator` + + Returns: + the next pseudorandom, uniformly distributed :code:`int` value from this random number generator's sequence + + public int nextInt(int n) throws :class:`~org.hipparchus.random.https:.docs.oracle.com.javase.8.docs.api.java.lang.IllegalArgumentException` + + Returns a pseudorandom, uniformly distributed :code:`int` value between 0 (inclusive) and the specified value + (exclusive), drawn from this random number generator's sequence. + + Specified by: + :meth:`~org.hipparchus.random.RandomGenerator.nextInt` in interface :class:`~org.hipparchus.random.RandomGenerator` + + Parameters: + n (int): the bound on the random number to be returned. Must be positive. + + Returns: + a pseudorandom, uniformly distributed :code:`int` value between 0 (inclusive) and n (exclusive). + + Raises: + :class:`~org.hipparchus.random.https:.docs.oracle.com.javase.8.docs.api.java.lang.IllegalArgumentException`: if n is not positive. + + + """ + ... + def setSeed(self, intArray: typing.Union[typing.List[int], jpype.JArray]) -> None: + """ + Sets the seed of the underlying random number generator using an :code:`int` array seed. + + Sequences of values generated starting with the same seeds should be identical. + + Specified by: + :meth:`~org.hipparchus.random.RandomGenerator.setSeed` in interface :class:`~org.hipparchus.random.RandomGenerator` + + Parameters: + seed (int[]): the seed value + + Sets the seed of the underlying random number generator using an :code:`int` seed. + + Sequences of values generated starting with the same seeds should be identical. + + Specified by: + :meth:`~org.hipparchus.random.RandomGenerator.setSeed` in interface :class:`~org.hipparchus.random.RandomGenerator` + + Parameters: + seed (int): the seed value + + Sets the seed of the underlying random number generator using a :code:`long` seed. + + Sequences of values generated starting with the same seeds should be identical. + + Specified by: + :meth:`~org.hipparchus.random.RandomGenerator.setSeed` in interface :class:`~org.hipparchus.random.RandomGenerator` + + Parameters: + seed (long): the seed value + + + """ + ... class JDKRandomGenerator(org.hipparchus.random.IntRandomGenerator, java.io.Serializable): + """ + public classJDKRandomGenerator extends :class:`~org.hipparchus.random.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.random.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + A :class:`~org.hipparchus.random.RandomGenerator` adapter that delegates the random number generation to the standard + :class:`~org.hipparchus.random.https:.docs.oracle.com.javase.8.docs.api.java.util.Random` class. + + Also see: + + - :meth:`~serialized` + """ @typing.overload def __init__(self): ... @typing.overload def __init__(self, random: java.util.Random): ... @typing.overload def __init__(self, long: int): ... - def nextBoolean(self) -> bool: ... - def nextBytes(self, byteArray: typing.Union[typing.List[int], jpype.JArray, bytes]) -> None: ... - def nextDouble(self) -> float: ... - def nextFloat(self) -> float: ... - def nextGaussian(self) -> float: ... - @typing.overload - def nextInt(self) -> int: ... - @typing.overload - def nextInt(self, int: int) -> int: ... - def nextLong(self) -> int: ... - @typing.overload - def setSeed(self, int: int) -> None: ... + def nextBoolean(self) -> bool: + """ + Returns the next pseudorandom, uniformly distributed :code:`boolean` value from this random number generator's sequence. + + Specified by: + :meth:`~org.hipparchus.random.RandomGenerator.nextBoolean` in interface :class:`~org.hipparchus.random.RandomGenerator` + + Returns: + the next pseudorandom, uniformly distributed :code:`boolean` value from this random number generator's sequence + + + """ + ... + def nextBytes(self, byteArray: typing.Union[typing.List[int], jpype.JArray, bytes]) -> None: + """ + Generates random bytes and places them into a user-supplied byte array. The number of random bytes produced is equal to + the length of the byte array. + + Specified by: + :meth:`~org.hipparchus.random.RandomGenerator.nextBytes` in interface :class:`~org.hipparchus.random.RandomGenerator` + + Parameters: + bytes (byte[]): the non-null byte array in which to put the random bytes + + public void nextBytes(byte[] bytes, int start, int len) + + Generates random bytes and places them into a user-supplied byte array. + + Parameters: + bytes (byte[]): the non-null byte array in which to put the random bytes + start (int): the starting index for inserting the generated bytes into the array + len (int): the number of bytes to generate + + + """ + ... + def nextDouble(self) -> float: + """ + Returns the next pseudorandom, uniformly distributed :code:`double` value between :code:`0.0` and :code:`1.0` from this + random number generator's sequence. + + Specified by: + :meth:`~org.hipparchus.random.RandomGenerator.nextDouble` in interface :class:`~org.hipparchus.random.RandomGenerator` + + Returns: + the next pseudorandom, uniformly distributed :code:`double` value between :code:`0.0` and :code:`1.0` from this random + number generator's sequence + + + """ + ... + def nextFloat(self) -> float: + """ + Returns the next pseudorandom, uniformly distributed :code:`float` value between :code:`0.0` and :code:`1.0` from this + random number generator's sequence. + + Specified by: + :meth:`~org.hipparchus.random.RandomGenerator.nextFloat` in interface :class:`~org.hipparchus.random.RandomGenerator` + + Returns: + the next pseudorandom, uniformly distributed :code:`float` value between :code:`0.0` and :code:`1.0` from this random + number generator's sequence + + + """ + ... + def nextGaussian(self) -> float: + """ + Returns the next pseudorandom, Gaussian ("normally") distributed :code:`double` value with mean :code:`0.0` and standard + deviation :code:`1.0` from this random number generator's sequence. + + Specified by: + :meth:`~org.hipparchus.random.RandomGenerator.nextGaussian` in + interface :class:`~org.hipparchus.random.RandomGenerator` + + Returns: + the next pseudorandom, Gaussian ("normally") distributed :code:`double` value with mean :code:`0.0` and standard + deviation :code:`1.0` from this random number generator's sequence + + + """ + ... + @typing.overload + def nextInt(self) -> int: + """ + Returns the next pseudorandom, uniformly distributed :code:`int` value from this random number generator's sequence. + + All 2 :sup:`32` possible :code:`int` values should be produced with (approximately) equal probability. + + Specified by: + :meth:`~org.hipparchus.random.RandomGenerator.nextInt` in interface :class:`~org.hipparchus.random.RandomGenerator` + + Returns: + the next pseudorandom, uniformly distributed :code:`int` value from this random number generator's sequence + + """ + ... + @typing.overload + def nextInt(self, int: int) -> int: + """ + Returns a pseudorandom, uniformly distributed :code:`int` value between 0 (inclusive) and the specified value + (exclusive), drawn from this random number generator's sequence. + + Specified by: + :meth:`~org.hipparchus.random.RandomGenerator.nextInt` in interface :class:`~org.hipparchus.random.RandomGenerator` + + Parameters: + n (int): the bound on the random number to be returned. Must be positive. + + Returns: + a pseudorandom, uniformly distributed :code:`int` value between 0 (inclusive) and n (exclusive). + + + """ + ... + def nextLong(self) -> int: + """ + Returns the next pseudorandom, uniformly distributed :code:`long` value from this random number generator's sequence. + All 2 :sup:`64` possible :code:`long` values should be produced with (approximately) equal probability. + + Specified by: + :meth:`~org.hipparchus.random.RandomGenerator.nextLong` in interface :class:`~org.hipparchus.random.RandomGenerator` + + Returns: + the next pseudorandom, uniformly distributed :code:`long` value from this random number generator's sequence + + public long nextLong(long n) + + Returns a pseudorandom, uniformly distributed :code:`int` value between 0 (inclusive) and the specified value + (exclusive), drawn from this random number generator's sequence. + + Specified by: + :meth:`~org.hipparchus.random.RandomGenerator.nextLong` in interface :class:`~org.hipparchus.random.RandomGenerator` + + Parameters: + n (long): the bound on the random number to be returned. Must be positive. + + Returns: + a pseudorandom, uniformly distributed :code:`int` value between 0 (inclusive) and n (exclusive). + + + """ + ... + @typing.overload + def setSeed(self, int: int) -> None: + """ + Sets the seed of the underlying random number generator using an :code:`int` seed. + + Sequences of values generated starting with the same seeds should be identical. + + Specified by: + :meth:`~org.hipparchus.random.RandomGenerator.setSeed` in interface :class:`~org.hipparchus.random.RandomGenerator` + + Parameters: + seed (int): the seed value + + Sets the seed of the underlying random number generator using a :code:`long` seed. + + Sequences of values generated starting with the same seeds should be identical. + + Specified by: + :meth:`~org.hipparchus.random.RandomGenerator.setSeed` in interface :class:`~org.hipparchus.random.RandomGenerator` + + Parameters: + seed (long): the seed value + + Sets the seed of the underlying random number generator using an :code:`int` array seed. + + Sequences of values generated starting with the same seeds should be identical. + + Specified by: + :meth:`~org.hipparchus.random.RandomGenerator.setSeed` in interface :class:`~org.hipparchus.random.RandomGenerator` + + Parameters: + seed (int[]): the seed value + + + """ + ... @typing.overload def setSeed(self, intArray: typing.Union[typing.List[int], jpype.JArray]) -> None: ... @typing.overload def setSeed(self, long: int) -> None: ... class MersenneTwister(org.hipparchus.random.IntRandomGenerator, java.io.Serializable): + """ + public classMersenneTwister extends :class:`~org.hipparchus.random.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.random.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + This class implements a powerful pseudo-random number generator developed by Makoto Matsumoto and Takuji Nishimura + during 1996-1997. + + **Caveat:** It is recommended to use one of WELL generators rather than the MersenneTwister generator (see ` this paper + <http://www.iro.umontreal.ca/~panneton/WELLRNG.html>` for more information). + + This generator features an extremely long period (2 :sup:`19937` -1) and 623-dimensional equidistribution up to 32 bits + accuracy. The home page for this generator is located at ` http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html + <http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html>`. + + This generator is described in a paper by Makoto Matsumoto and Takuji Nishimura in 1998: `Mersenne Twister: A + 623-Dimensionally Equidistributed Uniform Pseudo-Random Number Generator + <http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/ARTICLES/mt.pdf>`, ACM Transactions on Modeling and Computer + Simulation, Vol. 8, No. 1, January 1998, pp 3--30. + + This class is mainly a Java port of the 2002-01-26 version of the generator written in C by Makoto Matsumoto and Takuji + Nishimura. Here is their original copyright: + + Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura, All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the + following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following + disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the distribution. + 3. The names of its contributors may not be used to endorse or promote products derived from this software without specific + prior written permission. + + + **THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.** + + Also see: + + - :meth:`~serialized` + """ @typing.overload def __init__(self): ... @typing.overload @@ -221,46 +1558,366 @@ class MersenneTwister(org.hipparchus.random.IntRandomGenerator, java.io.Serializ def __init__(self, intArray: typing.Union[typing.List[int], jpype.JArray]): ... @typing.overload def __init__(self, long: int): ... - def nextInt(self) -> int: ... - @typing.overload - def setSeed(self, int: int) -> None: ... + def nextInt(self) -> int: + """ + Returns the next pseudorandom, uniformly distributed :code:`int` value from this random number generator's sequence. + + All 2 :sup:`32` possible :code:`int` values should be produced with (approximately) equal probability. + + Specified by: + :meth:`~org.hipparchus.random.RandomGenerator.nextInt` in interface :class:`~org.hipparchus.random.RandomGenerator` + + Returns: + the next pseudorandom, uniformly distributed :code:`int` value from this random number generator's sequence + + public int nextInt(int n) throws :class:`~org.hipparchus.random.https:.docs.oracle.com.javase.8.docs.api.java.lang.IllegalArgumentException` + + Returns a pseudorandom, uniformly distributed :code:`int` value between 0 (inclusive) and the specified value + (exclusive), drawn from this random number generator's sequence. + + Specified by: + :meth:`~org.hipparchus.random.RandomGenerator.nextInt` in interface :class:`~org.hipparchus.random.RandomGenerator` + + Parameters: + n (int): the bound on the random number to be returned. Must be positive. + + Returns: + a pseudorandom, uniformly distributed :code:`int` value between 0 (inclusive) and n (exclusive). + + Raises: + :class:`~org.hipparchus.random.https:.docs.oracle.com.javase.8.docs.api.java.lang.IllegalArgumentException`: if n is not positive. + + + """ + ... + @typing.overload + def setSeed(self, int: int) -> None: + """ + Reinitialize the generator as if just built with the given int seed. + + The state of the generator is exactly the same as a new generator built with the same seed. + + Specified by: + :meth:`~org.hipparchus.random.RandomGenerator.setSeed` in interface :class:`~org.hipparchus.random.RandomGenerator` + + Parameters: + seed (int): the initial seed (32 bits integer) + + Reinitialize the generator as if just built with the given int array seed. + + The state of the generator is exactly the same as a new generator built with the same seed. + + Specified by: + :meth:`~org.hipparchus.random.RandomGenerator.setSeed` in interface :class:`~org.hipparchus.random.RandomGenerator` + + Parameters: + seed (int[]): the initial seed (32 bits integers array), if null the seed of the generator will be the current system time plus the + system identity hash code of this instance + + Sets the seed of the underlying random number generator using a :code:`long` seed. + + Sequences of values generated starting with the same seeds should be identical. + + Specified by: + :meth:`~org.hipparchus.random.RandomGenerator.setSeed` in interface :class:`~org.hipparchus.random.RandomGenerator` + + Parameters: + seed (long): the seed value + + + """ + ... @typing.overload def setSeed(self, intArray: typing.Union[typing.List[int], jpype.JArray]) -> None: ... class RandomDataGenerator(org.hipparchus.random.ForwardingRandomGenerator, RandomGenerator, java.io.Serializable): + """ + public classRandomDataGenerator extends :class:`~org.hipparchus.random.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.random.RandomGenerator`, :class:`~org.hipparchus.random.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + A class for generating random data. + + Also see: + + - :meth:`~serialized` + """ @typing.overload def __init__(self): ... @typing.overload def __init__(self, long: int): ... - def nextBeta(self, double: float, double2: float) -> float: ... - @typing.overload - def nextDeviate(self, realDistribution: org.hipparchus.distribution.RealDistribution) -> float: ... + def nextBeta(self, double: float, double2: float) -> float: + """ + Returns the next pseudo-random beta-distributed value with the given shape and scale parameters. + + Parameters: + alpha (double): First shape parameter (must be positive). + beta (double): Second shape parameter (must be positive). + + Returns: + beta-distributed random deviate + + + """ + ... + @typing.overload + def nextDeviate(self, realDistribution: org.hipparchus.distribution.RealDistribution) -> float: + """ + Returns a random deviate from the given distribution. + + Parameters: + dist (:class:`~org.hipparchus.distribution.RealDistribution`): the distribution to sample from + + Returns: + a random value following the given distribution + + Returns a random deviate from the given distribution. + + Parameters: + dist (:class:`~org.hipparchus.distribution.IntegerDistribution`): the distribution to sample from + + Returns: + a random value following the given distribution + + + """ + ... @typing.overload def nextDeviate(self, integerDistribution: org.hipparchus.distribution.IntegerDistribution) -> int: ... @typing.overload - def nextDeviates(self, realDistribution: org.hipparchus.distribution.RealDistribution, int: int) -> typing.MutableSequence[float]: ... + def nextDeviates(self, realDistribution: org.hipparchus.distribution.RealDistribution, int: int) -> typing.MutableSequence[float]: + """ + Returns an array of random deviates from the given distribution. + + Parameters: + dist (:class:`~org.hipparchus.distribution.RealDistribution`): the distribution to sample from + size (int): the number of values to return + + Returns: + an array of :code:`size` values following the given distribution + + Returns an array of random deviates from the given distribution. + + Parameters: + dist (:class:`~org.hipparchus.distribution.IntegerDistribution`): the distribution to sample from + size (int): the number of values to return + + Returns: + an array of :code:`size`values following the given distribution + + + """ + ... @typing.overload def nextDeviates(self, integerDistribution: org.hipparchus.distribution.IntegerDistribution, int2: int) -> typing.MutableSequence[int]: ... - def nextExponential(self, double: float) -> float: ... - def nextGamma(self, double: float, double2: float) -> float: ... + def nextExponential(self, double: float) -> float: + """ + Returns the next pseudo-random, exponentially distributed deviate. + + Parameters: + mean (double): mean of the exponential distribution + + Returns: + exponentially distributed deviate about the given mean + + + """ + ... + def nextGamma(self, double: float, double2: float) -> float: + """ + Returns the next pseudo-random gamma-distributed value with the given shape and scale parameters. + + Parameters: + shape (double): shape parameter of the distribution + scale (double): scale parameter of the distribution + + Returns: + gamma-distributed random deviate + + + """ + ... def nextHexString(self, int: int) -> str: ... - def nextInt(self, int: int, int2: int) -> int: ... - def nextLogNormal(self, double: float, double2: float) -> float: ... + def nextInt(self, int: int, int2: int) -> int: + """ + Returns a uniformly distributed random integer between lower and upper (inclusive). + + Parameters: + lower (int): lower bound for the generated value + upper (int): upper bound for the generated value + + Returns: + a random integer value within the given bounds + + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if lower is not strictly less than or equal to upper + + public int nextInt() + + Returns the next pseudorandom, uniformly distributed :code:`int` value from this random number generator's sequence. + + All 2 :sup:`32` possible :code:`int` values should be produced with (approximately) equal probability. + + Specified by: + :meth:`~org.hipparchus.random.RandomGenerator.nextInt` in interface :class:`~org.hipparchus.random.RandomGenerator` + + Returns: + the next pseudorandom, uniformly distributed :code:`int` value from this random number generator's sequence + + public int nextInt(int n) + + Returns a pseudorandom, uniformly distributed :code:`int` value between 0 (inclusive) and the specified value + (exclusive), drawn from this random number generator's sequence. + + Specified by: + :meth:`~org.hipparchus.random.RandomGenerator.nextInt` in interface :class:`~org.hipparchus.random.RandomGenerator` + + Parameters: + n (int): the bound on the random number to be returned. Must be positive. + + Returns: + a pseudorandom, uniformly distributed :code:`int` value between 0 (inclusive) and n (exclusive). + + + """ + ... + def nextLogNormal(self, double: float, double2: float) -> float: + """ + Returns the next log-normally-distributed pseudo-random deviate. + + Parameters: + shape (double): shape parameter of the log-normal distribution + scale (double): scale parameter of the log-normal distribution + + Returns: + a random value, normally distributed with the given mean and standard deviation + + + """ + ... def nextLong(self, long: int, long2: int) -> int: ... - def nextNormal(self, double: float, double2: float) -> float: ... + def nextNormal(self, double: float, double2: float) -> float: + """ + Returns the next normally-distributed pseudo-random deviate. + + Parameters: + mean (double): mean of the normal distribution + standardDeviation (double): standard deviation of the normal distribution + + Returns: + a random value, normally distributed with the given mean and standard deviation + + + """ + ... def nextPermutation(self, int: int, int2: int) -> typing.MutableSequence[int]: ... - def nextPoisson(self, double: float) -> int: ... + def nextPoisson(self, double: float) -> int: + """ + Returns a poisson-distributed deviate with the given mean. + + Parameters: + mean (double): expected value + + Returns: + poisson deviate + + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if mean is not strictly positive + + + """ + ... @typing.overload def nextSample(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int) -> typing.MutableSequence[float]: ... @typing.overload def nextSample(self, collection: typing.Union[java.util.Collection[typing.Any], typing.Sequence[typing.Any], typing.Set[typing.Any]], int: int) -> typing.MutableSequence[typing.Any]: ... - def nextSampleWithReplacement(self, int: int, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> typing.MutableSequence[int]: ... - def nextUniform(self, double: float, double2: float) -> float: ... - def nextZipf(self, int: int, double: float) -> int: ... + def nextSampleWithReplacement(self, int: int, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> typing.MutableSequence[int]: + """ + Generates a random sample of size sampleSize from {0, 1, ... , weights.length - 1}, using weights as probabilities. + + For 0 < i < weights.length, the probability that i is selected (on any draw) is weights[i]. If necessary, the weights + array is normalized to sum to 1 so that weights[i] is a probability and the array sums to 1. + + Weights can be 0, but must not be negative, infinite or NaN. At least one weight must be positive. + + Parameters: + sampleSize (int): size of sample to generate + weights (double[]): probability sampling weights + + Returns: + an array of integers between 0 and weights.length - 1 + + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if weights contains negative, NaN or infinite values or only 0s or sampleSize is less than 0 + + + """ + ... + def nextUniform(self, double: float, double2: float) -> float: + """ + Returns a double value uniformly distributed over [lower, upper] + + Parameters: + lower (double): lower bound + upper (double): upper bound + + Returns: + uniform deviate + + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if upper is less than or equal to upper + + + """ + ... + def nextZipf(self, int: int, double: float) -> int: + """ + Returns an integer value following a Zipf distribution with the given parameter. + + Parameters: + numberOfElements (int): number of elements of the distribution + exponent (double): exponent of the distribution + + Returns: + random Zipf value + + + """ + ... @staticmethod - def of(randomGenerator: RandomGenerator) -> 'RandomDataGenerator': ... + def of(randomGenerator: RandomGenerator) -> 'RandomDataGenerator': + """ + Factory method to create a :code:`RandomData` instance using the supplied :code:`RandomGenerator`. + + Parameters: + randomGenerator (:class:`~org.hipparchus.random.RandomGenerator`): source of random bits + + Returns: + a RandomData using the given RandomGenerator to source bits + + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if randomGenerator is null + + + """ + ... class Well1024a(AbstractWell): + """ + public classWell1024a extends :class:`~org.hipparchus.random.AbstractWell` + + This class implements the WELL1024a pseudo-random number generator from François Panneton, Pierre L'Ecuyer and Makoto + Matsumoto. + + This generator is described in a paper by François Panneton, Pierre L'Ecuyer and Makoto Matsumoto `Improved Long-Period + Generators Based on Linear Recurrences Modulo 2 <http://www.iro.umontreal.ca/~lecuyer/myftp/papers/wellrng.pdf>` ACM + Transactions on Mathematical Software, 32, 1 (2006). The errata for the paper are in ` wellrng-errata.txt + <http://www.iro.umontreal.ca/~lecuyer/myftp/papers/wellrng-errata.txt>`. + + Also see: + + - `WELL Random number generator <http://www.iro.umontreal.ca/~panneton/WELLRNG.html>` + - :meth:`~serialized` + """ @typing.overload def __init__(self): ... @typing.overload @@ -269,9 +1926,56 @@ class Well1024a(AbstractWell): def __init__(self, intArray: typing.Union[typing.List[int], jpype.JArray]): ... @typing.overload def __init__(self, long: int): ... - def nextInt(self) -> int: ... + def nextInt(self) -> int: + """ + Returns the next pseudorandom, uniformly distributed :code:`int` value from this random number generator's sequence. + + All 2 :sup:`32` possible :code:`int` values should be produced with (approximately) equal probability. + + Specified by: + :meth:`~org.hipparchus.random.RandomGenerator.nextInt` in interface :class:`~org.hipparchus.random.RandomGenerator` + + Returns: + the next pseudorandom, uniformly distributed :code:`int` value from this random number generator's sequence + + public int nextInt(int n) throws :class:`~org.hipparchus.random.https:.docs.oracle.com.javase.8.docs.api.java.lang.IllegalArgumentException` + + Returns a pseudorandom, uniformly distributed :code:`int` value between 0 (inclusive) and the specified value + (exclusive), drawn from this random number generator's sequence. + + Specified by: + :meth:`~org.hipparchus.random.RandomGenerator.nextInt` in interface :class:`~org.hipparchus.random.RandomGenerator` + + Parameters: + n (int): the bound on the random number to be returned. Must be positive. + + Returns: + a pseudorandom, uniformly distributed :code:`int` value between 0 (inclusive) and n (exclusive). + + Raises: + :class:`~org.hipparchus.random.https:.docs.oracle.com.javase.8.docs.api.java.lang.IllegalArgumentException`: if n is not positive. + + + """ + ... class Well19937a(AbstractWell): + """ + public classWell19937a extends :class:`~org.hipparchus.random.AbstractWell` + + This class implements the WELL19937a pseudo-random number generator from François Panneton, Pierre L'Ecuyer and Makoto + Matsumoto. + + This generator is described in a paper by François Panneton, Pierre L'Ecuyer and Makoto Matsumoto `Improved Long-Period + Generators Based on Linear Recurrences Modulo 2 <http://www.iro.umontreal.ca/~lecuyer/myftp/papers/wellrng.pdf>` ACM + Transactions on Mathematical Software, 32, 1 (2006). The errata for the paper are in ` wellrng-errata.txt + <http://www.iro.umontreal.ca/~lecuyer/myftp/papers/wellrng-errata.txt>`. + + Also see: + + - `WELL Random number generator <http://www.iro.umontreal.ca/~panneton/WELLRNG.html>` + - :meth:`~serialized` + """ @typing.overload def __init__(self): ... @typing.overload @@ -280,9 +1984,56 @@ class Well19937a(AbstractWell): def __init__(self, intArray: typing.Union[typing.List[int], jpype.JArray]): ... @typing.overload def __init__(self, long: int): ... - def nextInt(self) -> int: ... + def nextInt(self) -> int: + """ + Returns the next pseudorandom, uniformly distributed :code:`int` value from this random number generator's sequence. + + All 2 :sup:`32` possible :code:`int` values should be produced with (approximately) equal probability. + + Specified by: + :meth:`~org.hipparchus.random.RandomGenerator.nextInt` in interface :class:`~org.hipparchus.random.RandomGenerator` + + Returns: + the next pseudorandom, uniformly distributed :code:`int` value from this random number generator's sequence + + public int nextInt(int n) throws :class:`~org.hipparchus.random.https:.docs.oracle.com.javase.8.docs.api.java.lang.IllegalArgumentException` + + Returns a pseudorandom, uniformly distributed :code:`int` value between 0 (inclusive) and the specified value + (exclusive), drawn from this random number generator's sequence. + + Specified by: + :meth:`~org.hipparchus.random.RandomGenerator.nextInt` in interface :class:`~org.hipparchus.random.RandomGenerator` + + Parameters: + n (int): the bound on the random number to be returned. Must be positive. + + Returns: + a pseudorandom, uniformly distributed :code:`int` value between 0 (inclusive) and n (exclusive). + + Raises: + :class:`~org.hipparchus.random.https:.docs.oracle.com.javase.8.docs.api.java.lang.IllegalArgumentException`: if n is not positive. + + + """ + ... class Well19937c(AbstractWell): + """ + public classWell19937c extends :class:`~org.hipparchus.random.AbstractWell` + + This class implements the WELL19937c pseudo-random number generator from François Panneton, Pierre L'Ecuyer and Makoto + Matsumoto. + + This generator is described in a paper by François Panneton, Pierre L'Ecuyer and Makoto Matsumoto `Improved Long-Period + Generators Based on Linear Recurrences Modulo 2 <http://www.iro.umontreal.ca/~lecuyer/myftp/papers/wellrng.pdf>` ACM + Transactions on Mathematical Software, 32, 1 (2006). The errata for the paper are in ` wellrng-errata.txt + <http://www.iro.umontreal.ca/~lecuyer/myftp/papers/wellrng-errata.txt>`. + + Also see: + + - `WELL Random number generator <http://www.iro.umontreal.ca/~panneton/WELLRNG.html>` + - :meth:`~serialized` + """ @typing.overload def __init__(self): ... @typing.overload @@ -291,9 +2042,56 @@ class Well19937c(AbstractWell): def __init__(self, intArray: typing.Union[typing.List[int], jpype.JArray]): ... @typing.overload def __init__(self, long: int): ... - def nextInt(self) -> int: ... + def nextInt(self) -> int: + """ + Returns the next pseudorandom, uniformly distributed :code:`int` value from this random number generator's sequence. + + All 2 :sup:`32` possible :code:`int` values should be produced with (approximately) equal probability. + + Specified by: + :meth:`~org.hipparchus.random.RandomGenerator.nextInt` in interface :class:`~org.hipparchus.random.RandomGenerator` + + Returns: + the next pseudorandom, uniformly distributed :code:`int` value from this random number generator's sequence + + public int nextInt(int n) throws :class:`~org.hipparchus.random.https:.docs.oracle.com.javase.8.docs.api.java.lang.IllegalArgumentException` + + Returns a pseudorandom, uniformly distributed :code:`int` value between 0 (inclusive) and the specified value + (exclusive), drawn from this random number generator's sequence. + + Specified by: + :meth:`~org.hipparchus.random.RandomGenerator.nextInt` in interface :class:`~org.hipparchus.random.RandomGenerator` + + Parameters: + n (int): the bound on the random number to be returned. Must be positive. + + Returns: + a pseudorandom, uniformly distributed :code:`int` value between 0 (inclusive) and n (exclusive). + + Raises: + :class:`~org.hipparchus.random.https:.docs.oracle.com.javase.8.docs.api.java.lang.IllegalArgumentException`: if n is not positive. + + + """ + ... class Well44497a(AbstractWell): + """ + public classWell44497a extends :class:`~org.hipparchus.random.AbstractWell` + + This class implements the WELL44497a pseudo-random number generator from François Panneton, Pierre L'Ecuyer and Makoto + Matsumoto. + + This generator is described in a paper by François Panneton, Pierre L'Ecuyer and Makoto Matsumoto `Improved Long-Period + Generators Based on Linear Recurrences Modulo 2 <http://www.iro.umontreal.ca/~lecuyer/myftp/papers/wellrng.pdf>` ACM + Transactions on Mathematical Software, 32, 1 (2006). The errata for the paper are in ` wellrng-errata.txt + <http://www.iro.umontreal.ca/~lecuyer/myftp/papers/wellrng-errata.txt>`. + + Also see: + + - `WELL Random number generator <http://www.iro.umontreal.ca/~panneton/WELLRNG.html>` + - :meth:`~serialized` + """ @typing.overload def __init__(self): ... @typing.overload @@ -302,9 +2100,56 @@ class Well44497a(AbstractWell): def __init__(self, intArray: typing.Union[typing.List[int], jpype.JArray]): ... @typing.overload def __init__(self, long: int): ... - def nextInt(self) -> int: ... + def nextInt(self) -> int: + """ + Returns the next pseudorandom, uniformly distributed :code:`int` value from this random number generator's sequence. + + All 2 :sup:`32` possible :code:`int` values should be produced with (approximately) equal probability. + + Specified by: + :meth:`~org.hipparchus.random.RandomGenerator.nextInt` in interface :class:`~org.hipparchus.random.RandomGenerator` + + Returns: + the next pseudorandom, uniformly distributed :code:`int` value from this random number generator's sequence + + public int nextInt(int n) throws :class:`~org.hipparchus.random.https:.docs.oracle.com.javase.8.docs.api.java.lang.IllegalArgumentException` + + Returns a pseudorandom, uniformly distributed :code:`int` value between 0 (inclusive) and the specified value + (exclusive), drawn from this random number generator's sequence. + + Specified by: + :meth:`~org.hipparchus.random.RandomGenerator.nextInt` in interface :class:`~org.hipparchus.random.RandomGenerator` + + Parameters: + n (int): the bound on the random number to be returned. Must be positive. + + Returns: + a pseudorandom, uniformly distributed :code:`int` value between 0 (inclusive) and n (exclusive). + + Raises: + :class:`~org.hipparchus.random.https:.docs.oracle.com.javase.8.docs.api.java.lang.IllegalArgumentException`: if n is not positive. + + + """ + ... class Well44497b(AbstractWell): + """ + public classWell44497b extends :class:`~org.hipparchus.random.AbstractWell` + + This class implements the WELL44497b pseudo-random number generator from François Panneton, Pierre L'Ecuyer and Makoto + Matsumoto. + + This generator is described in a paper by François Panneton, Pierre L'Ecuyer and Makoto Matsumoto `Improved Long-Period + Generators Based on Linear Recurrences Modulo 2 <http://www.iro.umontreal.ca/~lecuyer/myftp/papers/wellrng.pdf>` ACM + Transactions on Mathematical Software, 32, 1 (2006). The errata for the paper are in ` wellrng-errata.txt + <http://www.iro.umontreal.ca/~lecuyer/myftp/papers/wellrng-errata.txt>`. + + Also see: + + - `WELL Random number generator <http://www.iro.umontreal.ca/~panneton/WELLRNG.html>` + - :meth:`~serialized` + """ @typing.overload def __init__(self): ... @typing.overload @@ -313,9 +2158,56 @@ class Well44497b(AbstractWell): def __init__(self, intArray: typing.Union[typing.List[int], jpype.JArray]): ... @typing.overload def __init__(self, long: int): ... - def nextInt(self) -> int: ... + def nextInt(self) -> int: + """ + Returns the next pseudorandom, uniformly distributed :code:`int` value from this random number generator's sequence. + + All 2 :sup:`32` possible :code:`int` values should be produced with (approximately) equal probability. + + Specified by: + :meth:`~org.hipparchus.random.RandomGenerator.nextInt` in interface :class:`~org.hipparchus.random.RandomGenerator` + + Returns: + the next pseudorandom, uniformly distributed :code:`int` value from this random number generator's sequence + + public int nextInt(int n) throws :class:`~org.hipparchus.random.https:.docs.oracle.com.javase.8.docs.api.java.lang.IllegalArgumentException` + + Returns a pseudorandom, uniformly distributed :code:`int` value between 0 (inclusive) and the specified value + (exclusive), drawn from this random number generator's sequence. + + Specified by: + :meth:`~org.hipparchus.random.RandomGenerator.nextInt` in interface :class:`~org.hipparchus.random.RandomGenerator` + + Parameters: + n (int): the bound on the random number to be returned. Must be positive. + + Returns: + a pseudorandom, uniformly distributed :code:`int` value between 0 (inclusive) and n (exclusive). + + Raises: + :class:`~org.hipparchus.random.https:.docs.oracle.com.javase.8.docs.api.java.lang.IllegalArgumentException`: if n is not positive. + + + """ + ... class Well512a(AbstractWell): + """ + public classWell512a extends :class:`~org.hipparchus.random.AbstractWell` + + This class implements the WELL512a pseudo-random number generator from François Panneton, Pierre L'Ecuyer and Makoto + Matsumoto. + + This generator is described in a paper by François Panneton, Pierre L'Ecuyer and Makoto Matsumoto `Improved Long-Period + Generators Based on Linear Recurrences Modulo 2 <http://www.iro.umontreal.ca/~lecuyer/myftp/papers/wellrng.pdf>` ACM + Transactions on Mathematical Software, 32, 1 (2006). The errata for the paper are in ` wellrng-errata.txt + <http://www.iro.umontreal.ca/~lecuyer/myftp/papers/wellrng-errata.txt>`. + + Also see: + + - `WELL Random number generator <http://www.iro.umontreal.ca/~panneton/WELLRNG.html>` + - :meth:`~serialized` + """ @typing.overload def __init__(self): ... @typing.overload @@ -324,7 +2216,38 @@ class Well512a(AbstractWell): def __init__(self, intArray: typing.Union[typing.List[int], jpype.JArray]): ... @typing.overload def __init__(self, long: int): ... - def nextInt(self) -> int: ... + def nextInt(self) -> int: + """ + Returns the next pseudorandom, uniformly distributed :code:`int` value from this random number generator's sequence. + + All 2 :sup:`32` possible :code:`int` values should be produced with (approximately) equal probability. + + Specified by: + :meth:`~org.hipparchus.random.RandomGenerator.nextInt` in interface :class:`~org.hipparchus.random.RandomGenerator` + + Returns: + the next pseudorandom, uniformly distributed :code:`int` value from this random number generator's sequence + + public int nextInt(int n) throws :class:`~org.hipparchus.random.https:.docs.oracle.com.javase.8.docs.api.java.lang.IllegalArgumentException` + + Returns a pseudorandom, uniformly distributed :code:`int` value between 0 (inclusive) and the specified value + (exclusive), drawn from this random number generator's sequence. + + Specified by: + :meth:`~org.hipparchus.random.RandomGenerator.nextInt` in interface :class:`~org.hipparchus.random.RandomGenerator` + + Parameters: + n (int): the bound on the random number to be returned. Must be positive. + + Returns: + a pseudorandom, uniformly distributed :code:`int` value between 0 (inclusive) and n (exclusive). + + Raises: + :class:`~org.hipparchus.random.https:.docs.oracle.com.javase.8.docs.api.java.lang.IllegalArgumentException`: if n is not positive. + + + """ + ... class ForwardingRandomGenerator: ... diff --git a/org-stubs/hipparchus/special/__init__.pyi b/org-stubs/hipparchus/special/__init__.pyi index 5ce8b07..c472773 100644 --- a/org-stubs/hipparchus/special/__init__.pyi +++ b/org-stubs/hipparchus/special/__init__.pyi @@ -14,9 +14,51 @@ import typing class BesselJ(org.hipparchus.analysis.UnivariateFunction): + """ + public classBesselJ extends :class:`~org.hipparchus.special.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.analysis.UnivariateFunction` + + This class provides computation methods related to Bessel functions of the first kind. Detailed descriptions of these + functions are available in `Wikipedia <http://en.wikipedia.org/wiki/Bessel_function>`, `Abramowitz and Stegun + <http://en.wikipedia.org/wiki/Abramowitz_and_Stegun>` (Ch. 9-11), and `DLMF <http://dlmf.nist.gov/>` (Ch. 10). + + This implementation is based on the rjbesl Fortran routine at `Netlib <http://www.netlib.org/specfun/rjbesl>`. + + From the Fortran code: + + This program is based on a program written by David J. Sookne (2) that computes values of the Bessel functions J or I of + real argument and integer order. Modifications include the restriction of the computation to the J Bessel function of + non-negative real argument, the extension of the computation to arbitrary positive order, and the elimination of most + underflow. + + References: + + - "A Note on Backward Recurrence Algorithms," Olver, F. W. J., and Sookne, D. J., Math. Comp. 26, 1972, pp 941-947. + - "Bessel Functions of Real Argument and Integer Order," Sookne, D. J., NBS Jour. of Res. B. 77B, 1973, pp 125-132. + """ def __init__(self, double: float): ... @staticmethod - def rjBesl(double: float, double2: float, int: int) -> 'BesselJ.BesselJResult': ... + def rjBesl(double: float, double2: float, int: int) -> 'BesselJ.BesselJResult': + """ + Calculates Bessel functions \(J_{n+alpha}(x)\) for non-negative argument x, and non-negative order n + alpha. + + Before using the output vector, the user should check that nVals = nb, i.e., all orders have been calculated to the + desired accuracy. See BesselResult class javadoc for details on return values. + + Parameters: + x (double): non-negative real argument for which J's are to be calculated + alpha (double): fractional part of order for which J's or exponentially scaled J's (\(J\cdot e^{x}\)) are to be calculated. 0 <= alpha < + 1.0. + nb (int): integer number of functions to be calculated, nb > 0. The first function calculated is of order alpha, and the last is + of order nb - 1 + alpha. + + Returns: + BesselJResult a vector of the functions \(J_{alpha}(x)\) through \(J_{nb-1+alpha}(x)\), or the corresponding + exponentially scaled functions and an integer output variable indicating possible errors + + + """ + ... @typing.overload def value(self, double: float) -> float: ... @typing.overload @@ -28,11 +70,111 @@ class BesselJ(org.hipparchus.analysis.UnivariateFunction): def getnVals(self) -> int: ... class Beta: - @staticmethod - def logBeta(double: float, double2: float) -> float: ... - @typing.overload - @staticmethod - def regularizedBeta(double: float, double2: float, double3: float) -> float: ... + """ + public classBeta extends :class:`~org.hipparchus.special.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + + This is a utility class that provides computation methods related to the Beta family of functions. + + Implementation of :meth:`~org.hipparchus.special.Beta.logBeta` is based on the algorithms described in + + - `Didonato and Morris (1986) <http://dx.doi.org/10.1145/22721.23109>`, *Computation of the Incomplete Gamma Function + Ratios and their Inverse*, TOMS 12(4), 377-393, + - `Didonato and Morris (1992) <http://dx.doi.org/10.1145/131766.131776>`, *Algorithm 708: Significant Digit Computation of + the Incomplete Beta Function Ratios*, TOMS 18(3), 360-373, + + + and implemented in the `NSWC Library of Mathematical Functions <http://www.dtic.mil/docs/citations/ADA476840>`, + available `here <http://www.ualberta.ca/CNS/RESEARCH/Software/NumericalNSWC/site.html>`. This library is "approved for + public release", and the `Copyright guidance <http://www.dtic.mil/dtic/pdf/announcements/CopyrightGuidance.pdf>` + indicates that unless otherwise stated in the code, all FORTRAN functions in this library are license free. Since no + such notice appears in the code these functions can safely be ported to Hipparchus. + """ + @staticmethod + def logBeta(double: float, double2: float) -> float: + """ + Returns the value of log B(p, q) for 0 ≤ x ≤ 1 and p, q > 0. Based on the *NSWC Library of Mathematics Subroutines* + implementation, :code:`DBETLN`. + + Parameters: + p (double): First argument. + q (double): Second argument. + + Returns: + the value of :code:`log(Beta(p, q))`, :code:`NaN` if :code:`p <= 0` or :code:`q <= 0`. + + + """ + ... + @typing.overload + @staticmethod + def regularizedBeta(double: float, double2: float, double3: float) -> float: + """ + Returns the ` regularized beta function <http://mathworld.wolfram.com/RegularizedBetaFunction.html>` I(x, a, b). + + Parameters: + x (double): Value. + a (double): Parameter :code:`a`. + b (double): Parameter :code:`b`. + + Returns: + the regularized beta function I(x, a, b). + + Raises: + :class:`~org.hipparchus.exception.MathIllegalStateException`: if the algorithm fails to converge. + + Returns the ` regularized beta function <http://mathworld.wolfram.com/RegularizedBetaFunction.html>` I(x, a, b). + + Parameters: + x (double): Value. + a (double): Parameter :code:`a`. + b (double): Parameter :code:`b`. + epsilon (double): When the absolute value of the nth item in the series is less than epsilon the approximation ceases to calculate further + elements in the series. + + Returns: + the regularized beta function I(x, a, b) + + Raises: + :class:`~org.hipparchus.exception.MathIllegalStateException`: if the algorithm fails to converge. + + Returns the regularized beta function I(x, a, b). + + Parameters: + x (double): the value. + a (double): Parameter :code:`a`. + b (double): Parameter :code:`b`. + maxIterations (int): Maximum number of "iterations" to complete. + + Returns: + the regularized beta function I(x, a, b) + + Raises: + :class:`~org.hipparchus.exception.MathIllegalStateException`: if the algorithm fails to converge. + + Returns the regularized beta function I(x, a, b). The implementation of this method is based on: + + - ` Regularized Beta Function <http://mathworld.wolfram.com/RegularizedBetaFunction.html>`. + - ` Regularized Beta Function <http://functions.wolfram.com/06.21.10.0001.01>`. + + + Parameters: + x (double): the value. + a (double): Parameter :code:`a`. + b (double): Parameter :code:`b`. + epsilon (double): When the absolute value of the nth item in the series is less than epsilon the approximation ceases to calculate further + elements in the series. + maxIterations (int): Maximum number of "iterations" to complete. + + Returns: + the regularized beta function I(x, a, b) + + Raises: + :class:`~org.hipparchus.exception.MathIllegalStateException`: if the algorithm fails to converge. + + + """ + ... @typing.overload @staticmethod def regularizedBeta(double: float, double2: float, double3: float, double4: float) -> float: ... @@ -44,80 +186,511 @@ class Beta: def regularizedBeta(double: float, double2: float, double3: float, int: int) -> float: ... class Erf: + """ + public classErf extends :class:`~org.hipparchus.special.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + This is a utility class that provides computation methods related to the error functions. + """ _erf_2__T = typing.TypeVar('_erf_2__T', bound=org.hipparchus.CalculusFieldElement) # <T> _erf_3__T = typing.TypeVar('_erf_3__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload @staticmethod - def erf(double: float) -> float: ... + def erf(double: float) -> float: + """ + Returns the error function. \[ \mathrm{erf}(x) = \frac{2}{\sqrt{\pi}} \int_{t=0}^x e^{-t^2}dt \] + + This implementation computes erf(x) using the :meth:`~org.hipparchus.special.Gamma.regularizedGammaP`, following ` Erf + <http://mathworld.wolfram.com/Erf.html>`, equation (3) + + The value returned is always between -1 and 1 (inclusive). If :code:`abs(x) > 40`, then :code:`erf(x)` is + indistinguishable from either 1 or -1 as a double, so the appropriate extreme value is returned. + + Parameters: + x (double): the value. + + Returns: + the error function erf(x) + + Raises: + :class:`~org.hipparchus.exception.MathIllegalStateException`: if the algorithm fails to converge. + + Also see: + + - :meth:`~org.hipparchus.special.Gamma.regularizedGammaP` + + + Returns the difference between erf(x1) and erf(x2). + + The implementation uses either erf(double) or erfc(double) depending on which provides the most precise result. + + Parameters: + x1 (double): the first value + x2 (double): the second value + + Returns: + erf(x2) - erf(x1) + + """ + ... @typing.overload @staticmethod def erf(double: float, double2: float) -> float: ... @typing.overload @staticmethod - def erf(t: _erf_2__T) -> _erf_2__T: ... + def erf(t: _erf_2__T) -> _erf_2__T: + """ + Returns the error function. \[ \mathrm{erf}(x) = \frac{2}{\sqrt{\pi}} \int_{t=0}^x e^{-t^2}dt \] + + This implementation computes erf(x) using the :meth:`~org.hipparchus.special.Gamma.regularizedGammaP`, following ` Erf + <http://mathworld.wolfram.com/Erf.html>`, equation (3) + + The value returned is always between -1 and 1 (inclusive). If :code:`abs(x) > 40`, then :code:`erf(x)` is + indistinguishable from either 1 or -1 as a double, so the appropriate extreme value is returned. + + Parameters: + x (T): the value. + + Returns: + the error function erf(x) + + Raises: + :class:`~org.hipparchus.exception.MathIllegalStateException`: if the algorithm fails to converge. + + Also see: + + - :meth:`~org.hipparchus.special.Gamma.regularizedGammaP` + + + Returns the difference between erf(x1) and erf(x2). + + The implementation uses either erf(double) or erfc(double) depending on which provides the most precise result. + + Parameters: + x1 (T): the first value + x2 (T): the second value + + Returns: + erf(x2) - erf(x1) + + + """ + ... @typing.overload @staticmethod def erf(t: _erf_3__T, t2: _erf_3__T) -> _erf_3__T: ... _erfInv_1__T = typing.TypeVar('_erfInv_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload @staticmethod - def erfInv(double: float) -> float: ... - @typing.overload - @staticmethod - def erfInv(t: _erfInv_1__T) -> _erfInv_1__T: ... + def erfInv(double: float) -> float: + """ + Returns the inverse erf. + + This implementation is described in the paper: `Approximating the erfinv function + <http://people.maths.ox.ac.uk/gilesm/files/gems_erfinv.pdf>` by Mike Giles, Oxford-Man Institute of Quantitative + Finance, which was published in GPU Computing Gems, volume 2, 2010. The source code is available `here + <http://gpucomputing.net/?q=node/1828>`. + + Parameters: + x (double): the value + + Returns: + t such that x = erf(t) + + """ + ... + @typing.overload + @staticmethod + def erfInv(t: _erfInv_1__T) -> _erfInv_1__T: + """ + Returns the inverse erf. + + This implementation is described in the paper: `Approximating the erfinv function + <http://people.maths.ox.ac.uk/gilesm/files/gems_erfinv.pdf>` by Mike Giles, Oxford-Man Institute of Quantitative + Finance, which was published in GPU Computing Gems, volume 2, 2010. The source code is available `here + <http://gpucomputing.net/?q=node/1828>`. + + Parameters: + x (T): the value + + Returns: + t such that x = erf(t) + + + """ + ... _erfc_1__T = typing.TypeVar('_erfc_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload @staticmethod - def erfc(double: float) -> float: ... - @typing.overload - @staticmethod - def erfc(t: _erfc_1__T) -> _erfc_1__T: ... + def erfc(double: float) -> float: + """ + Returns the complementary error function. \[ \mathrm{erfc}(x) = \frac{2}{\sqrt{\pi}} \int_{t=x}^\infty e^{-t^2}dt = 1 - + \mathrm{erf} + + This implementation computes erfc(x) using the :meth:`~org.hipparchus.special.Gamma.regularizedGammaQ`, following ` Erf + <http://mathworld.wolfram.com/Erf.html>`, equation (3). + + The value returned is always between 0 and 2 (inclusive). If :code:`abs(x) > 40`, then :code:`erf(x)` is + indistinguishable from either 0 or 2 as a double, so the appropriate extreme value is returned. + + Parameters: + x (double): the value + + Returns: + the complementary error function erfc(x) + + Raises: + :class:`~org.hipparchus.exception.MathIllegalStateException`: if the algorithm fails to converge. + + Also see: + + - :meth:`~org.hipparchus.special.Gamma.regularizedGammaQ` + + + """ + ... + @typing.overload + @staticmethod + def erfc(t: _erfc_1__T) -> _erfc_1__T: + """ + Returns the complementary error function. \[ erfc(x) = \frac{2}{\sqrt{\pi}} \int_x^\infty e^{-t^2}dt = 1 - erf(x) \] + + This implementation computes erfc(x) using the :meth:`~org.hipparchus.special.Gamma.regularizedGammaQ`, following ` Erf + <http://mathworld.wolfram.com/Erf.html>`, equation (3). + + The value returned is always between 0 and 2 (inclusive). If :code:`abs(x) > 40`, then :code:`erf(x)` is + indistinguishable from either 0 or 2 as a double, so the appropriate extreme value is returned. **This implies that the + current implementation does not allow the use of :class:`~org.hipparchus.dfp.Dfp` with extended precision.** + + Parameters: + x (T): the value + + Returns: + the complementary error function erfc(x) + + Raises: + :class:`~org.hipparchus.exception.MathIllegalStateException`: if the algorithm fails to converge. + + Also see: + + - :meth:`~org.hipparchus.special.Gamma.regularizedGammaQ` + + + + """ + ... _erfcInv_1__T = typing.TypeVar('_erfcInv_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload @staticmethod - def erfcInv(double: float) -> float: ... - @typing.overload - @staticmethod - def erfcInv(t: _erfcInv_1__T) -> _erfcInv_1__T: ... + def erfcInv(double: float) -> float: + """ + Returns the inverse erfc. + + Parameters: + x (double): the value + + Returns: + t such that x = erfc(t) + + """ + ... + @typing.overload + @staticmethod + def erfcInv(t: _erfcInv_1__T) -> _erfcInv_1__T: + """ + Returns the inverse erfc. + + Parameters: + x (T): the value + + Returns: + t such that x = erfc(t) + + + """ + ... class Gamma: + """ + public classGamma extends :class:`~org.hipparchus.special.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + + This is a utility class that provides computation methods related to the Γ (Gamma) family of functions. + + Implementation of :meth:`~org.hipparchus.special.Gamma.invGamma1pm1` and + :meth:`~org.hipparchus.special.Gamma.logGamma1p` is based on the algorithms described in + + - `Didonato and Morris (1986) <http://dx.doi.org/10.1145/22721.23109>`, *Computation of the Incomplete Gamma Function + Ratios and their Inverse*, TOMS 12(4), 377-393, + - `Didonato and Morris (1992) <http://dx.doi.org/10.1145/131766.131776>`, *Algorithm 708: Significant Digit Computation of + the Incomplete Beta Function Ratios*, TOMS 18(3), 360-373, + + + and implemented in the `NSWC Library of Mathematical Functions <http://www.dtic.mil/docs/citations/ADA476840>`, + available `here <http://www.ualberta.ca/CNS/RESEARCH/Software/NumericalNSWC/site.html>`. This library is "approved for + public release", and the `Copyright guidance <http://www.dtic.mil/dtic/pdf/announcements/CopyrightGuidance.pdf>` + indicates that unless otherwise stated in the code, all FORTRAN functions in this library are license free. Since no + such notice appears in the code these functions can safely be ported to Hipparchus. + """ GAMMA: typing.ClassVar[float] = ... + """ + public static final double GAMMA + + `Euler-Mascheroni constant <http://en.wikipedia.org/wiki/Euler-Mascheroni_constant>` + + Also see: + + - :meth:`~constant` + + + + """ LANCZOS_G: typing.ClassVar[float] = ... + """ + public static final double LANCZOS_G + + The value of the :code:`g` constant in the Lanczos approximation, see :meth:`~org.hipparchus.special.Gamma.lanczos`. + + Also see: + + - :meth:`~constant` + + + + """ _digamma_1__T = typing.TypeVar('_digamma_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload @staticmethod - def digamma(double: float) -> float: ... - @typing.overload - @staticmethod - def digamma(t: _digamma_1__T) -> _digamma_1__T: ... + def digamma(double: float) -> float: + """ + + Computes the digamma function of x. + + This is an independently written implementation of the algorithm described in Jose Bernardo, Algorithm AS 103: Psi + (Digamma) Function, Applied Statistics, 1976. + + Some of the constants have been changed to increase accuracy at the moderate expense of run-time. The result should be + accurate to within 10^-8 absolute tolerance for x >= 10^-5 and within 10^-8 relative tolerance for x > 0. + + Performance for large negative values of x will be quite expensive (proportional to |x|). Accuracy for negative values + of x should be about 10^-8 absolute for results less than 10^5 and 10^-8 relative for results larger than that. + + Parameters: + x (double): Argument. + + Returns: + digamma(x) to within 10-8 relative or absolute error whichever is smaller. + + Also see: + + - `Digamma <http://en.wikipedia.org/wiki/Digamma_function>` + - `Bernardo's original article <http://www.uv.es/~bernardo/1976AppStatist.pdf>` + + + """ + ... + @typing.overload + @staticmethod + def digamma(t: _digamma_1__T) -> _digamma_1__T: + """ + + Computes the digamma function of x. + + This is an independently written implementation of the algorithm described in Jose Bernardo, Algorithm AS 103: Psi + (Digamma) Function, Applied Statistics, 1976. + + Some of the constants have been changed to increase accuracy at the moderate expense of run-time. The result should be + accurate to within 10^-8 absolute tolerance for x >= 10^-5 and within 10^-8 relative tolerance for x > 0. + + Performance for large negative values of x will be quite expensive (proportional to |x|). Accuracy for negative values + of x should be about 10^-8 absolute for results less than 10^5 and 10^-8 relative for results larger than that. + + Parameters: + x (T): Argument. + + Returns: + digamma(x) to within 10-8 relative or absolute error whichever is smaller. + + Also see: + + - `Digamma <http://en.wikipedia.org/wiki/Digamma_function>` + - `Bernardo's original article <http://www.uv.es/~bernardo/1976AppStatist.pdf>` + + + + """ + ... _gamma_1__T = typing.TypeVar('_gamma_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload @staticmethod - def gamma(double: float) -> float: ... - @typing.overload - @staticmethod - def gamma(t: _gamma_1__T) -> _gamma_1__T: ... + def gamma(double: float) -> float: + """ + Returns the value of Γ(x). Based on the *NSWC Library of Mathematics Subroutines* double precision implementation, + :code:`DGAMMA`. + + Parameters: + x (double): Argument. + + Returns: + the value of :code:`Gamma(x)`. + + """ + ... + @typing.overload + @staticmethod + def gamma(t: _gamma_1__T) -> _gamma_1__T: + """ + Returns the value of Γ(x). Based on the *NSWC Library of Mathematics Subroutines* double precision implementation, + :code:`DGAMMA`. + + Parameters: + x (T): Argument. + + Returns: + the value of :code:`Gamma(x)`. + + + """ + ... _invGamma1pm1_1__T = typing.TypeVar('_invGamma1pm1_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload @staticmethod - def invGamma1pm1(double: float) -> float: ... - @typing.overload - @staticmethod - def invGamma1pm1(t: _invGamma1pm1_1__T) -> _invGamma1pm1_1__T: ... + def invGamma1pm1(double: float) -> float: + """ + Returns the value of 1 / Γ(1 + x) - 1 for -0.5 ≤ x ≤ 1.5. This implementation is based on the double precision + implementation in the *NSWC Library of Mathematics Subroutines*, :code:`DGAM1`. + + Parameters: + x (double): Argument. + + Returns: + The value of :code:`1.0 / Gamma(1.0 + x) - 1.0`. + + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if :code:`x < -0.5` + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if :code:`x > 1.5` + + """ + ... + @typing.overload + @staticmethod + def invGamma1pm1(t: _invGamma1pm1_1__T) -> _invGamma1pm1_1__T: + """ + Returns the value of 1 / Γ(1 + x) - 1 for -0.5 ≤ x ≤ 1.5. This implementation is based on the double precision + implementation in the *NSWC Library of Mathematics Subroutines*, :code:`DGAM1`. + + Parameters: + x (T): Argument. + + Returns: + The value of :code:`1.0 / Gamma(1.0 + x) - 1.0`. + + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if :code:`x < -0.5` + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if :code:`x > 1.5` + + + """ + ... _lanczos_1__T = typing.TypeVar('_lanczos_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload @staticmethod - def lanczos(double: float) -> float: ... - @typing.overload - @staticmethod - def lanczos(t: _lanczos_1__T) -> _lanczos_1__T: ... + def lanczos(double: float) -> float: + """ + + Returns the Lanczos approximation used to compute the gamma function. The Lanczos approximation is related to the Gamma + function by the following equation \[ \Gamma(x) = \frac{\sqrt{2\pi}}{x} \times (x + g + \frac{1}{2}) ^ (x + \frac{1}{2}) + \times e^{-x - g - 0.5} \times \mathrm{lanczos}(x) \] where :code:`g` is the Lanczos constant. + + Parameters: + x (double): Argument. + + Returns: + The Lanczos approximation. + + Also see: + + - `Lanczos Approximation <http://mathworld.wolfram.com/LanczosApproximation.html>` equations (1) through (5), and Paul + Godfrey's `Note on the computation of the convergent Lanczos complex Gamma approximation + <http://my.fit.edu/~gabdo/gamma.txt>` + + + """ + ... + @typing.overload + @staticmethod + def lanczos(t: _lanczos_1__T) -> _lanczos_1__T: + """ + + Returns the Lanczos approximation used to compute the gamma function. The Lanczos approximation is related to the Gamma + function by the following equation \[ \Gamma(x) = \frac{\sqrt{2\pi}}{x} \times (x + g + \frac{1}{2}) ^ (x + \frac{1}{2}) + \times e^{-x - g - 0.5} \times \mathrm{lanczos}(x) \] where :code:`g` is the Lanczos constant. + + Parameters: + x (T): Argument. + + Returns: + The Lanczos approximation. + + Also see: + + - `Lanczos Approximation <http://mathworld.wolfram.com/LanczosApproximation.html>` equations (1) through (5), and Paul + Godfrey's `Note on the computation of the convergent Lanczos complex Gamma approximation + <http://my.fit.edu/~gabdo/gamma.txt>` + + + + """ + ... _logGamma_1__T = typing.TypeVar('_logGamma_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload @staticmethod - def logGamma(double: float) -> float: ... - @typing.overload - @staticmethod - def logGamma(t: _logGamma_1__T) -> _logGamma_1__T: ... + def logGamma(double: float) -> float: + """ + + Returns the value of log Γ(x) for x > 0. + + For x ≤ 8, the implementation is based on the double precision implementation in the *NSWC Library of Mathematics + Subroutines*, :code:`DGAMLN`. For x > 8, the implementation is based on + + - `Gamma Function <http://mathworld.wolfram.com/GammaFunction.html>`, equation (28). + - ` Lanczos Approximation <http://mathworld.wolfram.com/LanczosApproximation.html>`, equations (1) through (5). + - `Paul Godfrey, A note on the computation of the convergent Lanczos complex Gamma approximation + <http://my.fit.edu/~gabdo/gamma.txt>` + + + Parameters: + x (double): Argument. + + Returns: + the value of :code:`log(Gamma(x))`, :code:`Double.NaN` if :code:`x <= 0.0`. + + """ + ... + @typing.overload + @staticmethod + def logGamma(t: _logGamma_1__T) -> _logGamma_1__T: + """ + + Returns the value of log Γ(x) for x > 0. + + For x ≤ 8, the implementation is based on the double precision implementation in the *NSWC Library of Mathematics + Subroutines*, :code:`DGAMLN`. For x > 8, the implementation is based on + + - `Gamma Function <http://mathworld.wolfram.com/GammaFunction.html>`, equation (28). + - ` Lanczos Approximation <http://mathworld.wolfram.com/LanczosApproximation.html>`, equations (1) through (5). + - `Paul Godfrey, A note on the computation of the convergent Lanczos complex Gamma approximation + <http://my.fit.edu/~gabdo/gamma.txt>` + + + Parameters: + x (T): Argument. + + Returns: + the value of :code:`log(Gamma(x))`, :code:`Double.NaN` if :code:`x <= 0.0`. + + + """ + ... _logGamma1p_1__T = typing.TypeVar('_logGamma1p_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload @staticmethod @@ -129,13 +702,90 @@ class Gamma: _regularizedGammaP_3__T = typing.TypeVar('_regularizedGammaP_3__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload @staticmethod - def regularizedGammaP(double: float, double2: float) -> float: ... + def regularizedGammaP(double: float, double2: float) -> float: + """ + Returns the regularized gamma function P(a, x). + + Parameters: + a (double): Parameter. + x (double): Value. + + Returns: + the regularized gamma function P(a, x). + + Raises: + :class:`~org.hipparchus.exception.MathIllegalStateException`: if the algorithm fails to converge. + + Returns the regularized gamma function P(a, x). + + The implementation of this method is based on: + + - ` Regularized Gamma Function <http://mathworld.wolfram.com/RegularizedGammaFunction.html>`, equation (1) + - ` Incomplete Gamma Function <http://mathworld.wolfram.com/IncompleteGammaFunction.html>`, equation (4). + - ` Confluent Hypergeometric Function of the First Kind + <http://mathworld.wolfram.com/ConfluentHypergeometricFunctionoftheFirstKind.html>`, equation (1). + + + Parameters: + a (double): the a parameter. + x (double): the value. + epsilon (double): When the absolute value of the nth item in the series is less than epsilon the approximation ceases to calculate further + elements in the series. + maxIterations (int): Maximum number of "iterations" to complete. + + Returns: + the regularized gamma function P(a, x) + + Raises: + :class:`~org.hipparchus.exception.MathIllegalStateException`: if the algorithm fails to converge. + + """ + ... @typing.overload @staticmethod def regularizedGammaP(double: float, double2: float, double3: float, int: int) -> float: ... @typing.overload @staticmethod - def regularizedGammaP(t: _regularizedGammaP_2__T, t2: _regularizedGammaP_2__T) -> _regularizedGammaP_2__T: ... + def regularizedGammaP(t: _regularizedGammaP_2__T, t2: _regularizedGammaP_2__T) -> _regularizedGammaP_2__T: + """ + Returns the regularized gamma function P(a, x). + + Parameters: + a (T): Parameter. + x (T): Value. + + Returns: + the regularized gamma function P(a, x). + + Raises: + :class:`~org.hipparchus.exception.MathIllegalStateException`: if the algorithm fails to converge. + + Returns the regularized gamma function P(a, x). + + The implementation of this method is based on: + + - ` Regularized Gamma Function <http://mathworld.wolfram.com/RegularizedGammaFunction.html>`, equation (1) + - ` Incomplete Gamma Function <http://mathworld.wolfram.com/IncompleteGammaFunction.html>`, equation (4). + - ` Confluent Hypergeometric Function of the First Kind + <http://mathworld.wolfram.com/ConfluentHypergeometricFunctionoftheFirstKind.html>`, equation (1). + + + Parameters: + a (T): the a parameter. + x (T): the value. + epsilon (double): When the absolute value of the nth item in the series is less than epsilon the approximation ceases to calculate further + elements in the series. + maxIterations (int): Maximum number of "iterations" to complete. + + Returns: + the regularized gamma function P(a, x) + + Raises: + :class:`~org.hipparchus.exception.MathIllegalStateException`: if the algorithm fails to converge. + + + """ + ... @typing.overload @staticmethod def regularizedGammaP(t: _regularizedGammaP_3__T, t2: _regularizedGammaP_3__T, double: float, int: int) -> _regularizedGammaP_3__T: ... @@ -143,23 +793,133 @@ class Gamma: _regularizedGammaQ_3__T = typing.TypeVar('_regularizedGammaQ_3__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload @staticmethod - def regularizedGammaQ(double: float, double2: float) -> float: ... + def regularizedGammaQ(double: float, double2: float) -> float: + """ + Returns the regularized gamma function Q(a, x) = 1 - P(a, x). + + Parameters: + a (double): the a parameter. + x (double): the value. + + Returns: + the regularized gamma function Q(a, x) + + Raises: + :class:`~org.hipparchus.exception.MathIllegalStateException`: if the algorithm fails to converge. + + Returns the regularized gamma function Q(a, x) = 1 - P(a, x). + + The implementation of this method is based on: + + - ` Regularized Gamma Function <http://mathworld.wolfram.com/RegularizedGammaFunction.html>`, equation (1). + - ` Regularized incomplete gamma function: Continued fraction representations (formula 06.08.10.0003) + <http://functions.wolfram.com/GammaBetaErf/GammaRegularized/10/0003/>` + + + Parameters: + a (double): the a parameter. + x (double): the value. + epsilon (double): When the absolute value of the nth item in the series is less than epsilon the approximation ceases to calculate further + elements in the series. + maxIterations (int): Maximum number of "iterations" to complete. + + Returns: + the regularized gamma function P(a, x) + + Raises: + :class:`~org.hipparchus.exception.MathIllegalStateException`: if the algorithm fails to converge. + + """ + ... @typing.overload @staticmethod def regularizedGammaQ(double: float, double2: float, double3: float, int: int) -> float: ... @typing.overload @staticmethod - def regularizedGammaQ(t: _regularizedGammaQ_2__T, t2: _regularizedGammaQ_2__T) -> _regularizedGammaQ_2__T: ... + def regularizedGammaQ(t: _regularizedGammaQ_2__T, t2: _regularizedGammaQ_2__T) -> _regularizedGammaQ_2__T: + """ + Returns the regularized gamma function Q(a, x) = 1 - P(a, x). + + Parameters: + a (T): the a parameter. + x (T): the value. + + Returns: + the regularized gamma function Q(a, x) + + Raises: + :class:`~org.hipparchus.exception.MathIllegalStateException`: if the algorithm fails to converge. + + Returns the regularized gamma function Q(a, x) = 1 - P(a, x). + + The implementation of this method is based on: + + - ` Regularized Gamma Function <http://mathworld.wolfram.com/RegularizedGammaFunction.html>`, equation (1). + - ` Regularized incomplete gamma function: Continued fraction representations (formula 06.08.10.0003) + <http://functions.wolfram.com/GammaBetaErf/GammaRegularized/10/0003/>` + + + Parameters: + a (T): the a parameter. + x (T): the value. + epsilon (double): When the absolute value of the nth item in the series is less than epsilon the approximation ceases to calculate further + elements in the series. + maxIterations (int): Maximum number of "iterations" to complete. + + Returns: + the regularized gamma function P(a, x) + + Raises: + :class:`~org.hipparchus.exception.MathIllegalStateException`: if the algorithm fails to converge. + + + """ + ... @typing.overload @staticmethod def regularizedGammaQ(t: _regularizedGammaQ_3__T, t2: _regularizedGammaQ_3__T, double: float, int: int) -> _regularizedGammaQ_3__T: ... _trigamma_1__T = typing.TypeVar('_trigamma_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload @staticmethod - def trigamma(double: float) -> float: ... - @typing.overload - @staticmethod - def trigamma(t: _trigamma_1__T) -> _trigamma_1__T: ... + def trigamma(double: float) -> float: + """ + Computes the trigamma function of x. This function is derived by taking the derivative of the implementation of digamma. + + Parameters: + x (double): Argument. + + Returns: + trigamma(x) to within 10-8 relative or absolute error whichever is smaller + + Also see: + + - `Trigamma <http://en.wikipedia.org/wiki/Trigamma_function>` + - :meth:`~org.hipparchus.special.Gamma.digamma` + + + """ + ... + @typing.overload + @staticmethod + def trigamma(t: _trigamma_1__T) -> _trigamma_1__T: + """ + Computes the trigamma function of x. This function is derived by taking the derivative of the implementation of digamma. + + Parameters: + x (T): Argument. + + Returns: + trigamma(x) to within 10-8 relative or absolute error whichever is smaller + + Also see: + + - `Trigamma <http://en.wikipedia.org/wiki/Trigamma_function>` + - :meth:`~org.hipparchus.special.Gamma.digamma` + + + + """ + ... class __module_protocol__(Protocol): diff --git a/org-stubs/hipparchus/special/elliptic/carlson/__init__.pyi b/org-stubs/hipparchus/special/elliptic/carlson/__init__.pyi index ce6be55..2afc917 100644 --- a/org-stubs/hipparchus/special/elliptic/carlson/__init__.pyi +++ b/org-stubs/hipparchus/special/elliptic/carlson/__init__.pyi @@ -12,14 +12,94 @@ import typing class CarlsonEllipticIntegral: + """ + public classCarlsonEllipticIntegral extends :class:`~org.hipparchus.special.elliptic.carlson.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Elliptic integrals in Carlson symmetric form. + + This utility class computes the various symmetric elliptic integrals defined as: \[ \left\{\begin{align} R_F(x,y,z) &= + \frac{1}{2}\int_{0}^{\infty}\frac{\mathrm{d}t}{s(t)}\\ R_J(x,y,z,p) &= + \frac{3}{2}\int_{0}^{\infty}\frac{\mathrm{d}t}{s(t)(t+p)}\\ R_G(x,y,z) &= \frac{1}{4}\int_{0}^{\infty}\frac{1}{s(t)} + \left(\frac{x}{t+x}+\frac{y}{t+y}+\frac{z}{t+z}\right)t\mathrm{d}t\\ R_D(x,y,z) &= R_J(x,y,z,z)\\ R_C(x,y) &= R_F(x,y,y) + \end{align}\right. \] + + where \[ s(t) = \sqrt{t+x}\sqrt{t+y}\sqrt{t+z} \] + + The algorithms used are based on the duplication method as described in B. C. Carlson 1995 paper "Numerical computation + of real or complex elliptic integrals", with the improvements described in the appendix of B. C. Carlson and James + FitzSimons 2000 paper "Reduction theorems for elliptic integrands with the square root of two quadratic factors". They + are also described in :meth:`~org.hipparchus.special.elliptic.carlson.https:.dlmf.nist.gov.19.36#i` of Digital Library + of Mathematical Functions. + + *Beware that when computing elliptic integrals in the complex plane, many issues arise due to branch cuts. See the + :meth:`~org.hipparchus.special.elliptic.carlson.https:.www.hipparchus.org.hipparchus` for a thorough explanation.* + + Since: + 2.0 + """ _rC_1__T = typing.TypeVar('_rC_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> _rC_3__T = typing.TypeVar('_rC_3__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload @staticmethod - def rC(double: float, double2: float) -> float: ... + def rC(double: float, double2: float) -> float: + """ + Compute Carlson elliptic integral R :sub:`C` . + + The Carlson elliptic integral R :sub:`C` is defined as \[ + R_C(x,y,z)=R_F(x,y,y)=\frac{1}{2}\int_{0}^{\infty}\frac{\mathrm{d}t}{\sqrt{t+x}(t+y)} \] + + Parameters: + x (double): first symmetric variable of the integral + y (double): second symmetric variable of the integral + + Returns: + Carlson elliptic integral R :sub:`C` + + Compute Carlson elliptic integral R :sub:`C` . + + The Carlson elliptic integral R :sub:`C` is defined as \[ + R_C(x,y,z)=R_F(x,y,y)=\frac{1}{2}\int_{0}^{\infty}\frac{\mathrm{d}t}{\sqrt{t+x}(t+y)} \] + + Parameters: + x (:class:`~org.hipparchus.complex.Complex`): first symmetric variable of the integral + y (:class:`~org.hipparchus.complex.Complex`): second symmetric variable of the integral + + Returns: + Carlson elliptic integral R :sub:`C` + + """ + ... @typing.overload @staticmethod - def rC(t: _rC_1__T, t2: _rC_1__T) -> _rC_1__T: ... + def rC(t: _rC_1__T, t2: _rC_1__T) -> _rC_1__T: + """ + Compute Carlson elliptic integral R :sub:`C` . + + The Carlson elliptic integral R :sub:`C` is defined as \[ + R_C(x,y,z)=R_F(x,y,y)=\frac{1}{2}\int_{0}^{\infty}\frac{\mathrm{d}t}{\sqrt{t+x}(t+y)} \] + + Parameters: + x (T): first symmetric variable of the integral + y (T): second symmetric variable of the integral + + Returns: + Carlson elliptic integral R :sub:`C` + + Compute Carlson elliptic integral R :sub:`C` . + + The Carlson elliptic integral R :sub:`C` is defined as \[ + R_C(x,y,z)=R_F(x,y,y)=\frac{1}{2}\int_{0}^{\infty}\frac{\mathrm{d}t}{\sqrt{t+x}(t+y)} \] + + Parameters: + x (:class:`~org.hipparchus.complex.FieldComplex`<T> x): first symmetric variable of the integral + y (:class:`~org.hipparchus.complex.FieldComplex`<T> y): second symmetric variable of the integral + + Returns: + Carlson elliptic integral R :sub:`C` + + + """ + ... @typing.overload @staticmethod def rC(complex: org.hipparchus.complex.Complex, complex2: org.hipparchus.complex.Complex) -> org.hipparchus.complex.Complex: ... @@ -30,10 +110,69 @@ class CarlsonEllipticIntegral: _rD_3__T = typing.TypeVar('_rD_3__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload @staticmethod - def rD(double: float, double2: float, double3: float) -> float: ... + def rD(double: float, double2: float, double3: float) -> float: + """ + Compute Carlson elliptic integral R :sub:`D` . + + The Carlson elliptic integral R :sub:`D` is defined as \[ + R_D(x,y,z)=\frac{3}{2}\int_{0}^{\infty}\frac{\mathrm{d}t}{\sqrt{t+x}\sqrt{t+y}\sqrt{t+z}(t+z)} \] + + Parameters: + x (double): first symmetric variable of the integral + y (double): second symmetric variable of the integral + z (double): third symmetric variable of the integral + + Returns: + Carlson elliptic integral R :sub:`D` + + Compute Carlson elliptic integral R :sub:`D` . + + The Carlson elliptic integral R :sub:`D` is defined as \[ + R_D(x,y,z)=\frac{3}{2}\int_{0}^{\infty}\frac{\mathrm{d}t}{\sqrt{t+x}\sqrt{t+y}\sqrt{t+z}(t+z)} \] + + Parameters: + x (:class:`~org.hipparchus.complex.Complex`): first symmetric variable of the integral + y (:class:`~org.hipparchus.complex.Complex`): second symmetric variable of the integral + z (:class:`~org.hipparchus.complex.Complex`): third symmetric variable of the integral + + Returns: + Carlson elliptic integral R :sub:`D` + + """ + ... @typing.overload @staticmethod - def rD(t: _rD_1__T, t2: _rD_1__T, t3: _rD_1__T) -> _rD_1__T: ... + def rD(t: _rD_1__T, t2: _rD_1__T, t3: _rD_1__T) -> _rD_1__T: + """ + Compute Carlson elliptic integral R :sub:`D` . + + The Carlson elliptic integral R :sub:`D` is defined as \[ + R_D(x,y,z)=\frac{3}{2}\int_{0}^{\infty}\frac{\mathrm{d}t}{\sqrt{t+x}\sqrt{t+y}\sqrt{t+z}(t+z)} \] + + Parameters: + x (T): first symmetric variable of the integral + y (T): second symmetric variable of the integral + z (T): third symmetric variable of the integral + + Returns: + Carlson elliptic integral R :sub:`D` + + Compute Carlson elliptic integral R :sub:`D` . + + The Carlson elliptic integral R :sub:`D` is defined as \[ + R_D(x,y,z)=\frac{3}{2}\int_{0}^{\infty}\frac{\mathrm{d}t}{\sqrt{t+x}\sqrt{t+y}\sqrt{t+z}(t+z)} \] + + Parameters: + x (:class:`~org.hipparchus.complex.FieldComplex`<T> x): first symmetric variable of the integral + y (:class:`~org.hipparchus.complex.FieldComplex`<T> y): second symmetric variable of the integral + z (:class:`~org.hipparchus.complex.FieldComplex`<T> z): third symmetric variable of the integral + + Returns: + Carlson elliptic integral R :sub:`D` + + + """ + ... @typing.overload @staticmethod def rD(complex: org.hipparchus.complex.Complex, complex2: org.hipparchus.complex.Complex, complex3: org.hipparchus.complex.Complex) -> org.hipparchus.complex.Complex: ... @@ -44,10 +183,69 @@ class CarlsonEllipticIntegral: _rF_3__T = typing.TypeVar('_rF_3__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload @staticmethod - def rF(double: float, double2: float, double3: float) -> float: ... + def rF(double: float, double2: float, double3: float) -> float: + """ + Compute Carlson elliptic integral R :sub:`F` . + + The Carlson elliptic integral R :sub:`F` is defined as \[ + R_F(x,y,z)=\frac{1}{2}\int_{0}^{\infty}\frac{\mathrm{d}t}{\sqrt{t+x}\sqrt{t+y}\sqrt{t+z}} \] + + Parameters: + x (double): first symmetric variable of the integral + y (double): second symmetric variable of the integral + z (double): third symmetric variable of the integral + + Returns: + Carlson elliptic integral R :sub:`F` + + Compute Carlson elliptic integral R :sub:`F` . + + The Carlson elliptic integral R :sub:`F` is defined as \[ + R_F(x,y,z)=\frac{1}{2}\int_{0}^{\infty}\frac{\mathrm{d}t}{\sqrt{t+x}\sqrt{t+y}\sqrt{t+z}} \] + + Parameters: + x (:class:`~org.hipparchus.complex.Complex`): first symmetric variable of the integral + y (:class:`~org.hipparchus.complex.Complex`): second symmetric variable of the integral + z (:class:`~org.hipparchus.complex.Complex`): third symmetric variable of the integral + + Returns: + Carlson elliptic integral R :sub:`F` + + """ + ... @typing.overload @staticmethod - def rF(t: _rF_1__T, t2: _rF_1__T, t3: _rF_1__T) -> _rF_1__T: ... + def rF(t: _rF_1__T, t2: _rF_1__T, t3: _rF_1__T) -> _rF_1__T: + """ + Compute Carlson elliptic integral R :sub:`F` . + + The Carlson elliptic integral R :sub:`F` is defined as \[ + R_F(x,y,z)=\frac{1}{2}\int_{0}^{\infty}\frac{\mathrm{d}t}{\sqrt{t+x}\sqrt{t+y}\sqrt{t+z}} \] + + Parameters: + x (T): first symmetric variable of the integral + y (T): second symmetric variable of the integral + z (T): third symmetric variable of the integral + + Returns: + Carlson elliptic integral R :sub:`F` + + Compute Carlson elliptic integral R :sub:`F` . + + The Carlson elliptic integral R :sub:`F` is defined as \[ + R_F(x,y,z)=\frac{1}{2}\int_{0}^{\infty}\frac{\mathrm{d}t}{\sqrt{t+x}\sqrt{t+y}\sqrt{t+z}} \] + + Parameters: + x (:class:`~org.hipparchus.complex.FieldComplex`<T> x): first symmetric variable of the integral + y (:class:`~org.hipparchus.complex.FieldComplex`<T> y): second symmetric variable of the integral + z (:class:`~org.hipparchus.complex.FieldComplex`<T> z): third symmetric variable of the integral + + Returns: + Carlson elliptic integral R :sub:`F` + + + """ + ... @typing.overload @staticmethod def rF(complex: org.hipparchus.complex.Complex, complex2: org.hipparchus.complex.Complex, complex3: org.hipparchus.complex.Complex) -> org.hipparchus.complex.Complex: ... @@ -58,10 +256,69 @@ class CarlsonEllipticIntegral: _rG_3__T = typing.TypeVar('_rG_3__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload @staticmethod - def rG(double: float, double2: float, double3: float) -> float: ... + def rG(double: float, double2: float, double3: float) -> float: + """ + Compute Carlson elliptic integral R :sub:`G` . + + The Carlson elliptic integral R :sub:`G` is defined as \[ R_{G}(x,y,z)=\frac{1}{4}\int_{0}^{\infty}\frac{1}{s(t)} + \left(\frac{x}{t+x}+\frac{y}{t+y}+\frac{z}{t+z}\right)t\mathrm{d}t \] + + Parameters: + x (double): first symmetric variable of the integral + y (double): second symmetric variable of the integral + z (double): second symmetric variable of the integral + + Returns: + Carlson elliptic integral R :sub:`G` + + Compute Carlson elliptic integral R :sub:`G` . + + The Carlson elliptic integral R :sub:`G` is defined as \[ R_{G}(x,y,z)=\frac{1}{4}\int_{0}^{\infty}\frac{1}{s(t)} + \left(\frac{x}{t+x}+\frac{y}{t+y}+\frac{z}{t+z}\right)t\mathrm{d}t \] + + Parameters: + x (:class:`~org.hipparchus.complex.Complex`): first symmetric variable of the integral + y (:class:`~org.hipparchus.complex.Complex`): second symmetric variable of the integral + z (:class:`~org.hipparchus.complex.Complex`): second symmetric variable of the integral + + Returns: + Carlson elliptic integral R :sub:`G` + + """ + ... @typing.overload @staticmethod - def rG(t: _rG_1__T, t2: _rG_1__T, t3: _rG_1__T) -> _rG_1__T: ... + def rG(t: _rG_1__T, t2: _rG_1__T, t3: _rG_1__T) -> _rG_1__T: + """ + Compute Carlson elliptic integral R :sub:`G` . + + The Carlson elliptic integral R :sub:`G` is defined as \[ R_{G}(x,y,z)=\frac{1}{4}\int_{0}^{\infty}\frac{1}{s(t)} + \left(\frac{x}{t+x}+\frac{y}{t+y}+\frac{z}{t+z}\right)t\mathrm{d}t \] + + Parameters: + x (T): first symmetric variable of the integral + y (T): second symmetric variable of the integral + z (T): second symmetric variable of the integral + + Returns: + Carlson elliptic integral R :sub:`G` + + Compute Carlson elliptic integral R :sub:`G` . + + The Carlson elliptic integral R :sub:`G` is defined as \[ R_{G}(x,y,z)=\frac{1}{4}\int_{0}^{\infty}\frac{1}{s(t)} + \left(\frac{x}{t+x}+\frac{y}{t+y}+\frac{z}{t+z}\right)t\mathrm{d}t \] + + Parameters: + x (:class:`~org.hipparchus.complex.FieldComplex`<T> x): first symmetric variable of the integral + y (:class:`~org.hipparchus.complex.FieldComplex`<T> y): second symmetric variable of the integral + z (:class:`~org.hipparchus.complex.FieldComplex`<T> z): second symmetric variable of the integral + + Returns: + Carlson elliptic integral R :sub:`G` + + + """ + ... @typing.overload @staticmethod def rG(complex: org.hipparchus.complex.Complex, complex2: org.hipparchus.complex.Complex, complex3: org.hipparchus.complex.Complex) -> org.hipparchus.complex.Complex: ... @@ -74,16 +331,142 @@ class CarlsonEllipticIntegral: _rJ_7__T = typing.TypeVar('_rJ_7__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload @staticmethod - def rJ(double: float, double2: float, double3: float, double4: float) -> float: ... + def rJ(double: float, double2: float, double3: float, double4: float) -> float: + """ + Compute Carlson elliptic integral R :sub:`J` . + + The Carlson elliptic integral R :sub:`J` is defined as \[ + R_J(x,y,z,p)=\frac{3}{2}\int_{0}^{\infty}\frac{\mathrm{d}t}{\sqrt{t+x}\sqrt{t+y}\sqrt{t+z}(t+p)} \] + + Parameters: + x (double): first symmetric variable of the integral + y (double): second symmetric variable of the integral + z (double): third symmetric variable of the integral + p (double): fourth *not* symmetric variable of the integral + + Returns: + Carlson elliptic integral R :sub:`J` + + Compute Carlson elliptic integral R :sub:`J` . + + The Carlson elliptic integral R :sub:`J` is defined as \[ + R_J(x,y,z,p)=\frac{3}{2}\int_{0}^{\infty}\frac{\mathrm{d}t}{\sqrt{t+x}\sqrt{t+y}\sqrt{t+z}(t+p)} \] + + Parameters: + x (double): first symmetric variable of the integral + y (double): second symmetric variable of the integral + z (double): third symmetric variable of the integral + p (double): fourth *not* symmetric variable of the integral + delta (double): precomputed value of (p-x)(p-y)(p-z) + + Returns: + Carlson elliptic integral R :sub:`J` + + Compute Carlson elliptic integral R :sub:`J` . + + The Carlson elliptic integral R :sub:`J` is defined as \[ + R_J(x,y,z,p)=\frac{3}{2}\int_{0}^{\infty}\frac{\mathrm{d}t}{\sqrt{t+x}\sqrt{t+y}\sqrt{t+z}(t+p)} \] + + Parameters: + x (:class:`~org.hipparchus.complex.Complex`): first symmetric variable of the integral + y (:class:`~org.hipparchus.complex.Complex`): second symmetric variable of the integral + z (:class:`~org.hipparchus.complex.Complex`): third symmetric variable of the integral + p (:class:`~org.hipparchus.complex.Complex`): fourth *not* symmetric variable of the integral + + Returns: + Carlson elliptic integral R :sub:`J` + + Compute Carlson elliptic integral R :sub:`J` . + + The Carlson elliptic integral R :sub:`J` is defined as \[ + R_J(x,y,z,p)=\frac{3}{2}\int_{0}^{\infty}\frac{\mathrm{d}t}{\sqrt{t+x}\sqrt{t+y}\sqrt{t+z}(t+p)} \] + + Parameters: + x (:class:`~org.hipparchus.complex.Complex`): first symmetric variable of the integral + y (:class:`~org.hipparchus.complex.Complex`): second symmetric variable of the integral + z (:class:`~org.hipparchus.complex.Complex`): third symmetric variable of the integral + p (:class:`~org.hipparchus.complex.Complex`): fourth *not* symmetric variable of the integral + delta (:class:`~org.hipparchus.complex.Complex`): precomputed value of (p-x)(p-y)(p-z) + + Returns: + Carlson elliptic integral R :sub:`J` + + """ + ... @typing.overload @staticmethod def rJ(double: float, double2: float, double3: float, double4: float, double5: float) -> float: ... @typing.overload @staticmethod - def rJ(t: _rJ_2__T, t2: _rJ_2__T, t3: _rJ_2__T, t4: _rJ_2__T) -> _rJ_2__T: ... + def rJ(t: _rJ_2__T, t2: _rJ_2__T, t3: _rJ_2__T, t4: _rJ_2__T) -> _rJ_2__T: + """ + Compute Carlson elliptic integral R :sub:`J` . + + The Carlson elliptic integral R :sub:`J` is defined as \[ + R_J(x,y,z,p)=\frac{3}{2}\int_{0}^{\infty}\frac{\mathrm{d}t}{\sqrt{t+x}\sqrt{t+y}\sqrt{t+z}(t+p)} \] + + Parameters: + x (T): first symmetric variable of the integral + y (T): second symmetric variable of the integral + z (T): third symmetric variable of the integral + p (T): fourth *not* symmetric variable of the integral + + Returns: + Carlson elliptic integral R :sub:`J` + + Compute Carlson elliptic integral R :sub:`J` . + + The Carlson elliptic integral R :sub:`J` is defined as \[ + R_J(x,y,z,p)=\frac{3}{2}\int_{0}^{\infty}\frac{\mathrm{d}t}{\sqrt{t+x}\sqrt{t+y}\sqrt{t+z}(t+p)} \] + + Parameters: + x (T): first symmetric variable of the integral + y (T): second symmetric variable of the integral + z (T): third symmetric variable of the integral + p (T): fourth *not* symmetric variable of the integral + delta (T): precomputed value of (p-x)(p-y)(p-z) + + Returns: + Carlson elliptic integral R :sub:`J` + + Compute Carlson elliptic integral R :sub:`J` . + + The Carlson elliptic integral R :sub:`J` is defined as \[ + R_J(x,y,z,p)=\frac{3}{2}\int_{0}^{\infty}\frac{\mathrm{d}t}{\sqrt{t+x}\sqrt{t+y}\sqrt{t+z}(t+p)} \] + + Parameters: + x (:class:`~org.hipparchus.complex.FieldComplex`<T> x): first symmetric variable of the integral + y (:class:`~org.hipparchus.complex.FieldComplex`<T> y): second symmetric variable of the integral + z (:class:`~org.hipparchus.complex.FieldComplex`<T> z): third symmetric variable of the integral + p (:class:`~org.hipparchus.complex.FieldComplex`<T> p): fourth *not* symmetric variable of the integral + + Returns: + Carlson elliptic integral R :sub:`J` + + """ + ... @typing.overload @staticmethod - def rJ(t: _rJ_3__T, t2: _rJ_3__T, t3: _rJ_3__T, t4: _rJ_3__T, t5: _rJ_3__T) -> _rJ_3__T: ... + def rJ(t: _rJ_3__T, t2: _rJ_3__T, t3: _rJ_3__T, t4: _rJ_3__T, t5: _rJ_3__T) -> _rJ_3__T: + """ + Compute Carlson elliptic integral R :sub:`J` . + + The Carlson elliptic integral R :sub:`J` is defined as \[ + R_J(x,y,z,p)=\frac{3}{2}\int_{0}^{\infty}\frac{\mathrm{d}t}{\sqrt{t+x}\sqrt{t+y}\sqrt{t+z}(t+p)} \] + + Parameters: + x (:class:`~org.hipparchus.complex.FieldComplex`<T> x): first symmetric variable of the integral + y (:class:`~org.hipparchus.complex.FieldComplex`<T> y): second symmetric variable of the integral + z (:class:`~org.hipparchus.complex.FieldComplex`<T> z): third symmetric variable of the integral + p (:class:`~org.hipparchus.complex.FieldComplex`<T> p): fourth *not* symmetric variable of the integral + delta (:class:`~org.hipparchus.complex.FieldComplex`<T> delta): precomputed value of (p-x)(p-y)(p-z) + + Returns: + Carlson elliptic integral R :sub:`J` + + + """ + ... @typing.overload @staticmethod def rJ(complex: org.hipparchus.complex.Complex, complex2: org.hipparchus.complex.Complex, complex3: org.hipparchus.complex.Complex, complex4: org.hipparchus.complex.Complex) -> org.hipparchus.complex.Complex: ... diff --git a/org-stubs/hipparchus/special/elliptic/jacobi/__init__.pyi b/org-stubs/hipparchus/special/elliptic/jacobi/__init__.pyi index 5d1e302..9114a12 100644 --- a/org-stubs/hipparchus/special/elliptic/jacobi/__init__.pyi +++ b/org-stubs/hipparchus/special/elliptic/jacobi/__init__.pyi @@ -12,100 +12,733 @@ import typing class CopolarC: - def dc(self) -> float: ... - def nc(self) -> float: ... - def sc(self) -> float: ... + """ + public classCopolarC extends :class:`~org.hipparchus.special.elliptic.jacobi.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Copolar trio with pole at point c in Glaisher’s Notation. + + This is a container for the three subsidiary Jacobi elliptic functions :code:`dc(u|m)`, :code:`nc(u|m)`, and + :code:`sc(u|m)`. + + Since: + 2.0 + """ + def dc(self) -> float: + """ + Get the value of the dc function. + + Returns: + dc(u|m) + + + """ + ... + def nc(self) -> float: + """ + Get the value of the nc function. + + Returns: + nc(u|m) + + + """ + ... + def sc(self) -> float: + """ + Get the value of the sc function. + + Returns: + sc(u|m) + + + """ + ... class CopolarD: - def cd(self) -> float: ... - def nd(self) -> float: ... - def sd(self) -> float: ... + """ + public classCopolarD extends :class:`~org.hipparchus.special.elliptic.jacobi.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Copolar trio with pole at point d in Glaisher’s Notation. + + This is a container for the three subsidiary Jacobi elliptic functions :code:`nd(u|m)`, :code:`sd(u|m)`, and + :code:`cd(u|m)`. + + Since: + 2.0 + """ + def cd(self) -> float: + """ + Get the value of the cd function. + + Returns: + cd(u|m) + + + """ + ... + def nd(self) -> float: + """ + Get the value of the nd function. + + Returns: + nd(u|m) + + + """ + ... + def sd(self) -> float: + """ + Get the value of the sd function. + + Returns: + sd(u|m) + + + """ + ... class CopolarN: - def cn(self) -> float: ... - def dn(self) -> float: ... - def sn(self) -> float: ... + """ + public classCopolarN extends :class:`~org.hipparchus.special.elliptic.jacobi.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Copolar trio with pole at point n in Glaisher’s Notation. + + This is a container for the three principal Jacobi elliptic functions :code:`sn(u|m)`, :code:`cn(u|m)`, and + :code:`dn(u|m)`. + + Since: + 2.0 + """ + def cn(self) -> float: + """ + Get the value of the cn function. + + Returns: + cn(u|m) + + + """ + ... + def dn(self) -> float: + """ + Get the value of the dn function. + + Returns: + dn(u|m) + + + """ + ... + def sn(self) -> float: + """ + Get the value of the sn function. + + Returns: + sn(u|m) + + + """ + ... class CopolarS: - def cs(self) -> float: ... - def ds(self) -> float: ... - def ns(self) -> float: ... + """ + public classCopolarS extends :class:`~org.hipparchus.special.elliptic.jacobi.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Copolar trio with pole at point s in Glaisher’s Notation. + + This is a container for the three subsidiary Jacobi elliptic functions :code:`cs(u|m)`, :code:`ds(u|m)` and + :code:`ns(u|m)`. + + Since: + 2.0 + """ + def cs(self) -> float: + """ + Get the value of the cs function. + + Returns: + cs(u|m) + + + """ + ... + def ds(self) -> float: + """ + Get the value of the ds function. + + Returns: + ds(u|m) + + + """ + ... + def ns(self) -> float: + """ + Get the value of the ns function. + + Returns: + ns(u|m) + + + """ + ... _FieldCopolarC__T = typing.TypeVar('_FieldCopolarC__T', bound=org.hipparchus.CalculusFieldElement) # <T> class FieldCopolarC(typing.Generic[_FieldCopolarC__T]): - def dc(self) -> _FieldCopolarC__T: ... - def nc(self) -> _FieldCopolarC__T: ... - def sc(self) -> _FieldCopolarC__T: ... + """ + public classFieldCopolarC<T extends :class:`~org.hipparchus.CalculusFieldElement`<T>> extends :class:`~org.hipparchus.special.elliptic.jacobi.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Copolar trio with pole at point c in Glaisher’s Notation. + + This is a container for the three subsidiary Jacobi elliptic functions :code:`dc(u|m)`, :code:`nc(u|m)`, and + :code:`sc(u|m)`. + + Since: + 2.0 + """ + def dc(self) -> _FieldCopolarC__T: + """ + Get the value of the dc function. + + Returns: + dc(u|m) + + + """ + ... + def nc(self) -> _FieldCopolarC__T: + """ + Get the value of the nc function. + + Returns: + nc(u|m) + + + """ + ... + def sc(self) -> _FieldCopolarC__T: + """ + Get the value of the sc function. + + Returns: + sc(u|m) + + + """ + ... _FieldCopolarD__T = typing.TypeVar('_FieldCopolarD__T', bound=org.hipparchus.CalculusFieldElement) # <T> class FieldCopolarD(typing.Generic[_FieldCopolarD__T]): - def cd(self) -> _FieldCopolarD__T: ... - def nd(self) -> _FieldCopolarD__T: ... - def sd(self) -> _FieldCopolarD__T: ... + """ + public classFieldCopolarD<T extends :class:`~org.hipparchus.CalculusFieldElement`<T>> extends :class:`~org.hipparchus.special.elliptic.jacobi.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Copolar trio with pole at point d in Glaisher’s Notation. + + This is a container for the three subsidiary Jacobi elliptic functions :code:`nd(u|m)`, :code:`sd(u|m)`, and + :code:`cd(u|m)`. + + Since: + 2.0 + """ + def cd(self) -> _FieldCopolarD__T: + """ + Get the value of the cd function. + + Returns: + cd(u|m) + + + """ + ... + def nd(self) -> _FieldCopolarD__T: + """ + Get the value of the nd function. + + Returns: + nd(u|m) + + + """ + ... + def sd(self) -> _FieldCopolarD__T: + """ + Get the value of the sd function. + + Returns: + sd(u|m) + + + """ + ... _FieldCopolarN__T = typing.TypeVar('_FieldCopolarN__T', bound=org.hipparchus.CalculusFieldElement) # <T> class FieldCopolarN(typing.Generic[_FieldCopolarN__T]): - def cn(self) -> _FieldCopolarN__T: ... - def dn(self) -> _FieldCopolarN__T: ... - def sn(self) -> _FieldCopolarN__T: ... + """ + public classFieldCopolarN<T extends :class:`~org.hipparchus.CalculusFieldElement`<T>> extends :class:`~org.hipparchus.special.elliptic.jacobi.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Copolar trio with pole at point n in Glaisher’s Notation. + + This is a container for the three principal Jacobi elliptic functions :code:`sn(u|m)`, :code:`cn(u|m)`, and + :code:`dn(u|m)`. + + Since: + 2.0 + """ + def cn(self) -> _FieldCopolarN__T: + """ + Get the value of the cn function. + + Returns: + cn(u|m) + + + """ + ... + def dn(self) -> _FieldCopolarN__T: + """ + Get the value of the dn function. + + Returns: + dn(u|m) + + + """ + ... + def sn(self) -> _FieldCopolarN__T: + """ + Get the value of the sn function. + + Returns: + sn(u|m) + + + """ + ... _FieldCopolarS__T = typing.TypeVar('_FieldCopolarS__T', bound=org.hipparchus.CalculusFieldElement) # <T> class FieldCopolarS(typing.Generic[_FieldCopolarS__T]): - def cs(self) -> _FieldCopolarS__T: ... - def ds(self) -> _FieldCopolarS__T: ... - def ns(self) -> _FieldCopolarS__T: ... + """ + public classFieldCopolarS<T extends :class:`~org.hipparchus.CalculusFieldElement`<T>> extends :class:`~org.hipparchus.special.elliptic.jacobi.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Copolar trio with pole at point s in Glaisher’s Notation. + + This is a container for the three subsidiary Jacobi elliptic functions :code:`cs(u|m)`, :code:`ds(u|m)` and + :code:`ns(u|m)`. + + Since: + 2.0 + """ + def cs(self) -> _FieldCopolarS__T: + """ + Get the value of the cs function. + + Returns: + cs(u|m) + + + """ + ... + def ds(self) -> _FieldCopolarS__T: + """ + Get the value of the ds function. + + Returns: + ds(u|m) + + + """ + ... + def ns(self) -> _FieldCopolarS__T: + """ + Get the value of the ns function. + + Returns: + ns(u|m) + + + """ + ... _FieldJacobiElliptic__T = typing.TypeVar('_FieldJacobiElliptic__T', bound=org.hipparchus.CalculusFieldElement) # <T> class FieldJacobiElliptic(typing.Generic[_FieldJacobiElliptic__T]): + """ + public abstract classFieldJacobiElliptic<T extends :class:`~org.hipparchus.CalculusFieldElement`<T>> extends :class:`~org.hipparchus.special.elliptic.jacobi.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Computation of Jacobi elliptic functions. The Jacobi elliptic functions are related to elliptic integrals. + + Since: + 2.0 + """ @typing.overload - def arccd(self, double: float) -> _FieldJacobiElliptic__T: ... + def arccd(self, double: float) -> _FieldJacobiElliptic__T: + """ + Evaluate inverse of Jacobi elliptic function cd. + + Parameters: + x (:class:`~org.hipparchus.special.elliptic.jacobi.FieldJacobiElliptic`): value of Jacobi elliptic function :code:`cd(u|m)` + + Returns: + u such that :code:`x=cd(u|m)` + + Since: + 2.1 + + Evaluate inverse of Jacobi elliptic function cd. + + Parameters: + x (double): value of Jacobi elliptic function :code:`cd(u|m)` + + Returns: + u such that :code:`x=cd(u|m)` + + Since: + 2.1 + + + """ + ... @typing.overload def arccd(self, t: _FieldJacobiElliptic__T) -> _FieldJacobiElliptic__T: ... @typing.overload - def arccn(self, double: float) -> _FieldJacobiElliptic__T: ... + def arccn(self, double: float) -> _FieldJacobiElliptic__T: + """ + Evaluate inverse of Jacobi elliptic function cn. + + Parameters: + x (:class:`~org.hipparchus.special.elliptic.jacobi.FieldJacobiElliptic`): value of Jacobi elliptic function :code:`cn(u|m)` + + Returns: + u such that :code:`x=cn(u|m)` + + Since: + 2.1 + + Evaluate inverse of Jacobi elliptic function cn. + + Parameters: + x (double): value of Jacobi elliptic function :code:`cn(u|m)` + + Returns: + u such that :code:`x=cn(u|m)` + + Since: + 2.1 + + + """ + ... @typing.overload def arccn(self, t: _FieldJacobiElliptic__T) -> _FieldJacobiElliptic__T: ... @typing.overload - def arccs(self, double: float) -> _FieldJacobiElliptic__T: ... + def arccs(self, double: float) -> _FieldJacobiElliptic__T: + """ + Evaluate inverse of Jacobi elliptic function cs. + + Parameters: + x (:class:`~org.hipparchus.special.elliptic.jacobi.FieldJacobiElliptic`): value of Jacobi elliptic function :code:`cs(u|m)` + + Returns: + u such that :code:`x=cs(u|m)` + + Since: + 2.1 + + Evaluate inverse of Jacobi elliptic function cs. + + Parameters: + x (double): value of Jacobi elliptic function :code:`cs(u|m)` + + Returns: + u such that :code:`x=cs(u|m)` + + Since: + 2.1 + + + """ + ... @typing.overload def arccs(self, t: _FieldJacobiElliptic__T) -> _FieldJacobiElliptic__T: ... @typing.overload - def arcdc(self, double: float) -> _FieldJacobiElliptic__T: ... + def arcdc(self, double: float) -> _FieldJacobiElliptic__T: + """ + Evaluate inverse of Jacobi elliptic function dc. + + Parameters: + x (:class:`~org.hipparchus.special.elliptic.jacobi.FieldJacobiElliptic`): value of Jacobi elliptic function :code:`dc(u|m)` + + Returns: + u such that :code:`x=dc(u|m)` + + Since: + 2.1 + + Evaluate inverse of Jacobi elliptic function dc. + + Parameters: + x (double): value of Jacobi elliptic function :code:`dc(u|m)` + + Returns: + u such that :code:`x=dc(u|m)` + + Since: + 2.1 + + + """ + ... @typing.overload def arcdc(self, t: _FieldJacobiElliptic__T) -> _FieldJacobiElliptic__T: ... @typing.overload - def arcdn(self, double: float) -> _FieldJacobiElliptic__T: ... + def arcdn(self, double: float) -> _FieldJacobiElliptic__T: + """ + Evaluate inverse of Jacobi elliptic function dn. + + Parameters: + x (:class:`~org.hipparchus.special.elliptic.jacobi.FieldJacobiElliptic`): value of Jacobi elliptic function :code:`dn(u|m)` + + Returns: + u such that :code:`x=dn(u|m)` + + Since: + 2.1 + + Evaluate inverse of Jacobi elliptic function dn. + + Parameters: + x (double): value of Jacobi elliptic function :code:`dn(u|m)` + + Returns: + u such that :code:`x=dn(u|m)` + + Since: + 2.1 + + + """ + ... @typing.overload def arcdn(self, t: _FieldJacobiElliptic__T) -> _FieldJacobiElliptic__T: ... @typing.overload - def arcds(self, double: float) -> _FieldJacobiElliptic__T: ... + def arcds(self, double: float) -> _FieldJacobiElliptic__T: + """ + Evaluate inverse of Jacobi elliptic function ds. + + Parameters: + x (:class:`~org.hipparchus.special.elliptic.jacobi.FieldJacobiElliptic`): value of Jacobi elliptic function :code:`ds(u|m)` + + Returns: + u such that :code:`x=ds(u|m)` + + Since: + 2.1 + + Evaluate inverse of Jacobi elliptic function ds. + + Parameters: + x (double): value of Jacobi elliptic function :code:`ds(u|m)` + + Returns: + u such that :code:`x=ds(u|m)` + + Since: + 2.1 + + + """ + ... @typing.overload def arcds(self, t: _FieldJacobiElliptic__T) -> _FieldJacobiElliptic__T: ... @typing.overload - def arcnc(self, double: float) -> _FieldJacobiElliptic__T: ... + def arcnc(self, double: float) -> _FieldJacobiElliptic__T: + """ + Evaluate inverse of Jacobi elliptic function nc. + + Parameters: + x (:class:`~org.hipparchus.special.elliptic.jacobi.FieldJacobiElliptic`): value of Jacobi elliptic function :code:`nc(u|m)` + + Returns: + u such that :code:`x=nc(u|m)` + + Since: + 2.1 + + Evaluate inverse of Jacobi elliptic function nc. + + Parameters: + x (double): value of Jacobi elliptic function :code:`nc(u|m)` + + Returns: + u such that :code:`x=nc(u|m)` + + Since: + 2.1 + + + """ + ... @typing.overload def arcnc(self, t: _FieldJacobiElliptic__T) -> _FieldJacobiElliptic__T: ... @typing.overload - def arcnd(self, double: float) -> _FieldJacobiElliptic__T: ... + def arcnd(self, double: float) -> _FieldJacobiElliptic__T: + """ + Evaluate inverse of Jacobi elliptic function nd. + + Parameters: + x (:class:`~org.hipparchus.special.elliptic.jacobi.FieldJacobiElliptic`): value of Jacobi elliptic function :code:`nd(u|m)` + + Returns: + u such that :code:`x=nd(u|m)` + + Since: + 2.1 + + Evaluate inverse of Jacobi elliptic function nd. + + Parameters: + x (double): value of Jacobi elliptic function :code:`nd(u|m)` + + Returns: + u such that :code:`x=nd(u|m)` + + Since: + 2.1 + + + """ + ... @typing.overload def arcnd(self, t: _FieldJacobiElliptic__T) -> _FieldJacobiElliptic__T: ... @typing.overload - def arcns(self, double: float) -> _FieldJacobiElliptic__T: ... + def arcns(self, double: float) -> _FieldJacobiElliptic__T: + """ + Evaluate inverse of Jacobi elliptic function ns. + + Parameters: + x (:class:`~org.hipparchus.special.elliptic.jacobi.FieldJacobiElliptic`): value of Jacobi elliptic function :code:`ns(u|m)` + + Returns: + u such that :code:`x=ns(u|m)` + + Since: + 2.1 + + Evaluate inverse of Jacobi elliptic function ns. + + Parameters: + x (double): value of Jacobi elliptic function :code:`ns(u|m)` + + Returns: + u such that :code:`x=ns(u|m)` + + Since: + 2.1 + + + """ + ... @typing.overload def arcns(self, t: _FieldJacobiElliptic__T) -> _FieldJacobiElliptic__T: ... @typing.overload - def arcsc(self, double: float) -> _FieldJacobiElliptic__T: ... + def arcsc(self, double: float) -> _FieldJacobiElliptic__T: + """ + Evaluate inverse of Jacobi elliptic function sc. + + Parameters: + x (:class:`~org.hipparchus.special.elliptic.jacobi.FieldJacobiElliptic`): value of Jacobi elliptic function :code:`sc(u|m)` + + Returns: + u such that :code:`x=sc(u|m)` + + Since: + 2.1 + + Evaluate inverse of Jacobi elliptic function sc. + + Parameters: + x (double): value of Jacobi elliptic function :code:`sc(u|m)` + + Returns: + u such that :code:`x=sc(u|m)` + + Since: + 2.1 + + + """ + ... @typing.overload def arcsc(self, t: _FieldJacobiElliptic__T) -> _FieldJacobiElliptic__T: ... @typing.overload - def arcsd(self, double: float) -> _FieldJacobiElliptic__T: ... + def arcsd(self, double: float) -> _FieldJacobiElliptic__T: + """ + Evaluate inverse of Jacobi elliptic function sd. + + Parameters: + x (:class:`~org.hipparchus.special.elliptic.jacobi.FieldJacobiElliptic`): value of Jacobi elliptic function :code:`sd(u|m)` + + Returns: + u such that :code:`x=sd(u|m)` + + Since: + 2.1 + + Evaluate inverse of Jacobi elliptic function sd. + + Parameters: + x (double): value of Jacobi elliptic function :code:`sd(u|m)` + + Returns: + u such that :code:`x=sd(u|m)` + + Since: + 2.1 + + + """ + ... @typing.overload def arcsd(self, t: _FieldJacobiElliptic__T) -> _FieldJacobiElliptic__T: ... @typing.overload - def arcsn(self, double: float) -> _FieldJacobiElliptic__T: ... + def arcsn(self, double: float) -> _FieldJacobiElliptic__T: + """ + Evaluate inverse of Jacobi elliptic function sn. + + Parameters: + x (:class:`~org.hipparchus.special.elliptic.jacobi.FieldJacobiElliptic`): value of Jacobi elliptic function :code:`sn(u|m)` + + Returns: + u such that :code:`x=sn(u|m)` + + Since: + 2.1 + + Evaluate inverse of Jacobi elliptic function sn. + + Parameters: + x (double): value of Jacobi elliptic function :code:`sn(u|m)` + + Returns: + u such that :code:`x=sn(u|m)` + + Since: + 2.1 + + + """ + ... @typing.overload def arcsn(self, t: _FieldJacobiElliptic__T) -> _FieldJacobiElliptic__T: ... - def getM(self) -> _FieldJacobiElliptic__T: ... + def getM(self) -> _FieldJacobiElliptic__T: + """ + Get the parameter of the function. + + Returns: + parameter of the function + + + """ + ... @typing.overload def valuesC(self, double: float) -> FieldCopolarC[_FieldJacobiElliptic__T]: ... @typing.overload @@ -125,45 +758,418 @@ class FieldJacobiElliptic(typing.Generic[_FieldJacobiElliptic__T]): _FieldJacobiTheta__T = typing.TypeVar('_FieldJacobiTheta__T', bound=org.hipparchus.CalculusFieldElement) # <T> class FieldJacobiTheta(typing.Generic[_FieldJacobiTheta__T]): + """ + public classFieldJacobiTheta<T extends :class:`~org.hipparchus.CalculusFieldElement`<T>> extends :class:`~org.hipparchus.special.elliptic.jacobi.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Algorithm computing Jacobi theta functions. + + Since: + 2.0 + """ def __init__(self, t: _FieldJacobiTheta__T): ... - def getQ(self) -> _FieldJacobiTheta__T: ... + def getQ(self) -> _FieldJacobiTheta__T: + """ + Get the nome. + + Returns: + nome + + + """ + ... def values(self, t: _FieldJacobiTheta__T) -> 'FieldTheta'[_FieldJacobiTheta__T]: ... _FieldTheta__T = typing.TypeVar('_FieldTheta__T', bound=org.hipparchus.CalculusFieldElement) # <T> class FieldTheta(typing.Generic[_FieldTheta__T]): - def theta1(self) -> _FieldTheta__T: ... - def theta2(self) -> _FieldTheta__T: ... - def theta3(self) -> _FieldTheta__T: ... - def theta4(self) -> _FieldTheta__T: ... + """ + public classFieldTheta<T extends :class:`~org.hipparchus.CalculusFieldElement`<T>> extends :class:`~org.hipparchus.special.elliptic.jacobi.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Values of :class:`~org.hipparchus.special.elliptic.jacobi.FieldJacobiTheta` functions. + + This is a container for the four Jacobi theta functions θâ‚(z|Ï„), θ₂(z|Ï„), θ₃(z|Ï„), and θ₄(z|Ï„). + + Since: + 2.0 + + Also see: + + - :class:`~org.hipparchus.special.elliptic.jacobi.FieldJacobiTheta` + """ + def theta1(self) -> _FieldTheta__T: + """ + Get the value of the θâ‚(z|Ï„) function. + + Returns: + θâ‚(z|Ï„) + + + """ + ... + def theta2(self) -> _FieldTheta__T: + """ + Get the value of the θ₂(z|Ï„) function. + + Returns: + θ₂(z|Ï„) + + + """ + ... + def theta3(self) -> _FieldTheta__T: + """ + Get the value of the θ₃(z|Ï„) function. + + Returns: + θ₃(z|Ï„) + + + """ + ... + def theta4(self) -> _FieldTheta__T: + """ + Get the value of the θ₄(z|Ï„) function. + + Returns: + θ₄(z|Ï„) + + + """ + ... class JacobiElliptic: - def arccd(self, double: float) -> float: ... - def arccn(self, double: float) -> float: ... - def arccs(self, double: float) -> float: ... - def arcdc(self, double: float) -> float: ... - def arcdn(self, double: float) -> float: ... - def arcds(self, double: float) -> float: ... - def arcnc(self, double: float) -> float: ... - def arcnd(self, double: float) -> float: ... - def arcns(self, double: float) -> float: ... - def arcsc(self, double: float) -> float: ... - def arcsd(self, double: float) -> float: ... - def arcsn(self, double: float) -> float: ... - def getM(self) -> float: ... - def valuesC(self, double: float) -> CopolarC: ... - def valuesD(self, double: float) -> CopolarD: ... - def valuesN(self, double: float) -> CopolarN: ... - def valuesS(self, double: float) -> CopolarS: ... + """ + public abstract classJacobiElliptic extends :class:`~org.hipparchus.special.elliptic.jacobi.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Algorithm computing Jacobi elliptic functions. + + Since: + 2.0 + """ + def arccd(self, double: float) -> float: + """ + Evaluate inverse of Jacobi elliptic function cd. + + Parameters: + x (double): value of Jacobi elliptic function :code:`cd(u|m)` + + Returns: + u such that :code:`x=cd(u|m)` + + Since: + 2.1 + + + """ + ... + def arccn(self, double: float) -> float: + """ + Evaluate inverse of Jacobi elliptic function cn. + + Parameters: + x (double): value of Jacobi elliptic function :code:`cn(u|m)` + + Returns: + u such that :code:`x=cn(u|m)` + + Since: + 2.1 + + + """ + ... + def arccs(self, double: float) -> float: + """ + Evaluate inverse of Jacobi elliptic function cs. + + Parameters: + x (double): value of Jacobi elliptic function :code:`cs(u|m)` + + Returns: + u such that :code:`x=cs(u|m)` + + Since: + 2.1 + + + """ + ... + def arcdc(self, double: float) -> float: + """ + Evaluate inverse of Jacobi elliptic function dc. + + Parameters: + x (double): value of Jacobi elliptic function :code:`dc(u|m)` + + Returns: + u such that :code:`x=dc(u|m)` + + Since: + 2.1 + + + """ + ... + def arcdn(self, double: float) -> float: + """ + Evaluate inverse of Jacobi elliptic function dn. + + Parameters: + x (double): value of Jacobi elliptic function :code:`dn(u|m)` + + Returns: + u such that :code:`x=dn(u|m)` + + Since: + 2.1 + + + """ + ... + def arcds(self, double: float) -> float: + """ + Evaluate inverse of Jacobi elliptic function ds. + + Parameters: + x (double): value of Jacobi elliptic function :code:`ds(u|m)` + + Returns: + u such that :code:`x=ds(u|m)` + + Since: + 2.1 + + + """ + ... + def arcnc(self, double: float) -> float: + """ + Evaluate inverse of Jacobi elliptic function nc. + + Parameters: + x (double): value of Jacobi elliptic function :code:`nc(u|m)` + + Returns: + u such that :code:`x=nc(u|m)` + + Since: + 2.1 + + + """ + ... + def arcnd(self, double: float) -> float: + """ + Evaluate inverse of Jacobi elliptic function nd. + + Parameters: + x (double): value of Jacobi elliptic function :code:`nd(u|m)` + + Returns: + u such that :code:`x=nd(u|m)` + + Since: + 2.1 + + + """ + ... + def arcns(self, double: float) -> float: + """ + Evaluate inverse of Jacobi elliptic function ns. + + Parameters: + x (double): value of Jacobi elliptic function :code:`ns(u|m)` + + Returns: + u such that :code:`x=ns(u|m)` + + Since: + 2.1 + + + """ + ... + def arcsc(self, double: float) -> float: + """ + Evaluate inverse of Jacobi elliptic function sc. + + Parameters: + x (double): value of Jacobi elliptic function :code:`sc(u|m)` + + Returns: + u such that :code:`x=sc(u|m)` + + Since: + 2.1 + + + """ + ... + def arcsd(self, double: float) -> float: + """ + Evaluate inverse of Jacobi elliptic function sd. + + Parameters: + x (double): value of Jacobi elliptic function :code:`sd(u|m)` + + Returns: + u such that :code:`x=sd(u|m)` + + Since: + 2.1 + + + """ + ... + def arcsn(self, double: float) -> float: + """ + Evaluate inverse of Jacobi elliptic function sn. + + Parameters: + x (double): value of Jacobi elliptic function :code:`sn(u|m)` + + Returns: + u such that :code:`x=sn(u|m)` + + Since: + 2.1 + + + """ + ... + def getM(self) -> float: + """ + Get the parameter of the function. + + Returns: + parameter of the function + + + """ + ... + def valuesC(self, double: float) -> CopolarC: + """ + Evaluate the three subsidiary Jacobi elliptic functions with pole at point c in Glaisher’s Notation. + + Parameters: + u (double): argument of the functions + + Returns: + copolar trio containing the three subsidiary Jacobi elliptic functions :code:`dc(u|m)`, :code:`nc(u|m)`, and + :code:`sc(u|m)`. + + + """ + ... + def valuesD(self, double: float) -> CopolarD: + """ + Evaluate the three subsidiary Jacobi elliptic functions with pole at point d in Glaisher’s Notation. + + Parameters: + u (double): argument of the functions + + Returns: + copolar trio containing the three subsidiary Jacobi elliptic functions :code:`nd(u|m)`, :code:`sd(u|m)`, and + :code:`cd(u|m)`. + + + """ + ... + def valuesN(self, double: float) -> CopolarN: + """ + Evaluate the three principal Jacobi elliptic functions with pole at point n in Glaisher’s Notation. + + Parameters: + u (double): argument of the functions + + Returns: + copolar trio containing the three principal Jacobi elliptic functions :code:`sn(u|m)`, :code:`cn(u|m)`, and + :code:`dn(u|m)`. + + + """ + ... + def valuesS(self, double: float) -> CopolarS: + """ + Evaluate the three subsidiary Jacobi elliptic functions with pole at point s in Glaisher’s Notation. + + Parameters: + u (double): argument of the functions + + Returns: + copolar trio containing the three subsidiary Jacobi elliptic functions :code:`cs(u|m)`, :code:`ds(u|m)` and + :code:`ns(u|m)`. + + + """ + ... class JacobiEllipticBuilder: + """ + public classJacobiEllipticBuilder extends :class:`~org.hipparchus.special.elliptic.jacobi.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Builder for algorithms compmuting Jacobi elliptic functions. + + The Jacobi elliptic functions are related to elliptic integrals. + + There are different conventions to interpret the arguments of Jacobi elliptic functions. The first argument may be the + amplitude φ, but is more often the variable u (with sn(u) = sin(φ) and cn(u) = cos(φ)). The second argument is either + the modulus k or the parameter m with m = k². In Hipparchus, we adopted the convention to use u and m. + + Since: + 2.0 + """ _build_0__T = typing.TypeVar('_build_0__T', bound=org.hipparchus.CalculusFieldElement) # <T> _build_2__T = typing.TypeVar('_build_2__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload @staticmethod - def build(t: _build_0__T) -> FieldJacobiElliptic[_build_0__T]: ... + def build(t: _build_0__T) -> FieldJacobiElliptic[_build_0__T]: + """ + Build an algorithm for computing Jacobi elliptic functions. + + Parameters: + m (T): parameter of the Jacobi elliptic function + + Returns: + selected algorithm + + public static :class:`~org.hipparchus.special.elliptic.jacobi.FieldJacobiElliptic`<:class:`~org.hipparchus.complex.Complex`> build(:class:`~org.hipparchus.complex.Complex` m) + + Build an algorithm for computing Jacobi elliptic functions. + + Parameters: + m (:class:`~org.hipparchus.complex.Complex`): parameter of the Jacobi elliptic function + + Returns: + selected algorithm + + public static <T extends :class:`~org.hipparchus.CalculusFieldElement`<T>> :class:`~org.hipparchus.special.elliptic.jacobi.FieldJacobiElliptic`<:class:`~org.hipparchus.complex.FieldComplex`<T>> build(:class:`~org.hipparchus.complex.FieldComplex`<T> m) + + Build an algorithm for computing Jacobi elliptic functions. + + Parameters: + m (:class:`~org.hipparchus.complex.FieldComplex`<T> m): parameter of the Jacobi elliptic function + + Returns: + selected algorithm + + + """ + ... @typing.overload @staticmethod - def build(complex: org.hipparchus.complex.Complex) -> FieldJacobiElliptic[org.hipparchus.complex.Complex]: ... + def build(complex: org.hipparchus.complex.Complex) -> FieldJacobiElliptic[org.hipparchus.complex.Complex]: + """ + Build an algorithm for computing Jacobi elliptic functions. + + Parameters: + m (double): parameter of the Jacobi elliptic function + + Returns: + selected algorithm + + """ + ... @typing.overload @staticmethod def build(fieldComplex: org.hipparchus.complex.FieldComplex[_build_2__T]) -> FieldJacobiElliptic[org.hipparchus.complex.FieldComplex[_build_2__T]]: ... @@ -172,15 +1178,94 @@ class JacobiEllipticBuilder: def build(double: float) -> JacobiElliptic: ... class JacobiTheta: + """ + public classJacobiTheta extends :class:`~org.hipparchus.special.elliptic.jacobi.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Algorithm computing Jacobi theta functions. + + Since: + 2.0 + """ def __init__(self, double: float): ... - def getQ(self) -> float: ... - def values(self, complex: org.hipparchus.complex.Complex) -> 'Theta': ... + def getQ(self) -> float: + """ + Get the nome. + + Returns: + nome + + + """ + ... + def values(self, complex: org.hipparchus.complex.Complex) -> 'Theta': + """ + Evaluate the Jacobi theta functions. + + Parameters: + z (:class:`~org.hipparchus.complex.Complex`): argument of the functions + + Returns: + container for the four Jacobi theta functions θâ‚(z|Ï„), θ₂(z|Ï„), θ₃(z|Ï„), and θ₄(z|Ï„) + + + """ + ... class Theta: - def theta1(self) -> org.hipparchus.complex.Complex: ... - def theta2(self) -> org.hipparchus.complex.Complex: ... - def theta3(self) -> org.hipparchus.complex.Complex: ... - def theta4(self) -> org.hipparchus.complex.Complex: ... + """ + public classTheta extends :class:`~org.hipparchus.special.elliptic.jacobi.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Values of :class:`~org.hipparchus.special.elliptic.jacobi.JacobiTheta` functions. + + This is a container for the four Jacobi theta functions θâ‚(z|Ï„), θ₂(z|Ï„), θ₃(z|Ï„), and θ₄(z|Ï„). + + Since: + 2.0 + + Also see: + + - :class:`~org.hipparchus.special.elliptic.jacobi.JacobiTheta` + """ + def theta1(self) -> org.hipparchus.complex.Complex: + """ + Get the value of the θâ‚(z|Ï„) function. + + Returns: + θâ‚(z|Ï„) + + + """ + ... + def theta2(self) -> org.hipparchus.complex.Complex: + """ + Get the value of the θ₂(z|Ï„) function. + + Returns: + θ₂(z|Ï„) + + + """ + ... + def theta3(self) -> org.hipparchus.complex.Complex: + """ + Get the value of the θ₃(z|Ï„) function. + + Returns: + θ₃(z|Ï„) + + + """ + ... + def theta4(self) -> org.hipparchus.complex.Complex: + """ + Get the value of the θ₄(z|Ï„) function. + + Returns: + θ₄(z|Ï„) + + + """ + ... class __module_protocol__(Protocol): diff --git a/org-stubs/hipparchus/special/elliptic/legendre/__init__.pyi b/org-stubs/hipparchus/special/elliptic/legendre/__init__.pyi index 1e7ff2f..13b0807 100644 --- a/org-stubs/hipparchus/special/elliptic/legendre/__init__.pyi +++ b/org-stubs/hipparchus/special/elliptic/legendre/__init__.pyi @@ -12,22 +12,225 @@ import typing class LegendreEllipticIntegral: + """ + public classLegendreEllipticIntegral extends :class:`~org.hipparchus.special.elliptic.legendre.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Complete and incomplete elliptic integrals in Legendre form. + + The elliptic integrals are related to Jacobi elliptic functions. + + *Beware that when computing elliptic integrals in the complex plane, many issues arise due to branch cuts. See the + :meth:`~org.hipparchus.special.elliptic.legendre.https:.www.hipparchus.org.hipparchus` for a thorough explanation.* + + There are different conventions to interpret the arguments of Legendre elliptic integrals. In mathematical texts, these + conventions show up using the separator between arguments. So for example for the incomplete integral of the first kind + F we have: + + - F(φ, k): the first argument φ is an angle and the second argument k is the elliptic modulus: this is the trigonometric + form of the integral + - F(φ; m): the first argument φ is an angle and the second argument m=k² is the parameter: this is also a trigonometric + form of the integral + - F(x|m): the first argument x=sin(φ) is not an angle anymore and the second argument m=k² is the parameter: this is the + Legendre form + - F(φ\α): the first argument φ is an angle and the second argument α is the modular angle + + + As we have no separator in a method call, we have to adopt one convention and stick to it. In Hipparchus, we adopted the + Legendre form (i.e. F(x|m), with x=sin(φ) and m=k². These conventions are consistent with Wolfram Alpha functions + EllipticF, EllipticE, ElliptiPI… + + Since: + 2.0 + + Also see: + + - :class:`~org.hipparchus.special.elliptic.legendre.https:.en.wikipedia.org.wiki.Elliptic_integral` + - :class:`~org.hipparchus.special.elliptic.legendre.https:.mathworld.wolfram.com.CompleteEllipticIntegraloftheFirstKind` + - :class:`~org.hipparchus.special.elliptic.legendre.https:.mathworld.wolfram.com.CompleteEllipticIntegraloftheSecondKind` + - :class:`~org.hipparchus.special.elliptic.legendre.https:.mathworld.wolfram.com.EllipticIntegraloftheFirstKind` + - :class:`~org.hipparchus.special.elliptic.legendre.https:.mathworld.wolfram.com.EllipticIntegraloftheSecondKind` + - :class:`~org.hipparchus.special.elliptic.legendre.https:.mathworld.wolfram.com.EllipticIntegraloftheThirdKind` + """ _bigD_2__T = typing.TypeVar('_bigD_2__T', bound=org.hipparchus.CalculusFieldElement) # <T> _bigD_3__T = typing.TypeVar('_bigD_3__T', bound=org.hipparchus.CalculusFieldElement) # <T> _bigD_6__T = typing.TypeVar('_bigD_6__T', bound=org.hipparchus.CalculusFieldElement) # <T> _bigD_7__T = typing.TypeVar('_bigD_7__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload @staticmethod - def bigD(double: float) -> float: ... + def bigD(double: float) -> float: + """ + Get the complete elliptic integral D(m) = [K(m) - E(m)]/m. + + The complete elliptic integral D(m) is \[ \int_0^{\frac{\pi}{2}} \frac{\sin^2\theta}{\sqrt{1-m \sin^2\theta}} d\theta \] + + The algorithm for evaluating the functions is based on + :class:`~org.hipparchus.special.elliptic.carlson.CarlsonEllipticIntegral`. + + Parameters: + m (double): parameter (m=k² where k is the elliptic modulus) + + Returns: + complete elliptic integral D(m) + + Also see: + + - :meth:`~org.hipparchus.special.elliptic.legendre.LegendreEllipticIntegral.bigD` + + + Get the complete elliptic integral D(m) = [K(m) - E(m)]/m. + + The complete elliptic integral D(m) is \[ \int_0^{\frac{\pi}{2}} \frac{\sin^2\theta}{\sqrt{1-m \sin^2\theta}} d\theta \] + + The algorithm for evaluating the functions is based on + :class:`~org.hipparchus.special.elliptic.carlson.CarlsonEllipticIntegral`. + + Parameters: + m (:class:`~org.hipparchus.complex.Complex`): parameter (m=k² where k is the elliptic modulus) + + Returns: + complete elliptic integral D(m) + + Also see: + + - :meth:`~org.hipparchus.special.elliptic.legendre.LegendreEllipticIntegral.bigD` + + + Get the incomplete elliptic integral D(φ, m) = [F(φ, m) - E(φ, m)]/m. + + The incomplete elliptic integral D(φ, m) is \[ \int_0^{\phi} \frac{\sin^2\theta}{\sqrt{1-m \sin^2\theta}} d\theta \] + + The algorithm for evaluating the functions is based on + :class:`~org.hipparchus.special.elliptic.carlson.CarlsonEllipticIntegral`. + + Parameters: + phi (double): amplitude (i.e. upper bound of the integral) + m (double): parameter (m=k² where k is the elliptic modulus) + + Returns: + incomplete elliptic integral D(φ, m) + + Also see: + + - :meth:`~org.hipparchus.special.elliptic.legendre.LegendreEllipticIntegral.bigD` + + + Get the incomplete elliptic integral D(φ, m) = [F(φ, m) - E(φ, m)]/m. + + *BEWARE! Elliptic integrals for complex numbers in the incomplete case are considered experimental for now, they have + known issues.* + + The incomplete elliptic integral D(φ, m) is \[ \int_0^{\phi} \frac{\sin^2\theta}{\sqrt{1-m \sin^2\theta}} d\theta \] + + The algorithm for evaluating the functions is based on + :class:`~org.hipparchus.special.elliptic.carlson.CarlsonEllipticIntegral`. + + Parameters: + phi (:class:`~org.hipparchus.complex.Complex`): amplitude (i.e. upper bound of the integral) + m (:class:`~org.hipparchus.complex.Complex`): parameter (m=k² where k is the elliptic modulus) + + Returns: + incomplete elliptic integral D(φ, m) + + Also see: + + - :meth:`~org.hipparchus.special.elliptic.legendre.LegendreEllipticIntegral.bigD` + + + """ + ... @typing.overload @staticmethod def bigD(double: float, double2: float) -> float: ... @typing.overload @staticmethod - def bigD(t: _bigD_2__T) -> _bigD_2__T: ... + def bigD(t: _bigD_2__T) -> _bigD_2__T: + """ + Get the complete elliptic integral D(m) = [K(m) - E(m)]/m. + + The complete elliptic integral D(m) is \[ \int_0^{\frac{\pi}{2}} \frac{\sin^2\theta}{\sqrt{1-m \sin^2\theta}} d\theta \] + + The algorithm for evaluating the functions is based on + :class:`~org.hipparchus.special.elliptic.carlson.CarlsonEllipticIntegral`. + + Parameters: + m (T): parameter (m=k² where k is the elliptic modulus) + + Returns: + complete elliptic integral D(m) + + Also see: + + - :meth:`~org.hipparchus.special.elliptic.legendre.LegendreEllipticIntegral.bigD` + + + Get the complete elliptic integral D(m) = [K(m) - E(m)]/m. + + The complete elliptic integral D(m) is \[ \int_0^{\frac{\pi}{2}} \frac{\sin^2\theta}{\sqrt{1-m \sin^2\theta}} d\theta \] + + The algorithm for evaluating the functions is based on + :class:`~org.hipparchus.special.elliptic.carlson.CarlsonEllipticIntegral`. + + Parameters: + m (:class:`~org.hipparchus.complex.FieldComplex`<T> m): parameter (m=k² where k is the elliptic modulus) + + Returns: + complete elliptic integral D(m) + + Also see: + + - :meth:`~org.hipparchus.special.elliptic.legendre.LegendreEllipticIntegral.bigD` + + + Get the incomplete elliptic integral D(φ, m) = [F(φ, m) - E(φ, m)]/m. + + The incomplete elliptic integral D(φ, m) is \[ \int_0^{\phi} \frac{\sin^2\theta}{\sqrt{1-m \sin^2\theta}} d\theta \] + + The algorithm for evaluating the functions is based on + :class:`~org.hipparchus.special.elliptic.carlson.CarlsonEllipticIntegral`. + + Parameters: + phi (T): amplitude (i.e. upper bound of the integral) + m (T): parameter (m=k² where k is the elliptic modulus) + + Returns: + incomplete elliptic integral D(φ, m) + + Also see: + + - :meth:`~org.hipparchus.special.elliptic.legendre.LegendreEllipticIntegral.bigD` + + + """ + ... @typing.overload @staticmethod - def bigD(t: _bigD_3__T, t2: _bigD_3__T) -> _bigD_3__T: ... + def bigD(t: _bigD_3__T, t2: _bigD_3__T) -> _bigD_3__T: + """ + Get the incomplete elliptic integral D(φ, m) = [F(φ, m) - E(φ, m)]/m. + + *BEWARE! Elliptic integrals for complex numbers in the incomplete case are considered experimental for now, they have + known issues.* + + The incomplete elliptic integral D(φ, m) is \[ \int_0^{\phi} \frac{\sin^2\theta}{\sqrt{1-m \sin^2\theta}} d\theta \] + + The algorithm for evaluating the functions is based on + :class:`~org.hipparchus.special.elliptic.carlson.CarlsonEllipticIntegral`. + + Parameters: + phi (:class:`~org.hipparchus.complex.FieldComplex`<T> phi): amplitude (i.e. upper bound of the integral) + m (:class:`~org.hipparchus.complex.FieldComplex`<T> m): parameter (m=k² where k is the elliptic modulus) + + Returns: + incomplete elliptic integral D(φ, m) + + Also see: + + - :meth:`~org.hipparchus.special.elliptic.legendre.LegendreEllipticIntegral.bigD` + + + + """ + ... @typing.overload @staticmethod def bigD(complex: org.hipparchus.complex.Complex) -> org.hipparchus.complex.Complex: ... @@ -47,16 +250,223 @@ class LegendreEllipticIntegral: _bigE_9__T = typing.TypeVar('_bigE_9__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload @staticmethod - def bigE(double: float) -> float: ... + def bigE(double: float) -> float: + """ + Get the complete elliptic integral of the second kind E(m). + + The complete elliptic integral of the second kind E(m) is \[ \int_0^{\frac{\pi}{2}} \sqrt{1-m \sin^2\theta} d\theta \] + + The algorithm for evaluating the functions is based on + :class:`~org.hipparchus.special.elliptic.carlson.CarlsonEllipticIntegral`. + + Parameters: + m (double): parameter (m=k² where k is the elliptic modulus) + + Returns: + complete elliptic integral of the second kind E(m) + + Also see: + + - :meth:`~org.hipparchus.special.elliptic.legendre.LegendreEllipticIntegral.bigE` + - :class:`~org.hipparchus.special.elliptic.legendre.https:.mathworld.wolfram.com.CompleteEllipticIntegraloftheSecondKind` + - :class:`~org.hipparchus.special.elliptic.legendre.https:.en.wikipedia.org.wiki.Elliptic_integral` + + + Get the complete elliptic integral of the second kind E(m). + + The complete elliptic integral of the second kind E(m) is \[ \int_0^{\frac{\pi}{2}} \sqrt{1-m \sin^2\theta} d\theta \] + + The algorithm for evaluating the functions is based on + :class:`~org.hipparchus.special.elliptic.carlson.CarlsonEllipticIntegral`. + + Parameters: + m (:class:`~org.hipparchus.complex.Complex`): parameter (m=k² where k is the elliptic modulus) + + Returns: + complete elliptic integral of the second kind E(m) + + Also see: + + - :meth:`~org.hipparchus.special.elliptic.legendre.LegendreEllipticIntegral.bigE` + - :class:`~org.hipparchus.special.elliptic.legendre.https:.mathworld.wolfram.com.CompleteEllipticIntegraloftheSecondKind` + - :class:`~org.hipparchus.special.elliptic.legendre.https:.en.wikipedia.org.wiki.Elliptic_integral` + + + Get the incomplete elliptic integral of the second kind E(φ, m). + + The incomplete elliptic integral of the second kind E(φ, m) is \[ \int_0^{\phi} \sqrt{1-m \sin^2\theta} d\theta \] + + The algorithm for evaluating the functions is based on + :class:`~org.hipparchus.special.elliptic.carlson.CarlsonEllipticIntegral`. + + Parameters: + phi (double): amplitude (i.e. upper bound of the integral) + m (double): parameter (m=k² where k is the elliptic modulus) + + Returns: + incomplete elliptic integral of the second kind E(φ, m) + + Also see: + + - :meth:`~org.hipparchus.special.elliptic.legendre.LegendreEllipticIntegral.bigE` + - :class:`~org.hipparchus.special.elliptic.legendre.https:.mathworld.wolfram.com.EllipticIntegraloftheSecondKind` + - :class:`~org.hipparchus.special.elliptic.legendre.https:.en.wikipedia.org.wiki.Elliptic_integral` + + + Get the incomplete elliptic integral of the second kind E(φ, m). + + *BEWARE! Elliptic integrals for complex numbers in the incomplete case are considered experimental for now, they have + known issues.* + + The incomplete elliptic integral of the second kind E(φ, m) is \[ \int_0^{\phi} \sqrt{1-m \sin^2\theta} d\theta \] + + The algorithm for evaluating the functions is based on + :class:`~org.hipparchus.special.elliptic.carlson.CarlsonEllipticIntegral`. + + Parameters: + phi (:class:`~org.hipparchus.complex.Complex`): amplitude (i.e. upper bound of the integral) + m (:class:`~org.hipparchus.complex.Complex`): parameter (m=k² where k is the elliptic modulus) + + Returns: + incomplete elliptic integral of the second kind E(φ, m) + + Also see: + + - :meth:`~org.hipparchus.special.elliptic.legendre.LegendreEllipticIntegral.bigE` + - :class:`~org.hipparchus.special.elliptic.legendre.https:.mathworld.wolfram.com.EllipticIntegraloftheSecondKind` + - :class:`~org.hipparchus.special.elliptic.legendre.https:.en.wikipedia.org.wiki.Elliptic_integral` + + + Get the incomplete elliptic integral of the second kind E(φ, m) using numerical integration. + + *BEWARE! Elliptic integrals for complex numbers in the incomplete case are considered experimental for now, they have + known issues.* + + The incomplete elliptic integral of the second kind E(φ, m) is \[ \int_0^{\phi} \sqrt{1-m \sin^2\theta} d\theta \] + + The algorithm for evaluating the functions is based on numerical integration. If integration path comes too close to a + pole of the integrand, then integration will fail with a :class:`~org.hipparchus.exception.MathIllegalStateException` + even for very large :code:`maxEval`. This is normal behavior. + + Parameters: + phi (:class:`~org.hipparchus.complex.Complex`): amplitude (i.e. upper bound of the integral) + m (:class:`~org.hipparchus.complex.Complex`): parameter (m=k² where k is the elliptic modulus) + integrator (:class:`~org.hipparchus.complex.ComplexUnivariateIntegrator`): integrator to use + maxEval (int): maximum number of evaluations (real and imaginary parts are evaluated separately, so up to twice this number may be + used) + + Returns: + incomplete elliptic integral of the second kind E(φ, m) + + Also see: + + - :meth:`~org.hipparchus.special.elliptic.legendre.LegendreEllipticIntegral.bigE` + - :class:`~org.hipparchus.special.elliptic.legendre.https:.mathworld.wolfram.com.EllipticIntegraloftheSecondKind` + - :class:`~org.hipparchus.special.elliptic.legendre.https:.en.wikipedia.org.wiki.Elliptic_integral` + + + """ + ... @typing.overload @staticmethod def bigE(double: float, double2: float) -> float: ... @typing.overload @staticmethod - def bigE(t: _bigE_2__T) -> _bigE_2__T: ... + def bigE(t: _bigE_2__T) -> _bigE_2__T: + """ + Get the complete elliptic integral of the second kind E(m). + + The complete elliptic integral of the second kind E(m) is \[ \int_0^{\frac{\pi}{2}} \sqrt{1-m \sin^2\theta} d\theta \] + + The algorithm for evaluating the functions is based on + :class:`~org.hipparchus.special.elliptic.carlson.CarlsonEllipticIntegral`. + + Parameters: + m (T): parameter (m=k² where k is the elliptic modulus) + + Returns: + complete elliptic integral of the second kind E(m) + + Also see: + + - :meth:`~org.hipparchus.special.elliptic.legendre.LegendreEllipticIntegral.bigE` + - :class:`~org.hipparchus.special.elliptic.legendre.https:.mathworld.wolfram.com.CompleteEllipticIntegraloftheSecondKind` + - :class:`~org.hipparchus.special.elliptic.legendre.https:.en.wikipedia.org.wiki.Elliptic_integral` + + + Get the complete elliptic integral of the second kind E(m). + + The complete elliptic integral of the second kind E(m) is \[ \int_0^{\frac{\pi}{2}} \sqrt{1-m \sin^2\theta} d\theta \] + + The algorithm for evaluating the functions is based on + :class:`~org.hipparchus.special.elliptic.carlson.CarlsonEllipticIntegral`. + + Parameters: + m (:class:`~org.hipparchus.complex.FieldComplex`<T> m): parameter (m=k² where k is the elliptic modulus) + + Returns: + complete elliptic integral of the second kind E(m) + + Also see: + + - :meth:`~org.hipparchus.special.elliptic.legendre.LegendreEllipticIntegral.bigE` + - :class:`~org.hipparchus.special.elliptic.legendre.https:.mathworld.wolfram.com.CompleteEllipticIntegraloftheSecondKind` + - :class:`~org.hipparchus.special.elliptic.legendre.https:.en.wikipedia.org.wiki.Elliptic_integral` + + + Get the incomplete elliptic integral of the second kind E(φ, m). + + The incomplete elliptic integral of the second kind E(φ, m) is \[ \int_0^{\phi} \sqrt{1-m \sin^2\theta} d\theta \] + + The algorithm for evaluating the functions is based on + :class:`~org.hipparchus.special.elliptic.carlson.CarlsonEllipticIntegral`. + + Parameters: + phi (T): amplitude (i.e. upper bound of the integral) + m (T): parameter (m=k² where k is the elliptic modulus) + + Returns: + incomplete elliptic integral of the second kind E(φ, m) + + Also see: + + - :meth:`~org.hipparchus.special.elliptic.legendre.LegendreEllipticIntegral.bigE` + - :class:`~org.hipparchus.special.elliptic.legendre.https:.mathworld.wolfram.com.EllipticIntegraloftheSecondKind` + - :class:`~org.hipparchus.special.elliptic.legendre.https:.en.wikipedia.org.wiki.Elliptic_integral` + + + """ + ... @typing.overload @staticmethod - def bigE(t: _bigE_3__T, t2: _bigE_3__T) -> _bigE_3__T: ... + def bigE(t: _bigE_3__T, t2: _bigE_3__T) -> _bigE_3__T: + """ + Get the incomplete elliptic integral of the second kind E(φ, m). + + *BEWARE! Elliptic integrals for complex numbers in the incomplete case are considered experimental for now, they have + known issues.* + + The incomplete elliptic integral of the second kind E(φ, m) is \[ \int_0^{\phi} \sqrt{1-m \sin^2\theta} d\theta \] + + The algorithm for evaluating the functions is based on + :class:`~org.hipparchus.special.elliptic.carlson.CarlsonEllipticIntegral`. + + Parameters: + phi (:class:`~org.hipparchus.complex.FieldComplex`<T> phi): amplitude (i.e. upper bound of the integral) + m (:class:`~org.hipparchus.complex.FieldComplex`<T> m): parameter (m=k² where k is the elliptic modulus) + + Returns: + incomplete elliptic integral of the second kind E(φ, m) + + Also see: + + - :meth:`~org.hipparchus.special.elliptic.legendre.LegendreEllipticIntegral.bigE` + - :class:`~org.hipparchus.special.elliptic.legendre.https:.mathworld.wolfram.com.EllipticIntegraloftheSecondKind` + - :class:`~org.hipparchus.special.elliptic.legendre.https:.en.wikipedia.org.wiki.Elliptic_integral` + + + """ + ... @typing.overload @staticmethod def bigE(complex: org.hipparchus.complex.Complex) -> org.hipparchus.complex.Complex: ... @@ -74,16 +484,177 @@ class LegendreEllipticIntegral: def bigE(fieldComplex: org.hipparchus.complex.FieldComplex[_bigE_8__T], fieldComplex2: org.hipparchus.complex.FieldComplex[_bigE_8__T]) -> org.hipparchus.complex.FieldComplex[_bigE_8__T]: ... @typing.overload @staticmethod - def bigE(fieldComplex: org.hipparchus.complex.FieldComplex[_bigE_9__T], fieldComplex2: org.hipparchus.complex.FieldComplex[_bigE_9__T], fieldComplexUnivariateIntegrator: org.hipparchus.complex.FieldComplexUnivariateIntegrator[_bigE_9__T], int: int) -> org.hipparchus.complex.FieldComplex[_bigE_9__T]: ... + def bigE(fieldComplex: org.hipparchus.complex.FieldComplex[_bigE_9__T], fieldComplex2: org.hipparchus.complex.FieldComplex[_bigE_9__T], fieldComplexUnivariateIntegrator: org.hipparchus.complex.FieldComplexUnivariateIntegrator[_bigE_9__T], int: int) -> org.hipparchus.complex.FieldComplex[_bigE_9__T]: + """ + Get the incomplete elliptic integral of the second kind E(φ, m). + + *BEWARE! Elliptic integrals for complex numbers in the incomplete case are considered experimental for now, they have + known issues.* + + The incomplete elliptic integral of the second kind E(φ, m) is \[ \int_0^{\phi} \sqrt{1-m \sin^2\theta} d\theta \] + + The algorithm for evaluating the functions is based on numerical integration. If integration path comes too close to a + pole of the integrand, then integration will fail with a :class:`~org.hipparchus.exception.MathIllegalStateException` + even for very large :code:`maxEval`. This is normal behavior. + + Parameters: + phi (:class:`~org.hipparchus.complex.FieldComplex`<T> phi): amplitude (i.e. upper bound of the integral) + m (:class:`~org.hipparchus.complex.FieldComplex`<T> m): parameter (m=k² where k is the elliptic modulus) + integrator (:class:`~org.hipparchus.complex.FieldComplexUnivariateIntegrator`<T> integrator): integrator to use + maxEval (int): maximum number of evaluations (real and imaginary parts are evaluated separately, so up to twice this number may be + used) + + Returns: + incomplete elliptic integral of the second kind E(φ, m) + + Also see: + + - :meth:`~org.hipparchus.special.elliptic.legendre.LegendreEllipticIntegral.bigE` + - :class:`~org.hipparchus.special.elliptic.legendre.https:.mathworld.wolfram.com.EllipticIntegraloftheSecondKind` + - :class:`~org.hipparchus.special.elliptic.legendre.https:.en.wikipedia.org.wiki.Elliptic_integral` + + + + """ + ... _bigF_1__T = typing.TypeVar('_bigF_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> _bigF_4__T = typing.TypeVar('_bigF_4__T', bound=org.hipparchus.CalculusFieldElement) # <T> _bigF_5__T = typing.TypeVar('_bigF_5__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload @staticmethod - def bigF(double: float, double2: float) -> float: ... + def bigF(double: float, double2: float) -> float: + """ + Get the incomplete elliptic integral of the first kind F(φ, m). + + The incomplete elliptic integral of the first kind F(φ, m) is \[ \int_0^{\phi} \frac{d\theta}{\sqrt{1-m \sin^2\theta}} + \] + + The algorithm for evaluating the functions is based on + :class:`~org.hipparchus.special.elliptic.carlson.CarlsonEllipticIntegral`. + + Parameters: + phi (double): amplitude (i.e. upper bound of the integral) + m (double): parameter (m=k² where k is the elliptic modulus) + + Returns: + incomplete elliptic integral of the first kind F(φ, m) + + Also see: + + - :meth:`~org.hipparchus.special.elliptic.legendre.LegendreEllipticIntegral.bigK` + - :class:`~org.hipparchus.special.elliptic.legendre.https:.mathworld.wolfram.com.EllipticIntegraloftheFirstKind` + - :class:`~org.hipparchus.special.elliptic.legendre.https:.en.wikipedia.org.wiki.Elliptic_integral` + + + Get the incomplete elliptic integral of the first kind F(φ, m). + + *BEWARE! Elliptic integrals for complex numbers in the incomplete case are considered experimental for now, they have + known issues.* + + The incomplete elliptic integral of the first kind F(φ, m) is \[ \int_0^{\phi} \frac{d\theta}{\sqrt{1-m \sin^2\theta}} + \] + + The algorithm for evaluating the functions is based on + :class:`~org.hipparchus.special.elliptic.carlson.CarlsonEllipticIntegral`. + + Parameters: + phi (:class:`~org.hipparchus.complex.Complex`): amplitude (i.e. upper bound of the integral) + m (:class:`~org.hipparchus.complex.Complex`): parameter (m=k² where k is the elliptic modulus) + + Returns: + incomplete elliptic integral of the first kind F(φ, m) + + Also see: + + - :meth:`~org.hipparchus.special.elliptic.legendre.LegendreEllipticIntegral.bigK` + - :class:`~org.hipparchus.special.elliptic.legendre.https:.mathworld.wolfram.com.EllipticIntegraloftheFirstKind` + - :class:`~org.hipparchus.special.elliptic.legendre.https:.en.wikipedia.org.wiki.Elliptic_integral` + + + Get the incomplete elliptic integral of the first kind F(φ, m) using numerical integration. + + *BEWARE! Elliptic integrals for complex numbers in the incomplete case are considered experimental for now, they have + known issues.* + + The incomplete elliptic integral of the first kind F(φ, m) is \[ \int_0^{\phi} \frac{d\theta}{\sqrt{1-m \sin^2\theta}} + \] + + The algorithm for evaluating the functions is based on numerical integration. If integration path comes too close to a + pole of the integrand, then integration will fail with a :class:`~org.hipparchus.exception.MathIllegalStateException` + even for very large :code:`maxEval`. This is normal behavior. + + Parameters: + phi (:class:`~org.hipparchus.complex.Complex`): amplitude (i.e. upper bound of the integral) + m (:class:`~org.hipparchus.complex.Complex`): parameter (m=k² where k is the elliptic modulus) + integrator (:class:`~org.hipparchus.complex.ComplexUnivariateIntegrator`): integrator to use + maxEval (int): maximum number of evaluations (real and imaginary parts are evaluated separately, so up to twice this number may be + used) + + Returns: + incomplete elliptic integral of the first kind F(φ, m) + + Also see: + + - :meth:`~org.hipparchus.special.elliptic.legendre.LegendreEllipticIntegral.bigK` + - :class:`~org.hipparchus.special.elliptic.legendre.https:.mathworld.wolfram.com.EllipticIntegraloftheFirstKind` + - :class:`~org.hipparchus.special.elliptic.legendre.https:.en.wikipedia.org.wiki.Elliptic_integral` + + + """ + ... @typing.overload @staticmethod - def bigF(t: _bigF_1__T, t2: _bigF_1__T) -> _bigF_1__T: ... + def bigF(t: _bigF_1__T, t2: _bigF_1__T) -> _bigF_1__T: + """ + Get the incomplete elliptic integral of the first kind F(φ, m). + + The incomplete elliptic integral of the first kind F(φ, m) is \[ \int_0^{\phi} \frac{d\theta}{\sqrt{1-m \sin^2\theta}} + \] + + The algorithm for evaluating the functions is based on + :class:`~org.hipparchus.special.elliptic.carlson.CarlsonEllipticIntegral`. + + Parameters: + phi (T): amplitude (i.e. upper bound of the integral) + m (T): parameter (m=k² where k is the elliptic modulus) + + Returns: + incomplete elliptic integral of the first kind F(φ, m) + + Also see: + + - :meth:`~org.hipparchus.special.elliptic.legendre.LegendreEllipticIntegral.bigK` + - :class:`~org.hipparchus.special.elliptic.legendre.https:.mathworld.wolfram.com.EllipticIntegraloftheFirstKind` + - :class:`~org.hipparchus.special.elliptic.legendre.https:.en.wikipedia.org.wiki.Elliptic_integral` + + + Get the incomplete elliptic integral of the first kind F(φ, m). + + *BEWARE! Elliptic integrals for complex numbers in the incomplete case are considered experimental for now, they have + known issues.* + + The incomplete elliptic integral of the first kind F(φ, m) is \[ \int_0^{\phi} \frac{d\theta}{\sqrt{1-m \sin^2\theta}} + \] + + The algorithm for evaluating the functions is based on + :class:`~org.hipparchus.special.elliptic.carlson.CarlsonEllipticIntegral`. + + Parameters: + phi (:class:`~org.hipparchus.complex.FieldComplex`<T> phi): amplitude (i.e. upper bound of the integral) + m (:class:`~org.hipparchus.complex.FieldComplex`<T> m): parameter (m=k² where k is the elliptic modulus) + + Returns: + incomplete elliptic integral of the first kind F(φ, m) + + Also see: + + - :meth:`~org.hipparchus.special.elliptic.legendre.LegendreEllipticIntegral.bigK` + - :class:`~org.hipparchus.special.elliptic.legendre.https:.mathworld.wolfram.com.EllipticIntegraloftheFirstKind` + - :class:`~org.hipparchus.special.elliptic.legendre.https:.en.wikipedia.org.wiki.Elliptic_integral` + + + """ + ... @typing.overload @staticmethod def bigF(complex: org.hipparchus.complex.Complex, complex2: org.hipparchus.complex.Complex) -> org.hipparchus.complex.Complex: ... @@ -95,15 +666,143 @@ class LegendreEllipticIntegral: def bigF(fieldComplex: org.hipparchus.complex.FieldComplex[_bigF_4__T], fieldComplex2: org.hipparchus.complex.FieldComplex[_bigF_4__T]) -> org.hipparchus.complex.FieldComplex[_bigF_4__T]: ... @typing.overload @staticmethod - def bigF(fieldComplex: org.hipparchus.complex.FieldComplex[_bigF_5__T], fieldComplex2: org.hipparchus.complex.FieldComplex[_bigF_5__T], fieldComplexUnivariateIntegrator: org.hipparchus.complex.FieldComplexUnivariateIntegrator[_bigF_5__T], int: int) -> org.hipparchus.complex.FieldComplex[_bigF_5__T]: ... + def bigF(fieldComplex: org.hipparchus.complex.FieldComplex[_bigF_5__T], fieldComplex2: org.hipparchus.complex.FieldComplex[_bigF_5__T], fieldComplexUnivariateIntegrator: org.hipparchus.complex.FieldComplexUnivariateIntegrator[_bigF_5__T], int: int) -> org.hipparchus.complex.FieldComplex[_bigF_5__T]: + """ + Get the incomplete elliptic integral of the first kind F(φ, m). + + *BEWARE! Elliptic integrals for complex numbers in the incomplete case are considered experimental for now, they have + known issues.* + + The incomplete elliptic integral of the first kind F(φ, m) is \[ \int_0^{\phi} \frac{d\theta}{\sqrt{1-m \sin^2\theta}} + \] + + The algorithm for evaluating the functions is based on numerical integration. If integration path comes too close to a + pole of the integrand, then integration will fail with a :class:`~org.hipparchus.exception.MathIllegalStateException` + even for very large :code:`maxEval`. This is normal behavior. + + Parameters: + phi (:class:`~org.hipparchus.complex.FieldComplex`<T> phi): amplitude (i.e. upper bound of the integral) + m (:class:`~org.hipparchus.complex.FieldComplex`<T> m): parameter (m=k² where k is the elliptic modulus) + integrator (:class:`~org.hipparchus.complex.FieldComplexUnivariateIntegrator`<T> integrator): integrator to use + maxEval (int): maximum number of evaluations (real and imaginary parts are evaluated separately, so up to twice this number may be + used) + + Returns: + incomplete elliptic integral of the first kind F(φ, m) + + Also see: + + - :meth:`~org.hipparchus.special.elliptic.legendre.LegendreEllipticIntegral.bigK` + - :class:`~org.hipparchus.special.elliptic.legendre.https:.mathworld.wolfram.com.EllipticIntegraloftheFirstKind` + - :class:`~org.hipparchus.special.elliptic.legendre.https:.en.wikipedia.org.wiki.Elliptic_integral` + + + + """ + ... _bigK_1__T = typing.TypeVar('_bigK_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> _bigK_3__T = typing.TypeVar('_bigK_3__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload @staticmethod - def bigK(double: float) -> float: ... + def bigK(double: float) -> float: + """ + Get the complete elliptic integral of the first kind K(m). + + The complete elliptic integral of the first kind K(m) is \[ \int_0^{\frac{\pi}{2}} \frac{d\theta}{\sqrt{1-m + \sin^2\theta}} \] it corresponds to the real quarter-period of Jacobi elliptic functions + + The algorithm for evaluating the functions is based on + :class:`~org.hipparchus.special.elliptic.carlson.CarlsonEllipticIntegral`. + + Parameters: + m (double): parameter (m=k² where k is the elliptic modulus) + + Returns: + complete elliptic integral of the first kind K(m) + + Also see: + + - :meth:`~org.hipparchus.special.elliptic.legendre.LegendreEllipticIntegral.bigKPrime` + - :meth:`~org.hipparchus.special.elliptic.legendre.LegendreEllipticIntegral.bigF` + - :class:`~org.hipparchus.special.elliptic.legendre.https:.mathworld.wolfram.com.CompleteEllipticIntegraloftheFirstKind` + - :class:`~org.hipparchus.special.elliptic.legendre.https:.en.wikipedia.org.wiki.Elliptic_integral` + + + Get the complete elliptic integral of the first kind K(m). + + The complete elliptic integral of the first kind K(m) is \[ \int_0^{\frac{\pi}{2}} \frac{d\theta}{\sqrt{1-m + \sin^2\theta}} \] it corresponds to the real quarter-period of Jacobi elliptic functions + + The algorithm for evaluating the functions is based on + :class:`~org.hipparchus.special.elliptic.carlson.CarlsonEllipticIntegral`. + + Parameters: + m (:class:`~org.hipparchus.complex.Complex`): parameter (m=k² where k is the elliptic modulus) + + Returns: + complete elliptic integral of the first kind K(m) + + Also see: + + - :meth:`~org.hipparchus.special.elliptic.legendre.LegendreEllipticIntegral.bigKPrime` + - :meth:`~org.hipparchus.special.elliptic.legendre.LegendreEllipticIntegral.bigF` + - :class:`~org.hipparchus.special.elliptic.legendre.https:.mathworld.wolfram.com.CompleteEllipticIntegraloftheFirstKind` + - :class:`~org.hipparchus.special.elliptic.legendre.https:.en.wikipedia.org.wiki.Elliptic_integral` + + + """ + ... @typing.overload @staticmethod - def bigK(t: _bigK_1__T) -> _bigK_1__T: ... + def bigK(t: _bigK_1__T) -> _bigK_1__T: + """ + Get the complete elliptic integral of the first kind K(m). + + The complete elliptic integral of the first kind K(m) is \[ \int_0^{\frac{\pi}{2}} \frac{d\theta}{\sqrt{1-m + \sin^2\theta}} \] it corresponds to the real quarter-period of Jacobi elliptic functions + + The algorithm for evaluating the functions is based on + :class:`~org.hipparchus.special.elliptic.carlson.CarlsonEllipticIntegral`. + + Parameters: + m (T): parameter (m=k² where k is the elliptic modulus) + + Returns: + complete elliptic integral of the first kind K(m) + + Also see: + + - :meth:`~org.hipparchus.special.elliptic.legendre.LegendreEllipticIntegral.bigKPrime` + - :meth:`~org.hipparchus.special.elliptic.legendre.LegendreEllipticIntegral.bigF` + - :class:`~org.hipparchus.special.elliptic.legendre.https:.mathworld.wolfram.com.CompleteEllipticIntegraloftheFirstKind` + - :class:`~org.hipparchus.special.elliptic.legendre.https:.en.wikipedia.org.wiki.Elliptic_integral` + + + Get the complete elliptic integral of the first kind K(m). + + The complete elliptic integral of the first kind K(m) is \[ \int_0^{\frac{\pi}{2}} \frac{d\theta}{\sqrt{1-m + \sin^2\theta}} \] it corresponds to the real quarter-period of Jacobi elliptic functions + + The algorithm for evaluating the functions is based on + :class:`~org.hipparchus.special.elliptic.carlson.CarlsonEllipticIntegral`. + + Parameters: + m (:class:`~org.hipparchus.complex.FieldComplex`<T> m): parameter (m=k² where k is the elliptic modulus) + + Returns: + complete elliptic integral of the first kind K(m) + + Also see: + + - :meth:`~org.hipparchus.special.elliptic.legendre.LegendreEllipticIntegral.bigKPrime` + - :meth:`~org.hipparchus.special.elliptic.legendre.LegendreEllipticIntegral.bigF` + - :class:`~org.hipparchus.special.elliptic.legendre.https:.mathworld.wolfram.com.CompleteEllipticIntegraloftheFirstKind` + - :class:`~org.hipparchus.special.elliptic.legendre.https:.en.wikipedia.org.wiki.Elliptic_integral` + + + + """ + ... @typing.overload @staticmethod def bigK(complex: org.hipparchus.complex.Complex) -> org.hipparchus.complex.Complex: ... @@ -114,10 +813,101 @@ class LegendreEllipticIntegral: _bigKPrime_3__T = typing.TypeVar('_bigKPrime_3__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload @staticmethod - def bigKPrime(double: float) -> float: ... + def bigKPrime(double: float) -> float: + """ + Get the complete elliptic integral of the first kind K'(m). + + The complete elliptic integral of the first kind K'(m) is \[ \int_0^{\frac{\pi}{2}} \frac{d\theta}{\sqrt{1-(1-m) + \sin^2\theta}} \] it corresponds to the imaginary quarter-period of Jacobi elliptic functions + + The algorithm for evaluating the functions is based on + :class:`~org.hipparchus.special.elliptic.carlson.CarlsonEllipticIntegral`. + + Parameters: + m (double): parameter (m=k² where k is the elliptic modulus) + + Returns: + complete elliptic integral of the first kind K'(m) + + Also see: + + - :meth:`~org.hipparchus.special.elliptic.legendre.LegendreEllipticIntegral.bigK` + - :class:`~org.hipparchus.special.elliptic.legendre.https:.mathworld.wolfram.com.CompleteEllipticIntegraloftheFirstKind` + - :class:`~org.hipparchus.special.elliptic.legendre.https:.en.wikipedia.org.wiki.Elliptic_integral` + + + Get the complete elliptic integral of the first kind K'(m). + + The complete elliptic integral of the first kind K'(m) is \[ \int_0^{\frac{\pi}{2}} \frac{d\theta}{\sqrt{1-(1-m) + \sin^2\theta}} \] it corresponds to the imaginary quarter-period of Jacobi elliptic functions + + The algorithm for evaluating the functions is based on + :class:`~org.hipparchus.special.elliptic.carlson.CarlsonEllipticIntegral`. + + Parameters: + m (:class:`~org.hipparchus.complex.Complex`): parameter (m=k² where k is the elliptic modulus) + + Returns: + complete elliptic integral of the first kind K'(m) + + Also see: + + - :meth:`~org.hipparchus.special.elliptic.legendre.LegendreEllipticIntegral.bigK` + - :class:`~org.hipparchus.special.elliptic.legendre.https:.mathworld.wolfram.com.CompleteEllipticIntegraloftheFirstKind` + - :class:`~org.hipparchus.special.elliptic.legendre.https:.en.wikipedia.org.wiki.Elliptic_integral` + + + """ + ... @typing.overload @staticmethod - def bigKPrime(t: _bigKPrime_1__T) -> _bigKPrime_1__T: ... + def bigKPrime(t: _bigKPrime_1__T) -> _bigKPrime_1__T: + """ + Get the complete elliptic integral of the first kind K'(m). + + The complete elliptic integral of the first kind K'(m) is \[ \int_0^{\frac{\pi}{2}} \frac{d\theta}{\sqrt{1-(1-m) + \sin^2\theta}} \] it corresponds to the imaginary quarter-period of Jacobi elliptic functions + + The algorithm for evaluating the functions is based on + :class:`~org.hipparchus.special.elliptic.carlson.CarlsonEllipticIntegral`. + + Parameters: + m (T): parameter (m=k² where k is the elliptic modulus) + + Returns: + complete elliptic integral of the first kind K'(m) + + Also see: + + - :meth:`~org.hipparchus.special.elliptic.legendre.LegendreEllipticIntegral.bigK` + - :class:`~org.hipparchus.special.elliptic.legendre.https:.mathworld.wolfram.com.CompleteEllipticIntegraloftheFirstKind` + - :class:`~org.hipparchus.special.elliptic.legendre.https:.en.wikipedia.org.wiki.Elliptic_integral` + + + Get the complete elliptic integral of the first kind K'(m). + + The complete elliptic integral of the first kind K'(m) is \[ \int_0^{\frac{\pi}{2}} \frac{d\theta}{\sqrt{1-(1-m) + \sin^2\theta}} \] it corresponds to the imaginary quarter-period of Jacobi elliptic functions + + The algorithm for evaluating the functions is based on + :class:`~org.hipparchus.special.elliptic.carlson.CarlsonEllipticIntegral`. + + Parameters: + m (:class:`~org.hipparchus.complex.FieldComplex`<T> m): parameter (m=k² where k is the elliptic modulus) + + Returns: + complete elliptic integral of the first kind K'(m) + + Also see: + + - :meth:`~org.hipparchus.special.elliptic.legendre.LegendreEllipticIntegral.bigK` + - :class:`~org.hipparchus.special.elliptic.legendre.https:.mathworld.wolfram.com.CompleteEllipticIntegraloftheFirstKind` + - :class:`~org.hipparchus.special.elliptic.legendre.https:.en.wikipedia.org.wiki.Elliptic_integral` + + + + """ + ... @typing.overload @staticmethod def bigKPrime(complex: org.hipparchus.complex.Complex) -> org.hipparchus.complex.Complex: ... @@ -131,16 +921,240 @@ class LegendreEllipticIntegral: _bigPi_9__T = typing.TypeVar('_bigPi_9__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload @staticmethod - def bigPi(double: float, double2: float) -> float: ... + def bigPi(double: float, double2: float) -> float: + """ + Get the complete elliptic integral of the third kind Î (n, m). + + The complete elliptic integral of the third kind Î (n, m) is \[ \int_0^{\frac{\pi}{2}} \frac{d\theta}{\sqrt{1-m + \sin^2\theta}(1-n \sin^2\theta)} \] + + The algorithm for evaluating the functions is based on + :class:`~org.hipparchus.special.elliptic.carlson.CarlsonEllipticIntegral`. + + Parameters: + n (double): elliptic characteristic + m (double): parameter (m=k² where k is the elliptic modulus) + + Returns: + complete elliptic integral of the third kind Î (n, m) + + Also see: + + - :meth:`~org.hipparchus.special.elliptic.legendre.LegendreEllipticIntegral.bigPi` + - :class:`~org.hipparchus.special.elliptic.legendre.https:.mathworld.wolfram.com.EllipticIntegraloftheThirdKind` + - :class:`~org.hipparchus.special.elliptic.legendre.https:.en.wikipedia.org.wiki.Elliptic_integral` + + + Get the complete elliptic integral of the third kind Î (n, m). + + The complete elliptic integral of the third kind Î (n, m) is \[ \int_0^{\frac{\pi}{2}} \frac{d\theta}{\sqrt{1-m + \sin^2\theta}(1-n \sin^2\theta)} \] + + The algorithm for evaluating the functions is based on + :class:`~org.hipparchus.special.elliptic.carlson.CarlsonEllipticIntegral`. + + Parameters: + n (:class:`~org.hipparchus.complex.Complex`): elliptic characteristic + m (:class:`~org.hipparchus.complex.Complex`): parameter (m=k² where k is the elliptic modulus) + + Returns: + complete elliptic integral of the third kind Î (n, m) + + Also see: + + - :meth:`~org.hipparchus.special.elliptic.legendre.LegendreEllipticIntegral.bigPi` + - :class:`~org.hipparchus.special.elliptic.legendre.https:.mathworld.wolfram.com.EllipticIntegraloftheThirdKind` + - :class:`~org.hipparchus.special.elliptic.legendre.https:.en.wikipedia.org.wiki.Elliptic_integral` + + + Get the incomplete elliptic integral of the third kind Î (n, φ, m). + + The incomplete elliptic integral of the third kind Î (n, φ, m) is \[ \int_0^{\phi} \frac{d\theta}{\sqrt{1-m + \sin^2\theta}(1-n \sin^2\theta)} \] + + The algorithm for evaluating the functions is based on + :class:`~org.hipparchus.special.elliptic.carlson.CarlsonEllipticIntegral`. + + Parameters: + n (double): elliptic characteristic + phi (double): amplitude (i.e. upper bound of the integral) + m (double): parameter (m=k² where k is the elliptic modulus) + + Returns: + incomplete elliptic integral of the third kind Î (n, φ, m) + + Also see: + + - :meth:`~org.hipparchus.special.elliptic.legendre.LegendreEllipticIntegral.bigPi` + - :class:`~org.hipparchus.special.elliptic.legendre.https:.mathworld.wolfram.com.EllipticIntegraloftheThirdKind` + - :class:`~org.hipparchus.special.elliptic.legendre.https:.en.wikipedia.org.wiki.Elliptic_integral` + + + Get the incomplete elliptic integral of the third kind Î (n, φ, m). + + *BEWARE! Elliptic integrals for complex numbers in the incomplete case are considered experimental for now, they have + known issues.* + + The incomplete elliptic integral of the third kind Î (n, φ, m) is \[ \int_0^{\phi} \frac{d\theta}{\sqrt{1-m + \sin^2\theta}(1-n \sin^2\theta)} \] + + The algorithm for evaluating the functions is based on + :class:`~org.hipparchus.special.elliptic.carlson.CarlsonEllipticIntegral`. + + Parameters: + n (:class:`~org.hipparchus.complex.Complex`): elliptic characteristic + phi (:class:`~org.hipparchus.complex.Complex`): amplitude (i.e. upper bound of the integral) + m (:class:`~org.hipparchus.complex.Complex`): parameter (m=k² where k is the elliptic modulus) + + Returns: + incomplete elliptic integral of the third kind Î (n, φ, m) + + Also see: + + - :meth:`~org.hipparchus.special.elliptic.legendre.LegendreEllipticIntegral.bigPi` + - :class:`~org.hipparchus.special.elliptic.legendre.https:.mathworld.wolfram.com.EllipticIntegraloftheThirdKind` + - :class:`~org.hipparchus.special.elliptic.legendre.https:.en.wikipedia.org.wiki.Elliptic_integral` + + + Get the incomplete elliptic integral of the third kind Î (n, φ, m) using numerical integration. + + *BEWARE! Elliptic integrals for complex numbers in the incomplete case are considered experimental for now, they have + known issues.* + + The incomplete elliptic integral of the third kind Î (n, φ, m) is \[ \int_0^{\phi} \frac{d\theta}{\sqrt{1-m + \sin^2\theta}(1-n \sin^2\theta)} \] + + The algorithm for evaluating the functions is based on numerical integration. If integration path comes too close to a + pole of the integrand, then integration will fail with a :class:`~org.hipparchus.exception.MathIllegalStateException` + even for very large :code:`maxEval`. This is normal behavior. + + Parameters: + n (:class:`~org.hipparchus.complex.Complex`): elliptic characteristic + phi (:class:`~org.hipparchus.complex.Complex`): amplitude (i.e. upper bound of the integral) + m (:class:`~org.hipparchus.complex.Complex`): parameter (m=k² where k is the elliptic modulus) + integrator (:class:`~org.hipparchus.complex.ComplexUnivariateIntegrator`): integrator to use + maxEval (int): maximum number of evaluations (real and imaginary + + Returns: + incomplete elliptic integral of the third kind Î (n, φ, m) + + Also see: + + - :meth:`~org.hipparchus.special.elliptic.legendre.LegendreEllipticIntegral.bigPi` + - :class:`~org.hipparchus.special.elliptic.legendre.https:.mathworld.wolfram.com.EllipticIntegraloftheThirdKind` + - :class:`~org.hipparchus.special.elliptic.legendre.https:.en.wikipedia.org.wiki.Elliptic_integral` + + + """ + ... @typing.overload @staticmethod def bigPi(double: float, double2: float, double3: float) -> float: ... @typing.overload @staticmethod - def bigPi(t: _bigPi_2__T, t2: _bigPi_2__T) -> _bigPi_2__T: ... + def bigPi(t: _bigPi_2__T, t2: _bigPi_2__T) -> _bigPi_2__T: + """ + Get the complete elliptic integral of the third kind Î (n, m). + + The complete elliptic integral of the third kind Î (n, m) is \[ \int_0^{\frac{\pi}{2}} \frac{d\theta}{\sqrt{1-m + \sin^2\theta}(1-n \sin^2\theta)} \] + + The algorithm for evaluating the functions is based on + :class:`~org.hipparchus.special.elliptic.carlson.CarlsonEllipticIntegral`. + + Parameters: + n (T): elliptic characteristic + m (T): parameter (m=k² where k is the elliptic modulus) + + Returns: + complete elliptic integral of the third kind Î (n, m) + + Also see: + + - :meth:`~org.hipparchus.special.elliptic.legendre.LegendreEllipticIntegral.bigPi` + - :class:`~org.hipparchus.special.elliptic.legendre.https:.mathworld.wolfram.com.EllipticIntegraloftheThirdKind` + - :class:`~org.hipparchus.special.elliptic.legendre.https:.en.wikipedia.org.wiki.Elliptic_integral` + + + Get the complete elliptic integral of the third kind Î (n, m). + + The complete elliptic integral of the third kind Î (n, m) is \[ \int_0^{\frac{\pi}{2}} \frac{d\theta}{\sqrt{1-m + \sin^2\theta}(1-n \sin^2\theta)} \] + + The algorithm for evaluating the functions is based on + :class:`~org.hipparchus.special.elliptic.carlson.CarlsonEllipticIntegral`. + + Parameters: + n (:class:`~org.hipparchus.complex.FieldComplex`<T> n): elliptic characteristic + m (:class:`~org.hipparchus.complex.FieldComplex`<T> m): parameter (m=k² where k is the elliptic modulus) + + Returns: + complete elliptic integral of the third kind Î (n, m) + + Also see: + + - :meth:`~org.hipparchus.special.elliptic.legendre.LegendreEllipticIntegral.bigPi` + - :class:`~org.hipparchus.special.elliptic.legendre.https:.mathworld.wolfram.com.EllipticIntegraloftheThirdKind` + - :class:`~org.hipparchus.special.elliptic.legendre.https:.en.wikipedia.org.wiki.Elliptic_integral` + + + Get the incomplete elliptic integral of the third kind Î (n, φ, m). + + The incomplete elliptic integral of the third kind Î (n, φ, m) is \[ \int_0^{\phi} \frac{d\theta}{\sqrt{1-m + \sin^2\theta}(1-n \sin^2\theta)} \] + + The algorithm for evaluating the functions is based on + :class:`~org.hipparchus.special.elliptic.carlson.CarlsonEllipticIntegral`. + + Parameters: + n (T): elliptic characteristic + phi (T): amplitude (i.e. upper bound of the integral) + m (T): parameter (m=k² where k is the elliptic modulus) + + Returns: + incomplete elliptic integral of the third kind Î (n, φ, m) + + Also see: + + - :meth:`~org.hipparchus.special.elliptic.legendre.LegendreEllipticIntegral.bigPi` + - :class:`~org.hipparchus.special.elliptic.legendre.https:.mathworld.wolfram.com.EllipticIntegraloftheThirdKind` + - :class:`~org.hipparchus.special.elliptic.legendre.https:.en.wikipedia.org.wiki.Elliptic_integral` + + + """ + ... @typing.overload @staticmethod - def bigPi(t: _bigPi_3__T, t2: _bigPi_3__T, t3: _bigPi_3__T) -> _bigPi_3__T: ... + def bigPi(t: _bigPi_3__T, t2: _bigPi_3__T, t3: _bigPi_3__T) -> _bigPi_3__T: + """ + Get the incomplete elliptic integral of the third kind Î (n, φ, m). + + *BEWARE! Elliptic integrals for complex numbers in the incomplete case are considered experimental for now, they have + known issues.* + + The incomplete elliptic integral of the third kind Î (n, φ, m) is \[ \int_0^{\phi} \frac{d\theta}{\sqrt{1-m + \sin^2\theta}(1-n \sin^2\theta)} \] + + The algorithm for evaluating the functions is based on + :class:`~org.hipparchus.special.elliptic.carlson.CarlsonEllipticIntegral`. + + Parameters: + n (:class:`~org.hipparchus.complex.FieldComplex`<T> n): elliptic characteristic + phi (:class:`~org.hipparchus.complex.FieldComplex`<T> phi): amplitude (i.e. upper bound of the integral) + m (:class:`~org.hipparchus.complex.FieldComplex`<T> m): parameter (m=k² where k is the elliptic modulus) + + Returns: + incomplete elliptic integral of the third kind Î (n, φ, m) + + Also see: + + - :meth:`~org.hipparchus.special.elliptic.legendre.LegendreEllipticIntegral.bigPi` + - :class:`~org.hipparchus.special.elliptic.legendre.https:.mathworld.wolfram.com.EllipticIntegraloftheThirdKind` + - :class:`~org.hipparchus.special.elliptic.legendre.https:.en.wikipedia.org.wiki.Elliptic_integral` + + + """ + ... @typing.overload @staticmethod def bigPi(complex: org.hipparchus.complex.Complex, complex2: org.hipparchus.complex.Complex) -> org.hipparchus.complex.Complex: ... @@ -158,14 +1172,71 @@ class LegendreEllipticIntegral: def bigPi(fieldComplex: org.hipparchus.complex.FieldComplex[_bigPi_8__T], fieldComplex2: org.hipparchus.complex.FieldComplex[_bigPi_8__T], fieldComplex3: org.hipparchus.complex.FieldComplex[_bigPi_8__T]) -> org.hipparchus.complex.FieldComplex[_bigPi_8__T]: ... @typing.overload @staticmethod - def bigPi(fieldComplex: org.hipparchus.complex.FieldComplex[_bigPi_9__T], fieldComplex2: org.hipparchus.complex.FieldComplex[_bigPi_9__T], fieldComplex3: org.hipparchus.complex.FieldComplex[_bigPi_9__T], fieldComplexUnivariateIntegrator: org.hipparchus.complex.FieldComplexUnivariateIntegrator[_bigPi_9__T], int: int) -> org.hipparchus.complex.FieldComplex[_bigPi_9__T]: ... + def bigPi(fieldComplex: org.hipparchus.complex.FieldComplex[_bigPi_9__T], fieldComplex2: org.hipparchus.complex.FieldComplex[_bigPi_9__T], fieldComplex3: org.hipparchus.complex.FieldComplex[_bigPi_9__T], fieldComplexUnivariateIntegrator: org.hipparchus.complex.FieldComplexUnivariateIntegrator[_bigPi_9__T], int: int) -> org.hipparchus.complex.FieldComplex[_bigPi_9__T]: + """ + Get the incomplete elliptic integral of the third kind Î (n, φ, m). + + *BEWARE! Elliptic integrals for complex numbers in the incomplete case are considered experimental for now, they have + known issues.* + + The incomplete elliptic integral of the third kind Î (n, φ, m) is \[ \int_0^{\phi} \frac{d\theta}{\sqrt{1-m + \sin^2\theta}(1-n \sin^2\theta)} \] + + The algorithm for evaluating the functions is based on numerical integration. If integration path comes too close to a + pole of the integrand, then integration will fail with a :class:`~org.hipparchus.exception.MathIllegalStateException` + even for very large :code:`maxEval`. This is normal behavior. + + Parameters: + n (:class:`~org.hipparchus.complex.FieldComplex`<T> n): elliptic characteristic + phi (:class:`~org.hipparchus.complex.FieldComplex`<T> phi): amplitude (i.e. upper bound of the integral) + m (:class:`~org.hipparchus.complex.FieldComplex`<T> m): parameter (m=k² where k is the elliptic modulus) + integrator (:class:`~org.hipparchus.complex.FieldComplexUnivariateIntegrator`<T> integrator): integrator to use + maxEval (int): maximum number of evaluations (real and imaginary parts are evaluated separately, so up to twice this number may be + used) + + Returns: + incomplete elliptic integral of the third kind Î (n, φ, m) + + Also see: + + - :meth:`~org.hipparchus.special.elliptic.legendre.LegendreEllipticIntegral.bigPi` + - :class:`~org.hipparchus.special.elliptic.legendre.https:.mathworld.wolfram.com.EllipticIntegraloftheThirdKind` + - :class:`~org.hipparchus.special.elliptic.legendre.https:.en.wikipedia.org.wiki.Elliptic_integral` + + + + """ + ... _nome_1__T = typing.TypeVar('_nome_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload @staticmethod - def nome(double: float) -> float: ... + def nome(double: float) -> float: + """ + Get the nome q. + + Parameters: + m (double): parameter (m=k² where k is the elliptic modulus) + + Returns: + nome q + + """ + ... @typing.overload @staticmethod - def nome(t: _nome_1__T) -> _nome_1__T: ... + def nome(t: _nome_1__T) -> _nome_1__T: + """ + Get the nome q. + + Parameters: + m (T): parameter (m=k² where k is the elliptic modulus) + + Returns: + nome q + + + """ + ... class __module_protocol__(Protocol): diff --git a/org-stubs/hipparchus/stat/__init__.pyi b/org-stubs/hipparchus/stat/__init__.pyi index 192dfcc..b4f8566 100644 --- a/org-stubs/hipparchus/stat/__init__.pyi +++ b/org-stubs/hipparchus/stat/__init__.pyi @@ -24,31 +24,186 @@ import typing _Frequency__T = typing.TypeVar('_Frequency__T', bound=java.lang.Comparable) # <T> class Frequency(java.io.Serializable, typing.Generic[_Frequency__T]): + """ + public classFrequency<T extends :class:`~org.hipparchus.stat.https:.docs.oracle.com.javase.8.docs.api.java.lang.Comparable`<T>> extends :class:`~org.hipparchus.stat.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.stat.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + Maintains a frequency distribution of Comparable values. + + The values are ordered using the default (natural order), unless a :code:`Comparator` is supplied in the constructor. + + Also see: + + - :class:`~org.hipparchus.stat.LongFrequency` + - :meth:`~serialized` + """ @typing.overload def __init__(self): ... @typing.overload def __init__(self, comparator: typing.Union[java.util.Comparator[_Frequency__T], typing.Callable[[_Frequency__T, _Frequency__T], int]]): ... - def addValue(self, t: _Frequency__T) -> None: ... - def clear(self) -> None: ... + def addValue(self, t: _Frequency__T) -> None: + """ + Adds 1 to the frequency count for v. + + Parameters: + v (:class:`~org.hipparchus.stat.Frequency`): the value to add. + + + """ + ... + def clear(self) -> None: + """ + Clears the frequency table + + """ + ... def entrySetIterator(self) -> java.util.Iterator[java.util.Map.Entry[_Frequency__T, int]]: ... - def equals(self, object: typing.Any) -> bool: ... - def getCount(self, t: _Frequency__T) -> int: ... - def getCumFreq(self, t: _Frequency__T) -> int: ... - def getCumPct(self, t: _Frequency__T) -> float: ... + def equals(self, object: typing.Any) -> bool: + """ + + Overrides: + :meth:`~org.hipparchus.stat.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.equals` in + class :class:`~org.hipparchus.stat.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + + """ + ... + def getCount(self, t: _Frequency__T) -> int: + """ + Returns the number of values equal to v. Returns 0 if the value is not comparable. + + Parameters: + v (:class:`~org.hipparchus.stat.Frequency`): the value to lookup. + + Returns: + the frequency of v. + + + """ + ... + def getCumFreq(self, t: _Frequency__T) -> int: + """ + Returns the cumulative frequency of values less than or equal to v. + + Parameters: + v (:class:`~org.hipparchus.stat.Frequency`): the value to lookup. + + Returns: + the proportion of values equal to v + + + """ + ... + def getCumPct(self, t: _Frequency__T) -> float: + """ + Returns the cumulative percentage of values less than or equal to v (as a proportion between 0 and 1). + + Returns :code:`Double.NaN` if no values have been added. + + Parameters: + v (:class:`~org.hipparchus.stat.Frequency`): the value to lookup + + Returns: + the proportion of values less than or equal to v + + + """ + ... def getMode(self) -> java.util.List[_Frequency__T]: ... - def getPct(self, t: _Frequency__T) -> float: ... - def getSumFreq(self) -> int: ... - def getUniqueCount(self) -> int: ... - def hashCode(self) -> int: ... - def incrementValue(self, t: _Frequency__T, long: int) -> None: ... + def getPct(self, t: _Frequency__T) -> float: + """ + Returns the percentage of values that are equal to v (as a proportion between 0 and 1). + + Returns :code:`Double.NaN` if no values have been added. + + Parameters: + v (:class:`~org.hipparchus.stat.Frequency`): the value to lookup + + Returns: + the proportion of values equal to v + + + """ + ... + def getSumFreq(self) -> int: + """ + Returns the sum of all frequencies. + + Returns: + the total frequency count. + + + """ + ... + def getUniqueCount(self) -> int: + """ + Returns the number of values in the frequency table. + + Returns: + the number of unique values that have been added to the frequency table. + + Also see: + + - :meth:`~org.hipparchus.stat.Frequency.valuesIterator` + + + + """ + ... + def hashCode(self) -> int: + """ + + Overrides: + :meth:`~org.hipparchus.stat.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.hashCode` in + class :class:`~org.hipparchus.stat.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + + """ + ... + def incrementValue(self, t: _Frequency__T, long: int) -> None: + """ + Increments the frequency count for v. + + Parameters: + v (:class:`~org.hipparchus.stat.Frequency`): the value to add. + increment (long): the amount by which the value should be incremented + + + """ + ... @typing.overload def merge(self, collection: typing.Union[java.util.Collection['Frequency'[_Frequency__T]], typing.Sequence['Frequency'[_Frequency__T]], typing.Set['Frequency'[_Frequency__T]]]) -> None: ... @typing.overload def merge(self, frequency: 'Frequency'[_Frequency__T]) -> None: ... - def toString(self) -> str: ... + def toString(self) -> str: + """ + Return a string representation of this frequency distribution. + + Overrides: + :meth:`~org.hipparchus.stat.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.toString` in + class :class:`~org.hipparchus.stat.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Returns: + a string representation. + + + """ + ... def valuesIterator(self) -> java.util.Iterator[_Frequency__T]: ... class LocalizedStatFormats(java.lang.Enum['LocalizedStatFormats'], org.hipparchus.exception.Localizable): + """ + public enumLocalizedStatFormats extends :class:`~org.hipparchus.stat.https:.docs.oracle.com.javase.8.docs.api.java.lang.Enum`<:class:`~org.hipparchus.stat.LocalizedStatFormats`> + implements :class:`~org.hipparchus.stat.https:.www.hipparchus.org.hipparchus` + + Enumeration for localized messages formats used in exceptions messages. + + The constants in this enumeration represent the available formats as localized strings. These formats are intended to be + localized using simple properties files, using the constant name as the key and the property value as the message + format. The source English format is provided in the constants themselves to serve both as a reminder for developers to + understand the parameters needed by each format, as a basis for translators to create localized properties files, and as + a default format if some translation is missing. + """ TIES_ARE_NOT_ALLOWED: typing.ClassVar['LocalizedStatFormats'] = ... INSUFFICIENT_DATA_FOR_T_STATISTIC: typing.ClassVar['LocalizedStatFormats'] = ... NOT_ENOUGH_DATA_REGRESSION: typing.ClassVar['LocalizedStatFormats'] = ... @@ -65,19 +220,68 @@ class LocalizedStatFormats(java.lang.Enum['LocalizedStatFormats'], org.hipparchu TWO_OR_MORE_CATEGORIES_REQUIRED: typing.ClassVar['LocalizedStatFormats'] = ... TWO_OR_MORE_VALUES_IN_CATEGORY_REQUIRED: typing.ClassVar['LocalizedStatFormats'] = ... ILLEGAL_STATE_PCA: typing.ClassVar['LocalizedStatFormats'] = ... - def getLocalizedString(self, locale: java.util.Locale) -> str: ... - def getSourceString(self) -> str: ... + def getLocalizedString(self, locale: java.util.Locale) -> str: + """ + + Specified by: + :meth:`~org.hipparchus.stat.https:.www.hipparchus.org.hipparchus` in + interface :class:`~org.hipparchus.stat.https:.www.hipparchus.org.hipparchus` + + + """ + ... + def getSourceString(self) -> str: + """ + + Specified by: + :meth:`~org.hipparchus.stat.https:.www.hipparchus.org.hipparchus` in + interface :class:`~org.hipparchus.stat.https:.www.hipparchus.org.hipparchus` + + + """ + ... _valueOf_0__T = typing.TypeVar('_valueOf_0__T', bound=java.lang.Enum) # <T> @typing.overload @staticmethod def valueOf(class_: typing.Type[_valueOf_0__T], string: str) -> _valueOf_0__T: ... @typing.overload @staticmethod - def valueOf(string: str) -> 'LocalizedStatFormats': ... - @staticmethod - def values() -> typing.MutableSequence['LocalizedStatFormats']: ... + def valueOf(string: str) -> 'LocalizedStatFormats': + """ + Returns the enum constant of this type with the specified name. The string must match *exactly* an identifier used to + declare an enum constant in this type. (Extraneous whitespace characters are not permitted.) + + Parameters: + name (:class:`~org.hipparchus.stat.https:.docs.oracle.com.javase.8.docs.api.java.lang.String`): the name of the enum constant to be returned. + + Returns: + the enum constant with the specified name + + Raises: + :class:`~org.hipparchus.stat.https:.docs.oracle.com.javase.8.docs.api.java.lang.IllegalArgumentException`: if this enum type has no constant with the specified name + :class:`~org.hipparchus.stat.https:.docs.oracle.com.javase.8.docs.api.java.lang.NullPointerException`: if the argument is null + + + """ + ... + @staticmethod + def values() -> typing.MutableSequence['LocalizedStatFormats']: + """ + Returns an array containing the constants of this enum type, in the order they are declared. + + Returns: + an array containing the constants of this enum type, in the order they are declared + + + """ + ... class StatUtils: + """ + public final classStatUtils extends :class:`~org.hipparchus.stat.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + StatUtils provides static methods for computing statistics based on data stored in double[] arrays. + """ @typing.overload @staticmethod def geometricMean(*double: float) -> float: ... @@ -109,9 +313,48 @@ class StatUtils: def mode(*double: float) -> typing.MutableSequence[float]: ... @typing.overload @staticmethod - def mode(doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, int2: int) -> typing.MutableSequence[float]: ... - @staticmethod - def normalize(*double: float) -> typing.MutableSequence[float]: ... + def mode(doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, int2: int) -> typing.MutableSequence[float]: + """ + Returns the sample mode(s). + + The mode is the most frequently occurring value in the sample. If there is a unique value with maximum frequency, this + value is returned as the only element of the output array. Otherwise, the returned array contains the maximum frequency + elements in increasing order. + + For example, if :code:`sample` is {0, 12, 5, 6, 0, 13, 5, 17}, the returned array will have length two, with 0 in the + first element and 5 in the second. + + NaN values are ignored when computing the mode - i.e., NaNs will never appear in the output array. If the sample + includes only NaNs or has length 0, an empty array is returned. + + Parameters: + sample (double[]): input data + begin (int): index (0-based) of the first array element to include + length (int): the number of elements to include + + Returns: + array of array of the most frequently occurring element(s) sorted in ascending order. + + Raises: + :class:`~org.hipparchus.stat.https:.www.hipparchus.org.hipparchus`: if the indices are invalid or the array is null + + + """ + ... + @staticmethod + def normalize(*double: float) -> typing.MutableSequence[float]: + """ + Normalize (standardize) the sample, so it is has a mean of 0 and a standard deviation of 1. + + Parameters: + sample (double...): Sample to normalize. + + Returns: + normalized (standardized) sample. + + + """ + ... @typing.overload @staticmethod def percentile(doubleArray: typing.Union[typing.List[float], jpype.JArray], double2: float) -> float: ... @@ -172,32 +415,123 @@ class StatUtils: def varianceDifference(doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray], double3: float) -> float: ... class LongFrequency(Frequency[int]): + """ + public classLongFrequency extends :class:`~org.hipparchus.stat.Frequency`<:class:`~org.hipparchus.stat.https:.docs.oracle.com.javase.8.docs.api.java.lang.Long`> + + Maintains a frequency distribution of Long values. + + Accepts byte, short, int, long primitive or Integer and Long values. + + Integer values (byte, short, int, long, Integer, Long) are not distinguished by type, i.e. + :code:`addValue(Long.valueOf(2)), addValue(2), addValue(2L)` all have the same effect (similarly for arguments to + :code:`getCount()` etc.). + + NOTE: byte and short values will be implicitly converted to int values by the compiler, thus there are no explicit + overloaded methods for these primitive types. + + The values are ordered using the default (natural order), unless a :code:`Comparator` is supplied in the constructor. + + Also see: + + - :meth:`~serialized` + """ @typing.overload def __init__(self): ... @typing.overload def __init__(self, comparator: typing.Union[java.util.Comparator[int], typing.Callable[[int, int], int]]): ... @typing.overload - def addValue(self, t: java.lang.Comparable) -> None: ... + def addValue(self, t: java.lang.Comparable) -> None: + """ + Adds 1 to the frequency count for v. + + Parameters: + v (int): the value to add. + + + """ + ... @typing.overload def addValue(self, int: int) -> None: ... @typing.overload - def getCount(self, t: java.lang.Comparable) -> int: ... + def getCount(self, t: java.lang.Comparable) -> int: + """ + Returns the number of values equal to v. + + Parameters: + v (int): the value to lookup. + + Returns: + the frequency of v. + + + """ + ... @typing.overload def getCount(self, int: int) -> int: ... @typing.overload - def getCumFreq(self, t: java.lang.Comparable) -> int: ... + def getCumFreq(self, t: java.lang.Comparable) -> int: + """ + Returns the cumulative frequency of values less than or equal to v. + + Parameters: + v (int): the value to lookup. + + Returns: + the proportion of values equal to v + + + """ + ... @typing.overload def getCumFreq(self, int: int) -> int: ... @typing.overload - def getCumPct(self, t: java.lang.Comparable) -> float: ... + def getCumPct(self, t: java.lang.Comparable) -> float: + """ + Returns the cumulative percentage of values less than or equal to v (as a proportion between 0 and 1). + + Returns :code:`Double.NaN` if no values have been added. + + Parameters: + v (int): the value to lookup + + Returns: + the proportion of values less than or equal to v + + + """ + ... @typing.overload def getCumPct(self, int: int) -> float: ... @typing.overload - def getPct(self, t: java.lang.Comparable) -> float: ... + def getPct(self, t: java.lang.Comparable) -> float: + """ + Returns the percentage of values that are equal to v (as a proportion between 0 and 1). + + Returns :code:`Double.NaN` if no values have been added. + + Parameters: + v (int): the value to lookup + + Returns: + the proportion of values equal to v + + + """ + ... @typing.overload def getPct(self, int: int) -> float: ... @typing.overload - def incrementValue(self, t: java.lang.Comparable, long: int) -> None: ... + def incrementValue(self, t: java.lang.Comparable, long: int) -> None: + """ + Increments the frequency count for v. + + Parameters: + v (int): the value to add. + increment (long): the amount by which the value should be incremented + + + """ + ... @typing.overload def incrementValue(self, int: int, long: int) -> None: ... diff --git a/org-stubs/hipparchus/stat/correlation/__init__.pyi b/org-stubs/hipparchus/stat/correlation/__init__.pyi index d99ee06..1a7a31a 100644 --- a/org-stubs/hipparchus/stat/correlation/__init__.pyi +++ b/org-stubs/hipparchus/stat/correlation/__init__.pyi @@ -13,6 +13,24 @@ import typing class Covariance: + """ + public classCovariance extends :class:`~org.hipparchus.stat.correlation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Computes covariances for pairs of arrays or columns of a matrix. + + The constructors that take :code:`RealMatrix` or :code:`double[][]` arguments generate covariance matrices. The columns + of the input matrices are assumed to represent variable values. + + The constructor argument :code:`biasCorrected` determines whether or not computed covariances are bias-corrected. + + Unbiased covariances are given by the formula: + + :code:`cov(X, Y) = Σ[(x :sub:`i` - E(X))(y :sub:`i` - E(Y))] / (n - 1)` + + where :code:`E(X)` is the mean of :code:`X` and :code:`E(Y)` is the mean of the :code:`Y` values. + + Non-bias-corrected estimates use :code:`n` in place of :code:`n - 1`. + """ @typing.overload def __init__(self): ... @typing.overload @@ -27,10 +45,60 @@ class Covariance: def covariance(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray]) -> float: ... @typing.overload def covariance(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray], boolean: bool) -> float: ... - def getCovarianceMatrix(self) -> org.hipparchus.linear.RealMatrix: ... - def getN(self) -> int: ... + def getCovarianceMatrix(self) -> org.hipparchus.linear.RealMatrix: + """ + Returns the covariance matrix + + Returns: + covariance matrix + + + """ + ... + def getN(self) -> int: + """ + Returns the number of observations (length of covariate vectors) + + Returns: + number of observations + + + """ + ... class KendallsCorrelation: + """ + public classKendallsCorrelation extends :class:`~org.hipparchus.stat.correlation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Implementation of Kendall's Tau-b rank correlation. + + A pair of observations (x :sub:`1` , y :sub:`1` ) and (x :sub:`2` , y :sub:`2` ) are considered *concordant* if x + :sub:`1` < x :sub:`2` and y :sub:`1` < y :sub:`2` or x :sub:`2` < x :sub:`1` and y :sub:`2` < y :sub:`1` . The pair is + *discordant* if x :sub:`1` < x :sub:`2` and y :sub:`2` < y :sub:`1` or x :sub:`2` < x :sub:`1` and y :sub:`1` < y + :sub:`2` . If either x :sub:`1` = x :sub:`2` or y :sub:`1` = y :sub:`2` , the pair is neither concordant nor discordant. + + Kendall's Tau-b is defined as: \[ \tau_b = \frac{n_c - n_d}{\sqrt{(n_0 - n_1) (n_0 - n_2)}} \] + + where: + + - n :sub:`0` = n * (n - 1) / 2 + - n :sub:`c` = Number of concordant pairs + - n :sub:`d` = Number of discordant pairs + - n :sub:`1` = sum of t :sub:`i` * (t :sub:`i` - 1) / 2 for all i + - n :sub:`2` = sum of u :sub:`j` * (u :sub:`j` - 1) / 2 for all j + - t :sub:`i` = Number of tied values in the i :sup:`th` group of ties in x + - u :sub:`j` = Number of tied values in the j :sup:`th` group of ties in y + + + This implementation uses the O(n log n) algorithm described in William R. Knight's 1966 paper "A Computer Method for + Calculating Kendall's Tau with Ungrouped Data" in the Journal of the American Statistical Association. + + Also see: + + - ` Kendall tau rank correlation coefficient (Wikipedia) + <http://en.wikipedia.org/wiki/Kendall_tau_rank_correlation_coefficient>` + - `A Computer Method for Calculating Kendall's Tau with Ungrouped Data <http://www.jstor.org/stable/2282833>` + """ @typing.overload def __init__(self): ... @typing.overload @@ -38,13 +106,66 @@ class KendallsCorrelation: @typing.overload def __init__(self, realMatrix: org.hipparchus.linear.RealMatrix): ... @typing.overload - def computeCorrelationMatrix(self, doubleArray: typing.Union[typing.List[typing.MutableSequence[float]], jpype.JArray]) -> org.hipparchus.linear.RealMatrix: ... + def computeCorrelationMatrix(self, doubleArray: typing.Union[typing.List[typing.MutableSequence[float]], jpype.JArray]) -> org.hipparchus.linear.RealMatrix: + """ + Computes the Kendall's Tau rank correlation matrix for the columns of the input matrix. + + Parameters: + matrix (:class:`~org.hipparchus.stat.correlation.https:.www.hipparchus.org.hipparchus`): matrix with columns representing variables to correlate + + Returns: + correlation matrix + + Computes the Kendall's Tau rank correlation matrix for the columns of the input rectangular array. The columns of the + array represent values of variables to be correlated. + + Parameters: + matrix (double[][]): matrix with columns representing variables to correlate + + Returns: + correlation matrix + + + """ + ... @typing.overload def computeCorrelationMatrix(self, realMatrix: org.hipparchus.linear.RealMatrix) -> org.hipparchus.linear.RealMatrix: ... def correlation(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray]) -> float: ... - def getCorrelationMatrix(self) -> org.hipparchus.linear.RealMatrix: ... + def getCorrelationMatrix(self) -> org.hipparchus.linear.RealMatrix: + """ + Returns the correlation matrix. + + Returns: + correlation matrix + + + """ + ... class PearsonsCorrelation: + """ + public classPearsonsCorrelation extends :class:`~org.hipparchus.stat.correlation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Computes Pearson's product-moment correlation coefficients for pairs of arrays or columns of a matrix. + + The constructors that take :code:`RealMatrix` or :code:`double[][]` arguments generate correlation matrices. The columns + of the input matrices are assumed to represent variable values. Correlations are given by the formula: + + :code:`cor(X, Y) = Σ[(x :sub:`i` - E(X))(y :sub:`i` - E(Y))] / [(n - 1)s(X)s(Y)]` + + where :code:`E(X)` is the mean of :code:`X`, :code:`E(Y)` is the mean of the :code:`Y` values and s(X), s(Y) are + standard deviations. + + To compute the correlation coefficient for a single pair of arrays, use + :meth:`~org.hipparchus.stat.correlation.PearsonsCorrelation.%3Cinit%3E` to construct an instance with no data and then + :meth:`~org.hipparchus.stat.correlation.PearsonsCorrelation.correlation`. Correlation matrices can also be computed + directly from an instance with no data using + :meth:`~org.hipparchus.stat.correlation.PearsonsCorrelation.computeCorrelationMatrix`. In order to use + :meth:`~org.hipparchus.stat.correlation.PearsonsCorrelation.getCorrelationMatrix`, + :meth:`~org.hipparchus.stat.correlation.PearsonsCorrelation.getCorrelationPValues`, or + :meth:`~org.hipparchus.stat.correlation.PearsonsCorrelation.getCorrelationStandardErrors`; however, one of the + constructors supplying data or a covariance matrix must be used to create the instance. + """ @typing.overload def __init__(self): ... @typing.overload @@ -56,16 +177,168 @@ class PearsonsCorrelation: @typing.overload def __init__(self, covariance: Covariance): ... @typing.overload - def computeCorrelationMatrix(self, doubleArray: typing.Union[typing.List[typing.MutableSequence[float]], jpype.JArray]) -> org.hipparchus.linear.RealMatrix: ... + def computeCorrelationMatrix(self, doubleArray: typing.Union[typing.List[typing.MutableSequence[float]], jpype.JArray]) -> org.hipparchus.linear.RealMatrix: + """ + Computes the correlation matrix for the columns of the input matrix, using + :meth:`~org.hipparchus.stat.correlation.PearsonsCorrelation.correlation`. Throws MathIllegalArgumentException if the + matrix does not have at least two columns and two rows. Pairwise correlations are set to NaN if one of the correlates + has zero variance. + + Parameters: + matrix (:class:`~org.hipparchus.stat.correlation.https:.www.hipparchus.org.hipparchus`): matrix with columns representing variables to correlate + + Returns: + correlation matrix + + Raises: + :class:`~org.hipparchus.stat.correlation.https:.www.hipparchus.org.hipparchus`: if the matrix does not contain sufficient data + + Also see: + + - :meth:`~org.hipparchus.stat.correlation.PearsonsCorrelation.correlation` + + + Computes the correlation matrix for the columns of the input rectangular array. The columns of the array represent + values of variables to be correlated. Throws MathIllegalArgumentException if the matrix does not have at least two + columns and two rows or if the array is not rectangular. Pairwise correlations are set to NaN if one of the correlates + has zero variance. + + Parameters: + data (double[][]): matrix with columns representing variables to correlate + + Returns: + correlation matrix + + Raises: + :class:`~org.hipparchus.stat.correlation.https:.www.hipparchus.org.hipparchus`: if the array does not contain sufficient data + + Also see: + + - :meth:`~org.hipparchus.stat.correlation.PearsonsCorrelation.correlation` + + + + """ + ... @typing.overload def computeCorrelationMatrix(self, realMatrix: org.hipparchus.linear.RealMatrix) -> org.hipparchus.linear.RealMatrix: ... - def correlation(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray]) -> float: ... - def covarianceToCorrelation(self, realMatrix: org.hipparchus.linear.RealMatrix) -> org.hipparchus.linear.RealMatrix: ... - def getCorrelationMatrix(self) -> org.hipparchus.linear.RealMatrix: ... - def getCorrelationPValues(self) -> org.hipparchus.linear.RealMatrix: ... - def getCorrelationStandardErrors(self) -> org.hipparchus.linear.RealMatrix: ... + def correlation(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray]) -> float: + """ + Computes the Pearson's product-moment correlation coefficient between two arrays. + + Throws MathIllegalArgumentException if the arrays do not have the same length or their common length is less than 2. + Returns :code:`NaN` if either of the arrays has zero variance (i.e., if one of the arrays does not contain at least two + distinct values). + + Parameters: + xArray (double[]): first data array + yArray (double[]): second data array + + Returns: + Returns Pearson's correlation coefficient for the two arrays + + Raises: + :class:`~org.hipparchus.stat.correlation.https:.www.hipparchus.org.hipparchus`: if the arrays lengths do not match + :class:`~org.hipparchus.stat.correlation.https:.www.hipparchus.org.hipparchus`: if there is insufficient data + + + """ + ... + def covarianceToCorrelation(self, realMatrix: org.hipparchus.linear.RealMatrix) -> org.hipparchus.linear.RealMatrix: + """ + Derives a correlation matrix from a covariance matrix. + + Uses the formula + + + :code:`r(X,Y) = cov(X,Y)/s(X)s(Y)` where :code:`r(·,·)` is the correlation coefficient and :code:`s(·)` means + standard deviation. + + Parameters: + covarianceMatrix (:class:`~org.hipparchus.stat.correlation.https:.www.hipparchus.org.hipparchus`): the covariance matrix + + Returns: + correlation matrix + + + """ + ... + def getCorrelationMatrix(self) -> org.hipparchus.linear.RealMatrix: + """ + Returns the correlation matrix. + + This method will return null if the argumentless constructor was used to create this instance, even if + :meth:`~org.hipparchus.stat.correlation.PearsonsCorrelation.computeCorrelationMatrix` has been called before it is + activated. + + Returns: + correlation matrix + + + """ + ... + def getCorrelationPValues(self) -> org.hipparchus.linear.RealMatrix: + """ + Returns a matrix of p-values associated with the (two-sided) null hypothesis that the corresponding correlation + coefficient is zero. + + :code:`getCorrelationPValues().getEntry(i,j)` is the probability that a random variable distributed as :code:`t + :sub:`n-2`` takes a value with absolute value greater than or equal to + + + :code:`|r|((n - 2) / (1 - r :sup:`2` )) :sup:`1/2`` + + The values in the matrix are sometimes referred to as the *significance* of the corresponding correlation coefficients. + + To use this method, one of the constructors that supply an input matrix must have been used to create this instance. + + Returns: + matrix of p-values + + Raises: + :class:`~org.hipparchus.stat.correlation.https:.www.hipparchus.org.hipparchus`: if an error occurs estimating probabilities + :class:`~org.hipparchus.stat.correlation.https:.docs.oracle.com.javase.8.docs.api.java.lang.NullPointerException`: if this instance was created with no data + + + """ + ... + def getCorrelationStandardErrors(self) -> org.hipparchus.linear.RealMatrix: + """ + Returns a matrix of standard errors associated with the estimates in the correlation matrix. + + + :code:`getCorrelationStandardErrors().getEntry(i,j)` is the standard error associated with + :code:`getCorrelationMatrix.getEntry(i,j)` + + The formula used to compute the standard error is + + + :code:`SE :sub:`r` = ((1 - r :sup:`2` ) / (n - 2)) :sup:`1/2`` where :code:`r` is the estimated correlation coefficient + and :code:`n` is the number of observations in the source dataset. + + To use this method, one of the constructors that supply an input matrix must have been used to create this instance. + + Returns: + matrix of correlation standard errors + + Raises: + :class:`~org.hipparchus.stat.correlation.https:.docs.oracle.com.javase.8.docs.api.java.lang.NullPointerException`: if this instance was created with no data + + + """ + ... class SpearmansCorrelation: + """ + public classSpearmansCorrelation extends :class:`~org.hipparchus.stat.correlation.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Spearman's rank correlation. This implementation performs a rank transformation on the input data and then computes + :class:`~org.hipparchus.stat.correlation.PearsonsCorrelation` on the ranked data. + + By default, ranks are computed using :class:`~org.hipparchus.stat.ranking.NaturalRanking` with default strategies for + handling NaNs and ties in the data (NaNs maximal, ties averaged). The ranking algorithm can be set using a constructor + argument. + """ @typing.overload def __init__(self): ... @typing.overload @@ -75,14 +348,93 @@ class SpearmansCorrelation: @typing.overload def __init__(self, rankingAlgorithm: typing.Union[org.hipparchus.stat.ranking.RankingAlgorithm, typing.Callable]): ... @typing.overload - def computeCorrelationMatrix(self, doubleArray: typing.Union[typing.List[typing.MutableSequence[float]], jpype.JArray]) -> org.hipparchus.linear.RealMatrix: ... + def computeCorrelationMatrix(self, doubleArray: typing.Union[typing.List[typing.MutableSequence[float]], jpype.JArray]) -> org.hipparchus.linear.RealMatrix: + """ + Computes the Spearman's rank correlation matrix for the columns of the input matrix. + + Parameters: + matrix (:class:`~org.hipparchus.stat.correlation.https:.www.hipparchus.org.hipparchus`): matrix with columns representing variables to correlate + + Returns: + correlation matrix + + Computes the Spearman's rank correlation matrix for the columns of the input rectangular array. The columns of the array + represent values of variables to be correlated. + + Parameters: + matrix (double[][]): matrix with columns representing variables to correlate + + Returns: + correlation matrix + + + """ + ... @typing.overload def computeCorrelationMatrix(self, realMatrix: org.hipparchus.linear.RealMatrix) -> org.hipparchus.linear.RealMatrix: ... - def correlation(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray]) -> float: ... - def getCorrelationMatrix(self) -> org.hipparchus.linear.RealMatrix: ... - def getRankCorrelation(self) -> PearsonsCorrelation: ... + def correlation(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray]) -> float: + """ + Computes the Spearman's rank correlation coefficient between the two arrays. + + Parameters: + xArray (double[]): first data array + yArray (double[]): second data array + + Returns: + Returns Spearman's rank correlation coefficient for the two arrays + + Raises: + :class:`~org.hipparchus.stat.correlation.https:.www.hipparchus.org.hipparchus`: if the arrays lengths do not match + :class:`~org.hipparchus.stat.correlation.https:.www.hipparchus.org.hipparchus`: if the array length is less than 2 + + + """ + ... + def getCorrelationMatrix(self) -> org.hipparchus.linear.RealMatrix: + """ + Calculate the Spearman Rank Correlation Matrix. + + Returns: + Spearman Rank Correlation Matrix + + Raises: + :class:`~org.hipparchus.stat.correlation.https:.docs.oracle.com.javase.8.docs.api.java.lang.NullPointerException`: if this instance was created with no data + + + """ + ... + def getRankCorrelation(self) -> PearsonsCorrelation: + """ + Returns a :class:`~org.hipparchus.stat.correlation.PearsonsCorrelation` instance constructed from the ranked input data. + That is, :code:`new SpearmansCorrelation(matrix).getRankCorrelation()` is equivalent to :code:`new + PearsonsCorrelation(rankTransform(matrix))` where :code:`rankTransform(matrix)` is the result of applying the configured + :code:`RankingAlgorithm` to each of the columns of :code:`matrix.` + + Returns null if this instance was created with no data. + + Returns: + PearsonsCorrelation among ranked column data + + + """ + ... class StorelessCovariance(Covariance): + """ + public classStorelessCovariance extends :class:`~org.hipparchus.stat.correlation.Covariance` + + Covariance implementation that does not require input data to be stored in memory. The size of the covariance matrix is + specified in the constructor. Specific elements of the matrix are incrementally updated with calls to incrementRow() or + increment Covariance(). + + This class is based on a paper written by Philippe Pébay: ` Formulas for Robust, One-Pass Parallel Computation of + Covariances and Arbitrary-Order Statistical Moments + <http://prod.sandia.gov/techlib/access-control.cgi/2008/086212.pdf>`, 2008, Technical Report SAND2008-6212, Sandia + National Laboratories. + + Note: the underlying covariance matrix is symmetric, thus only the upper triangular part of the matrix is stored and + updated each increment. + """ @typing.overload def __init__(self, int: int): ... @typing.overload diff --git a/org-stubs/hipparchus/stat/descriptive/__init__.pyi b/org-stubs/hipparchus/stat/descriptive/__init__.pyi index 2384dd9..26b9053 100644 --- a/org-stubs/hipparchus/stat/descriptive/__init__.pyi +++ b/org-stubs/hipparchus/stat/descriptive/__init__.pyi @@ -23,197 +23,1617 @@ import typing _AggregatableStatistic__T = typing.TypeVar('_AggregatableStatistic__T') # <T> class AggregatableStatistic(typing.Generic[_AggregatableStatistic__T]): + """ + public interfaceAggregatableStatistic<T> + + An interface for statistics that can aggregate results. + """ @typing.overload - def aggregate(self, t: _AggregatableStatistic__T) -> None: ... + def aggregate(self, t: _AggregatableStatistic__T) -> None: + """ + Aggregates the results from the provided instances into this instance. + + This method can be used to combine statistics computed over partitions or subsamples - i.e., the value of this instance + after this operation should be the same as if a single statistic would have been applied over the combined dataset. + + Parameters: + others (:class:`~org.hipparchus.stat.descriptive.AggregatableStatistic`...): the other instances to aggregate into this instance + + Raises: + :class:`~org.hipparchus.stat.descriptive.https:.www.hipparchus.org.hipparchus`: if either others or any instance is null + + default void aggregate(:class:`~org.hipparchus.stat.descriptive.https:.docs.oracle.com.javase.8.docs.api.java.lang.Iterable`<:class:`~org.hipparchus.stat.descriptive.AggregatableStatistic`> others) + + Aggregates the results from the provided instances into this instance. + + This method can be used to combine statistics computed over partitions or subsamples - i.e., the value of this instance + after this operation should be the same as if a single statistic would have been applied over the combined dataset. + + Parameters: + others (:class:`~org.hipparchus.stat.descriptive.https:.docs.oracle.com.javase.8.docs.api.java.lang.Iterable`<:class:`~org.hipparchus.stat.descriptive.AggregatableStatistic`> others): the other instances to aggregate into this instance + + Raises: + :class:`~org.hipparchus.stat.descriptive.https:.www.hipparchus.org.hipparchus`: if either others or any instance is null + + + """ + ... @typing.overload def aggregate(self, iterable: typing.Union[java.lang.Iterable[_AggregatableStatistic__T], typing.Sequence[_AggregatableStatistic__T], typing.Set[_AggregatableStatistic__T], typing.Callable[[], java.util.Iterator[typing.Any]]]) -> None: ... @typing.overload def aggregate(self, *t: _AggregatableStatistic__T) -> None: ... class StatisticalMultivariateSummary: - def getCovariance(self) -> org.hipparchus.linear.RealMatrix: ... - def getDimension(self) -> int: ... - def getGeometricMean(self) -> typing.MutableSequence[float]: ... - def getMax(self) -> typing.MutableSequence[float]: ... - def getMean(self) -> typing.MutableSequence[float]: ... - def getMin(self) -> typing.MutableSequence[float]: ... - def getN(self) -> int: ... - def getStandardDeviation(self) -> typing.MutableSequence[float]: ... - def getSum(self) -> typing.MutableSequence[float]: ... - def getSumLog(self) -> typing.MutableSequence[float]: ... - def getSumSq(self) -> typing.MutableSequence[float]: ... + """ + public interfaceStatisticalMultivariateSummary + + Reporting interface for basic multivariate statistics. + """ + def getCovariance(self) -> org.hipparchus.linear.RealMatrix: + """ + Returns the covariance of the available values. + + Returns: + The covariance, null if no multivariate sample have been added or a zeroed matrix for a single value set. + + + """ + ... + def getDimension(self) -> int: + """ + Returns the dimension of the data + + Returns: + The dimension of the data + + + """ + ... + def getGeometricMean(self) -> typing.MutableSequence[float]: + """ + Returns an array whose i :sup:`th` entry is the geometric mean of the i :sup:`th` entries of the arrays that correspond + to each multivariate sample + + Returns: + the array of component geometric means + + + """ + ... + def getMax(self) -> typing.MutableSequence[float]: + """ + Returns an array whose i :sup:`th` entry is the maximum of the i :sup:`th` entries of the arrays that correspond to each + multivariate sample + + Returns: + the array of component maxima + + + """ + ... + def getMean(self) -> typing.MutableSequence[float]: + """ + Returns an array whose i :sup:`th` entry is the mean of the i :sup:`th` entries of the arrays that correspond to each + multivariate sample + + Returns: + the array of component means + + + """ + ... + def getMin(self) -> typing.MutableSequence[float]: + """ + Returns an array whose i :sup:`th` entry is the minimum of the i :sup:`th` entries of the arrays that correspond to each + multivariate sample + + Returns: + the array of component minima + + + """ + ... + def getN(self) -> int: + """ + Returns the number of available values + + Returns: + The number of available values + + + """ + ... + def getStandardDeviation(self) -> typing.MutableSequence[float]: + """ + Returns an array whose i :sup:`th` entry is the standard deviation of the i :sup:`th` entries of the arrays that + correspond to each multivariate sample + + Returns: + the array of component standard deviations + + + """ + ... + def getSum(self) -> typing.MutableSequence[float]: + """ + Returns an array whose i :sup:`th` entry is the sum of the i :sup:`th` entries of the arrays that correspond to each + multivariate sample + + Returns: + the array of component sums + + + """ + ... + def getSumLog(self) -> typing.MutableSequence[float]: + """ + Returns an array whose i :sup:`th` entry is the sum of logs of the i :sup:`th` entries of the arrays that correspond to + each multivariate sample + + Returns: + the array of component log sums + + + """ + ... + def getSumSq(self) -> typing.MutableSequence[float]: + """ + Returns an array whose i :sup:`th` entry is the sum of squares of the i :sup:`th` entries of the arrays that correspond + to each multivariate sample + + Returns: + the array of component sums of squares + + + """ + ... class StatisticalSummary: + """ + public interfaceStatisticalSummary + + Reporting interface for basic univariate statistics. + """ @typing.overload @staticmethod - def aggregate(iterable: typing.Union[java.lang.Iterable['StatisticalSummary'], typing.Sequence['StatisticalSummary'], typing.Set['StatisticalSummary'], typing.Callable[[], java.util.Iterator[typing.Any]]]) -> 'StatisticalSummary': ... + def aggregate(iterable: typing.Union[java.lang.Iterable['StatisticalSummary'], typing.Sequence['StatisticalSummary'], typing.Set['StatisticalSummary'], typing.Callable[[], java.util.Iterator[typing.Any]]]) -> 'StatisticalSummary': + """ + Computes aggregated statistical summaries. + + This method can be used to combine statistics computed over partitions or subsamples - i.e., the returned + StatisticalSummary should contain the same values that would have been obtained by computing a single StatisticalSummary + over the combined dataset. + + Parameters: + statistics (:class:`~org.hipparchus.stat.descriptive.StatisticalSummary`...): StatisticalSummary instances to aggregate + + Returns: + summary statistics for the combined dataset + + Raises: + :class:`~org.hipparchus.stat.descriptive.https:.www.hipparchus.org.hipparchus`: if the input is null + + static :class:`~org.hipparchus.stat.descriptive.StatisticalSummary` aggregate(:class:`~org.hipparchus.stat.descriptive.https:.docs.oracle.com.javase.8.docs.api.java.lang.Iterable`<? extends :class:`~org.hipparchus.stat.descriptive.StatisticalSummary`> statistics) + + Computes aggregated statistical summaries. + + This method can be used to combine statistics computed over partitions or subsamples - i.e., the returned + StatisticalSummary should contain the same values that would have been obtained by computing a single StatisticalSummary + over the combined dataset. + + Parameters: + statistics (:class:`~org.hipparchus.stat.descriptive.https:.docs.oracle.com.javase.8.docs.api.java.lang.Iterable`<? extends :class:`~org.hipparchus.stat.descriptive.StatisticalSummary`> statistics): iterable of StatisticalSummary instances to aggregate + + Returns: + summary statistics for the combined dataset + + Raises: + :class:`~org.hipparchus.stat.descriptive.https:.www.hipparchus.org.hipparchus`: if the input is null + + + """ + ... @typing.overload @staticmethod def aggregate(*statisticalSummary: 'StatisticalSummary') -> 'StatisticalSummary': ... - def getMax(self) -> float: ... - def getMean(self) -> float: ... - def getMin(self) -> float: ... - def getN(self) -> int: ... - def getStandardDeviation(self) -> float: ... - def getSum(self) -> float: ... - def getVariance(self) -> float: ... + def getMax(self) -> float: + """ + Returns the maximum of the available values + + Returns: + The max or Double.NaN if no values have been added. + + + """ + ... + def getMean(self) -> float: + """ + Returns the ` arithmetic mean <http://www.xycoon.com/arithmetic_mean.htm>` of the available values + + Returns: + The mean or Double.NaN if no values have been added. + + + """ + ... + def getMin(self) -> float: + """ + Returns the minimum of the available values + + Returns: + The min or Double.NaN if no values have been added. + + + """ + ... + def getN(self) -> int: + """ + Returns the number of available values + + Returns: + The number of available values + + + """ + ... + def getStandardDeviation(self) -> float: + """ + Returns the standard deviation of the available values. + + Returns: + The standard deviation, Double.NaN if no values have been added or 0.0 for a single value set. + + + """ + ... + def getSum(self) -> float: + """ + Returns the sum of the values that have been added to Univariate. + + Returns: + The sum or Double.NaN if no values have been added + + + """ + ... + def getVariance(self) -> float: + """ + Returns the variance of the available values. + + Returns: + The variance, Double.NaN if no values have been added or 0.0 for a single value set. + + + """ + ... class StorelessMultivariateStatistic: - def clear(self) -> None: ... - def getDimension(self) -> int: ... - def getN(self) -> int: ... - def getResult(self) -> typing.MutableSequence[float]: ... - def increment(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> None: ... + """ + public interfaceStorelessMultivariateStatistic + + Base interface implemented by storeless multivariate statistics. + """ + def clear(self) -> None: + """ + Clears the internal state of the statistic. + + """ + ... + def getDimension(self) -> int: + """ + Returns the dimension of the statistic. + + Returns: + the dimension of the statistic + + + """ + ... + def getN(self) -> int: + """ + Returns the number of values that have been added. + + Returns: + the number of values. + + + """ + ... + def getResult(self) -> typing.MutableSequence[float]: + """ + Returns the current value of the Statistic. + + Returns: + value of the statistic, :code:`Double.NaN` if it has been cleared or just instantiated. + + + """ + ... + def increment(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> None: + """ + Updates the internal state of the statistic to reflect the addition of the new value. + + Parameters: + d (double[]): the new value + + + """ + ... class UnivariateStatistic(org.hipparchus.util.MathArrays.Function): - def copy(self) -> 'UnivariateStatistic': ... + """ + public interfaceUnivariateStatisticextends :class:`~org.hipparchus.stat.descriptive.https:.www.hipparchus.org.hipparchus` + + Base interface implemented by all statistics. + """ + def copy(self) -> 'UnivariateStatistic': + """ + Returns a copy of the statistic with the same internal state. + + Returns: + a copy of the statistic + + + """ + ... @typing.overload def evaluate(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, int2: int) -> float: ... @typing.overload def evaluate(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> float: ... class WeightedEvaluation: + """ + public interfaceWeightedEvaluation + + Weighted evaluation for statistics. + """ @typing.overload def evaluate(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray], int: int, int2: int) -> float: ... @typing.overload def evaluate(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray]) -> float: ... class AbstractUnivariateStatistic(UnivariateStatistic): - def copy(self) -> UnivariateStatistic: ... + """ + public abstract classAbstractUnivariateStatistic extends :class:`~org.hipparchus.stat.descriptive.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.stat.descriptive.UnivariateStatistic` + + Abstract base class for implementations of the :class:`~org.hipparchus.stat.descriptive.UnivariateStatistic` interface. + """ + def copy(self) -> UnivariateStatistic: + """ + Returns a copy of the statistic with the same internal state. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.UnivariateStatistic.copy` in + interface :class:`~org.hipparchus.stat.descriptive.UnivariateStatistic` + + Returns: + a copy of the statistic + + + """ + ... @typing.overload def evaluate(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, int2: int) -> float: ... @typing.overload def evaluate(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> float: ... @typing.overload def evaluate(self) -> float: ... - def getData(self) -> typing.MutableSequence[float]: ... + def getData(self) -> typing.MutableSequence[float]: + """ + Get a copy of the stored data array. + + Returns: + copy of the stored data array (may be null) + + + """ + ... @typing.overload - def setData(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> None: ... + def setData(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> None: + """ + Set the data array. + + The stored value is a copy of the parameter array, not the array itself. + + Parameters: + values (double[]): data array to store (may be null to remove stored data) + + Also see: + + - :meth:`~org.hipparchus.stat.descriptive.AbstractUnivariateStatistic.evaluate` + + + public void setData(double[] values, int begin, int length) throws :class:`~org.hipparchus.stat.descriptive.https:.www.hipparchus.org.hipparchus` + + Set the data array. The input array is copied, not referenced. + + Parameters: + values (double[]): data array to store + begin (int): the index of the first element to include + length (int): the number of elements to include + + Raises: + :class:`~org.hipparchus.stat.descriptive.https:.www.hipparchus.org.hipparchus`: if values is null or the indices are not valid + + Also see: + + - :meth:`~org.hipparchus.stat.descriptive.AbstractUnivariateStatistic.evaluate` + + + + """ + ... @typing.overload def setData(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, int2: int) -> None: ... class DescriptiveStatistics(StatisticalSummary, java.util.function.DoubleConsumer, java.io.Serializable): + """ + public classDescriptiveStatistics extends :class:`~org.hipparchus.stat.descriptive.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.stat.descriptive.StatisticalSummary`, :class:`~org.hipparchus.stat.descriptive.https:.docs.oracle.com.javase.8.docs.api.java.util.function.DoubleConsumer`, :class:`~org.hipparchus.stat.descriptive.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + Maintains a dataset of values of a single variable and computes descriptive statistics based on stored data. + + The :meth:`~org.hipparchus.stat.descriptive.DescriptiveStatistics.getWindowSize` property sets a limit on the number of + values that can be stored in the dataset. The default value, INFINITE_WINDOW, puts no limit on the size of the dataset. + This value should be used with caution, as the backing store will grow without bound in this case. + + For very large datasets, :class:`~org.hipparchus.stat.descriptive.StreamingStatistics`, which does not store the + dataset, should be used instead of this class. If :code:`windowSize` is not INFINITE_WINDOW and more values are added + than can be stored in the dataset, new values are added in a "rolling" manner, with new values replacing the "oldest" + values in the dataset. + + Note: this class is not threadsafe. + + Also see: + + - :meth:`~serialized` + """ @typing.overload def __init__(self): ... @typing.overload def __init__(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]): ... @typing.overload def __init__(self, int: int): ... - def accept(self, double: float) -> None: ... - def addValue(self, double: float) -> None: ... - def apply(self, univariateStatistic: UnivariateStatistic) -> float: ... - def clear(self) -> None: ... - def copy(self) -> 'DescriptiveStatistics': ... - def getElement(self, int: int) -> float: ... - def getGeometricMean(self) -> float: ... - def getKurtosis(self) -> float: ... - def getMax(self) -> float: ... - def getMean(self) -> float: ... - def getMin(self) -> float: ... - def getN(self) -> int: ... + def accept(self, double: float) -> None: + """ + + Specified by: + + meth:`~org.hipparchus.stat.descriptive.https:.docs.oracle.com.javase.8.docs.api.java.util.function.DoubleConsumer.accept` in + interface :class:`~org.hipparchus.stat.descriptive.https:.docs.oracle.com.javase.8.docs.api.java.util.function.DoubleConsumer` + + + """ + ... + def addValue(self, double: float) -> None: + """ + Adds the value to the dataset. If the dataset is at the maximum size (i.e., the number of stored elements equals the + currently configured windowSize), the first (oldest) element in the dataset is discarded to make room for the new value. + + Parameters: + v (double): the value to be added + + + """ + ... + def apply(self, univariateStatistic: UnivariateStatistic) -> float: + """ + Apply the given statistic to the data associated with this set of statistics. + + Parameters: + stat (:class:`~org.hipparchus.stat.descriptive.UnivariateStatistic`): the statistic to apply + + Returns: + the computed value of the statistic. + + + """ + ... + def clear(self) -> None: + """ + Resets all statistics and storage. + + """ + ... + def copy(self) -> 'DescriptiveStatistics': + """ + Returns a copy of this DescriptiveStatistics instance with the same internal state. + + Returns: + a copy of this + + + """ + ... + def getElement(self, int: int) -> float: + """ + Returns the element at the specified index + + Parameters: + index (int): The Index of the element + + Returns: + return the element at the specified index + + + """ + ... + def getGeometricMean(self) -> float: + """ + Returns the geometric mean of the available values. + + See :class:`~org.hipparchus.stat.descriptive.moment.GeometricMean` for details on the computing algorithm. + + Returns: + The geometricMean, Double.NaN if no values have been added, or if any negative values have been added. + + Also see: + + - ` Geometric mean <http://www.xycoon.com/geometric_mean.htm>` + + + + """ + ... + def getKurtosis(self) -> float: + """ + Returns the Kurtosis of the available values. Kurtosis is a measure of the "peakedness" of a distribution. + + Returns: + The kurtosis, Double.NaN if less than 4 values have been added. + + + """ + ... + def getMax(self) -> float: + """ + Returns the maximum of the available values + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StatisticalSummary.getMax` in + interface :class:`~org.hipparchus.stat.descriptive.StatisticalSummary` + + Returns: + The max or Double.NaN if no values have been added. + + + """ + ... + def getMean(self) -> float: + """ + Returns the ` arithmetic mean <http://www.xycoon.com/arithmetic_mean.htm>` of the available values + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StatisticalSummary.getMean` in + interface :class:`~org.hipparchus.stat.descriptive.StatisticalSummary` + + Returns: + The mean or Double.NaN if no values have been added. + + + """ + ... + def getMin(self) -> float: + """ + Returns the minimum of the available values + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StatisticalSummary.getMin` in + interface :class:`~org.hipparchus.stat.descriptive.StatisticalSummary` + + Returns: + The min or Double.NaN if no values have been added. + + + """ + ... + def getN(self) -> int: + """ + Returns the number of available values + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StatisticalSummary.getN` in + interface :class:`~org.hipparchus.stat.descriptive.StatisticalSummary` + + Returns: + The number of available values + + + """ + ... def getPercentile(self, double: float) -> float: ... - def getPopulationVariance(self) -> float: ... - def getQuadraticMean(self) -> float: ... - def getSkewness(self) -> float: ... - def getSortedValues(self) -> typing.MutableSequence[float]: ... - def getStandardDeviation(self) -> float: ... - def getSum(self) -> float: ... - def getSumOfSquares(self) -> float: ... - def getValues(self) -> typing.MutableSequence[float]: ... - def getVariance(self) -> float: ... - def getWindowSize(self) -> int: ... + def getPopulationVariance(self) -> float: + """ + Returns the population variance of the available values. + + Returns: + The population variance, Double.NaN if no values have been added, or 0.0 for a single value set. + + Also see: + + - ` Population variance <http://en.wikibooks.org/wiki/Statistics/Summary/Variance>` + + + + """ + ... + def getQuadraticMean(self) -> float: + """ + Returns the quadratic mean of the available values. + + Returns: + The quadratic mean or :code:`Double.NaN` if no values have been added. + + Also see: + + - ` Root Mean Square <http://mathworld.wolfram.com/Root-Mean-Square.html>` + + + + """ + ... + def getSkewness(self) -> float: + """ + Returns the skewness of the available values. Skewness is a measure of the asymmetry of a given distribution. + + Returns: + The skewness, Double.NaN if less than 3 values have been added. + + + """ + ... + def getSortedValues(self) -> typing.MutableSequence[float]: + """ + Returns the current set of values in an array of double primitives, sorted in ascending order. The returned array is a + fresh copy of the underlying data -- i.e., it is not a reference to the stored data. + + Returns: + returns the current set of numbers sorted in ascending order + + + """ + ... + def getStandardDeviation(self) -> float: + """ + Returns the standard deviation of the available values. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StatisticalSummary.getStandardDeviation` in + interface :class:`~org.hipparchus.stat.descriptive.StatisticalSummary` + + Returns: + The standard deviation, Double.NaN if no values have been added or 0.0 for a single value set. + + + """ + ... + def getSum(self) -> float: + """ + Returns the sum of the values that have been added to Univariate. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StatisticalSummary.getSum` in + interface :class:`~org.hipparchus.stat.descriptive.StatisticalSummary` + + Returns: + The sum or Double.NaN if no values have been added + + + """ + ... + def getSumOfSquares(self) -> float: + """ + Returns the sum of the squares of the available values. + + Returns: + The sum of the squares or Double.NaN if no values have been added. + + + """ + ... + def getValues(self) -> typing.MutableSequence[float]: + """ + Returns the current set of values in an array of double primitives. The order of addition is preserved. The returned + array is a fresh copy of the underlying data -- i.e., it is not a reference to the stored data. + + Returns: + the current set of numbers in the order in which they were added to this set + + + """ + ... + def getVariance(self) -> float: + """ + Returns the variance of the available values. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StatisticalSummary.getVariance` in + interface :class:`~org.hipparchus.stat.descriptive.StatisticalSummary` + + Returns: + The variance, Double.NaN if no values have been added or 0.0 for a single value set. + + + """ + ... + def getWindowSize(self) -> int: + """ + Returns the maximum number of values that can be stored in the dataset, or INFINITE_WINDOW (-1) if there is no limit. + + Returns: + The current window size or -1 if its Infinite. + + + """ + ... def removeMostRecentValue(self) -> None: ... def replaceMostRecentValue(self, double: float) -> float: ... def setWindowSize(self, int: int) -> None: ... - def toString(self) -> str: ... + def toString(self) -> str: + """ + Generates a text report displaying univariate statistics from values that have been added. Each statistic is displayed + on a separate line. + + Overrides: + :meth:`~org.hipparchus.stat.descriptive.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.toString` in + class :class:`~org.hipparchus.stat.descriptive.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Returns: + String with line feeds displaying statistics + + + """ + ... class MultivariateSummaryStatistics(StatisticalMultivariateSummary, java.io.Serializable): + """ + public classMultivariateSummaryStatistics extends :class:`~org.hipparchus.stat.descriptive.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.stat.descriptive.StatisticalMultivariateSummary`, :class:`~org.hipparchus.stat.descriptive.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + Computes summary statistics for a stream of n-tuples added using the + :meth:`~org.hipparchus.stat.descriptive.MultivariateSummaryStatistics.addValue` method. The data values are not stored + in memory, so this class can be used to compute statistics for very large n-tuple streams. + + To compute statistics for a stream of n-tuples, construct a + :class:`~org.hipparchus.stat.descriptive.MultivariateSummaryStatistics` instance with dimension n and then use + :meth:`~org.hipparchus.stat.descriptive.MultivariateSummaryStatistics.addValue` to add n-tuples. The :code:`getXxx` + methods where Xxx is a statistic return an array of :code:`double` values, where for :code:`i = 0,...,n-1` the i + :sup:`th` array element is the value of the given statistic for data range consisting of the i :sup:`th` element of each + of the input n-tuples. For example, if :code:`addValue` is called with actual parameters {0, 1, 2}, then {3, 4, 5} and + finally {6, 7, 8}, :code:`getSum` will return a three-element array with values {0+3+6, 1+4+7, 2+5+8} + + Note: This class is not thread-safe. + + Also see: + + - :meth:`~serialized` + """ @typing.overload def __init__(self, int: int): ... @typing.overload def __init__(self, int: int, boolean: bool): ... def addValue(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> None: ... - def clear(self) -> None: ... - def equals(self, object: typing.Any) -> bool: ... - def getCovariance(self) -> org.hipparchus.linear.RealMatrix: ... - def getDimension(self) -> int: ... - def getGeometricMean(self) -> typing.MutableSequence[float]: ... - def getMax(self) -> typing.MutableSequence[float]: ... - def getMean(self) -> typing.MutableSequence[float]: ... - def getMin(self) -> typing.MutableSequence[float]: ... - def getN(self) -> int: ... - def getStandardDeviation(self) -> typing.MutableSequence[float]: ... - def getSum(self) -> typing.MutableSequence[float]: ... - def getSumLog(self) -> typing.MutableSequence[float]: ... - def getSumSq(self) -> typing.MutableSequence[float]: ... - def hashCode(self) -> int: ... - def toString(self) -> str: ... + def clear(self) -> None: + """ + Resets all statistics and storage. + + """ + ... + def equals(self, object: typing.Any) -> bool: + """ + Returns true iff :code:`object` is a :code:`MultivariateSummaryStatistics` instance and all statistics have the same + values as this. + + Overrides: + :meth:`~org.hipparchus.stat.descriptive.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.equals` in + class :class:`~org.hipparchus.stat.descriptive.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Parameters: + object (:class:`~org.hipparchus.stat.descriptive.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object`): the object to test equality against. + + Returns: + true if object equals this + + + """ + ... + def getCovariance(self) -> org.hipparchus.linear.RealMatrix: + """ + Returns the covariance of the available values. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StatisticalMultivariateSummary.getCovariance` in + interface :class:`~org.hipparchus.stat.descriptive.StatisticalMultivariateSummary` + + Returns: + The covariance, null if no multivariate sample have been added or a zeroed matrix for a single value set. + + + """ + ... + def getDimension(self) -> int: + """ + Returns the dimension of the data + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StatisticalMultivariateSummary.getDimension` in + interface :class:`~org.hipparchus.stat.descriptive.StatisticalMultivariateSummary` + + Returns: + The dimension of the data + + + """ + ... + def getGeometricMean(self) -> typing.MutableSequence[float]: + """ + Returns an array whose i :sup:`th` entry is the geometric mean of the i :sup:`th` entries of the arrays that correspond + to each multivariate sample + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StatisticalMultivariateSummary.getGeometricMean` in + interface :class:`~org.hipparchus.stat.descriptive.StatisticalMultivariateSummary` + + Returns: + the array of component geometric means + + + """ + ... + def getMax(self) -> typing.MutableSequence[float]: + """ + Returns an array whose i :sup:`th` entry is the maximum of the i :sup:`th` entries of the arrays that correspond to each + multivariate sample + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StatisticalMultivariateSummary.getMax` in + interface :class:`~org.hipparchus.stat.descriptive.StatisticalMultivariateSummary` + + Returns: + the array of component maxima + + + """ + ... + def getMean(self) -> typing.MutableSequence[float]: + """ + Returns an array whose i :sup:`th` entry is the mean of the i :sup:`th` entries of the arrays that correspond to each + multivariate sample + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StatisticalMultivariateSummary.getMean` in + interface :class:`~org.hipparchus.stat.descriptive.StatisticalMultivariateSummary` + + Returns: + the array of component means + + + """ + ... + def getMin(self) -> typing.MutableSequence[float]: + """ + Returns an array whose i :sup:`th` entry is the minimum of the i :sup:`th` entries of the arrays that correspond to each + multivariate sample + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StatisticalMultivariateSummary.getMin` in + interface :class:`~org.hipparchus.stat.descriptive.StatisticalMultivariateSummary` + + Returns: + the array of component minima + + + """ + ... + def getN(self) -> int: + """ + Returns the number of available values + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StatisticalMultivariateSummary.getN` in + interface :class:`~org.hipparchus.stat.descriptive.StatisticalMultivariateSummary` + + Returns: + The number of available values + + + """ + ... + def getStandardDeviation(self) -> typing.MutableSequence[float]: + """ + Returns an array whose i :sup:`th` entry is the standard deviation of the i :sup:`th` entries of the arrays that have + been added using :meth:`~org.hipparchus.stat.descriptive.MultivariateSummaryStatistics.addValue` + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StatisticalMultivariateSummary.getStandardDeviation` in + interface :class:`~org.hipparchus.stat.descriptive.StatisticalMultivariateSummary` + + Returns: + the array of component standard deviations + + + """ + ... + def getSum(self) -> typing.MutableSequence[float]: + """ + Returns an array whose i :sup:`th` entry is the sum of the i :sup:`th` entries of the arrays that correspond to each + multivariate sample + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StatisticalMultivariateSummary.getSum` in + interface :class:`~org.hipparchus.stat.descriptive.StatisticalMultivariateSummary` + + Returns: + the array of component sums + + + """ + ... + def getSumLog(self) -> typing.MutableSequence[float]: + """ + Returns an array whose i :sup:`th` entry is the sum of logs of the i :sup:`th` entries of the arrays that correspond to + each multivariate sample + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StatisticalMultivariateSummary.getSumLog` in + interface :class:`~org.hipparchus.stat.descriptive.StatisticalMultivariateSummary` + + Returns: + the array of component log sums + + + """ + ... + def getSumSq(self) -> typing.MutableSequence[float]: + """ + Returns an array whose i :sup:`th` entry is the sum of squares of the i :sup:`th` entries of the arrays that correspond + to each multivariate sample + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StatisticalMultivariateSummary.getSumSq` in + interface :class:`~org.hipparchus.stat.descriptive.StatisticalMultivariateSummary` + + Returns: + the array of component sums of squares + + + """ + ... + def hashCode(self) -> int: + """ + Returns hash code based on values of statistics + + Overrides: + :meth:`~org.hipparchus.stat.descriptive.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.hashCode` in + class :class:`~org.hipparchus.stat.descriptive.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Returns: + hash code + + + """ + ... + def toString(self) -> str: + """ + Generates a text report displaying summary statistics from values that have been added. + + Overrides: + :meth:`~org.hipparchus.stat.descriptive.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.toString` in + class :class:`~org.hipparchus.stat.descriptive.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Returns: + String with line feeds displaying statistics + + + """ + ... class StatisticalSummaryValues(java.io.Serializable, StatisticalSummary): + """ + public classStatisticalSummaryValues extends :class:`~org.hipparchus.stat.descriptive.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.stat.descriptive.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable`, :class:`~org.hipparchus.stat.descriptive.StatisticalSummary` + + Value object representing the results of a univariate statistical summary. + + Also see: + + - :meth:`~serialized` + """ def __init__(self, double: float, double2: float, long: int, double3: float, double4: float, double5: float): ... - def equals(self, object: typing.Any) -> bool: ... - def getMax(self) -> float: ... - def getMean(self) -> float: ... - def getMin(self) -> float: ... - def getN(self) -> int: ... - def getStandardDeviation(self) -> float: ... - def getSum(self) -> float: ... - def getVariance(self) -> float: ... - def hashCode(self) -> int: ... - def toString(self) -> str: ... + def equals(self, object: typing.Any) -> bool: + """ + Returns true iff :code:`object` is a :code:`StatisticalSummary` instance and all statistics have the same values as + this. + + Overrides: + :meth:`~org.hipparchus.stat.descriptive.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.equals` in + class :class:`~org.hipparchus.stat.descriptive.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Parameters: + object (:class:`~org.hipparchus.stat.descriptive.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object`): the object to test equality against. + + Returns: + true if object equals this + + + """ + ... + def getMax(self) -> float: + """ + Description copied from interface: :meth:`~org.hipparchus.stat.descriptive.StatisticalSummary.getMax` + Returns the maximum of the available values + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StatisticalSummary.getMax` in + interface :class:`~org.hipparchus.stat.descriptive.StatisticalSummary` + + Returns: + Returns the max. + + + """ + ... + def getMean(self) -> float: + """ + Description copied from interface: :meth:`~org.hipparchus.stat.descriptive.StatisticalSummary.getMean` + Returns the ` arithmetic mean <http://www.xycoon.com/arithmetic_mean.htm>` of the available values + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StatisticalSummary.getMean` in + interface :class:`~org.hipparchus.stat.descriptive.StatisticalSummary` + + Returns: + Returns the mean. + + + """ + ... + def getMin(self) -> float: + """ + Description copied from interface: :meth:`~org.hipparchus.stat.descriptive.StatisticalSummary.getMin` + Returns the minimum of the available values + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StatisticalSummary.getMin` in + interface :class:`~org.hipparchus.stat.descriptive.StatisticalSummary` + + Returns: + Returns the min. + + + """ + ... + def getN(self) -> int: + """ + Description copied from interface: :meth:`~org.hipparchus.stat.descriptive.StatisticalSummary.getN` + Returns the number of available values + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StatisticalSummary.getN` in + interface :class:`~org.hipparchus.stat.descriptive.StatisticalSummary` + + Returns: + Returns the number of values. + + + """ + ... + def getStandardDeviation(self) -> float: + """ + Description copied from interface: :meth:`~org.hipparchus.stat.descriptive.StatisticalSummary.getStandardDeviation` + Returns the standard deviation of the available values. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StatisticalSummary.getStandardDeviation` in + interface :class:`~org.hipparchus.stat.descriptive.StatisticalSummary` + + Returns: + Returns the standard deviation + + + """ + ... + def getSum(self) -> float: + """ + Description copied from interface: :meth:`~org.hipparchus.stat.descriptive.StatisticalSummary.getSum` + Returns the sum of the values that have been added to Univariate. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StatisticalSummary.getSum` in + interface :class:`~org.hipparchus.stat.descriptive.StatisticalSummary` + + Returns: + Returns the sum. + + + """ + ... + def getVariance(self) -> float: + """ + Description copied from interface: :meth:`~org.hipparchus.stat.descriptive.StatisticalSummary.getVariance` + Returns the variance of the available values. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StatisticalSummary.getVariance` in + interface :class:`~org.hipparchus.stat.descriptive.StatisticalSummary` + + Returns: + Returns the variance. + + + """ + ... + def hashCode(self) -> int: + """ + Returns hash code based on values of statistics + + Overrides: + :meth:`~org.hipparchus.stat.descriptive.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.hashCode` in + class :class:`~org.hipparchus.stat.descriptive.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Returns: + hash code + + + """ + ... + def toString(self) -> str: + """ + Generates a text report displaying values of statistics. Each statistic is displayed on a separate line. + + Overrides: + :meth:`~org.hipparchus.stat.descriptive.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.toString` in + class :class:`~org.hipparchus.stat.descriptive.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Returns: + String with line feeds displaying statistics + + + """ + ... class StorelessUnivariateStatistic(UnivariateStatistic, java.util.function.DoubleConsumer): - def accept(self, double: float) -> None: ... - def clear(self) -> None: ... - def copy(self) -> 'StorelessUnivariateStatistic': ... + """ + public interfaceStorelessUnivariateStatisticextends :class:`~org.hipparchus.stat.descriptive.UnivariateStatistic`, :class:`~org.hipparchus.stat.descriptive.https:.docs.oracle.com.javase.8.docs.api.java.util.function.DoubleConsumer` + + Extends the definition of :class:`~org.hipparchus.stat.descriptive.UnivariateStatistic` with + :meth:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic.increment` and + :meth:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic.incrementAll` methods for adding values and + updating internal state. + + This interface is designed to be used for calculating statistics that can be computed in one pass through the data + without storing the full array of sample values. + + Note: unless otherwise stated, the :meth:`~org.hipparchus.stat.descriptive.UnivariateStatistic.evaluate` and + :meth:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic.evaluate` methods do **NOT** alter the internal + state of the respective statistic. + """ + def accept(self, double: float) -> None: + """ + + Specified by: + + meth:`~org.hipparchus.stat.descriptive.https:.docs.oracle.com.javase.8.docs.api.java.util.function.DoubleConsumer.accept` in + interface :class:`~org.hipparchus.stat.descriptive.https:.docs.oracle.com.javase.8.docs.api.java.util.function.DoubleConsumer` + + + """ + ... + def clear(self) -> None: + """ + Clears the internal state of the Statistic + + """ + ... + def copy(self) -> 'StorelessUnivariateStatistic': + """ + Returns a copy of the statistic with the same internal state. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.UnivariateStatistic.copy` in + interface :class:`~org.hipparchus.stat.descriptive.UnivariateStatistic` + + Returns: + a copy of the statistic + + + """ + ... @typing.overload def evaluate(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, int2: int) -> float: ... @typing.overload def evaluate(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> float: ... - def getN(self) -> int: ... - def getResult(self) -> float: ... - def increment(self, double: float) -> None: ... + def getN(self) -> int: + """ + Returns the number of values that have been added. + + Returns: + the number of values. + + + """ + ... + def getResult(self) -> float: + """ + Returns the current value of the Statistic. + + Returns: + value of the statistic, :code:`Double.NaN` if it has been cleared or just instantiated. + + + """ + ... + def increment(self, double: float) -> None: + """ + Updates the internal state of the statistic to reflect the addition of the new value. + + Parameters: + d (double): the new value. + + + """ + ... @typing.overload def incrementAll(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> None: ... @typing.overload def incrementAll(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, int2: int) -> None: ... class StreamingStatistics(StatisticalSummary, AggregatableStatistic['StreamingStatistics'], java.util.function.DoubleConsumer, java.io.Serializable): + """ + public classStreamingStatistics extends :class:`~org.hipparchus.stat.descriptive.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.stat.descriptive.StatisticalSummary`, :class:`~org.hipparchus.stat.descriptive.AggregatableStatistic`<:class:`~org.hipparchus.stat.descriptive.StreamingStatistics`>, :class:`~org.hipparchus.stat.descriptive.https:.docs.oracle.com.javase.8.docs.api.java.util.function.DoubleConsumer`, :class:`~org.hipparchus.stat.descriptive.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + Computes summary statistics for a stream of data values added using the + :meth:`~org.hipparchus.stat.descriptive.StreamingStatistics.addValue` method. The data values are not stored in memory, + so this class can be used to compute statistics for very large data streams. + + By default, all statistics other than percentiles are maintained. Percentile calculations use an embedded + :class:`~org.hipparchus.stat.descriptive.rank.RandomPercentile` which carries more memory and compute overhead than the + other statistics, so it is disabled by default. To enable percentiles, either pass :code:`true` to the constructor or + use a :class:`~org.hipparchus.stat.descriptive.StreamingStatistics.StreamingStatisticsBuilder` to configure an instance + with percentiles turned on. Other stats can also be selectively disabled using :code:`StreamingStatisticsBulder`. + + Note: This class is not thread-safe. + + Also see: + + - :meth:`~serialized` + """ @typing.overload def __init__(self): ... @typing.overload def __init__(self, double: float, randomGenerator: org.hipparchus.random.RandomGenerator): ... - def accept(self, double: float) -> None: ... - def addValue(self, double: float) -> None: ... + def accept(self, double: float) -> None: + """ + + Specified by: + + meth:`~org.hipparchus.stat.descriptive.https:.docs.oracle.com.javase.8.docs.api.java.util.function.DoubleConsumer.accept` in + interface :class:`~org.hipparchus.stat.descriptive.https:.docs.oracle.com.javase.8.docs.api.java.util.function.DoubleConsumer` + + + """ + ... + def addValue(self, double: float) -> None: + """ + Add a value to the data + + Parameters: + value (double): the value to add + + + """ + ... @typing.overload - def aggregate(self, iterable: typing.Union[java.lang.Iterable[typing.Any], typing.Sequence[typing.Any], typing.Set[typing.Any], typing.Callable[[], java.util.Iterator[typing.Any]]]) -> None: ... + def aggregate(self, iterable: typing.Union[java.lang.Iterable[typing.Any], typing.Sequence[typing.Any], typing.Set[typing.Any], typing.Callable[[], java.util.Iterator[typing.Any]]]) -> None: + """ + Aggregates the provided instance into this instance. + + This method can be used to combine statistics computed over partitions or subsamples - i.e., the value of this instance + after this operation should be the same as if a single statistic would have been applied over the combined dataset. + Statistics are aggregated only when both this and other are maintaining them. For example, if this.computeMoments is + false, but other.computeMoments is true, the moment data in other will be lost. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.AggregatableStatistic.aggregate` in + interface :class:`~org.hipparchus.stat.descriptive.AggregatableStatistic` + + Parameters: + other (:class:`~org.hipparchus.stat.descriptive.StreamingStatistics`): the instance to aggregate into this instance + + + """ + ... @typing.overload def aggregate(self, *t: typing.Any) -> None: ... @typing.overload def aggregate(self, streamingStatistics: 'StreamingStatistics') -> None: ... @staticmethod - def builder() -> 'StreamingStatistics.StreamingStatisticsBuilder': ... - def clear(self) -> None: ... - def copy(self) -> 'StreamingStatistics': ... - def equals(self, object: typing.Any) -> bool: ... - def getGeometricMean(self) -> float: ... - def getMax(self) -> float: ... - def getMean(self) -> float: ... - def getMedian(self) -> float: ... - def getMin(self) -> float: ... - def getN(self) -> int: ... - def getPercentile(self, double: float) -> float: ... - def getPopulationVariance(self) -> float: ... - def getQuadraticMean(self) -> float: ... - def getSecondMoment(self) -> float: ... - def getStandardDeviation(self) -> float: ... - def getSum(self) -> float: ... - def getSumOfLogs(self) -> float: ... - def getSumOfSquares(self) -> float: ... - def getSummary(self) -> StatisticalSummary: ... - def getVariance(self) -> float: ... - def hashCode(self) -> int: ... - def toString(self) -> str: ... + def builder() -> 'StreamingStatistics.StreamingStatisticsBuilder': + """ + Returns a :class:`~org.hipparchus.stat.descriptive.StreamingStatistics.StreamingStatisticsBuilder` to source configured + :code:`StreamingStatistics` instances. + + Returns: + a StreamingStatisticsBuilder instance + + + """ + ... + def clear(self) -> None: + """ + Resets all statistics and storage. + + """ + ... + def copy(self) -> 'StreamingStatistics': + """ + Returns a copy of this StreamingStatistics instance with the same internal state. + + Returns: + a copy of this + + + """ + ... + def equals(self, object: typing.Any) -> bool: + """ + Returns true iff :code:`object` is a :code:`StreamingStatistics` instance and all statistics have the same values as + this. + + Overrides: + :meth:`~org.hipparchus.stat.descriptive.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.equals` in + class :class:`~org.hipparchus.stat.descriptive.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Parameters: + object (:class:`~org.hipparchus.stat.descriptive.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object`): the object to test equality against. + + Returns: + true if object equals this + + + """ + ... + def getGeometricMean(self) -> float: + """ + Returns the geometric mean of the values that have been added. + + Double.NaN is returned if no values have been added. + + Returns: + the geometric mean + + + """ + ... + def getMax(self) -> float: + """ + Returns the maximum of the available values + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StatisticalSummary.getMax` in + interface :class:`~org.hipparchus.stat.descriptive.StatisticalSummary` + + Returns: + The max or Double.NaN if no values have been added. + + + """ + ... + def getMean(self) -> float: + """ + Returns the ` arithmetic mean <http://www.xycoon.com/arithmetic_mean.htm>` of the available values + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StatisticalSummary.getMean` in + interface :class:`~org.hipparchus.stat.descriptive.StatisticalSummary` + + Returns: + The mean or Double.NaN if no values have been added. + + + """ + ... + def getMedian(self) -> float: + """ + Returns an estimate of the median of the values that have been entered. See + :class:`~org.hipparchus.stat.descriptive.rank.RandomPercentile` for a description of the algorithm used for large data + streams. + + Returns: + the median + + + """ + ... + def getMin(self) -> float: + """ + Returns the minimum of the available values + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StatisticalSummary.getMin` in + interface :class:`~org.hipparchus.stat.descriptive.StatisticalSummary` + + Returns: + The min or Double.NaN if no values have been added. + + + """ + ... + def getN(self) -> int: + """ + Returns the number of available values + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StatisticalSummary.getN` in + interface :class:`~org.hipparchus.stat.descriptive.StatisticalSummary` + + Returns: + The number of available values + + + """ + ... + def getPercentile(self, double: float) -> float: + """ + Returns an estimate of the given percentile of the values that have been entered. See + :class:`~org.hipparchus.stat.descriptive.rank.RandomPercentile` for a description of the algorithm used for large data + streams. + + Parameters: + percentile (double): the desired percentile (must be between 0 and 100) + + Returns: + estimated percentile + + + """ + ... + def getPopulationVariance(self) -> float: + """ + Returns the ` population variance <http://en.wikibooks.org/wiki/Statistics/Summary/Variance>` of the values that have + been added. + + Double.NaN is returned if no values have been added. + + Returns: + the population variance + + + """ + ... + def getQuadraticMean(self) -> float: + """ + Returns the quadratic mean, a.k.a. ` root-mean-square <http://mathworld.wolfram.com/Root-Mean-Square.html>` of the + available values + + Returns: + The quadratic mean or :code:`Double.NaN` if no values have been added. + + + """ + ... + def getSecondMoment(self) -> float: + """ + Returns a statistic related to the Second Central Moment. Specifically, what is returned is the sum of squared + deviations from the sample mean among the values that have been added. + + Returns :code:`Double.NaN` if no data values have been added and returns :code:`0` if there is just one value in the + data set. + + Returns: + second central moment statistic + + + """ + ... + def getStandardDeviation(self) -> float: + """ + Returns the standard deviation of the values that have been added. + + Double.NaN is returned if no values have been added. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StatisticalSummary.getStandardDeviation` in + interface :class:`~org.hipparchus.stat.descriptive.StatisticalSummary` + + Returns: + the standard deviation + + + """ + ... + def getSum(self) -> float: + """ + Returns the sum of the values that have been added to Univariate. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StatisticalSummary.getSum` in + interface :class:`~org.hipparchus.stat.descriptive.StatisticalSummary` + + Returns: + The sum or Double.NaN if no values have been added + + + """ + ... + def getSumOfLogs(self) -> float: + """ + Returns the sum of the logs of the values that have been added. + + Double.NaN is returned if no values have been added. + + Returns: + the sum of logs + + + """ + ... + def getSumOfSquares(self) -> float: + """ + Returns the sum of the squares of the values that have been added. + + Double.NaN is returned if no values have been added. + + Returns: + The sum of squares + + + """ + ... + def getSummary(self) -> StatisticalSummary: + """ + Return a :class:`~org.hipparchus.stat.descriptive.StatisticalSummaryValues` instance reporting current statistics. + + Returns: + Current values of statistics + + + """ + ... + def getVariance(self) -> float: + """ + Returns the variance of the available values. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StatisticalSummary.getVariance` in + interface :class:`~org.hipparchus.stat.descriptive.StatisticalSummary` + + Returns: + The variance, Double.NaN if no values have been added or 0.0 for a single value set. + + + """ + ... + def hashCode(self) -> int: + """ + Returns hash code based on values of statistics. + + Overrides: + :meth:`~org.hipparchus.stat.descriptive.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.hashCode` in + class :class:`~org.hipparchus.stat.descriptive.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Returns: + hash code + + + """ + ... + def toString(self) -> str: + """ + Generates a text report displaying summary statistics from values that have been added. + + Overrides: + :meth:`~org.hipparchus.stat.descriptive.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.toString` in + class :class:`~org.hipparchus.stat.descriptive.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Returns: + String with line feeds displaying statistics + + + """ + ... class StreamingStatisticsBuilder: def __init__(self): ... def build(self) -> 'StreamingStatistics': ... @@ -224,14 +1644,116 @@ class StreamingStatistics(StatisticalSummary, AggregatableStatistic['StreamingSt def sumOfSquares(self, boolean: bool) -> 'StreamingStatistics.StreamingStatisticsBuilder': ... class AbstractStorelessUnivariateStatistic(StorelessUnivariateStatistic): + """ + public abstract classAbstractStorelessUnivariateStatistic extends :class:`~org.hipparchus.stat.descriptive.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic` + + Abstract base class for implementations of the :class:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic` + interface. + + Provides default :code:`hashCode()` and :code:`equals(Object)` implementations. + """ def __init__(self): ... - def clear(self) -> None: ... - def copy(self) -> StorelessUnivariateStatistic: ... - def equals(self, object: typing.Any) -> bool: ... - def getResult(self) -> float: ... - def hashCode(self) -> int: ... - def increment(self, double: float) -> None: ... - def toString(self) -> str: ... + def clear(self) -> None: + """ + Clears the internal state of the Statistic + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic.clear` in + interface :class:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic` + + + """ + ... + def copy(self) -> StorelessUnivariateStatistic: + """ + Returns a copy of the statistic with the same internal state. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic.copy` in + interface :class:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic` + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.UnivariateStatistic.copy` in + interface :class:`~org.hipparchus.stat.descriptive.UnivariateStatistic` + + Returns: + a copy of the statistic + + + """ + ... + def equals(self, object: typing.Any) -> bool: + """ + Returns true iff :code:`object` is the same type of + :class:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic` (the object's class equals this instance) + returning the same values as this for :code:`getResult()` and :code:`getN()`. + + Overrides: + :meth:`~org.hipparchus.stat.descriptive.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.equals` in + class :class:`~org.hipparchus.stat.descriptive.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Parameters: + object (:class:`~org.hipparchus.stat.descriptive.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object`): object to test equality against. + + Returns: + true if object returns the same value as this + + + """ + ... + def getResult(self) -> float: + """ + Returns the current value of the Statistic. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic.getResult` in + interface :class:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic` + + Returns: + value of the statistic, :code:`Double.NaN` if it has been cleared or just instantiated. + + + """ + ... + def hashCode(self) -> int: + """ + Returns hash code based on getResult() and getN(). + + Overrides: + :meth:`~org.hipparchus.stat.descriptive.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.hashCode` in + class :class:`~org.hipparchus.stat.descriptive.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Returns: + hash code + + + """ + ... + def increment(self, double: float) -> None: + """ + Updates the internal state of the statistic to reflect the addition of the new value. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic.increment` in + interface :class:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic` + + Parameters: + d (double): the new value. + + + """ + ... + def toString(self) -> str: + """ + + Overrides: + :meth:`~org.hipparchus.stat.descriptive.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.toString` in + class :class:`~org.hipparchus.stat.descriptive.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + + """ + ... class __module_protocol__(Protocol): diff --git a/org-stubs/hipparchus/stat/descriptive/moment/__init__.pyi b/org-stubs/hipparchus/stat/descriptive/moment/__init__.pyi index 6ca0748..8696ed8 100644 --- a/org-stubs/hipparchus/stat/descriptive/moment/__init__.pyi +++ b/org-stubs/hipparchus/stat/descriptive/moment/__init__.pyi @@ -16,6 +16,30 @@ import typing class GeometricMean(org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic, org.hipparchus.stat.descriptive.AggregatableStatistic['GeometricMean'], java.io.Serializable): + """ + public classGeometricMean extends :class:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic` + implements :class:`~org.hipparchus.stat.descriptive.AggregatableStatistic`<:class:`~org.hipparchus.stat.descriptive.moment.GeometricMean`>, :class:`~org.hipparchus.stat.descriptive.moment.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + Returns the ` geometric mean <http://www.xycoon.com/geometric_mean.htm>` of the available values. + + Uses a :class:`~org.hipparchus.stat.descriptive.summary.SumOfLogs` instance to compute sum of logs and returns + :code:`exp( 1/n (sum of logs) ).` Therefore, + + - If any of values are < 0, the result is :code:`NaN.` + - If all values are non-negative and less than :code:`Double.POSITIVE_INFINITY`, but at least one value is 0, the result + is :code:`0.` + - If both :code:`Double.POSITIVE_INFINITY` and :code:`Double.NEGATIVE_INFINITY` are among the values, the result is + :code:`NaN.` + + + **Note that this implementation is not synchronized.** If multiple threads access an instance of this class + concurrently, and at least one of the threads invokes the :code:`increment()` or :code:`clear()` method, it must be + synchronized externally. + + Also see: + + - :meth:`~serialized` + """ @typing.overload def __init__(self): ... @typing.overload @@ -23,39 +47,284 @@ class GeometricMean(org.hipparchus.stat.descriptive.AbstractStorelessUnivariateS @typing.overload def __init__(self, sumOfLogs: org.hipparchus.stat.descriptive.summary.SumOfLogs): ... @typing.overload - def aggregate(self, iterable: typing.Union[java.lang.Iterable[typing.Any], typing.Sequence[typing.Any], typing.Set[typing.Any], typing.Callable[[], java.util.Iterator[typing.Any]]]) -> None: ... + def aggregate(self, iterable: typing.Union[java.lang.Iterable[typing.Any], typing.Sequence[typing.Any], typing.Set[typing.Any], typing.Callable[[], java.util.Iterator[typing.Any]]]) -> None: + """ + Aggregates the provided instance into this instance. + + This method can be used to combine statistics computed over partitions or subsamples - i.e., the value of this instance + after this operation should be the same as if a single statistic would have been applied over the combined dataset. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.AggregatableStatistic.aggregate` in + interface :class:`~org.hipparchus.stat.descriptive.AggregatableStatistic` + + Parameters: + other (:class:`~org.hipparchus.stat.descriptive.moment.GeometricMean`): the instance to aggregate into this instance + + + """ + ... @typing.overload def aggregate(self, *t: typing.Any) -> None: ... @typing.overload def aggregate(self, geometricMean: 'GeometricMean') -> None: ... - def clear(self) -> None: ... - def copy(self) -> 'GeometricMean': ... + def clear(self) -> None: + """ + Clears the internal state of the Statistic + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic.clear` in + interface :class:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic` + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic.clear` in + class :class:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic` + + + """ + ... + def copy(self) -> 'GeometricMean': + """ + Returns a copy of the statistic with the same internal state. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic.copy` in + interface :class:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic` + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.UnivariateStatistic.copy` in + interface :class:`~org.hipparchus.stat.descriptive.UnivariateStatistic` + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic.copy` in + class :class:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic` + + Returns: + a copy of the statistic + + + """ + ... @typing.overload def evaluate(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> float: ... @typing.overload def evaluate(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, int2: int) -> float: ... - def getN(self) -> int: ... - def getResult(self) -> float: ... - def increment(self, double: float) -> None: ... + def getN(self) -> int: + """ + Returns the number of values that have been added. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic.getN` in + interface :class:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic` + + Returns: + the number of values. + + + """ + ... + def getResult(self) -> float: + """ + Returns the current value of the Statistic. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic.getResult` in + interface :class:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic` + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic.getResult` in + class :class:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic` + + Returns: + value of the statistic, :code:`Double.NaN` if it has been cleared or just instantiated. + + + """ + ... + def increment(self, double: float) -> None: + """ + Updates the internal state of the statistic to reflect the addition of the new value. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic.increment` in + interface :class:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic` + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic.increment` in + class :class:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic` + + Parameters: + d (double): the new value. + + + """ + ... class Kurtosis(org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic, java.io.Serializable): + """ + public classKurtosis extends :class:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic` + implements :class:`~org.hipparchus.stat.descriptive.moment.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + Computes the Kurtosis of the available values. + + We use the following (unbiased) formula to define kurtosis: + + kurtosis = { [n(n+1) / (n -1)(n - 2)(n-3)] sum[(x_i - mean)^4] / std^4 } - [3(n-1)^2 / (n-2)(n-3)] + + where n is the number of values, mean is the :class:`~org.hipparchus.stat.descriptive.moment.Mean` and std is the + :class:`~org.hipparchus.stat.descriptive.moment.StandardDeviation`. + + Note that this statistic is undefined for n < 4. :code:`Double.Nan` is returned when there is not sufficient data to + compute the statistic. Note that Double.NaN may also be returned if the input includes NaN and / or infinite values. + + **Note that this implementation is not synchronized.** If multiple threads access an instance of this class + concurrently, and at least one of the threads invokes the :code:`increment()` or :code:`clear()` method, it must be + synchronized externally. + + Also see: + + - :meth:`~serialized` + """ @typing.overload def __init__(self): ... @typing.overload def __init__(self, fourthMoment: 'FourthMoment'): ... @typing.overload def __init__(self, kurtosis: 'Kurtosis'): ... - def clear(self) -> None: ... - def copy(self) -> 'Kurtosis': ... + def clear(self) -> None: + """ + Clears the internal state of the Statistic + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic.clear` in + interface :class:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic` + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic.clear` in + class :class:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic` + + + """ + ... + def copy(self) -> 'Kurtosis': + """ + Returns a copy of the statistic with the same internal state. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic.copy` in + interface :class:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic` + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.UnivariateStatistic.copy` in + interface :class:`~org.hipparchus.stat.descriptive.UnivariateStatistic` + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic.copy` in + class :class:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic` + + Returns: + a copy of the statistic + + + """ + ... @typing.overload def evaluate(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> float: ... @typing.overload def evaluate(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, int2: int) -> float: ... - def getN(self) -> int: ... - def getResult(self) -> float: ... - def increment(self, double: float) -> None: ... + def getN(self) -> int: + """ + Returns the number of values that have been added. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic.getN` in + interface :class:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic` + + Returns: + the number of values. + + + """ + ... + def getResult(self) -> float: + """ + Returns the current value of the Statistic. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic.getResult` in + interface :class:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic` + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic.getResult` in + class :class:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic` + + Returns: + value of the statistic, :code:`Double.NaN` if it has been cleared or just instantiated. + + + """ + ... + def increment(self, double: float) -> None: + """ + Updates the internal state of the statistic to reflect the addition of the new value. + + Note that when :meth:`~org.hipparchus.stat.descriptive.moment.Kurtosis.%3Cinit%3E` is used to create a Variance, this + method does nothing. In that case, the FourthMoment should be incremented directly. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic.increment` in + interface :class:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic` + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic.increment` in + class :class:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic` + + Parameters: + d (double): the new value. + + + """ + ... class Mean(org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic, org.hipparchus.stat.descriptive.AggregatableStatistic['Mean'], org.hipparchus.stat.descriptive.WeightedEvaluation, java.io.Serializable): + """ + public classMean extends :class:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic` + implements :class:`~org.hipparchus.stat.descriptive.AggregatableStatistic`<:class:`~org.hipparchus.stat.descriptive.moment.Mean`>, :class:`~org.hipparchus.stat.descriptive.WeightedEvaluation`, :class:`~org.hipparchus.stat.descriptive.moment.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + Computes the arithmetic mean of a set of values. Uses the definitional formula: + + mean = sum(x_i) / n + + where :code:`n` is the number of observations. + + When :meth:`~org.hipparchus.stat.descriptive.moment.Mean.increment` is used to add data incrementally from a stream of + (unstored) values, the value of the statistic that :meth:`~org.hipparchus.stat.descriptive.moment.Mean.getResult` + returns is computed using the following recursive updating algorithm: + + 1. Initialize :code:`m =` the first value + 2. For each additional value, update using + + + :code:`m = m + (new value - m) / (number of observations)` + + + If :meth:`~org.hipparchus.stat.descriptive.UnivariateStatistic.evaluate` is used to compute the mean of an array of + stored values, a two-pass, corrected algorithm is used, starting with the definitional formula computed using the array + of stored values and then correcting this by adding the mean deviation of the data values from the arithmetic mean. See, + e.g. "Comparison of Several Algorithms for Computing Sample Means and Variances," Robert F. Ling, Journal of the + American Statistical Association, Vol. 69, No. 348 (Dec., 1974), pp. 859-866. + + Returns :code:`Double.NaN` if the dataset is empty. Note that Double.NaN may also be returned if the input includes NaN + and / or infinite values. + + **Note that this implementation is not synchronized.** If multiple threads access an instance of this class + concurrently, and at least one of the threads invokes the :code:`increment()` or :code:`clear()` method, it must be + synchronized externally. + + Also see: + + - :meth:`~serialized` + """ @typing.overload def __init__(self): ... @typing.overload @@ -63,13 +332,64 @@ class Mean(org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic, @typing.overload def __init__(self, mean: 'Mean'): ... @typing.overload - def aggregate(self, iterable: typing.Union[java.lang.Iterable[typing.Any], typing.Sequence[typing.Any], typing.Set[typing.Any], typing.Callable[[], java.util.Iterator[typing.Any]]]) -> None: ... + def aggregate(self, iterable: typing.Union[java.lang.Iterable[typing.Any], typing.Sequence[typing.Any], typing.Set[typing.Any], typing.Callable[[], java.util.Iterator[typing.Any]]]) -> None: + """ + Aggregates the provided instance into this instance. + + This method can be used to combine statistics computed over partitions or subsamples - i.e., the value of this instance + after this operation should be the same as if a single statistic would have been applied over the combined dataset. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.AggregatableStatistic.aggregate` in + interface :class:`~org.hipparchus.stat.descriptive.AggregatableStatistic` + + Parameters: + other (:class:`~org.hipparchus.stat.descriptive.moment.Mean`): the instance to aggregate into this instance + + + """ + ... @typing.overload def aggregate(self, *t: typing.Any) -> None: ... @typing.overload def aggregate(self, mean: 'Mean') -> None: ... - def clear(self) -> None: ... - def copy(self) -> 'Mean': ... + def clear(self) -> None: + """ + Clears the internal state of the Statistic + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic.clear` in + interface :class:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic` + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic.clear` in + class :class:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic` + + + """ + ... + def copy(self) -> 'Mean': + """ + Returns a copy of the statistic with the same internal state. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic.copy` in + interface :class:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic` + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.UnivariateStatistic.copy` in + interface :class:`~org.hipparchus.stat.descriptive.UnivariateStatistic` + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic.copy` in + class :class:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic` + + Returns: + a copy of the statistic + + + """ + ... @typing.overload def evaluate(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> float: ... @typing.overload @@ -78,13 +398,108 @@ class Mean(org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic, def evaluate(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray], int: int, int2: int) -> float: ... @typing.overload def evaluate(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, int2: int) -> float: ... - def getN(self) -> int: ... - def getResult(self) -> float: ... - def increment(self, double: float) -> None: ... + def getN(self) -> int: + """ + Returns the number of values that have been added. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic.getN` in + interface :class:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic` + + Returns: + the number of values. + + + """ + ... + def getResult(self) -> float: + """ + Returns the current value of the Statistic. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic.getResult` in + interface :class:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic` + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic.getResult` in + class :class:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic` + + Returns: + value of the statistic, :code:`Double.NaN` if it has been cleared or just instantiated. + + + """ + ... + def increment(self, double: float) -> None: + """ + Updates the internal state of the statistic to reflect the addition of the new value. + + Note that when :meth:`~org.hipparchus.stat.descriptive.moment.Mean.%3Cinit%3E` is used to create a Mean, this method + does nothing. In that case, the FirstMoment should be incremented directly. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic.increment` in + interface :class:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic` + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic.increment` in + class :class:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic` + + Parameters: + d (double): the new value. + + + """ + ... class SemiVariance(org.hipparchus.stat.descriptive.AbstractUnivariateStatistic, java.io.Serializable): + """ + public classSemiVariance extends :class:`~org.hipparchus.stat.descriptive.AbstractUnivariateStatistic` + implements :class:`~org.hipparchus.stat.descriptive.moment.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + Computes the semivariance of a set of values with respect to a given cutoff value. + + We define the *downside semivariance* of a set of values :code:`x` against the *cutoff value* :code:`cutoff` to be + + + :code:`Σ (x[i] - target) :sup:`2` / df` + + + where the sum is taken over all :code:`i` such that :code:`x[i] < cutoff` and :code:`df` is the length of :code:`x` + (non-bias-corrected) or one less than this number (bias corrected). The *upside semivariance* is defined similarly, with + the sum taken over values of :code:`x` that exceed the cutoff value. + + The cutoff value defaults to the mean, bias correction defaults to :code:`true` and the "variance direction" (upside or + downside) defaults to downside. The variance direction and bias correction may be set using property setters or their + values can provided as parameters to :meth:`~org.hipparchus.stat.descriptive.moment.SemiVariance.evaluate`. + + If the input array is null, :code:`evaluate` methods throw :code:`IllegalArgumentException.` If the array has length 1, + :code:`0` is returned, regardless of the value of the :code:`cutoff.` + + **Note that this class is not intended to be threadsafe.** If multiple threads access an instance of this class + concurrently, and one or more of these threads invoke property setters, external synchronization must be provided to + ensure correct results. + + Also see: + + - :meth:`~serialized` + """ UPSIDE_VARIANCE: typing.ClassVar['SemiVariance.Direction'] = ... + """ + public static final :class:`~org.hipparchus.stat.descriptive.moment.SemiVariance.Direction` UPSIDE_VARIANCE + + The UPSIDE Direction is used to specify that the observations above the cutoff point will be used to calculate + SemiVariance. + + """ DOWNSIDE_VARIANCE: typing.ClassVar['SemiVariance.Direction'] = ... + """ + public static final :class:`~org.hipparchus.stat.descriptive.moment.SemiVariance.Direction` DOWNSIDE_VARIANCE + + The DOWNSIDE Direction is used to specify that the observations below the cutoff point will be used to calculate + SemiVariance + + """ @typing.overload def __init__(self): ... @typing.overload @@ -95,7 +510,24 @@ class SemiVariance(org.hipparchus.stat.descriptive.AbstractUnivariateStatistic, def __init__(self, direction: 'SemiVariance.Direction'): ... @typing.overload def __init__(self, semiVariance: 'SemiVariance'): ... - def copy(self) -> 'SemiVariance': ... + def copy(self) -> 'SemiVariance': + """ + Returns a copy of the statistic with the same internal state. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.UnivariateStatistic.copy` in + interface :class:`~org.hipparchus.stat.descriptive.UnivariateStatistic` + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.AbstractUnivariateStatistic.copy` in + class :class:`~org.hipparchus.stat.descriptive.AbstractUnivariateStatistic` + + Returns: + a copy of the statistic + + + """ + ... @typing.overload def evaluate(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> float: ... @typing.overload @@ -110,10 +542,52 @@ class SemiVariance(org.hipparchus.stat.descriptive.AbstractUnivariateStatistic, def evaluate(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, int2: int) -> float: ... @typing.overload def evaluate(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], direction: 'SemiVariance.Direction') -> float: ... - def getVarianceDirection(self) -> 'SemiVariance.Direction': ... - def isBiasCorrected(self) -> bool: ... - def withBiasCorrected(self, boolean: bool) -> 'SemiVariance': ... - def withVarianceDirection(self, direction: 'SemiVariance.Direction') -> 'SemiVariance': ... + def getVarianceDirection(self) -> 'SemiVariance.Direction': + """ + Returns the varianceDirection property. + + Returns: + the varianceDirection + + + """ + ... + def isBiasCorrected(self) -> bool: + """ + Returns true iff biasCorrected property is set to true. + + Returns: + the value of biasCorrected. + + + """ + ... + def withBiasCorrected(self, boolean: bool) -> 'SemiVariance': + """ + Returns a copy of this instance with the given biasCorrected setting. + + Parameters: + isBiasCorrected (boolean): new biasCorrected property value + + Returns: + a copy of this instance with the given bias correction setting + + + """ + ... + def withVarianceDirection(self, direction: 'SemiVariance.Direction') -> 'SemiVariance': + """ + Returns a copy of this instance with the given direction setting. + + Parameters: + direction (:class:`~org.hipparchus.stat.descriptive.moment.SemiVariance.Direction`): the direction of the semivariance + + Returns: + a copy of this instance with the given direction setting + + + """ + ... class Direction(java.lang.Enum['SemiVariance.Direction']): UPSIDE: typing.ClassVar['SemiVariance.Direction'] = ... DOWNSIDE: typing.ClassVar['SemiVariance.Direction'] = ... @@ -128,23 +602,156 @@ class SemiVariance(org.hipparchus.stat.descriptive.AbstractUnivariateStatistic, def values() -> typing.MutableSequence['SemiVariance.Direction']: ... class Skewness(org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic, java.io.Serializable): + """ + public classSkewness extends :class:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic` + implements :class:`~org.hipparchus.stat.descriptive.moment.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + Computes the skewness of the available values. + + We use the following (unbiased) formula to define skewness: + + skewness = [n / (n -1) (n - 2)] sum[(x_i - mean)^3] / std^3 + + where n is the number of values, mean is the :class:`~org.hipparchus.stat.descriptive.moment.Mean` and std is the + :class:`~org.hipparchus.stat.descriptive.moment.StandardDeviation`. + + Note that this statistic is undefined for n < 3. :code:`Double.Nan` is returned when there is not sufficient data to + compute the statistic. Double.NaN may also be returned if the input includes NaN and / or infinite values. + + **Note that this implementation is not synchronized.** If multiple threads access an instance of this class + concurrently, and at least one of the threads invokes the :code:`increment()` or :code:`clear()` method, it must be + synchronized externally. + + Also see: + + - :meth:`~serialized` + """ @typing.overload def __init__(self): ... @typing.overload def __init__(self, skewness: 'Skewness'): ... @typing.overload def __init__(self, thirdMoment: 'ThirdMoment'): ... - def clear(self) -> None: ... - def copy(self) -> 'Skewness': ... + def clear(self) -> None: + """ + Clears the internal state of the Statistic + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic.clear` in + interface :class:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic` + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic.clear` in + class :class:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic` + + + """ + ... + def copy(self) -> 'Skewness': + """ + Returns a copy of the statistic with the same internal state. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic.copy` in + interface :class:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic` + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.UnivariateStatistic.copy` in + interface :class:`~org.hipparchus.stat.descriptive.UnivariateStatistic` + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic.copy` in + class :class:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic` + + Returns: + a copy of the statistic + + + """ + ... @typing.overload def evaluate(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> float: ... @typing.overload def evaluate(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, int2: int) -> float: ... - def getN(self) -> int: ... - def getResult(self) -> float: ... - def increment(self, double: float) -> None: ... + def getN(self) -> int: + """ + Returns the number of values that have been added. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic.getN` in + interface :class:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic` + + Returns: + the number of values. + + + """ + ... + def getResult(self) -> float: + """ + Returns the value of the statistic based on the values that have been added. + + See :class:`~org.hipparchus.stat.descriptive.moment.Skewness` for the definition used in the computation. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic.getResult` in + interface :class:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic` + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic.getResult` in + class :class:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic` + + Returns: + the skewness of the available values. + + + """ + ... + def increment(self, double: float) -> None: + """ + Updates the internal state of the statistic to reflect the addition of the new value. + + Note that when :meth:`~org.hipparchus.stat.descriptive.moment.Skewness.%3Cinit%3E` is used to create a Skewness, this + method does nothing. In that case, the ThirdMoment should be incremented directly. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic.increment` in + interface :class:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic` + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic.increment` in + class :class:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic` + + Parameters: + d (double): the new value. + + + """ + ... class StandardDeviation(org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic, java.io.Serializable): + """ + public classStandardDeviation extends :class:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic` + implements :class:`~org.hipparchus.stat.descriptive.moment.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + Computes the sample standard deviation. + + The standard deviation is the positive square root of the variance. This implementation wraps a + :class:`~org.hipparchus.stat.descriptive.moment.Variance` instance. + + The :code:`isBiasCorrected` property of the wrapped Variance instance is exposed, so that this class can be used to + compute both the "sample standard deviation" (the square root of the bias-corrected "sample variance") or the + "population standard deviation" (the square root of the non-bias-corrected "population variance"). See + :class:`~org.hipparchus.stat.descriptive.moment.Variance` for more information. + + **Note that this implementation is not synchronized.** If multiple threads access an instance of this class + concurrently, and at least one of the threads invokes the :code:`increment()` or :code:`clear()` method, it must be + synchronized externally. + + Also see: + + - :meth:`~serialized` + """ @typing.overload def __init__(self): ... @typing.overload @@ -155,8 +762,43 @@ class StandardDeviation(org.hipparchus.stat.descriptive.AbstractStorelessUnivari def __init__(self, secondMoment: 'SecondMoment'): ... @typing.overload def __init__(self, standardDeviation: 'StandardDeviation'): ... - def clear(self) -> None: ... - def copy(self) -> 'StandardDeviation': ... + def clear(self) -> None: + """ + Clears the internal state of the Statistic + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic.clear` in + interface :class:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic` + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic.clear` in + class :class:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic` + + + """ + ... + def copy(self) -> 'StandardDeviation': + """ + Returns a copy of the statistic with the same internal state. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic.copy` in + interface :class:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic` + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.UnivariateStatistic.copy` in + interface :class:`~org.hipparchus.stat.descriptive.UnivariateStatistic` + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic.copy` in + class :class:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic` + + Returns: + a copy of the statistic + + + """ + ... @typing.overload def evaluate(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> float: ... @typing.overload @@ -165,13 +807,119 @@ class StandardDeviation(org.hipparchus.stat.descriptive.AbstractStorelessUnivari def evaluate(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], double2: float, int: int, int2: int) -> float: ... @typing.overload def evaluate(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, int2: int) -> float: ... - def getN(self) -> int: ... - def getResult(self) -> float: ... - def increment(self, double: float) -> None: ... - def isBiasCorrected(self) -> bool: ... - def withBiasCorrection(self, boolean: bool) -> 'StandardDeviation': ... + def getN(self) -> int: + """ + Returns the number of values that have been added. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic.getN` in + interface :class:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic` + + Returns: + the number of values. + + + """ + ... + def getResult(self) -> float: + """ + Returns the current value of the Statistic. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic.getResult` in + interface :class:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic` + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic.getResult` in + class :class:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic` + + Returns: + value of the statistic, :code:`Double.NaN` if it has been cleared or just instantiated. + + + """ + ... + def increment(self, double: float) -> None: + """ + Updates the internal state of the statistic to reflect the addition of the new value. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic.increment` in + interface :class:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic` + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic.increment` in + class :class:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic` + + Parameters: + d (double): the new value. + + + """ + ... + def isBiasCorrected(self) -> bool: + """ + Check if bias is corrected. + + Returns: + Returns the isBiasCorrected. + + + """ + ... + def withBiasCorrection(self, boolean: bool) -> 'StandardDeviation': + """ + Returns a new copy of this standard deviation with the given bias correction setting. + + Parameters: + biasCorrection (boolean): The bias correction flag to set. + + Returns: + a copy of this instance with the given bias correction setting + + + """ + ... class Variance(org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic, org.hipparchus.stat.descriptive.AggregatableStatistic['Variance'], org.hipparchus.stat.descriptive.WeightedEvaluation, java.io.Serializable): + """ + public classVariance extends :class:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic` + implements :class:`~org.hipparchus.stat.descriptive.AggregatableStatistic`<:class:`~org.hipparchus.stat.descriptive.moment.Variance`>, :class:`~org.hipparchus.stat.descriptive.WeightedEvaluation`, :class:`~org.hipparchus.stat.descriptive.moment.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + Computes the variance of the available values. By default, the unbiased "sample variance" definitional formula is used: + + variance = sum((x_i - mean)^2) / (n - 1) + + where mean is the :class:`~org.hipparchus.stat.descriptive.moment.Mean` and :code:`n` is the number of sample + observations. + + The definitional formula does not have good numerical properties, so this implementation does not compute the statistic + using the definitional formula. + + - The :code:`getResult` method computes the variance using updating formulas based on West's algorithm, as described in ` + Chan, T. F. and J. G. Lewis 1979, *Communications of the ACM*, vol. 22 no. 9, pp. 526-531. + <http://doi.acm.org/10.1145/359146.359152>` + - The :code:`evaluate` methods leverage the fact that they have the full array of values in memory to execute a two-pass + algorithm. Specifically, these methods use the "corrected two-pass algorithm" from Chan, Golub, Levesque, *Algorithms + for Computing the Sample Variance*, American Statistician, vol. 37, no. 3 (1983) pp. 242-247. + + + Note that adding values using :code:`increment` or :code:`incrementAll` and then executing :code:`getResult` will + sometimes give a different, less accurate, result than executing :code:`evaluate` with the full array of values. The + former approach should only be used when the full array of values is not available. + + The "population variance" ( sum((x_i - mean)^2) / n ) can also be computed using this statistic. The + :code:`isBiasCorrected` property determines whether the "population" or "sample" value is returned by the + :code:`evaluate` and :code:`getResult` methods. To compute population variances, set this property to :code:`false.` + + **Note that this implementation is not synchronized.** If multiple threads access an instance of this class + concurrently, and at least one of the threads invokes the :code:`increment()` or :code:`clear()` method, it must be + synchronized externally. + + Also see: + + - :meth:`~serialized` + """ @typing.overload def __init__(self): ... @typing.overload @@ -183,13 +931,64 @@ class Variance(org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatis @typing.overload def __init__(self, variance: 'Variance'): ... @typing.overload - def aggregate(self, iterable: typing.Union[java.lang.Iterable[typing.Any], typing.Sequence[typing.Any], typing.Set[typing.Any], typing.Callable[[], java.util.Iterator[typing.Any]]]) -> None: ... + def aggregate(self, iterable: typing.Union[java.lang.Iterable[typing.Any], typing.Sequence[typing.Any], typing.Set[typing.Any], typing.Callable[[], java.util.Iterator[typing.Any]]]) -> None: + """ + Aggregates the provided instance into this instance. + + This method can be used to combine statistics computed over partitions or subsamples - i.e., the value of this instance + after this operation should be the same as if a single statistic would have been applied over the combined dataset. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.AggregatableStatistic.aggregate` in + interface :class:`~org.hipparchus.stat.descriptive.AggregatableStatistic` + + Parameters: + other (:class:`~org.hipparchus.stat.descriptive.moment.Variance`): the instance to aggregate into this instance + + + """ + ... @typing.overload def aggregate(self, *t: typing.Any) -> None: ... @typing.overload def aggregate(self, variance: 'Variance') -> None: ... - def clear(self) -> None: ... - def copy(self) -> 'Variance': ... + def clear(self) -> None: + """ + Clears the internal state of the Statistic + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic.clear` in + interface :class:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic` + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic.clear` in + class :class:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic` + + + """ + ... + def copy(self) -> 'Variance': + """ + Returns a copy of the statistic with the same internal state. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic.copy` in + interface :class:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic` + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.UnivariateStatistic.copy` in + interface :class:`~org.hipparchus.stat.descriptive.UnivariateStatistic` + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic.copy` in + class :class:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic` + + Returns: + a copy of the statistic + + + """ + ... @typing.overload def evaluate(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> float: ... @typing.overload @@ -206,11 +1005,88 @@ class Variance(org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatis def evaluate(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray], int: int, int2: int) -> float: ... @typing.overload def evaluate(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, int2: int) -> float: ... - def getN(self) -> int: ... - def getResult(self) -> float: ... - def increment(self, double: float) -> None: ... - def isBiasCorrected(self) -> bool: ... - def withBiasCorrection(self, boolean: bool) -> 'Variance': ... + def getN(self) -> int: + """ + Returns the number of values that have been added. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic.getN` in + interface :class:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic` + + Returns: + the number of values. + + + """ + ... + def getResult(self) -> float: + """ + Returns the current value of the Statistic. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic.getResult` in + interface :class:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic` + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic.getResult` in + class :class:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic` + + Returns: + value of the statistic, :code:`Double.NaN` if it has been cleared or just instantiated. + + + """ + ... + def increment(self, double: float) -> None: + """ + Updates the internal state of the statistic to reflect the addition of the new value. + + If all values are available, it is more accurate to use + :meth:`~org.hipparchus.stat.descriptive.UnivariateStatistic.evaluate` rather than adding values one at a time using this + method and then executing :meth:`~org.hipparchus.stat.descriptive.moment.Variance.getResult`, since :code:`evaluate` + leverages the fact that is has the full list of values together to execute a two-pass algorithm. See + :class:`~org.hipparchus.stat.descriptive.moment.Variance`. + + Note also that when :meth:`~org.hipparchus.stat.descriptive.moment.Variance.%3Cinit%3E` is used to create a Variance, + this method does nothing. In that case, the SecondMoment should be incremented directly. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic.increment` in + interface :class:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic` + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic.increment` in + class :class:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic` + + Parameters: + d (double): the new value. + + + """ + ... + def isBiasCorrected(self) -> bool: + """ + Check if bias is corrected. + + Returns: + Returns the isBiasCorrected. + + + """ + ... + def withBiasCorrection(self, boolean: bool) -> 'Variance': + """ + Returns a new copy of this variance with the given bias correction setting. + + Parameters: + biasCorrection (boolean): The bias correction flag to set. + + Returns: + a copy of this instance with the given bias correction setting + + + """ + ... class FirstMoment: ... @@ -219,20 +1095,123 @@ class FourthMoment: ... class ThirdMoment: ... class SecondMoment(FirstMoment, org.hipparchus.stat.descriptive.AggregatableStatistic['SecondMoment'], java.io.Serializable): + """ + public classSecondMoment extends :class:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic` + implements :class:`~org.hipparchus.stat.descriptive.AggregatableStatistic`<:class:`~org.hipparchus.stat.descriptive.moment.SecondMoment`>, :class:`~org.hipparchus.stat.descriptive.moment.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + Computes a statistic related to the Second Central Moment. Specifically, what is computed is the sum of squared + deviations from the sample mean. + + The following recursive updating formula is used: + + Let + + - dev = (current obs - previous mean) + - n = number of observations (including current obs) + + Then + + new value = old value + dev^2 * (n - 1) / n. + + Returns :code:`Double.NaN` if no data values have been added and returns :code:`0` if there is just one value in the + data set. Note that Double.NaN may also be returned if the input includes NaN and / or infinite values. + + **Note that this implementation is not synchronized.** If multiple threads access an instance of this class + concurrently, and at least one of the threads invokes the :code:`increment()` or :code:`clear()` method, it must be + synchronized externally. + + Also see: + + - :meth:`~serialized` + """ @typing.overload def __init__(self): ... @typing.overload def __init__(self, secondMoment: 'SecondMoment'): ... @typing.overload - def aggregate(self, iterable: typing.Union[java.lang.Iterable[typing.Any], typing.Sequence[typing.Any], typing.Set[typing.Any], typing.Callable[[], java.util.Iterator[typing.Any]]]) -> None: ... + def aggregate(self, iterable: typing.Union[java.lang.Iterable[typing.Any], typing.Sequence[typing.Any], typing.Set[typing.Any], typing.Callable[[], java.util.Iterator[typing.Any]]]) -> None: + """ + Aggregates the provided instance into this instance. + + This method can be used to combine statistics computed over partitions or subsamples - i.e., the value of this instance + after this operation should be the same as if a single statistic would have been applied over the combined dataset. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.AggregatableStatistic.aggregate` in + interface :class:`~org.hipparchus.stat.descriptive.AggregatableStatistic` + + Parameters: + other (:class:`~org.hipparchus.stat.descriptive.moment.SecondMoment`): the instance to aggregate into this instance + + Aggregates the results of the provided instance into this instance. + + Parameters: + other (org.hipparchus.stat.descriptive.moment.FirstMoment): the instance to aggregate from + + + """ + ... @typing.overload def aggregate(self, *t: typing.Any) -> None: ... @typing.overload def aggregate(self, secondMoment: 'SecondMoment') -> None: ... - def clear(self) -> None: ... - def copy(self) -> 'SecondMoment': ... - def getResult(self) -> float: ... - def increment(self, double: float) -> None: ... + def clear(self) -> None: + """ + Clears the internal state of the Statistic + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic.clear` in + interface :class:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic` + + + """ + ... + def copy(self) -> 'SecondMoment': + """ + Returns a copy of the statistic with the same internal state. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic.copy` in + interface :class:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic` + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.UnivariateStatistic.copy` in + interface :class:`~org.hipparchus.stat.descriptive.UnivariateStatistic` + + Returns: + a copy of the statistic + + + """ + ... + def getResult(self) -> float: + """ + Returns the current value of the Statistic. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic.getResult` in + interface :class:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic` + + Returns: + value of the statistic, :code:`Double.NaN` if it has been cleared or just instantiated. + + + """ + ... + def increment(self, double: float) -> None: + """ + Updates the internal state of the statistic to reflect the addition of the new value. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic.increment` in + interface :class:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic` + + Parameters: + d (double): the new value. + + + """ + ... class __module_protocol__(Protocol): diff --git a/org-stubs/hipparchus/stat/descriptive/rank/__init__.pyi b/org-stubs/hipparchus/stat/descriptive/rank/__init__.pyi index f96cd10..cc65c90 100644 --- a/org-stubs/hipparchus/stat/descriptive/rank/__init__.pyi +++ b/org-stubs/hipparchus/stat/descriptive/rank/__init__.pyi @@ -18,62 +18,403 @@ import typing class Max(org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic, org.hipparchus.stat.descriptive.AggregatableStatistic['Max'], java.io.Serializable): + """ + public classMax extends :class:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic` + implements :class:`~org.hipparchus.stat.descriptive.AggregatableStatistic`<:class:`~org.hipparchus.stat.descriptive.rank.Max`>, :class:`~org.hipparchus.stat.descriptive.rank.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + Returns the maximum of the available values. + + - The result is :code:`NaN` iff all values are :code:`NaN` (i.e. :code:`NaN` values have no impact on the value of the + statistic). + - If any of the values equals :code:`Double.POSITIVE_INFINITY`, the result is :code:`Double.POSITIVE_INFINITY.` + + + **Note that this implementation is not synchronized.** If multiple threads access an instance of this class + concurrently, and at least one of the threads invokes the :code:`increment()` or :code:`clear()` method, it must be + synchronized externally. + + Also see: + + - :meth:`~serialized` + """ @typing.overload def __init__(self): ... @typing.overload def __init__(self, max: 'Max'): ... @typing.overload - def aggregate(self, iterable: typing.Union[java.lang.Iterable[typing.Any], typing.Sequence[typing.Any], typing.Set[typing.Any], typing.Callable[[], java.util.Iterator[typing.Any]]]) -> None: ... + def aggregate(self, iterable: typing.Union[java.lang.Iterable[typing.Any], typing.Sequence[typing.Any], typing.Set[typing.Any], typing.Callable[[], java.util.Iterator[typing.Any]]]) -> None: + """ + Aggregates the provided instance into this instance. + + This method can be used to combine statistics computed over partitions or subsamples - i.e., the value of this instance + after this operation should be the same as if a single statistic would have been applied over the combined dataset. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.AggregatableStatistic.aggregate` in + interface :class:`~org.hipparchus.stat.descriptive.AggregatableStatistic` + + Parameters: + other (:class:`~org.hipparchus.stat.descriptive.rank.Max`): the instance to aggregate into this instance + + + """ + ... @typing.overload def aggregate(self, *t: typing.Any) -> None: ... @typing.overload def aggregate(self, max: 'Max') -> None: ... - def clear(self) -> None: ... - def copy(self) -> 'Max': ... + def clear(self) -> None: + """ + Clears the internal state of the Statistic + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic.clear` in + interface :class:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic` + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic.clear` in + class :class:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic` + + + """ + ... + def copy(self) -> 'Max': + """ + Returns a copy of the statistic with the same internal state. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic.copy` in + interface :class:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic` + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.UnivariateStatistic.copy` in + interface :class:`~org.hipparchus.stat.descriptive.UnivariateStatistic` + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic.copy` in + class :class:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic` + + Returns: + a copy of the statistic + + + """ + ... @typing.overload def evaluate(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> float: ... @typing.overload def evaluate(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, int2: int) -> float: ... - def getN(self) -> int: ... - def getResult(self) -> float: ... - def increment(self, double: float) -> None: ... + def getN(self) -> int: + """ + Returns the number of values that have been added. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic.getN` in + interface :class:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic` + + Returns: + the number of values. + + + """ + ... + def getResult(self) -> float: + """ + Returns the current value of the Statistic. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic.getResult` in + interface :class:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic` + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic.getResult` in + class :class:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic` + + Returns: + value of the statistic, :code:`Double.NaN` if it has been cleared or just instantiated. + + + """ + ... + def increment(self, double: float) -> None: + """ + Updates the internal state of the statistic to reflect the addition of the new value. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic.increment` in + interface :class:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic` + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic.increment` in + class :class:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic` + + Parameters: + d (double): the new value. + + + """ + ... class Median(org.hipparchus.stat.descriptive.AbstractUnivariateStatistic, java.io.Serializable): + """ + public classMedian extends :class:`~org.hipparchus.stat.descriptive.AbstractUnivariateStatistic` + implements :class:`~org.hipparchus.stat.descriptive.rank.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + Returns the median of the available values. This is the same as the 50th percentile. See + :class:`~org.hipparchus.stat.descriptive.rank.Percentile` for a description of the algorithm used. + + **Note that this implementation is not synchronized.** If multiple threads access an instance of this class + concurrently, and at least one of the threads invokes the :code:`increment()` or :code:`clear()` method, it must be + synchronized externally. + + Also see: + + - :meth:`~serialized` + """ def __init__(self): ... - def copy(self) -> 'Median': ... + def copy(self) -> 'Median': + """ + Returns a copy of the statistic with the same internal state. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.UnivariateStatistic.copy` in + interface :class:`~org.hipparchus.stat.descriptive.UnivariateStatistic` + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.AbstractUnivariateStatistic.copy` in + class :class:`~org.hipparchus.stat.descriptive.AbstractUnivariateStatistic` + + Returns: + a copy of the statistic + + + """ + ... @typing.overload def evaluate(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> float: ... @typing.overload def evaluate(self) -> float: ... @typing.overload def evaluate(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, int2: int) -> float: ... - def getEstimationType(self) -> 'Percentile.EstimationType': ... - def getKthSelector(self) -> org.hipparchus.util.KthSelector: ... - def getNaNStrategy(self) -> org.hipparchus.stat.ranking.NaNStrategy: ... - def withEstimationType(self, estimationType: 'Percentile.EstimationType') -> 'Median': ... - def withKthSelector(self, kthSelector: org.hipparchus.util.KthSelector) -> 'Median': ... - def withNaNStrategy(self, naNStrategy: org.hipparchus.stat.ranking.NaNStrategy) -> 'Median': ... + def getEstimationType(self) -> 'Percentile.EstimationType': + """ + Get the estimation :class:`~org.hipparchus.stat.descriptive.rank.Percentile.EstimationType` used for computation. + + Returns: + the :code:`estimationType` set + + + """ + ... + def getKthSelector(self) -> org.hipparchus.util.KthSelector: + """ + Get the :class:`~org.hipparchus.stat.descriptive.rank.https:.www.hipparchus.org.hipparchus` used for computation. + + Returns: + the :code:`kthSelector` set + + + """ + ... + def getNaNStrategy(self) -> org.hipparchus.stat.ranking.NaNStrategy: + """ + Get the :class:`~org.hipparchus.stat.ranking.NaNStrategy` strategy used for computation. + + Returns: + :code:`NaN Handling` strategy set during construction + + + """ + ... + def withEstimationType(self, estimationType: 'Percentile.EstimationType') -> 'Median': + """ + Build a new instance similar to the current one except for the + :class:`~org.hipparchus.stat.descriptive.rank.Percentile.EstimationType`. + + Parameters: + newEstimationType (:class:`~org.hipparchus.stat.descriptive.rank.Percentile.EstimationType`): estimation type for the new instance + + Returns: + a new instance, with changed estimation type + + Raises: + :class:`~org.hipparchus.stat.descriptive.rank.https:.www.hipparchus.org.hipparchus`: when newEstimationType is null + + + """ + ... + def withKthSelector(self, kthSelector: org.hipparchus.util.KthSelector) -> 'Median': + """ + Build a new instance similar to the current one except for the + :class:`~org.hipparchus.stat.descriptive.rank.https:.www.hipparchus.org.hipparchus` instance specifically set. + + Parameters: + newKthSelector (:class:`~org.hipparchus.stat.descriptive.rank.https:.www.hipparchus.org.hipparchus`): KthSelector for the new instance + + Returns: + a new instance, with changed KthSelector + + Raises: + :class:`~org.hipparchus.stat.descriptive.rank.https:.www.hipparchus.org.hipparchus`: when newKthSelector is null + + + """ + ... + def withNaNStrategy(self, naNStrategy: org.hipparchus.stat.ranking.NaNStrategy) -> 'Median': + """ + Build a new instance similar to the current one except for the :class:`~org.hipparchus.stat.ranking.NaNStrategy` + strategy. + + Parameters: + newNaNStrategy (:class:`~org.hipparchus.stat.ranking.NaNStrategy`): NaN strategy for the new instance + + Returns: + a new instance, with changed NaN handling strategy + + Raises: + :class:`~org.hipparchus.stat.descriptive.rank.https:.www.hipparchus.org.hipparchus`: when newNaNStrategy is null + + + """ + ... class Min(org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic, org.hipparchus.stat.descriptive.AggregatableStatistic['Min'], java.io.Serializable): + """ + public classMin extends :class:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic` + implements :class:`~org.hipparchus.stat.descriptive.AggregatableStatistic`<:class:`~org.hipparchus.stat.descriptive.rank.Min`>, :class:`~org.hipparchus.stat.descriptive.rank.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + Returns the minimum of the available values. + + - The result is :code:`NaN` iff all values are :code:`NaN` (i.e. :code:`NaN` values have no impact on the value of the + statistic). + - If any of the values equals :code:`Double.NEGATIVE_INFINITY`, the result is :code:`Double.NEGATIVE_INFINITY.` + + + **Note that this implementation is not synchronized.** If multiple threads access an instance of this class + concurrently, and at least one of the threads invokes the :code:`increment()` or :code:`clear()` method, it must be + synchronized externally. + + Also see: + + - :meth:`~serialized` + """ @typing.overload def __init__(self): ... @typing.overload def __init__(self, min: 'Min'): ... @typing.overload - def aggregate(self, iterable: typing.Union[java.lang.Iterable[typing.Any], typing.Sequence[typing.Any], typing.Set[typing.Any], typing.Callable[[], java.util.Iterator[typing.Any]]]) -> None: ... + def aggregate(self, iterable: typing.Union[java.lang.Iterable[typing.Any], typing.Sequence[typing.Any], typing.Set[typing.Any], typing.Callable[[], java.util.Iterator[typing.Any]]]) -> None: + """ + Aggregates the provided instance into this instance. + + This method can be used to combine statistics computed over partitions or subsamples - i.e., the value of this instance + after this operation should be the same as if a single statistic would have been applied over the combined dataset. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.AggregatableStatistic.aggregate` in + interface :class:`~org.hipparchus.stat.descriptive.AggregatableStatistic` + + Parameters: + other (:class:`~org.hipparchus.stat.descriptive.rank.Min`): the instance to aggregate into this instance + + + """ + ... @typing.overload def aggregate(self, *t: typing.Any) -> None: ... @typing.overload def aggregate(self, min: 'Min') -> None: ... - def clear(self) -> None: ... - def copy(self) -> 'Min': ... + def clear(self) -> None: + """ + Clears the internal state of the Statistic + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic.clear` in + interface :class:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic` + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic.clear` in + class :class:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic` + + + """ + ... + def copy(self) -> 'Min': + """ + Returns a copy of the statistic with the same internal state. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic.copy` in + interface :class:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic` + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.UnivariateStatistic.copy` in + interface :class:`~org.hipparchus.stat.descriptive.UnivariateStatistic` + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic.copy` in + class :class:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic` + + Returns: + a copy of the statistic + + + """ + ... @typing.overload def evaluate(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> float: ... @typing.overload def evaluate(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, int2: int) -> float: ... - def getN(self) -> int: ... - def getResult(self) -> float: ... - def increment(self, double: float) -> None: ... + def getN(self) -> int: + """ + Returns the number of values that have been added. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic.getN` in + interface :class:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic` + + Returns: + the number of values. + + + """ + ... + def getResult(self) -> float: + """ + Returns the current value of the Statistic. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic.getResult` in + interface :class:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic` + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic.getResult` in + class :class:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic` + + Returns: + value of the statistic, :code:`Double.NaN` if it has been cleared or just instantiated. + + + """ + ... + def increment(self, double: float) -> None: + """ + Updates the internal state of the statistic to reflect the addition of the new value. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic.increment` in + interface :class:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic` + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic.increment` in + class :class:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic` + + Parameters: + d (double): the new value. + + + """ + ... class PSquarePercentile(org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic, org.hipparchus.stat.descriptive.StorelessUnivariateStatistic, java.io.Serializable): @typing.overload @@ -95,13 +436,78 @@ class PSquarePercentile(org.hipparchus.stat.descriptive.AbstractStorelessUnivari class PSquareMarkers: ... class Percentile(org.hipparchus.stat.descriptive.AbstractUnivariateStatistic, java.io.Serializable): + """ + public classPercentile extends :class:`~org.hipparchus.stat.descriptive.AbstractUnivariateStatistic` + implements :class:`~org.hipparchus.stat.descriptive.rank.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + Provides percentile computation. + + There are several commonly used methods for estimating percentiles (a.k.a. quantiles) based on sample data. For large + samples, the different methods agree closely, but when sample sizes are small, different methods will give significantly + different results. The algorithm implemented here works as follows: + + 1. Let :code:`n` be the length of the (sorted) array and :code:`0 < p <= 100` be the desired percentile. + 2. If :code:`n = 1` return the unique array element (regardless of the value of :code:`p`); otherwise + 3. Compute the estimated percentile position :code:`pos = p * (n + 1) / 100` and the difference, :code:`d` between + :code:`pos` and :code:`floor(pos)` (i.e. the fractional part of :code:`pos`). + 4. If :code:`pos < 1` return the smallest element in the array. + 5. Else if :code:`pos >= n` return the largest element in the array. + 6. Else let :code:`lower` be the element in position :code:`floor(pos)` in the array and let :code:`upper` be the next + element in the array. Return :code:`lower + d * (upper - lower)` + + + To compute percentiles, the data must be at least partially ordered. Input arrays are copied and recursively partitioned + using an ordering definition. The ordering used by :code:`Arrays.sort(double[])` is the one determined by + :meth:`~org.hipparchus.stat.descriptive.rank.https:.docs.oracle.com.javase.8.docs.api.java.lang.Double.compareTo`. This + ordering makes :code:`Double.NaN` larger than any other value (including :code:`Double.POSITIVE_INFINITY`). Therefore, + for example, the median (50th percentile) of :code:`{0, 1, 2, 3, 4, Double.NaN}` evaluates to :code:`2.5.` + + Since percentile estimation usually involves interpolation between array elements, arrays containing :code:`NaN` or + infinite values will often result in :code:`NaN` or infinite values returned. + + Further, to include different estimation types such as R1, R2 as mentioned in `Quantile page(wikipedia) + <http://en.wikipedia.org/wiki/Quantile>`, a type specific NaN handling strategy is used to closely match with the + typically observed results from popular tools like R(R1-R9), Excel(R7). + + Percentile uses only selection instead of complete sorting and caches selection algorithm state between calls to the + various :code:`evaluate` methods. This greatly improves efficiency, both for a single percentile and multiple percentile + computations. To maximize performance when multiple percentiles are computed based on the same data, users should set + the data array once using either one of the :meth:`~org.hipparchus.stat.descriptive.rank.Percentile.evaluate` or + :meth:`~org.hipparchus.stat.descriptive.rank.Percentile.setData` methods and thereafter + :meth:`~org.hipparchus.stat.descriptive.rank.Percentile.evaluate` with just the percentile provided. + + **Note that this implementation is not synchronized.** If multiple threads access an instance of this class + concurrently, and at least one of the threads invokes the :code:`increment()` or :code:`clear()` method, it must be + synchronized externally. + + Also see: + + - :meth:`~serialized` + """ @typing.overload def __init__(self): ... @typing.overload def __init__(self, double: float): ... @typing.overload def __init__(self, percentile: 'Percentile'): ... - def copy(self) -> 'Percentile': ... + def copy(self) -> 'Percentile': + """ + Returns a copy of the statistic with the same internal state. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.UnivariateStatistic.copy` in + interface :class:`~org.hipparchus.stat.descriptive.UnivariateStatistic` + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.AbstractUnivariateStatistic.copy` in + class :class:`~org.hipparchus.stat.descriptive.AbstractUnivariateStatistic` + + Returns: + a copy of the statistic + + + """ + ... @typing.overload def evaluate(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> float: ... @typing.overload @@ -114,19 +520,197 @@ class Percentile(org.hipparchus.stat.descriptive.AbstractUnivariateStatistic, ja def evaluate(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, int2: int) -> float: ... @typing.overload def evaluate(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, int2: int, double2: float) -> float: ... - def getEstimationType(self) -> 'Percentile.EstimationType': ... - def getKthSelector(self) -> org.hipparchus.util.KthSelector: ... - def getNaNStrategy(self) -> org.hipparchus.stat.ranking.NaNStrategy: ... - def getPivotingStrategy(self) -> org.hipparchus.util.PivotingStrategy: ... - def getQuantile(self) -> float: ... + def getEstimationType(self) -> 'Percentile.EstimationType': + """ + Get the estimation :class:`~org.hipparchus.stat.descriptive.rank.Percentile.EstimationType` used for computation. + + Returns: + the :code:`estimationType` set + + + """ + ... + def getKthSelector(self) -> org.hipparchus.util.KthSelector: + """ + Get the :class:`~org.hipparchus.stat.descriptive.rank.https:.www.hipparchus.org.hipparchus` used for computation. + + Returns: + the :code:`kthSelector` set + + + """ + ... + def getNaNStrategy(self) -> org.hipparchus.stat.ranking.NaNStrategy: + """ + Get the :class:`~org.hipparchus.stat.ranking.NaNStrategy` strategy used for computation. + + Returns: + :code:`NaN Handling` strategy set during construction + + + """ + ... + def getPivotingStrategy(self) -> org.hipparchus.util.PivotingStrategy: + """ + Get the :class:`~org.hipparchus.stat.descriptive.rank.https:.www.hipparchus.org.hipparchus` used in KthSelector for + computation. + + Returns: + the pivoting strategy set + + + """ + ... + def getQuantile(self) -> float: + """ + Returns the value of the quantile field (determines what percentile is computed when evaluate() is called with no + quantile argument). + + Returns: + quantile set while construction or :meth:`~org.hipparchus.stat.descriptive.rank.Percentile.setQuantile` + + + """ + ... @typing.overload - def setData(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> None: ... + def setData(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> None: + """ + Set the data array. + + The stored value is a copy of the parameter array, not the array itself. + + Overrides: + :meth:`~org.hipparchus.stat.descriptive.AbstractUnivariateStatistic.setData` in + class :class:`~org.hipparchus.stat.descriptive.AbstractUnivariateStatistic` + + Parameters: + values (double[]): data array to store (may be null to remove stored data) + + Also see: + + - :meth:`~org.hipparchus.stat.descriptive.AbstractUnivariateStatistic.evaluate` + + + public void setData(double[] values, int begin, int length) throws :class:`~org.hipparchus.stat.descriptive.rank.https:.www.hipparchus.org.hipparchus` + + Set the data array. The input array is copied, not referenced. + + Overrides: + :meth:`~org.hipparchus.stat.descriptive.AbstractUnivariateStatistic.setData` in + class :class:`~org.hipparchus.stat.descriptive.AbstractUnivariateStatistic` + + Parameters: + values (double[]): data array to store + begin (int): the index of the first element to include + length (int): the number of elements to include + + Raises: + :class:`~org.hipparchus.stat.descriptive.rank.https:.www.hipparchus.org.hipparchus`: if values is null or the indices are not valid + + Also see: + + - :meth:`~org.hipparchus.stat.descriptive.AbstractUnivariateStatistic.evaluate` + + + + """ + ... @typing.overload def setData(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, int2: int) -> None: ... def setQuantile(self, double: float) -> None: ... - def withEstimationType(self, estimationType: 'Percentile.EstimationType') -> 'Percentile': ... - def withKthSelector(self, kthSelector: org.hipparchus.util.KthSelector) -> 'Percentile': ... - def withNaNStrategy(self, naNStrategy: org.hipparchus.stat.ranking.NaNStrategy) -> 'Percentile': ... + def withEstimationType(self, estimationType: 'Percentile.EstimationType') -> 'Percentile': + """ + Build a new instance similar to the current one except for the + :class:`~org.hipparchus.stat.descriptive.rank.Percentile.EstimationType`. + + This method is intended to be used as part of a fluent-type builder pattern. Building finely tune instances should be + done as follows: + + .. code-block: java + + Percentile customized = new Percentile(quantile). + withEstimationType(estimationType). + withNaNStrategy(nanStrategy). + withKthSelector(kthSelector); + + + If any of the :code:`withXxx` method is omitted, the default value for the corresponding customization parameter will be + used. + + Parameters: + newEstimationType (:class:`~org.hipparchus.stat.descriptive.rank.Percentile.EstimationType`): estimation type for the new instance + + Returns: + a new instance, with changed estimation type + + Raises: + :class:`~org.hipparchus.stat.descriptive.rank.https:.www.hipparchus.org.hipparchus`: when newEstimationType is null + + + """ + ... + def withKthSelector(self, kthSelector: org.hipparchus.util.KthSelector) -> 'Percentile': + """ + Build a new instance similar to the current one except for the + :class:`~org.hipparchus.stat.descriptive.rank.https:.www.hipparchus.org.hipparchus` instance specifically set. + + This method is intended to be used as part of a fluent-type builder pattern. Building finely tune instances should be + done as follows: + + .. code-block: java + + Percentile customized = new Percentile(quantile). + withEstimationType(estimationType). + withNaNStrategy(nanStrategy). + withKthSelector(newKthSelector); + + + If any of the :code:`withXxx` method is omitted, the default value for the corresponding customization parameter will be + used. + + Parameters: + newKthSelector (:class:`~org.hipparchus.stat.descriptive.rank.https:.www.hipparchus.org.hipparchus`): KthSelector for the new instance + + Returns: + a new instance, with changed KthSelector + + Raises: + :class:`~org.hipparchus.stat.descriptive.rank.https:.www.hipparchus.org.hipparchus`: when newKthSelector is null + + + """ + ... + def withNaNStrategy(self, naNStrategy: org.hipparchus.stat.ranking.NaNStrategy) -> 'Percentile': + """ + Build a new instance similar to the current one except for the :class:`~org.hipparchus.stat.ranking.NaNStrategy` + strategy. + + This method is intended to be used as part of a fluent-type builder pattern. Building finely tune instances should be + done as follows: + + .. code-block: java + + Percentile customized = new Percentile(quantile). + withEstimationType(estimationType). + withNaNStrategy(nanStrategy). + withKthSelector(kthSelector); + + + If any of the :code:`withXxx` method is omitted, the default value for the corresponding customization parameter will be + used. + + Parameters: + newNaNStrategy (:class:`~org.hipparchus.stat.ranking.NaNStrategy`): NaN strategy for the new instance + + Returns: + a new instance, with changed NaN handling strategy + + Raises: + :class:`~org.hipparchus.stat.descriptive.rank.https:.www.hipparchus.org.hipparchus`: when newNaNStrategy is null + + + """ + ... class EstimationType(java.lang.Enum['Percentile.EstimationType']): LEGACY: typing.ClassVar['Percentile.EstimationType'] = ... R_1: typing.ClassVar['Percentile.EstimationType'] = ... @@ -150,7 +734,67 @@ class Percentile(org.hipparchus.stat.descriptive.AbstractUnivariateStatistic, ja def values() -> typing.MutableSequence['Percentile.EstimationType']: ... class RandomPercentile(org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic, org.hipparchus.stat.descriptive.StorelessUnivariateStatistic, org.hipparchus.stat.descriptive.AggregatableStatistic['RandomPercentile'], java.io.Serializable): + """ + public classRandomPercentile extends :class:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic` + implements :class:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic`, :class:`~org.hipparchus.stat.descriptive.AggregatableStatistic`<:class:`~org.hipparchus.stat.descriptive.rank.RandomPercentile`>, :class:`~org.hipparchus.stat.descriptive.rank.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + A :class:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic` estimating percentiles using the `RANDOM + <http:/dimacs.rutgers.edu/~graham/pubs/papers/nquantiles.pdf>` Algorithm. + + Storage requirements for the RANDOM algorithm depend on the desired accuracy of quantile estimates. Quantile estimate + accuracy is defined as follows. + + Let \(X\) be the set of all data values consumed from the stream and let \(q\) be a quantile (measured between 0 and 1) + to be estimated. If + + - \(\epsilon\) is the configured accuracy + - \(\hat{q}\) is a RandomPercentile estimate for \(q\) (what is returned by + :meth:`~org.hipparchus.stat.descriptive.rank.RandomPercentile.getResult` or + :meth:`~org.hipparchus.stat.descriptive.rank.RandomPercentile.getResult`) with \(100q\) as actual parameter) + - \(rank(\hat{q}) = |\{x \in X : x < \hat{q}\}|\) is the actual rank of \(\hat{q}\) in the full data stream + - \(n = |X|\) is the number of observations + + then we can expect \((q - \epsilon)n < rank(\hat{q}) < (q + \epsilon)n\). + + The algorithm maintains \(\left\lceil {log_{2}(1/\epsilon)}\right\rceil + 1\) buffers of size \(\left\lceil {1/\epsilon + \sqrt{log_2(1/\epsilon)}}\right\rceil\). When :code:`epsilon` is set to the default value of \(10^{-4}\), this makes 15 + buffers of size 36,453. + + The algorithm uses the buffers to maintain samples of data from the stream. Until all buffers are full, the entire + sample is stored in the buffers. If one of the :code:`getResult` methods is called when all data are available in memory + and there is room to make a copy of the data (meaning the combined set of buffers is less than half full), the + :code:`getResult` method delegates to a :class:`~org.hipparchus.stat.descriptive.rank.Percentile` instance to compute + and return the exact value for the desired quantile. For default :code:`epsilon`, this means exact values will be + returned whenever fewer than \(\left\lceil {15 \times 36453 / 2} \right\rceil = 273,398\) values have been consumed from + the data stream. + + When buffers become full, the algorithm merges buffers so that they effectively represent a larger set of values than + they can hold. Subsequently, data values are sampled from the stream to fill buffers freed by merge operations. Both the + merging and the sampling require random selection, which is done using a :code:`RandomGenerator`. To get repeatable + results for large data streams, users should provide :code:`RandomGenerator` instances with fixed seeds. + :code:`RandomPercentile` itself does not reseed or otherwise initialize the :code:`RandomGenerator` provided to it. By + default, it uses a :class:`~org.hipparchus.stat.descriptive.rank.https:.www.hipparchus.org.hipparchus` generator with + the default seed. + + Note: This implementation is not thread-safe. + + Also see: + + - :meth:`~serialized` + """ DEFAULT_EPSILON: typing.ClassVar[float] = ... + """ + public static final double DEFAULT_EPSILON + + Default quantile estimation error setting + + Also see: + + - :meth:`~constant` + + + + """ @typing.overload def __init__(self): ... @typing.overload @@ -167,12 +811,98 @@ class RandomPercentile(org.hipparchus.stat.descriptive.AbstractStorelessUnivaria def aggregate(self, *t: typing.Any) -> None: ... @typing.overload def aggregate(self, randomPercentile: 'RandomPercentile') -> None: ... - def clear(self) -> None: ... - def copy(self) -> 'RandomPercentile': ... + def clear(self) -> None: + """ + Description copied from class: :meth:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic.clear` + Clears the internal state of the Statistic + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic.clear` in + interface :class:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic` + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic.clear` in + class :class:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic` + + + """ + ... + def copy(self) -> 'RandomPercentile': + """ + Description copied from class: :meth:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic.copy` + Returns a copy of the statistic with the same internal state. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic.copy` in + interface :class:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic` + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.UnivariateStatistic.copy` in + interface :class:`~org.hipparchus.stat.descriptive.UnivariateStatistic` + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic.copy` in + class :class:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic` + + Returns: + a copy of the statistic + + + """ + ... @typing.overload - def evaluate(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> float: ... + def evaluate(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> float: + """ + Returns an estimate of percentile over the given array. + + Parameters: + values (double): source of input data + percentile (double[]): desired percentile (scaled 0 - 100) + + Returns: + estimated percentile + + Raises: + :class:`~org.hipparchus.stat.descriptive.rank.https:.www.hipparchus.org.hipparchus`: if percentile is out of the range [0, 100] + + + """ + ... @typing.overload - def evaluate(self, double: float, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> float: ... + def evaluate(self, double: float, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> float: + """ + Returns an estimate of the median, computed using the designated array segment as input data. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.rank.https:.www.hipparchus.org.hipparchus` in + interface :class:`~org.hipparchus.stat.descriptive.rank.https:.www.hipparchus.org.hipparchus` + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic.evaluate` in + interface :class:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic` + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.UnivariateStatistic.evaluate` in + interface :class:`~org.hipparchus.stat.descriptive.UnivariateStatistic` + + Parameters: + values (double[]): source of input data + begin (int): position of the first element of the values array to include + length (int): number of array elements to include + + Returns: + estimated percentile + + Raises: + :class:`~org.hipparchus.stat.descriptive.rank.https:.www.hipparchus.org.hipparchus`: if percentile is out of the range [0, 100] + + Also see: + + - :meth:`~org.hipparchus.stat.descriptive.UnivariateStatistic.evaluate` + + + """ + ... @typing.overload def evaluate(self, double: float, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, int2: int) -> float: ... @typing.overload @@ -180,16 +910,124 @@ class RandomPercentile(org.hipparchus.stat.descriptive.AbstractStorelessUnivaria def getAggregateN(self, collection: typing.Union[java.util.Collection['RandomPercentile'], typing.Sequence['RandomPercentile'], typing.Set['RandomPercentile']]) -> float: ... def getAggregateQuantileRank(self, double: float, collection: typing.Union[java.util.Collection['RandomPercentile'], typing.Sequence['RandomPercentile'], typing.Set['RandomPercentile']]) -> float: ... def getAggregateRank(self, double: float, collection: typing.Union[java.util.Collection['RandomPercentile'], typing.Sequence['RandomPercentile'], typing.Set['RandomPercentile']]) -> float: ... - def getN(self) -> int: ... - def getQuantileRank(self, double: float) -> float: ... - def getRank(self, double: float) -> float: ... + def getN(self) -> int: + """ + Description copied from interface: :meth:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic.getN` + Returns the number of values that have been added. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic.getN` in + interface :class:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic` + + Returns: + the number of values. + + + """ + ... + def getQuantileRank(self, double: float) -> float: + """ + Returns the estimated quantile position of value in the dataset. Specifically, what is returned is an estimate of \(|\{x + \in X : x < value\}| / |X|\) where \(X\) is the set of values that have been consumed from the stream. + + Parameters: + value (double): value whose quantile rank is sought. + + Returns: + estimated proportion of sample values that are strictly less than :code:`value` + + + """ + ... + def getRank(self, double: float) -> float: + """ + Gets the estimated rank of :code:`value`, i.e. \(|\{x \in X : x < value\}|\) where \(X\) is the set of values that have + been consumed from the stream. + + Parameters: + value (double): value whose overall rank is sought + + Returns: + estimated number of sample values that are strictly less than :code:`value` + + + """ + ... @typing.overload - def getResult(self) -> float: ... + def getResult(self) -> float: + """ + Returns an estimate of the median. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic.getResult` in + interface :class:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic` + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic.getResult` in + class :class:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic` + + Returns: + value of the statistic, :code:`Double.NaN` if it has been cleared or just instantiated. + + """ + ... @typing.overload - def getResult(self, double: float) -> float: ... - def increment(self, double: float) -> None: ... + def getResult(self, double: float) -> float: + """ + Returns an estimate of the given percentile. + + Parameters: + percentile (double): desired percentile (scaled 0 - 100) + + Returns: + estimated percentile + + Raises: + :class:`~org.hipparchus.stat.descriptive.rank.https:.www.hipparchus.org.hipparchus`: if percentile is out of the range [0, 100] + + + """ + ... + def increment(self, double: float) -> None: + """ + Description copied from class: :meth:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic.increment` + Updates the internal state of the statistic to reflect the addition of the new value. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic.increment` in + interface :class:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic` + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic.increment` in + class :class:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic` + + Parameters: + d (double): the new value. + + + """ + ... @staticmethod - def maxValuesRetained(double: float) -> int: ... + def maxValuesRetained(double: float) -> int: + """ + Returns the maximum number of :code:`double` values that a :code:`RandomPercentile` instance created with the given + :code:`epsilon` value will retain in memory. + + If the number of values that have been consumed from the stream is less than 1/2 of this value, reported statistics are + exact. + + Parameters: + epsilon (double): bound on the relative quantile error (see class javadoc) + + Returns: + upper bound on the total number of primitive double values retained in memory + + Raises: + :class:`~org.hipparchus.stat.descriptive.rank.https:.www.hipparchus.org.hipparchus`: if epsilon is not in the interval (0,1) + + + """ + ... def reduce(self, double: float, collection: typing.Union[java.util.Collection['RandomPercentile'], typing.Sequence['RandomPercentile'], typing.Set['RandomPercentile']]) -> float: ... diff --git a/org-stubs/hipparchus/stat/descriptive/summary/__init__.pyi b/org-stubs/hipparchus/stat/descriptive/summary/__init__.pyi index dbeea92..b329fea 100644 --- a/org-stubs/hipparchus/stat/descriptive/summary/__init__.pyi +++ b/org-stubs/hipparchus/stat/descriptive/summary/__init__.pyi @@ -15,18 +15,86 @@ import typing class Product(org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic, org.hipparchus.stat.descriptive.AggregatableStatistic['Product'], org.hipparchus.stat.descriptive.WeightedEvaluation, java.io.Serializable): + """ + public classProduct extends :class:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic` + implements :class:`~org.hipparchus.stat.descriptive.AggregatableStatistic`<:class:`~org.hipparchus.stat.descriptive.summary.Product`>, :class:`~org.hipparchus.stat.descriptive.WeightedEvaluation`, :class:`~org.hipparchus.stat.descriptive.summary.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + Returns the product of the available values. + + If there are no values in the dataset, then 1 is returned. If any of the values are :code:`NaN`, then :code:`NaN` is + returned. + + **Note that this implementation is not synchronized.** If multiple threads access an instance of this class + concurrently, and at least one of the threads invokes the :code:`increment()` or :code:`clear()` method, it must be + synchronized externally. + + Also see: + + - :meth:`~serialized` + """ @typing.overload def __init__(self): ... @typing.overload def __init__(self, product: 'Product'): ... @typing.overload - def aggregate(self, iterable: typing.Union[java.lang.Iterable[typing.Any], typing.Sequence[typing.Any], typing.Set[typing.Any], typing.Callable[[], java.util.Iterator[typing.Any]]]) -> None: ... + def aggregate(self, iterable: typing.Union[java.lang.Iterable[typing.Any], typing.Sequence[typing.Any], typing.Set[typing.Any], typing.Callable[[], java.util.Iterator[typing.Any]]]) -> None: + """ + Aggregates the provided instance into this instance. + + This method can be used to combine statistics computed over partitions or subsamples - i.e., the value of this instance + after this operation should be the same as if a single statistic would have been applied over the combined dataset. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.AggregatableStatistic.aggregate` in + interface :class:`~org.hipparchus.stat.descriptive.AggregatableStatistic` + + Parameters: + other (:class:`~org.hipparchus.stat.descriptive.summary.Product`): the instance to aggregate into this instance + + + """ + ... @typing.overload def aggregate(self, *t: typing.Any) -> None: ... @typing.overload def aggregate(self, product: 'Product') -> None: ... - def clear(self) -> None: ... - def copy(self) -> 'Product': ... + def clear(self) -> None: + """ + Clears the internal state of the Statistic + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic.clear` in + interface :class:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic` + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic.clear` in + class :class:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic` + + + """ + ... + def copy(self) -> 'Product': + """ + Returns a copy of the statistic with the same internal state. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic.copy` in + interface :class:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic` + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.UnivariateStatistic.copy` in + interface :class:`~org.hipparchus.stat.descriptive.UnivariateStatistic` + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic.copy` in + class :class:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic` + + Returns: + a copy of the statistic + + + """ + ... @typing.overload def evaluate(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> float: ... @typing.overload @@ -35,23 +103,138 @@ class Product(org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatist def evaluate(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray], int: int, int2: int) -> float: ... @typing.overload def evaluate(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, int2: int) -> float: ... - def getN(self) -> int: ... - def getResult(self) -> float: ... - def increment(self, double: float) -> None: ... + def getN(self) -> int: + """ + Returns the number of values that have been added. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic.getN` in + interface :class:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic` + + Returns: + the number of values. + + + """ + ... + def getResult(self) -> float: + """ + Returns the current value of the Statistic. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic.getResult` in + interface :class:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic` + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic.getResult` in + class :class:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic` + + Returns: + value of the statistic, :code:`Double.NaN` if it has been cleared or just instantiated. + + + """ + ... + def increment(self, double: float) -> None: + """ + Updates the internal state of the statistic to reflect the addition of the new value. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic.increment` in + interface :class:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic` + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic.increment` in + class :class:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic` + + Parameters: + d (double): the new value. + + + """ + ... class Sum(org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic, org.hipparchus.stat.descriptive.AggregatableStatistic['Sum'], org.hipparchus.stat.descriptive.WeightedEvaluation, java.io.Serializable): + """ + public classSum extends :class:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic` + implements :class:`~org.hipparchus.stat.descriptive.AggregatableStatistic`<:class:`~org.hipparchus.stat.descriptive.summary.Sum`>, :class:`~org.hipparchus.stat.descriptive.WeightedEvaluation`, :class:`~org.hipparchus.stat.descriptive.summary.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + Returns the sum of the available values. + + If there are no values in the dataset, then 0 is returned. If any of the values are :code:`NaN`, then :code:`NaN` is + returned. + + **Note that this implementation is not synchronized.** If multiple threads access an instance of this class + concurrently, and at least one of the threads invokes the :code:`increment()` or :code:`clear()` method, it must be + synchronized externally. + + Also see: + + - :meth:`~serialized` + """ @typing.overload def __init__(self): ... @typing.overload def __init__(self, sum: 'Sum'): ... @typing.overload - def aggregate(self, iterable: typing.Union[java.lang.Iterable[typing.Any], typing.Sequence[typing.Any], typing.Set[typing.Any], typing.Callable[[], java.util.Iterator[typing.Any]]]) -> None: ... + def aggregate(self, iterable: typing.Union[java.lang.Iterable[typing.Any], typing.Sequence[typing.Any], typing.Set[typing.Any], typing.Callable[[], java.util.Iterator[typing.Any]]]) -> None: + """ + Aggregates the provided instance into this instance. + + This method can be used to combine statistics computed over partitions or subsamples - i.e., the value of this instance + after this operation should be the same as if a single statistic would have been applied over the combined dataset. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.AggregatableStatistic.aggregate` in + interface :class:`~org.hipparchus.stat.descriptive.AggregatableStatistic` + + Parameters: + other (:class:`~org.hipparchus.stat.descriptive.summary.Sum`): the instance to aggregate into this instance + + + """ + ... @typing.overload def aggregate(self, *t: typing.Any) -> None: ... @typing.overload def aggregate(self, sum: 'Sum') -> None: ... - def clear(self) -> None: ... - def copy(self) -> 'Sum': ... + def clear(self) -> None: + """ + Clears the internal state of the Statistic + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic.clear` in + interface :class:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic` + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic.clear` in + class :class:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic` + + + """ + ... + def copy(self) -> 'Sum': + """ + Returns a copy of the statistic with the same internal state. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic.copy` in + interface :class:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic` + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.UnivariateStatistic.copy` in + interface :class:`~org.hipparchus.stat.descriptive.UnivariateStatistic` + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic.copy` in + class :class:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic` + + Returns: + a copy of the statistic + + + """ + ... @typing.overload def evaluate(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> float: ... @typing.overload @@ -60,51 +243,335 @@ class Sum(org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic, def evaluate(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray], int: int, int2: int) -> float: ... @typing.overload def evaluate(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, int2: int) -> float: ... - def getN(self) -> int: ... - def getResult(self) -> float: ... - def increment(self, double: float) -> None: ... + def getN(self) -> int: + """ + Returns the number of values that have been added. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic.getN` in + interface :class:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic` + + Returns: + the number of values. + + + """ + ... + def getResult(self) -> float: + """ + Returns the current value of the Statistic. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic.getResult` in + interface :class:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic` + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic.getResult` in + class :class:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic` + + Returns: + value of the statistic, :code:`Double.NaN` if it has been cleared or just instantiated. + + + """ + ... + def increment(self, double: float) -> None: + """ + Updates the internal state of the statistic to reflect the addition of the new value. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic.increment` in + interface :class:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic` + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic.increment` in + class :class:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic` + + Parameters: + d (double): the new value. + + + """ + ... class SumOfLogs(org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic, org.hipparchus.stat.descriptive.AggregatableStatistic['SumOfLogs'], java.io.Serializable): + """ + public classSumOfLogs extends :class:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic` + implements :class:`~org.hipparchus.stat.descriptive.AggregatableStatistic`<:class:`~org.hipparchus.stat.descriptive.summary.SumOfLogs`>, :class:`~org.hipparchus.stat.descriptive.summary.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + Returns the sum of the natural logs for this collection of values. + + Uses :meth:`~org.hipparchus.stat.descriptive.summary.https:.www.hipparchus.org.hipparchus` to compute the logs. + Therefore, + + - If any of values are < 0, the result is :code:`NaN.` + - If all values are non-negative and less than :code:`Double.POSITIVE_INFINITY`, but at least one value is 0, the result + is :code:`Double.NEGATIVE_INFINITY.` + - If both :code:`Double.POSITIVE_INFINITY` and :code:`Double.NEGATIVE_INFINITY` are among the values, the result is + :code:`NaN.` + + + **Note that this implementation is not synchronized.** If multiple threads access an instance of this class + concurrently, and at least one of the threads invokes the :code:`increment()` or :code:`clear()` method, it must be + synchronized externally. + + Also see: + + - :meth:`~serialized` + """ @typing.overload def __init__(self): ... @typing.overload def __init__(self, sumOfLogs: 'SumOfLogs'): ... @typing.overload - def aggregate(self, iterable: typing.Union[java.lang.Iterable[typing.Any], typing.Sequence[typing.Any], typing.Set[typing.Any], typing.Callable[[], java.util.Iterator[typing.Any]]]) -> None: ... + def aggregate(self, iterable: typing.Union[java.lang.Iterable[typing.Any], typing.Sequence[typing.Any], typing.Set[typing.Any], typing.Callable[[], java.util.Iterator[typing.Any]]]) -> None: + """ + Aggregates the provided instance into this instance. + + This method can be used to combine statistics computed over partitions or subsamples - i.e., the value of this instance + after this operation should be the same as if a single statistic would have been applied over the combined dataset. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.AggregatableStatistic.aggregate` in + interface :class:`~org.hipparchus.stat.descriptive.AggregatableStatistic` + + Parameters: + other (:class:`~org.hipparchus.stat.descriptive.summary.SumOfLogs`): the instance to aggregate into this instance + + + """ + ... @typing.overload def aggregate(self, *t: typing.Any) -> None: ... @typing.overload def aggregate(self, sumOfLogs: 'SumOfLogs') -> None: ... - def clear(self) -> None: ... - def copy(self) -> 'SumOfLogs': ... + def clear(self) -> None: + """ + Clears the internal state of the Statistic + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic.clear` in + interface :class:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic` + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic.clear` in + class :class:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic` + + + """ + ... + def copy(self) -> 'SumOfLogs': + """ + Returns a copy of the statistic with the same internal state. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic.copy` in + interface :class:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic` + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.UnivariateStatistic.copy` in + interface :class:`~org.hipparchus.stat.descriptive.UnivariateStatistic` + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic.copy` in + class :class:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic` + + Returns: + a copy of the statistic + + + """ + ... @typing.overload def evaluate(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> float: ... @typing.overload def evaluate(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, int2: int) -> float: ... - def getN(self) -> int: ... - def getResult(self) -> float: ... - def increment(self, double: float) -> None: ... + def getN(self) -> int: + """ + Returns the number of values that have been added. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic.getN` in + interface :class:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic` + + Returns: + the number of values. + + + """ + ... + def getResult(self) -> float: + """ + Returns the current value of the Statistic. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic.getResult` in + interface :class:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic` + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic.getResult` in + class :class:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic` + + Returns: + value of the statistic, :code:`Double.NaN` if it has been cleared or just instantiated. + + + """ + ... + def increment(self, double: float) -> None: + """ + Updates the internal state of the statistic to reflect the addition of the new value. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic.increment` in + interface :class:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic` + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic.increment` in + class :class:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic` + + Parameters: + d (double): the new value. + + + """ + ... class SumOfSquares(org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic, org.hipparchus.stat.descriptive.AggregatableStatistic['SumOfSquares'], java.io.Serializable): + """ + public classSumOfSquares extends :class:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic` + implements :class:`~org.hipparchus.stat.descriptive.AggregatableStatistic`<:class:`~org.hipparchus.stat.descriptive.summary.SumOfSquares`>, :class:`~org.hipparchus.stat.descriptive.summary.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + Returns the sum of the squares of the available values. + + If there are no values in the dataset, then 0 is returned. If any of the values are :code:`NaN`, then :code:`NaN` is + returned. + + **Note that this implementation is not synchronized.** If multiple threads access an instance of this class + concurrently, and at least one of the threads invokes the :code:`increment()` or :code:`clear()` method, it must be + synchronized externally. + + Also see: + + - :meth:`~serialized` + """ @typing.overload def __init__(self): ... @typing.overload def __init__(self, sumOfSquares: 'SumOfSquares'): ... @typing.overload - def aggregate(self, iterable: typing.Union[java.lang.Iterable[typing.Any], typing.Sequence[typing.Any], typing.Set[typing.Any], typing.Callable[[], java.util.Iterator[typing.Any]]]) -> None: ... + def aggregate(self, iterable: typing.Union[java.lang.Iterable[typing.Any], typing.Sequence[typing.Any], typing.Set[typing.Any], typing.Callable[[], java.util.Iterator[typing.Any]]]) -> None: + """ + Aggregates the provided instance into this instance. + + This method can be used to combine statistics computed over partitions or subsamples - i.e., the value of this instance + after this operation should be the same as if a single statistic would have been applied over the combined dataset. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.AggregatableStatistic.aggregate` in + interface :class:`~org.hipparchus.stat.descriptive.AggregatableStatistic` + + Parameters: + other (:class:`~org.hipparchus.stat.descriptive.summary.SumOfSquares`): the instance to aggregate into this instance + + + """ + ... @typing.overload def aggregate(self, *t: typing.Any) -> None: ... @typing.overload def aggregate(self, sumOfSquares: 'SumOfSquares') -> None: ... - def clear(self) -> None: ... - def copy(self) -> 'SumOfSquares': ... + def clear(self) -> None: + """ + Clears the internal state of the Statistic + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic.clear` in + interface :class:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic` + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic.clear` in + class :class:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic` + + + """ + ... + def copy(self) -> 'SumOfSquares': + """ + Returns a copy of the statistic with the same internal state. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic.copy` in + interface :class:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic` + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.UnivariateStatistic.copy` in + interface :class:`~org.hipparchus.stat.descriptive.UnivariateStatistic` + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic.copy` in + class :class:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic` + + Returns: + a copy of the statistic + + + """ + ... @typing.overload def evaluate(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> float: ... @typing.overload def evaluate(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, int2: int) -> float: ... - def getN(self) -> int: ... - def getResult(self) -> float: ... - def increment(self, double: float) -> None: ... + def getN(self) -> int: + """ + Returns the number of values that have been added. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic.getN` in + interface :class:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic` + + Returns: + the number of values. + + + """ + ... + def getResult(self) -> float: + """ + Returns the current value of the Statistic. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic.getResult` in + interface :class:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic` + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic.getResult` in + class :class:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic` + + Returns: + value of the statistic, :code:`Double.NaN` if it has been cleared or just instantiated. + + + """ + ... + def increment(self, double: float) -> None: + """ + Updates the internal state of the statistic to reflect the addition of the new value. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic.increment` in + interface :class:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic` + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic.increment` in + class :class:`~org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic` + + Parameters: + d (double): the new value. + + + """ + ... class __module_protocol__(Protocol): diff --git a/org-stubs/hipparchus/stat/descriptive/vector/__init__.pyi b/org-stubs/hipparchus/stat/descriptive/vector/__init__.pyi index 0b9521b..322e7f7 100644 --- a/org-stubs/hipparchus/stat/descriptive/vector/__init__.pyi +++ b/org-stubs/hipparchus/stat/descriptive/vector/__init__.pyi @@ -14,23 +14,165 @@ import typing class VectorialCovariance(java.io.Serializable): + """ + public classVectorialCovariance extends :class:`~org.hipparchus.stat.descriptive.vector.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.stat.descriptive.vector.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + Returns the covariance matrix of the available vectors. + + Also see: + + - :meth:`~serialized` + """ def __init__(self, int: int, boolean: bool): ... - def clear(self) -> None: ... - def equals(self, object: typing.Any) -> bool: ... - def getN(self) -> int: ... - def getResult(self) -> org.hipparchus.linear.RealMatrix: ... - def hashCode(self) -> int: ... + def clear(self) -> None: + """ + Clears the internal state of the Statistic + + """ + ... + def equals(self, object: typing.Any) -> bool: + """ + + Overrides: + :meth:`~org.hipparchus.stat.descriptive.vector.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.equals` in + class :class:`~org.hipparchus.stat.descriptive.vector.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + + """ + ... + def getN(self) -> int: + """ + Get the number of vectors in the sample. + + Returns: + number of vectors in the sample + + + """ + ... + def getResult(self) -> org.hipparchus.linear.RealMatrix: + """ + Get the covariance matrix. + + Returns: + covariance matrix + + + """ + ... + def hashCode(self) -> int: + """ + + Overrides: + :meth:`~org.hipparchus.stat.descriptive.vector.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.hashCode` in + class :class:`~org.hipparchus.stat.descriptive.vector.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + + """ + ... def increment(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> None: ... class VectorialStorelessStatistic(org.hipparchus.stat.descriptive.StorelessMultivariateStatistic, java.io.Serializable): + """ + public classVectorialStorelessStatistic extends :class:`~org.hipparchus.stat.descriptive.vector.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.stat.descriptive.StorelessMultivariateStatistic`, :class:`~org.hipparchus.stat.descriptive.vector.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + Uses an independent :class:`~org.hipparchus.stat.descriptive.StorelessUnivariateStatistic` instance for each component + of a vector. + + Also see: + + - :meth:`~serialized` + """ def __init__(self, int: int, storelessUnivariateStatistic: org.hipparchus.stat.descriptive.StorelessUnivariateStatistic): ... - def clear(self) -> None: ... - def equals(self, object: typing.Any) -> bool: ... - def getDimension(self) -> int: ... - def getN(self) -> int: ... - def getResult(self) -> typing.MutableSequence[float]: ... - def hashCode(self) -> int: ... - def increment(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> None: ... + def clear(self) -> None: + """ + Clears the internal state of the statistic. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StorelessMultivariateStatistic.clear` in + interface :class:`~org.hipparchus.stat.descriptive.StorelessMultivariateStatistic` + + + """ + ... + def equals(self, object: typing.Any) -> bool: + """ + + Overrides: + :meth:`~org.hipparchus.stat.descriptive.vector.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.equals` in + class :class:`~org.hipparchus.stat.descriptive.vector.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + + """ + ... + def getDimension(self) -> int: + """ + Returns the dimension of the statistic. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StorelessMultivariateStatistic.getDimension` in + interface :class:`~org.hipparchus.stat.descriptive.StorelessMultivariateStatistic` + + Returns: + the dimension of the statistic + + + """ + ... + def getN(self) -> int: + """ + Returns the number of values that have been added. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StorelessMultivariateStatistic.getN` in + interface :class:`~org.hipparchus.stat.descriptive.StorelessMultivariateStatistic` + + Returns: + the number of values. + + + """ + ... + def getResult(self) -> typing.MutableSequence[float]: + """ + Returns the current value of the Statistic. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StorelessMultivariateStatistic.getResult` in + interface :class:`~org.hipparchus.stat.descriptive.StorelessMultivariateStatistic` + + Returns: + value of the statistic, :code:`Double.NaN` if it has been cleared or just instantiated. + + + """ + ... + def hashCode(self) -> int: + """ + + Overrides: + :meth:`~org.hipparchus.stat.descriptive.vector.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.hashCode` in + class :class:`~org.hipparchus.stat.descriptive.vector.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + + """ + ... + def increment(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> None: + """ + Updates the internal state of the statistic to reflect the addition of the new value. + + Specified by: + :meth:`~org.hipparchus.stat.descriptive.StorelessMultivariateStatistic.increment` in + interface :class:`~org.hipparchus.stat.descriptive.StorelessMultivariateStatistic` + + Parameters: + d (double[]): the new value + + + """ + ... class __module_protocol__(Protocol): diff --git a/org-stubs/hipparchus/stat/fitting/__init__.pyi b/org-stubs/hipparchus/stat/fitting/__init__.pyi index 4b69e12..7a75c74 100644 --- a/org-stubs/hipparchus/stat/fitting/__init__.pyi +++ b/org-stubs/hipparchus/stat/fitting/__init__.pyi @@ -19,7 +19,77 @@ import typing class EmpiricalDistribution(org.hipparchus.distribution.continuous.AbstractRealDistribution): + """ + public classEmpiricalDistribution extends :class:`~org.hipparchus.stat.fitting.https:.www.hipparchus.org.hipparchus` + + + Represents an ` empirical probability distribution + <http://http://en.wikipedia.org/wiki/Empirical_distribution_function>` -- a probability distribution derived from + observed data without making any assumptions about the functional form of the population distribution that the data come + from. + + An :code:`EmpiricalDistribution` maintains data structures, called *distribution digests*, that describe empirical + distributions and support the following operations: + + - loading the distribution from a file of observed data values + - dividing the input data into "bin ranges" and reporting bin frequency counts (data for histogram) + - reporting univariate statistics describing the full set of data values as well as the observations within each bin + - generating random values from the distribution + + + Applications can use :code:`EmpiricalDistribution` to build grouped frequency histograms representing the input data or + to generate random values "like" those in the input file -- i.e., the values generated will follow the distribution of + the values in the file. + + The implementation uses what amounts to the ` Variable Kernel Method + <http://nedwww.ipac.caltech.edu/level5/March02/Silverman/Silver2_6.html>` with Gaussian smoothing: + + **Digesting the input file** + + 1. Pass the file once to compute min and max. + 2. Divide the range from min-max into :code:`binCount` "bins." + 3. Pass the data file again, computing bin counts and univariate statistics (mean, std dev.) for each of the bins + 4. Divide the interval (0,1) into subintervals associated with the bins, with the length of a bin's subinterval + proportional to its count. + + **Generating random values from the distribution** + + 1. Generate a uniformly distributed value in (0,1) + 2. Select the subinterval to which the value belongs. + 3. Generate a random Gaussian value with mean = mean of the associated bin and std dev = std dev of associated bin. + + + EmpiricalDistribution implements the :class:`~org.hipparchus.stat.fitting.https:.www.hipparchus.org.hipparchus` + interface as follows. Given x within the range of values in the dataset, let B be the bin containing x and let K be the + within-bin kernel for B. Let P(B-) be the sum of the probabilities of the bins below B and let K(B) be the mass of B + under K (i.e., the integral of the kernel density over B). Then set P(X < x) = P(B-) + P(B) * K(x) / K(B) where K(x) is + the kernel distribution evaluated at x. This results in a cdf that matches the grouped frequency distribution at the bin + endpoints and interpolates within bins using within-bin kernels. + + **USAGE NOTES:** + + - The :code:`binCount` is set by default to 1000. A good rule of thumb is to set the bin count to approximately the length + of the input file divided by 10. + - The input file *must* be a plain text file containing one valid numeric entry per line. + + + Also see: + + - :meth:`~serialized` + """ DEFAULT_BIN_COUNT: typing.ClassVar[int] = ... + """ + public static final int DEFAULT_BIN_COUNT + + Default bin count + + Also see: + + - :meth:`~constant` + + + + """ @typing.overload def __init__(self): ... @typing.overload @@ -28,20 +98,112 @@ class EmpiricalDistribution(org.hipparchus.distribution.continuous.AbstractRealD def __init__(self, int: int, randomGenerator: org.hipparchus.random.RandomGenerator): ... @typing.overload def __init__(self, randomGenerator: org.hipparchus.random.RandomGenerator): ... - def cumulativeProbability(self, double: float) -> float: ... - def density(self, double: float) -> float: ... - def getBinCount(self) -> int: ... + def cumulativeProbability(self, double: float) -> float: + """ + + Algorithm description: + + 1. Find the bin B that x belongs to. + 2. Compute P(B) = the mass of B and P(B-) = the combined mass of the bins below B. + 3. Compute K(B) = the probability mass of B with respect to the within-bin kernel and K(B-) = the kernel distribution + evaluated at the lower endpoint of B + 4. Return P(B-) + P(B) * [K(x) - K(B-)] / K(B) where K(x) is the within-bin kernel distribution function evaluated at x. + + + If K is a constant distribution, we return P(B-) + P(B) (counting the full mass of B). + + """ + ... + def density(self, double: float) -> float: + """ + + Returns the kernel density normalized so that its integral over each bin equals the bin mass. + + Algorithm description: + + 1. Find the bin B that x belongs to. + 2. Compute K(B) = the mass of B with respect to the within-bin kernel (i.e., the integral of the kernel density over B). + 3. Return k(x) * P(B) / K(B), where k is the within-bin kernel density and P(B) is the mass of B. + + + """ + ... + def getBinCount(self) -> int: + """ + Returns the number of bins. + + Returns: + the number of bins. + + + """ + ... def getBinStats(self) -> java.util.List[org.hipparchus.stat.descriptive.StreamingStatistics]: ... - def getGeneratorUpperBounds(self) -> typing.MutableSequence[float]: ... + def getGeneratorUpperBounds(self) -> typing.MutableSequence[float]: + """ + + Returns a fresh copy of the array of upper bounds of the subintervals of [0,1] used in generating data from the + empirical distribution. Subintervals correspond to bins with lengths proportional to bin counts. + **Preconditions:** + + - the distribution must be loaded before invoking this method + + + Returns: + array of upper bounds of subintervals used in data generation + + Raises: + :class:`~org.hipparchus.stat.fitting.https:.docs.oracle.com.javase.8.docs.api.java.lang.NullPointerException`: unless a :code:`load` method has been called beforehand. + + + """ + ... def getNextValue(self) -> float: ... def getNumericalMean(self) -> float: ... def getNumericalVariance(self) -> float: ... - def getSampleStats(self) -> org.hipparchus.stat.descriptive.StatisticalSummary: ... + def getSampleStats(self) -> org.hipparchus.stat.descriptive.StatisticalSummary: + """ + Returns a :class:`~org.hipparchus.stat.descriptive.StatisticalSummary` describing this distribution. **Preconditions:** + + - the distribution must be loaded before invoking this method + + + Returns: + the sample statistics + + Raises: + :class:`~org.hipparchus.stat.fitting.https:.docs.oracle.com.javase.8.docs.api.java.lang.IllegalStateException`: if the distribution has not been loaded + + + """ + ... def getSupportLowerBound(self) -> float: ... def getSupportUpperBound(self) -> float: ... - def getUpperBounds(self) -> typing.MutableSequence[float]: ... + def getUpperBounds(self) -> typing.MutableSequence[float]: + """ + + Returns a fresh copy of the array of upper bounds for the bins. Bins are: + + + [min,upperBounds[0]],(upperBounds[0],upperBounds[1]],..., (upperBounds[binCount-2], upperBounds[binCount-1] = max]. + + Returns: + array of bin upper bounds + + + """ + ... def inverseCumulativeProbability(self, double: float) -> float: ... - def isLoaded(self) -> bool: ... + def isLoaded(self) -> bool: + """ + Property indicating whether or not the distribution has been loaded. + + Returns: + true if the distribution has been loaded + + + """ + ... def isSupportConnected(self) -> bool: ... @typing.overload def load(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> None: ... @@ -49,10 +211,39 @@ class EmpiricalDistribution(org.hipparchus.distribution.continuous.AbstractRealD def load(self, file: typing.Union[java.io.File, jpype.protocol.SupportsPath]) -> None: ... @typing.overload def load(self, uRL: java.net.URL) -> None: ... - def reSeed(self, long: int) -> None: ... - def reseedRandomGenerator(self, long: int) -> None: ... + def reSeed(self, long: int) -> None: + """ + Reseeds the random number generator used by :meth:`~org.hipparchus.stat.fitting.EmpiricalDistribution.getNextValue`. + + Parameters: + seed (long): random generator seed + + + """ + ... + def reseedRandomGenerator(self, long: int) -> None: + """ + Reseed the underlying PRNG. + + Parameters: + seed (long): new seed value + + + """ + ... class MultivariateNormalMixtureExpectationMaximization: + """ + public classMultivariateNormalMixtureExpectationMaximization extends :class:`~org.hipparchus.stat.fitting.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Expectation-Maximization algorithm for fitting the parameters of multivariate normal mixture model distributions. This + implementation is pure original code based on + :class:`~org.hipparchus.stat.fitting.https:.www.ee.washington.edu.techsite.papers.documents.UWEETR` by Yihua Chen and + Maya R. Gupta, Department of Electrical Engineering, University of Washington, Seattle, WA 98195. It was verified using + external tools like `CRAN Mixtools <http://cran.r-project.org/web/packages/mixtools/index.html>` (see the JUnit test + cases) but it is **not** based on Mixtools code at all. The discussion of the origin of this class can be seen in the + comments of the :class:`~org.hipparchus.stat.fitting.https:.issues.apache.org.jira.browse.MATH` JIRA issue. + """ def __init__(self, doubleArray: typing.Union[typing.List[typing.MutableSequence[float]], jpype.JArray]): ... @staticmethod def estimate(doubleArray: typing.Union[typing.List[typing.MutableSequence[float]], jpype.JArray], int: int) -> org.hipparchus.distribution.multivariate.MixtureMultivariateNormalDistribution: ... @@ -60,8 +251,26 @@ class MultivariateNormalMixtureExpectationMaximization: def fit(self, mixtureMultivariateNormalDistribution: org.hipparchus.distribution.multivariate.MixtureMultivariateNormalDistribution) -> None: ... @typing.overload def fit(self, mixtureMultivariateNormalDistribution: org.hipparchus.distribution.multivariate.MixtureMultivariateNormalDistribution, int: int, double: float) -> None: ... - def getFittedModel(self) -> org.hipparchus.distribution.multivariate.MixtureMultivariateNormalDistribution: ... - def getLogLikelihood(self) -> float: ... + def getFittedModel(self) -> org.hipparchus.distribution.multivariate.MixtureMultivariateNormalDistribution: + """ + Gets the fitted model. + + Returns: + fitted model or :code:`null` if no fit has been performed yet. + + + """ + ... + def getLogLikelihood(self) -> float: + """ + Gets the log likelihood of the data under the fitted model. + + Returns: + Log likelihood of data or zero of no data has been fit + + + """ + ... class __module_protocol__(Protocol): diff --git a/org-stubs/hipparchus/stat/inference/__init__.pyi b/org-stubs/hipparchus/stat/inference/__init__.pyi index 7542a91..f59c30c 100644 --- a/org-stubs/hipparchus/stat/inference/__init__.pyi +++ b/org-stubs/hipparchus/stat/inference/__init__.pyi @@ -16,6 +16,11 @@ import typing class AlternativeHypothesis(java.lang.Enum['AlternativeHypothesis']): + """ + public enumAlternativeHypothesis extends :class:`~org.hipparchus.stat.inference.https:.docs.oracle.com.javase.8.docs.api.java.lang.Enum`<:class:`~org.hipparchus.stat.inference.AlternativeHypothesis`> + + Represents an alternative hypothesis for a hypothesis test. + """ TWO_SIDED: typing.ClassVar['AlternativeHypothesis'] = ... GREATER_THAN: typing.ClassVar['AlternativeHypothesis'] = ... LESS_THAN: typing.ClassVar['AlternativeHypothesis'] = ... @@ -25,18 +30,143 @@ class AlternativeHypothesis(java.lang.Enum['AlternativeHypothesis']): def valueOf(class_: typing.Type[_valueOf_0__T], string: str) -> _valueOf_0__T: ... @typing.overload @staticmethod - def valueOf(string: str) -> 'AlternativeHypothesis': ... - @staticmethod - def values() -> typing.MutableSequence['AlternativeHypothesis']: ... + def valueOf(string: str) -> 'AlternativeHypothesis': + """ + Returns the enum constant of this type with the specified name. The string must match *exactly* an identifier used to + declare an enum constant in this type. (Extraneous whitespace characters are not permitted.) + + Parameters: + name (:class:`~org.hipparchus.stat.inference.https:.docs.oracle.com.javase.8.docs.api.java.lang.String`): the name of the enum constant to be returned. + + Returns: + the enum constant with the specified name + + Raises: + :class:`~org.hipparchus.stat.inference.https:.docs.oracle.com.javase.8.docs.api.java.lang.IllegalArgumentException`: if this enum type has no constant with the specified name + :class:`~org.hipparchus.stat.inference.https:.docs.oracle.com.javase.8.docs.api.java.lang.NullPointerException`: if the argument is null + + + """ + ... + @staticmethod + def values() -> typing.MutableSequence['AlternativeHypothesis']: + """ + Returns an array containing the constants of this enum type, in the order they are declared. + + Returns: + an array containing the constants of this enum type, in the order they are declared + + + """ + ... class BinomialTest: + """ + public classBinomialTest extends :class:`~org.hipparchus.stat.inference.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Implements binomial test statistics. + + Exact test for the statistical significance of deviations from a theoretically expected distribution of observations + into two categories. + + Also see: + + - `Binomial test (Wikipedia) <http://en.wikipedia.org/wiki/Binomial_test>` + """ def __init__(self): ... @typing.overload - def binomialTest(self, int: int, int2: int, double: float, alternativeHypothesis: AlternativeHypothesis, double2: float) -> bool: ... - @typing.overload - def binomialTest(self, int: int, int2: int, double: float, alternativeHypothesis: AlternativeHypothesis) -> float: ... + def binomialTest(self, int: int, int2: int, double: float, alternativeHypothesis: AlternativeHypothesis, double2: float) -> bool: + """ + Returns whether the null hypothesis can be rejected with the given confidence level. + + **Preconditions**: + + - Number of trials must be ≥ 0. + - Number of successes must be ≥ 0. + - Number of successes must be ≤ number of trials. + - Probability must be ≥ 0 and ≤ 1. + + + Parameters: + numberOfTrials (int): number of trials performed + numberOfSuccesses (int): number of successes observed + probability (double): assumed probability of a single trial under the null hypothesis + alternativeHypothesis (:class:`~org.hipparchus.stat.inference.AlternativeHypothesis`): type of hypothesis being evaluated (one- or two-sided) + alpha (double): significance level of the test + + Returns: + true if the null hypothesis can be rejected with confidence :code:`1 - alpha` + + Raises: + :class:`~org.hipparchus.stat.inference.https:.www.hipparchus.org.hipparchus`: if :code:`numberOfTrials` or :code:`numberOfSuccesses` is negative + :class:`~org.hipparchus.stat.inference.https:.www.hipparchus.org.hipparchus`: if :code:`probability` is not between 0 and 1 + :class:`~org.hipparchus.stat.inference.https:.www.hipparchus.org.hipparchus`: if :code:`numberOfTrials` < :code:`numberOfSuccesses` or if :code:`alternateHypothesis` is null. + + Also see: + + - :class:`~org.hipparchus.stat.inference.AlternativeHypothesis` + + + """ + ... + @typing.overload + def binomialTest(self, int: int, int2: int, double: float, alternativeHypothesis: AlternativeHypothesis) -> float: + """ + Returns the *observed significance level*, or `p-value <http://www.cas.lancs.ac.uk/glossary_v1.1/hyptest.html#pvalue>`, + associated with a ` Binomial test <http://en.wikipedia.org/wiki/Binomial_test>`. + + The number returned is the smallest significance level at which one can reject the null hypothesis. The form of the + hypothesis depends on :code:`alternativeHypothesis`. + + The p-Value represents the likelihood of getting a result at least as extreme as the sample, given the provided + :code:`probability` of success on a single trial. For single-sided tests, this value can be directly derived from the + Binomial distribution. For the two-sided test, the implementation works as follows: we start by looking at the most + extreme cases (0 success and n success where n is the number of trials from the sample) and determine their likelihood. + The lower value is added to the p-Value (if both values are equal, both are added). Then we continue with the next + extreme value, until we added the value for the actual observed sample. + + * **Preconditions**: + + - Number of trials must be ≥ 0. + - Number of successes must be ≥ 0. + - Number of successes must be ≤ number of trials. + - Probability must be ≥ 0 and ≤ 1. + + + Parameters: + numberOfTrials (int): number of trials performed + numberOfSuccesses (int): number of successes observed + probability (double): assumed probability of a single trial under the null hypothesis + alternativeHypothesis (:class:`~org.hipparchus.stat.inference.AlternativeHypothesis`): type of hypothesis being evaluated (one- or two-sided) + + Returns: + p-value + + Raises: + :class:`~org.hipparchus.stat.inference.https:.www.hipparchus.org.hipparchus`: if :code:`numberOfTrials` or :code:`numberOfSuccesses` is negative + :class:`~org.hipparchus.stat.inference.https:.www.hipparchus.org.hipparchus`: if :code:`probability` is not between 0 and 1 + :class:`~org.hipparchus.stat.inference.https:.www.hipparchus.org.hipparchus`: if :code:`numberOfTrials` < :code:`numberOfSuccesses` or if :code:`alternateHypothesis` is null. + + Also see: + + - :class:`~org.hipparchus.stat.inference.AlternativeHypothesis` + + + + """ + ... class ChiSquareTest: + """ + public classChiSquareTest extends :class:`~org.hipparchus.stat.inference.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Implements Chi-Square test statistics. + + This implementation handles both known and unknown distributions. + + Two samples tests can be used when the distribution is unknown *a priori* but provided by one sample, or when the + hypothesis under test is that the two samples come from the same underlying distribution. + """ def __init__(self): ... @typing.overload def chiSquare(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], longArray: typing.Union[typing.List[int], jpype.JArray]) -> float: ... @@ -57,6 +187,17 @@ class ChiSquareTest: def chiSquareTestDataSetsComparison(self, longArray: typing.Union[typing.List[int], jpype.JArray], longArray2: typing.Union[typing.List[int], jpype.JArray]) -> float: ... class GTest: + """ + public classGTest extends :class:`~org.hipparchus.stat.inference.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Implements `G Test <http://en.wikipedia.org/wiki/G-test>` statistics. + + This is known in statistical genetics as the McDonald-Kreitman test. The implementation handles both known and unknown + distributions. + + Two samples tests can be used when the distribution is unknown *a priori* but provided by one sample, or when the + hypothesis under test is that the two samples come from the same underlying distribution. + """ def __init__(self): ... def g(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], longArray: typing.Union[typing.List[int], jpype.JArray]) -> float: ... def gDataSetsComparison(self, longArray: typing.Union[typing.List[int], jpype.JArray], longArray2: typing.Union[typing.List[int], jpype.JArray]) -> float: ... @@ -69,11 +210,69 @@ class GTest: @typing.overload def gTestDataSetsComparison(self, longArray: typing.Union[typing.List[int], jpype.JArray], longArray2: typing.Union[typing.List[int], jpype.JArray]) -> float: ... def gTestIntrinsic(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], longArray: typing.Union[typing.List[int], jpype.JArray]) -> float: ... - def rootLogLikelihoodRatio(self, long: int, long2: int, long3: int, long4: int) -> float: ... + def rootLogLikelihoodRatio(self, long: int, long2: int, long3: int, long4: int) -> float: + """ + Calculates the root log-likelihood ratio for 2 state Datasets. See + :meth:`~org.hipparchus.stat.inference.GTest.gDataSetsComparison`. + + Given two events A and B, let k11 be the number of times both events occur, k12 the incidence of B without A, k21 the + count of A without B, and k22 the number of times neither A nor B occurs. What is returned by this method is + + :code:`(sgn) sqrt(gValueDataSetsComparison({k11, k12}, {k21, k22})` + + where :code:`sgn` is -1 if :code:`k11 / (k11 + k12) < k21 / (k21 + k22))`; + + + 1 otherwise. + + Signed root LLR has two advantages over the basic LLR: a) it is positive where k11 is bigger than expected, negative + where it is lower b) if there is no difference it is asymptotically normally distributed. This allows one to talk about + "number of standard deviations" which is a more common frame of reference than the chi^2 distribution. + + Parameters: + k11 (long): number of times the two events occurred together (AB) + k12 (long): number of times the second event occurred WITHOUT the first event (notA,B) + k21 (long): number of times the first event occurred WITHOUT the second event (A, notB) + k22 (long): number of times something else occurred (i.e. was neither of these events (notA, notB) + + Returns: + root log-likelihood ratio + + + """ + ... class InferenceTestUtils: - @staticmethod - def approximateP(double: float, int: int, int2: int) -> float: ... + """ + public classInferenceTestUtils extends :class:`~org.hipparchus.stat.inference.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + A collection of static methods to create inference test instances or to perform inference tests. + """ + @staticmethod + def approximateP(double: float, int: int, int2: int) -> float: + """ + Uses the Kolmogorov-Smirnov distribution to approximate \(P(D_{n,m} > d)\) where \(D_{n,m}\) is the 2-sample + Kolmogorov-Smirnov statistic. See + :meth:`~org.hipparchus.stat.inference.KolmogorovSmirnovTest.kolmogorovSmirnovStatistic` for the definition of + \(D_{n,m}\). + + Specifically, what is returned is \(1 - k(d \sqrt{mn / (m + n)})\) where \(k(t) = 1 + 2 \sum_{i=1}^\infty (-1)^i e^{-2 + i^2 t^2}\). See :meth:`~org.hipparchus.stat.inference.KolmogorovSmirnovTest.ksSum` for details on how convergence of the + sum is determined. This implementation passes :code:`ksSum` + :meth:`~org.hipparchus.stat.inference.KolmogorovSmirnovTest.KS_SUM_CAUCHY_CRITERION` as :code:`tolerance` and + :meth:`~org.hipparchus.stat.inference.KolmogorovSmirnovTest.MAXIMUM_PARTIAL_SUM_COUNT` as :code:`maxIterations`. + + Parameters: + d (double): D-statistic value + n (int): first sample size + m (int): second sample size + + Returns: + approximate probability that a randomly selected m-n partition of m + n generates \(D_{n,m}\) greater than :code:`d` + + + """ + ... @typing.overload @staticmethod def chiSquare(doubleArray: typing.Union[typing.List[float], jpype.JArray], longArray: typing.Union[typing.List[int], jpype.JArray]) -> float: ... @@ -101,7 +300,29 @@ class InferenceTestUtils: @staticmethod def chiSquareTestDataSetsComparison(longArray: typing.Union[typing.List[int], jpype.JArray], longArray2: typing.Union[typing.List[int], jpype.JArray]) -> float: ... @staticmethod - def exactP(double: float, int: int, int2: int, boolean: bool) -> float: ... + def exactP(double: float, int: int, int2: int, boolean: bool) -> float: + """ + Computes \(P(D_{n,m} > d)\) if :code:`strict` is :code:`true`; otherwise \(P(D_{n,m} \ge d)\), where \(D_{n,m}\) is the + 2-sample Kolmogorov-Smirnov statistic. See + :meth:`~org.hipparchus.stat.inference.KolmogorovSmirnovTest.kolmogorovSmirnovStatistic` for the definition of + \(D_{n,m}\). + + The returned probability is exact, implemented by unwinding the recursive function definitions presented in [4] from the + class javadoc. + + Parameters: + d (double): D-statistic value + n (int): first sample size + m (int): second sample size + strict (boolean): whether or not the probability to compute is expressed as a strict inequality + + Returns: + probability that a randomly selected m-n partition of m + n generates \(D_{n,m}\) greater than (resp. greater than or + equal to) :code:`d` + + + """ + ... @staticmethod def g(doubleArray: typing.Union[typing.List[float], jpype.JArray], longArray: typing.Union[typing.List[int], jpype.JArray]) -> float: ... @staticmethod @@ -210,13 +431,139 @@ class InferenceTestUtils: def tTest(statisticalSummary: org.hipparchus.stat.descriptive.StatisticalSummary, statisticalSummary2: org.hipparchus.stat.descriptive.StatisticalSummary) -> float: ... class KolmogorovSmirnovTest: + """ + public classKolmogorovSmirnovTest extends :class:`~org.hipparchus.stat.inference.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Implementation of the ` Kolmogorov-Smirnov (K-S) test <http://en.wikipedia.org/wiki/Kolmogorov-Smirnov_test>` for + equality of continuous distributions. + + The K-S test uses a statistic based on the maximum deviation of the empirical distribution of sample data points from + the distribution expected under the null hypothesis. For one-sample tests evaluating the null hypothesis that a set of + sample data points follow a given distribution, the test statistic is \(D_n=\sup_x |F_n(x)-F(x)|\), where \(F\) is the + expected distribution and \(F_n\) is the empirical distribution of the \(n\) sample data points. The distribution of + \(D_n\) is estimated using a method based on [1] with certain quick decisions for extreme values given in [2]. + + Two-sample tests are also supported, evaluating the null hypothesis that the two samples :code:`x` and :code:`y` come + from the same underlying distribution. In this case, the test statistic is \(D_{n,m}=\sup_t | F_n(t)-F_m(t)|\) where + \(n\) is the length of :code:`x`, \(m\) is the length of :code:`y`, \(F_n\) is the empirical distribution that puts mass + \(1/n\) at each of the values in :code:`x` and \(F_m\) is the empirical distribution of the :code:`y` values. The + default 2-sample test method, :meth:`~org.hipparchus.stat.inference.KolmogorovSmirnovTest.kolmogorovSmirnovTest` works + as follows: + + - For small samples (where the product of the sample sizes is less than + :meth:`~org.hipparchus.stat.inference.KolmogorovSmirnovTest.LARGE_SAMPLE_PRODUCT`), the method presented in [4] is used + to compute the exact p-value for the 2-sample test. + - When the product of the sample sizes exceeds + :meth:`~org.hipparchus.stat.inference.KolmogorovSmirnovTest.LARGE_SAMPLE_PRODUCT`, the asymptotic distribution of + \(D_{n,m}\) is used. See :meth:`~org.hipparchus.stat.inference.KolmogorovSmirnovTest.approximateP` for details on the + approximation. + + + If the product of the sample sizes is less than + :meth:`~org.hipparchus.stat.inference.KolmogorovSmirnovTest.LARGE_SAMPLE_PRODUCT` and the sample data contains ties, + random jitter is added to the sample data to break ties before applying the algorithm above. Alternatively, the + :meth:`~org.hipparchus.stat.inference.KolmogorovSmirnovTest.bootstrap` method, modeled after `ks.boot + <http://sekhon.berkeley.edu/matching/ks.boot.html>` in the R Matching package [3], can be used if ties are known to be + present in the data. + + In the two-sample case, \(D_{n,m}\) has a discrete distribution. This makes the p-value associated with the null + hypothesis \(H_0 : D_{n,m} \ge d \) differ from \(H_0 : D_{n,m} > d \) by the mass of the observed value \(d\). To + distinguish these, the two-sample tests use a boolean :code:`strict` parameter. This parameter is ignored for large + samples. + + The methods used by the 2-sample default implementation are also exposed directly: + + - :meth:`~org.hipparchus.stat.inference.KolmogorovSmirnovTest.exactP` computes exact 2-sample p-values + - :meth:`~org.hipparchus.stat.inference.KolmogorovSmirnovTest.approximateP` uses the asymptotic distribution The + :code:`boolean` arguments in the first two methods allow the probability used to estimate the p-value to be expressed + using strict or non-strict inequality. See + :meth:`~org.hipparchus.stat.inference.KolmogorovSmirnovTest.kolmogorovSmirnovTest`. + + + References: + + - [1] ` Evaluating Kolmogorov's Distribution <http://www.jstatsoft.org/v08/i18/>` by George Marsaglia, Wai Wan Tsang, and + Jingbo Wang + - [2] ` Computing the Two-Sided Kolmogorov-Smirnov Distribution <http://www.jstatsoft.org/v39/i11/>` by Richard Simard and + Pierre L'Ecuyer + - [3] Jasjeet S. Sekhon. 2011. ` Multivariate and Propensity Score Matching Software with Automated Balance Optimization: + The Matching package for R <http://www.jstatsoft.org/article/view/v042i07>` Journal of Statistical Software, 42(7): + 1-52. + - [4] Kim, P. J. and Jennrich, R. I. (1970). Tables of the Exact Sampling Distribution of the Two-Sample + Kolmogorov-Smirnov Criterion D_mn ,m≦n in Selected Tables in Mathematical Statistics, Vol. 1, H. L. Harter and D. B. + Owen, editors. + + + Note that [1] contains an error in computing h, refer to + :class:`~org.hipparchus.stat.inference.https:.issues.apache.org.jira.browse.MATH` for details. + """ @typing.overload def __init__(self): ... @typing.overload def __init__(self, long: int): ... - def approximateP(self, double: float, int: int, int2: int) -> float: ... - @typing.overload - def bootstrap(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray], int: int) -> float: ... + def approximateP(self, double: float, int: int, int2: int) -> float: + """ + Uses the Kolmogorov-Smirnov distribution to approximate \(P(D_{n,m} > d)\) where \(D_{n,m}\) is the 2-sample + Kolmogorov-Smirnov statistic. See + :meth:`~org.hipparchus.stat.inference.KolmogorovSmirnovTest.kolmogorovSmirnovStatistic` for the definition of + \(D_{n,m}\). + + Specifically, what is returned is \(1 - k(d \sqrt{mn / (m + n)})\) where \(k(t) = 1 + 2 \sum_{i=1}^\infty (-1)^i e^{-2 + i^2 t^2}\). See :meth:`~org.hipparchus.stat.inference.KolmogorovSmirnovTest.ksSum` for details on how convergence of the + sum is determined. This implementation passes :code:`ksSum` + :meth:`~org.hipparchus.stat.inference.KolmogorovSmirnovTest.KS_SUM_CAUCHY_CRITERION` as :code:`tolerance` and + :meth:`~org.hipparchus.stat.inference.KolmogorovSmirnovTest.MAXIMUM_PARTIAL_SUM_COUNT` as :code:`maxIterations`. + + Parameters: + d (double): D-statistic value + n (int): first sample size + m (int): second sample size + + Returns: + approximate probability that a randomly selected m-n partition of m + n generates \(D_{n,m}\) greater than :code:`d` + + + """ + ... + @typing.overload + def bootstrap(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray], int: int) -> float: + """ + Estimates the *p-value* of a two-sample ` Kolmogorov-Smirnov test + <http://en.wikipedia.org/wiki/Kolmogorov-Smirnov_test>` evaluating the null hypothesis that :code:`x` and :code:`y` are + samples drawn from the same probability distribution. This method estimates the p-value by repeatedly sampling sets of + size :code:`x.length` and :code:`y.length` from the empirical distribution of the combined sample. When :code:`strict` + is true, this is equivalent to the algorithm implemented in the R function :code:`ks.boot`, described in + + .. code-block: java + + Jasjeet S. Sekhon. 2011. 'Multivariate and Propensity Score Matching + Software with Automated Balance Optimization: The Matching package for R.' + Journal of Statistical Software, 42(7): 1-52. + + + Parameters: + x (double[]): first sample + y (double[]): second sample + iterations (int): number of bootstrap resampling iterations + strict (boolean): whether or not the null hypothesis is expressed as a strict inequality + + Returns: + estimated p-value + + Computes :code:`bootstrap(x, y, iterations, true)`. This is equivalent to ks.boot(x,y, nboots=iterations) using the R + Matching package function. See #bootstrap(double[], double[], int, boolean). + + Parameters: + x (double[]): first sample + y (double[]): second sample + iterations (int): number of bootstrap resampling iterations + + Returns: + estimated p-value + + + """ + ... @typing.overload def bootstrap(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray], int: int, boolean: bool) -> float: ... @typing.overload @@ -224,25 +571,242 @@ class KolmogorovSmirnovTest: @typing.overload def cdf(self, double: float, int: int, boolean: bool) -> float: ... def cdfExact(self, double: float, int: int) -> float: ... - def exactP(self, double: float, int: int, int2: int, boolean: bool) -> float: ... - @typing.overload - def kolmogorovSmirnovStatistic(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray]) -> float: ... + def exactP(self, double: float, int: int, int2: int, boolean: bool) -> float: + """ + Computes \(P(D_{n,m} > d)\) if :code:`strict` is :code:`true`; otherwise \(P(D_{n,m} \ge d)\), where \(D_{n,m}\) is the + 2-sample Kolmogorov-Smirnov statistic. See + :meth:`~org.hipparchus.stat.inference.KolmogorovSmirnovTest.kolmogorovSmirnovStatistic` for the definition of + \(D_{n,m}\). + + The returned probability is exact, implemented by unwinding the recursive function definitions presented in [4] from the + class javadoc. + + Parameters: + d (double): D-statistic value + n (int): first sample size + m (int): second sample size + strict (boolean): whether or not the probability to compute is expressed as a strict inequality + + Returns: + probability that a randomly selected m-n partition of m + n generates \(D_{n,m}\) greater than (resp. greater than or + equal to) :code:`d` + + + """ + ... + @typing.overload + def kolmogorovSmirnovStatistic(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray]) -> float: + """ + Computes the one-sample Kolmogorov-Smirnov test statistic, \(D_n=\sup_x |F_n(x)-F(x)|\) where \(F\) is the distribution + (cdf) function associated with :code:`distribution`, \(n\) is the length of :code:`data` and \(F_n\) is the empirical + distribution that puts mass \(1/n\) at each of the values in :code:`data`. + + Parameters: + distribution (:class:`~org.hipparchus.stat.inference.https:.www.hipparchus.org.hipparchus`): reference distribution + data (double[]): sample being evaluated + + Returns: + Kolmogorov-Smirnov statistic \(D_n\) + + Raises: + :class:`~org.hipparchus.stat.inference.https:.www.hipparchus.org.hipparchus`: if :code:`data` does not have length at least 2 + :class:`~org.hipparchus.stat.inference.https:.www.hipparchus.org.hipparchus`: if :code:`data` is null + + Computes the two-sample Kolmogorov-Smirnov test statistic, \(D_{n,m}=\sup_x |F_n(x)-F_m(x)|\) where \(n\) is the length + of :code:`x`, \(m\) is the length of :code:`y`, \(F_n\) is the empirical distribution that puts mass \(1/n\) at each of + the values in :code:`x` and \(F_m\) is the empirical distribution of the :code:`y` values. + + Parameters: + x (double[]): first sample + y (double[]): second sample + + Returns: + test statistic \(D_{n,m}\) used to evaluate the null hypothesis that :code:`x` and :code:`y` represent samples from the + same underlying distribution + + Raises: + :class:`~org.hipparchus.stat.inference.https:.www.hipparchus.org.hipparchus`: if either :code:`x` or :code:`y` does not have length at least 2 + :class:`~org.hipparchus.stat.inference.https:.www.hipparchus.org.hipparchus`: if either :code:`x` or :code:`y` is null + + + """ + ... @typing.overload def kolmogorovSmirnovStatistic(self, realDistribution: org.hipparchus.distribution.RealDistribution, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> float: ... @typing.overload - def kolmogorovSmirnovTest(self, realDistribution: org.hipparchus.distribution.RealDistribution, doubleArray: typing.Union[typing.List[float], jpype.JArray], double2: float) -> bool: ... - @typing.overload - def kolmogorovSmirnovTest(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray]) -> float: ... + def kolmogorovSmirnovTest(self, realDistribution: org.hipparchus.distribution.RealDistribution, doubleArray: typing.Union[typing.List[float], jpype.JArray], double2: float) -> bool: + """ + Computes the *p-value*, or *observed significance level*, of a one-sample ` Kolmogorov-Smirnov test + <http://en.wikipedia.org/wiki/Kolmogorov-Smirnov_test>` evaluating the null hypothesis that :code:`data` conforms to + :code:`distribution`. If :code:`exact` is true, the distribution used to compute the p-value is computed using extended + precision. See :meth:`~org.hipparchus.stat.inference.KolmogorovSmirnovTest.cdfExact`. + + Parameters: + distribution (:class:`~org.hipparchus.stat.inference.https:.www.hipparchus.org.hipparchus`): reference distribution + data (double[]): sample being being evaluated + exact (boolean): whether or not to force exact computation of the p-value + + Returns: + the p-value associated with the null hypothesis that :code:`data` is a sample from :code:`distribution` + + Raises: + :class:`~org.hipparchus.stat.inference.https:.www.hipparchus.org.hipparchus`: if :code:`data` does not have length at least 2 + :class:`~org.hipparchus.stat.inference.https:.www.hipparchus.org.hipparchus`: if :code:`data` is null + + Computes the *p-value*, or *observed significance level*, of a two-sample ` Kolmogorov-Smirnov test + <http://en.wikipedia.org/wiki/Kolmogorov-Smirnov_test>` evaluating the null hypothesis that :code:`x` and :code:`y` are + samples drawn from the same probability distribution. Specifically, what is returned is an estimate of the probability + that the :meth:`~org.hipparchus.stat.inference.KolmogorovSmirnovTest.kolmogorovSmirnovStatistic` associated with a + randomly selected partition of the combined sample into subsamples of sizes :code:`x.length` and :code:`y.length` will + strictly exceed (if :code:`strict` is :code:`true`) or be at least as large as :code:`strict = false`) as + :code:`kolmogorovSmirnovStatistic(x, y)`. + + - For small samples (where the product of the sample sizes is less than + :meth:`~org.hipparchus.stat.inference.KolmogorovSmirnovTest.LARGE_SAMPLE_PRODUCT`), the exact p-value is computed using + the method presented in [4], implemented in :meth:`~org.hipparchus.stat.inference.KolmogorovSmirnovTest.exactP`. + - When the product of the sample sizes exceeds + :meth:`~org.hipparchus.stat.inference.KolmogorovSmirnovTest.LARGE_SAMPLE_PRODUCT`, the asymptotic distribution of + \(D_{n,m}\) is used. See :meth:`~org.hipparchus.stat.inference.KolmogorovSmirnovTest.approximateP` for details on the + approximation. + + + If :code:`x.length * y.length` < :meth:`~org.hipparchus.stat.inference.KolmogorovSmirnovTest.LARGE_SAMPLE_PRODUCT` and + the combined set of values in :code:`x` and :code:`y` contains ties, random jitter is added to :code:`x` and :code:`y` + to break ties before computing \(D_{n,m}\) and the p-value. The jitter is uniformly distributed on (-minDelta / 2, + minDelta / 2) where minDelta is the smallest pairwise difference between values in the combined sample. + + If ties are known to be present in the data, :meth:`~org.hipparchus.stat.inference.KolmogorovSmirnovTest.bootstrap` may + be used as an alternative method for estimating the p-value. + + Parameters: + x (double[]): first sample dataset + y (double[]): second sample dataset + strict (boolean): whether or not the probability to compute is expressed as a strict inequality (ignored for large samples) + + Returns: + p-value associated with the null hypothesis that :code:`x` and :code:`y` represent samples from the same distribution + + Raises: + :class:`~org.hipparchus.stat.inference.https:.www.hipparchus.org.hipparchus`: if either :code:`x` or :code:`y` does not have length at least 2 + :class:`~org.hipparchus.stat.inference.https:.www.hipparchus.org.hipparchus`: if either :code:`x` or :code:`y` is null + + Also see: + + - :meth:`~org.hipparchus.stat.inference.KolmogorovSmirnovTest.bootstrap` + + + Performs a ` Kolmogorov-Smirnov test <http://en.wikipedia.org/wiki/Kolmogorov-Smirnov_test>` evaluating the null + hypothesis that :code:`data` conforms to :code:`distribution`. + + Parameters: + distribution (:class:`~org.hipparchus.stat.inference.https:.www.hipparchus.org.hipparchus`): reference distribution + data (double[]): sample being being evaluated + alpha (double): significance level of the test + + Returns: + true iff the null hypothesis that :code:`data` is a sample from :code:`distribution` can be rejected with confidence 1 - + :code:`alpha` + + Raises: + :class:`~org.hipparchus.stat.inference.https:.www.hipparchus.org.hipparchus`: if :code:`data` does not have length at least 2 + :class:`~org.hipparchus.stat.inference.https:.www.hipparchus.org.hipparchus`: if :code:`data` is null + + + """ + ... + @typing.overload + def kolmogorovSmirnovTest(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray]) -> float: + """ + Computes the *p-value*, or *observed significance level*, of a two-sample ` Kolmogorov-Smirnov test + <http://en.wikipedia.org/wiki/Kolmogorov-Smirnov_test>` evaluating the null hypothesis that :code:`x` and :code:`y` are + samples drawn from the same probability distribution. Assumes the strict form of the inequality used to compute the + p-value. See :meth:`~org.hipparchus.stat.inference.KolmogorovSmirnovTest.kolmogorovSmirnovTest`. + + Parameters: + x (double[]): first sample dataset + y (double[]): second sample dataset + + Returns: + p-value associated with the null hypothesis that :code:`x` and :code:`y` represent samples from the same distribution + + Raises: + :class:`~org.hipparchus.stat.inference.https:.www.hipparchus.org.hipparchus`: if either :code:`x` or :code:`y` does not have length at least 2 + :class:`~org.hipparchus.stat.inference.https:.www.hipparchus.org.hipparchus`: if either :code:`x` or :code:`y` is null + + Computes the *p-value*, or *observed significance level*, of a one-sample ` Kolmogorov-Smirnov test + <http://en.wikipedia.org/wiki/Kolmogorov-Smirnov_test>` evaluating the null hypothesis that :code:`data` conforms to + :code:`distribution`. + + Parameters: + distribution (:class:`~org.hipparchus.stat.inference.https:.www.hipparchus.org.hipparchus`): reference distribution + data (double[]): sample being being evaluated + + Returns: + the p-value associated with the null hypothesis that :code:`data` is a sample from :code:`distribution` + + Raises: + :class:`~org.hipparchus.stat.inference.https:.www.hipparchus.org.hipparchus`: if :code:`data` does not have length at least 2 + :class:`~org.hipparchus.stat.inference.https:.www.hipparchus.org.hipparchus`: if :code:`data` is null + + """ + ... @typing.overload def kolmogorovSmirnovTest(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray], boolean: bool) -> float: ... @typing.overload def kolmogorovSmirnovTest(self, realDistribution: org.hipparchus.distribution.RealDistribution, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> float: ... @typing.overload def kolmogorovSmirnovTest(self, realDistribution: org.hipparchus.distribution.RealDistribution, doubleArray: typing.Union[typing.List[float], jpype.JArray], boolean: bool) -> float: ... - def ksSum(self, double: float, double2: float, int: int) -> float: ... - def pelzGood(self, double: float, int: int) -> float: ... + def ksSum(self, double: float, double2: float, int: int) -> float: + """ + Computes \( 1 + 2 \sum_{i=1}^\infty (-1)^i e^{-2 i^2 t^2} \) stopping when successive partial sums are within + :code:`tolerance` of one another, or when :code:`maxIterations` partial sums have been computed. If the sum does not + converge before :code:`maxIterations` iterations a + :class:`~org.hipparchus.stat.inference.https:.www.hipparchus.org.hipparchus` is thrown. + + Parameters: + t (double): argument + tolerance (double): Cauchy criterion for partial sums + maxIterations (int): maximum number of partial sums to compute + + Returns: + Kolmogorov sum evaluated at t + + Raises: + :class:`~org.hipparchus.stat.inference.https:.www.hipparchus.org.hipparchus`: if the series does not converge + + + """ + ... + def pelzGood(self, double: float, int: int) -> float: + """ + Computes the Pelz-Good approximation for \(P(D_n < d)\) as described in [2] in the class javadoc. + + Parameters: + d (double): value of d-statistic (x in [2]) + n (int): sample size + + Returns: + \(P(D_n < d)\) + + + """ + ... class MannWhitneyUTest: + """ + public classMannWhitneyUTest extends :class:`~org.hipparchus.stat.inference.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + An implementation of the Mann-Whitney U test. + + The definitions and computing formulas used in this implementation follow those in the article, ` Mann-Whitney U Test + <http://en.wikipedia.org/wiki/Mann%E2%80%93Whitney_U>` + + In general, results correspond to (and have been tested against) the R wilcox.test function, with :code:`exact` meaning + the same thing in both APIs and :code:`CORRECT` uniformly true in this implementation. For example, wilcox.test(x, y, + alternative = "two.sided", mu = 0, paired = FALSE, exact = FALSE correct = TRUE) will return the same p-value as + mannWhitneyUTest(x, y, false). The minimum of the W value returned by R for wilcox.test(x, y...) and wilcox.test(y, + x...) should equal mannWhitneyU(x, y...). + """ @typing.overload def __init__(self): ... @typing.overload @@ -254,6 +818,26 @@ class MannWhitneyUTest: def mannWhitneyUTest(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray], boolean: bool) -> float: ... class OneWayAnova: + """ + public classOneWayAnova extends :class:`~org.hipparchus.stat.inference.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Implements one-way ANOVA (analysis of variance) statistics. + + Tests for differences between two or more categories of univariate data (for example, the body mass index of + accountants, lawyers, doctors and computer programmers). When two categories are given, this is equivalent to the + :class:`~org.hipparchus.stat.inference.TTest`. + + Uses the :class:`~org.hipparchus.stat.inference.https:.www.hipparchus.org.hipparchus` to estimate exact p-values. + + This implementation is based on a description at `One way Anova (dead link) + <http://faculty.vassar.edu/lowry/ch13pt1.html>` + + .. code-block: java + + Abbreviations: bg = between groups, + wg = within groups, + ss = sum squared deviations + """ def __init__(self): ... def anovaFValue(self, collection: typing.Union[java.util.Collection[typing.Union[typing.List[float], jpype.JArray]], typing.Sequence[typing.Union[typing.List[float], jpype.JArray]], typing.Set[typing.Union[typing.List[float], jpype.JArray]]]) -> float: ... @typing.overload @@ -263,9 +847,51 @@ class OneWayAnova: def anovaTest(self, collection: typing.Union[java.util.Collection[typing.Union[typing.List[float], jpype.JArray]], typing.Sequence[typing.Union[typing.List[float], jpype.JArray]], typing.Set[typing.Union[typing.List[float], jpype.JArray]]], double: float) -> bool: ... class TTest: + """ + public classTTest extends :class:`~org.hipparchus.stat.inference.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + An implementation for Student's t-tests. + + Tests can be: + + - One-sample or two-sample + - One-sided or two-sided + - Paired or unpaired (for two-sample tests) + - Homoscedastic (equal variance assumption) or heteroscedastic (for two sample tests) + - Fixed significance level (boolean-valued) or returning p-values. + + + Test statistics are available for all tests. Methods including "Test" in in their names perform tests, all other methods + return t-statistics. Among the "Test" methods, :code:`double-`valued methods return p-values; :code:`boolean-`valued + methods perform fixed significance level tests. Significance levels are always specified as numbers between 0 and 0.5 + (e.g. tests at the 95% level use :code:`alpha=0.05`). + + Input to tests can be either :code:`double[]` arrays or :class:`~org.hipparchus.stat.descriptive.StatisticalSummary` + instances. + + Uses Hipparchus :class:`~org.hipparchus.stat.inference.https:.www.hipparchus.org.hipparchus` implementation to estimate + exact p-values. + """ def __init__(self): ... @typing.overload - def homoscedasticT(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray]) -> float: ... + def homoscedasticT(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray]) -> float: + """ + Computes t test statistic for 2-sample t-test under the hypothesis of equal subpopulation variances. + + Parameters: + m1 (double): first sample mean + m2 (double): second sample mean + v1 (double): first sample variance + v2 (double): second sample variance + n1 (double): first sample n + n2 (double): second sample n + + Returns: + t test statistic + + + """ + ... @typing.overload def homoscedasticT(self, statisticalSummary: org.hipparchus.stat.descriptive.StatisticalSummary, statisticalSummary2: org.hipparchus.stat.descriptive.StatisticalSummary) -> float: ... @typing.overload @@ -280,7 +906,37 @@ class TTest: @typing.overload def pairedTTest(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray]) -> float: ... @typing.overload - def t(self, double: float, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> float: ... + def t(self, double: float, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> float: + """ + Computes t test statistic for 1-sample t-test. + + Parameters: + m (double): sample mean + mu (double): constant to test against + v (double): sample variance + n (double): sample n + + Returns: + t test statistic + + Computes t test statistic for 2-sample t-test. + + Does not assume that subpopulation variances are equal. + + Parameters: + m1 (double): first sample mean + m2 (double): second sample mean + v1 (double): first sample variance + v2 (double): second sample variance + n1 (double): first sample n + n2 (double): second sample n + + Returns: + t test statistic + + + """ + ... @typing.overload def t(self, double: float, statisticalSummary: org.hipparchus.stat.descriptive.StatisticalSummary) -> float: ... @typing.overload @@ -305,6 +961,13 @@ class TTest: def tTest(self, statisticalSummary: org.hipparchus.stat.descriptive.StatisticalSummary, statisticalSummary2: org.hipparchus.stat.descriptive.StatisticalSummary) -> float: ... class WilcoxonSignedRankTest: + """ + public classWilcoxonSignedRankTest extends :class:`~org.hipparchus.stat.inference.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + An implementation of the Wilcoxon signed-rank test. This implementation currently handles only paired (equal length) + samples and discards tied pairs from the analysis. The latter behavior differs from the R implementation of wilcox.test + and corresponds to the "wilcox" zero_method configurable in scipy.stats.wilcoxon. + """ @typing.overload def __init__(self): ... @typing.overload diff --git a/org-stubs/hipparchus/stat/interval/__init__.pyi b/org-stubs/hipparchus/stat/interval/__init__.pyi index 35320a3..30c9c6a 100644 --- a/org-stubs/hipparchus/stat/interval/__init__.pyi +++ b/org-stubs/hipparchus/stat/interval/__init__.pyi @@ -10,6 +10,16 @@ import typing class BinomialProportion: + """ + public classBinomialProportion extends :class:`~org.hipparchus.stat.interval.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Utility methods to generate confidence intervals for a binomial proportion. + + Also see: + + - ` Binomial proportion confidence interval (Wikipedia) + <http://en.wikipedia.org/wiki/Binomial_proportion_confidence_interval>` + """ @staticmethod def getAgrestiCoullInterval(int: int, double: float, double2: float) -> 'ConfidenceInterval': ... @staticmethod @@ -20,11 +30,56 @@ class BinomialProportion: def getWilsonScoreInterval(int: int, double: float, double2: float) -> 'ConfidenceInterval': ... class ConfidenceInterval: + """ + public classConfidenceInterval extends :class:`~org.hipparchus.stat.interval.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Represents an interval estimate of a population parameter. + """ def __init__(self, double: float, double2: float, double3: float): ... - def getConfidenceLevel(self) -> float: ... - def getLowerBound(self) -> float: ... - def getUpperBound(self) -> float: ... - def toString(self) -> str: ... + def getConfidenceLevel(self) -> float: + """ + Get asserted probability that the interval contains the population parameter. + + Returns: + the asserted probability that the interval contains the population parameter + + + """ + ... + def getLowerBound(self) -> float: + """ + Get lower endpoint of the interval. + + Returns: + the lower endpoint of the interval + + + """ + ... + def getUpperBound(self) -> float: + """ + Get upper endpoint of the interval. + + Returns: + the upper endpoint of the interval + + + """ + ... + def toString(self) -> str: + """ + Get String representation of the confidence interval. + + Overrides: + :meth:`~org.hipparchus.stat.interval.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.toString` in + class :class:`~org.hipparchus.stat.interval.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Returns: + String representation of the confidence interval + + + """ + ... class __module_protocol__(Protocol): diff --git a/org-stubs/hipparchus/stat/projection/__init__.pyi b/org-stubs/hipparchus/stat/projection/__init__.pyi index b971b22..01affae 100644 --- a/org-stubs/hipparchus/stat/projection/__init__.pyi +++ b/org-stubs/hipparchus/stat/projection/__init__.pyi @@ -11,19 +11,122 @@ import typing class PCA: + """ + public classPCA extends :class:`~org.hipparchus.stat.projection.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Principal component analysis (PCA) is a statistical technique for reducing the dimensionality of a dataset. + :class:`~org.hipparchus.stat.projection.https:.en.wikipedia.org.wiki.Principal_component_analysis` can be thought of as + a projection or scaling of the data to reduce the number of dimensions but done in a way that preserves as much + information as possible. + + Since: + 3.0 + """ @typing.overload def __init__(self, int: int): ... @typing.overload def __init__(self, int: int, boolean: bool, boolean2: bool): ... - def fit(self, doubleArray: typing.Union[typing.List[typing.MutableSequence[float]], jpype.JArray]) -> 'PCA': ... - def fitAndTransform(self, doubleArray: typing.Union[typing.List[typing.MutableSequence[float]], jpype.JArray]) -> typing.MutableSequence[typing.MutableSequence[float]]: ... - def getCenter(self) -> typing.MutableSequence[float]: ... - def getComponents(self) -> typing.MutableSequence[typing.MutableSequence[float]]: ... - def getNumComponents(self) -> int: ... - def getVariance(self) -> typing.MutableSequence[float]: ... - def isBiasCorrection(self) -> bool: ... - def isScale(self) -> bool: ... - def transform(self, doubleArray: typing.Union[typing.List[typing.MutableSequence[float]], jpype.JArray]) -> typing.MutableSequence[typing.MutableSequence[float]]: ... + def fit(self, doubleArray: typing.Union[typing.List[typing.MutableSequence[float]], jpype.JArray]) -> 'PCA': + """ + Fit our model to the data, ready for subsequence transforms. + + Parameters: + data (double[][]): the input data + + Returns: + this + + + """ + ... + def fitAndTransform(self, doubleArray: typing.Union[typing.List[typing.MutableSequence[float]], jpype.JArray]) -> typing.MutableSequence[typing.MutableSequence[float]]: + """ + Fit our model to the data and then transform it to the reduced dimensions. + + Parameters: + data (double[][]): the input data + + Returns: + the fitted data + + + """ + ... + def getCenter(self) -> typing.MutableSequence[float]: + """ + Get by column center (or mean) of the fitted data. + + Returns: + the by column center (or mean) of the fitted data + + + """ + ... + def getComponents(self) -> typing.MutableSequence[typing.MutableSequence[float]]: + """ + Returns the principal components of our projection model. These are the eigenvectors of our covariance/correlation + matrix. + + Returns: + the principal components + + + """ + ... + def getNumComponents(self) -> int: + """ + GEt number of components. + + Returns: + the number of components + + + """ + ... + def getVariance(self) -> typing.MutableSequence[float]: + """ + Get principal component variances. + + Returns: + the principal component variances, ordered from largest to smallest, which are the eigenvalues of the covariance or + correlation matrix of the fitted data + + + """ + ... + def isBiasCorrection(self) -> bool: + """ + Check whether scaling (correlation), if in use, adjusts for bias. + + Returns: + whether scaling (correlation), if in use, adjusts for bias + + + """ + ... + def isScale(self) -> bool: + """ + Check whether scaling (correlation) or no scaling (covariance) is used. + + Returns: + whether scaling (correlation) or no scaling (covariance) is used + + + """ + ... + def transform(self, doubleArray: typing.Union[typing.List[typing.MutableSequence[float]], jpype.JArray]) -> typing.MutableSequence[typing.MutableSequence[float]]: + """ + Transform the supplied data using our projection model. + + Parameters: + data (double[][]): the input data + + Returns: + the fitted data + + + """ + ... class __module_protocol__(Protocol): diff --git a/org-stubs/hipparchus/stat/ranking/__init__.pyi b/org-stubs/hipparchus/stat/ranking/__init__.pyi index d4b0777..a4dfb15 100644 --- a/org-stubs/hipparchus/stat/ranking/__init__.pyi +++ b/org-stubs/hipparchus/stat/ranking/__init__.pyi @@ -13,6 +13,19 @@ import typing class NaNStrategy(java.lang.Enum['NaNStrategy']): + """ + public enumNaNStrategy extends :class:`~org.hipparchus.stat.ranking.https:.docs.oracle.com.javase.8.docs.api.java.lang.Enum`<:class:`~org.hipparchus.stat.ranking.NaNStrategy`> + + Strategies for handling NaN values in rank transformations. + + - MINIMAL - NaNs are treated as minimal in the ordering, equivalent to (that is, tied with) + :code:`Double.NEGATIVE_INFINITY`. + - MAXIMAL - NaNs are treated as maximal in the ordering, equivalent to :code:`Double.POSITIVE_INFINITY` + - REMOVED - NaNs are removed before the rank transform is applied + - FIXED - NaNs are left "in place," that is the rank transformation is applied to the other elements in the input array, + but the NaN elements are returned unchanged. + - FAILED - If any NaN is encountered in the input array, an appropriate exception is thrown + """ MINIMAL: typing.ClassVar['NaNStrategy'] = ... MAXIMAL: typing.ClassVar['NaNStrategy'] = ... REMOVED: typing.ClassVar['NaNStrategy'] = ... @@ -24,14 +37,77 @@ class NaNStrategy(java.lang.Enum['NaNStrategy']): def valueOf(class_: typing.Type[_valueOf_0__T], string: str) -> _valueOf_0__T: ... @typing.overload @staticmethod - def valueOf(string: str) -> 'NaNStrategy': ... + def valueOf(string: str) -> 'NaNStrategy': + """ + Returns the enum constant of this type with the specified name. The string must match *exactly* an identifier used to + declare an enum constant in this type. (Extraneous whitespace characters are not permitted.) + + Parameters: + name (:class:`~org.hipparchus.stat.ranking.https:.docs.oracle.com.javase.8.docs.api.java.lang.String`): the name of the enum constant to be returned. + + Returns: + the enum constant with the specified name + + Raises: + :class:`~org.hipparchus.stat.ranking.https:.docs.oracle.com.javase.8.docs.api.java.lang.IllegalArgumentException`: if this enum type has no constant with the specified name + :class:`~org.hipparchus.stat.ranking.https:.docs.oracle.com.javase.8.docs.api.java.lang.NullPointerException`: if the argument is null + + + """ + ... @staticmethod - def values() -> typing.MutableSequence['NaNStrategy']: ... + def values() -> typing.MutableSequence['NaNStrategy']: + """ + Returns an array containing the constants of this enum type, in the order they are declared. + + Returns: + an array containing the constants of this enum type, in the order they are declared + + + """ + ... class RankingAlgorithm: - def rank(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> typing.MutableSequence[float]: ... + """ + public interfaceRankingAlgorithm + + Interface representing a rank transformation. + """ + def rank(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> typing.MutableSequence[float]: + """ + Performs a rank transformation on the input data, returning an array of ranks. + + Ranks should be 1-based - that is, the smallest value returned in an array of ranks should be greater than or equal to + one, rather than 0. Ranks should in general take integer values, though implementations may return averages or other + floating point values to resolve ties in the input data. + + Parameters: + data (double[]): array of data to be ranked + + Returns: + an array of ranks corresponding to the elements of the input array + + + """ + ... class TiesStrategy(java.lang.Enum['TiesStrategy']): + """ + public enumTiesStrategy extends :class:`~org.hipparchus.stat.ranking.https:.docs.oracle.com.javase.8.docs.api.java.lang.Enum`<:class:`~org.hipparchus.stat.ranking.TiesStrategy`> + + Strategies for handling tied values in rank transformations. + + - SEQUENTIAL - Ties are assigned ranks in order of occurrence in the original array, for example (1,3,4,3) is ranked as + (1,2,4,3) + - MINIMUM - Tied values are assigned the minimum applicable rank, or the rank of the first occurrence. For example, + (1,3,4,3) is ranked as (1,2,4,2) + - MAXIMUM - Tied values are assigned the maximum applicable rank, or the rank of the last occurrence. For example, + (1,3,4,3) is ranked as (1,3,4,3) + - AVERAGE - Tied values are assigned the average of the applicable ranks. For example, (1,3,4,3) is ranked as + (1,2.5,4,2.5) + - RANDOM - Tied values are assigned a random integer rank from among the applicable values. The assigned rank will always + be an integer, (inclusively) between the values returned by the MINIMUM and MAXIMUM strategies. + """ SEQUENTIAL: typing.ClassVar['TiesStrategy'] = ... MINIMUM: typing.ClassVar['TiesStrategy'] = ... MAXIMUM: typing.ClassVar['TiesStrategy'] = ... @@ -43,13 +119,65 @@ class TiesStrategy(java.lang.Enum['TiesStrategy']): def valueOf(class_: typing.Type[_valueOf_0__T], string: str) -> _valueOf_0__T: ... @typing.overload @staticmethod - def valueOf(string: str) -> 'TiesStrategy': ... + def valueOf(string: str) -> 'TiesStrategy': + """ + Returns the enum constant of this type with the specified name. The string must match *exactly* an identifier used to + declare an enum constant in this type. (Extraneous whitespace characters are not permitted.) + + Parameters: + name (:class:`~org.hipparchus.stat.ranking.https:.docs.oracle.com.javase.8.docs.api.java.lang.String`): the name of the enum constant to be returned. + + Returns: + the enum constant with the specified name + + Raises: + :class:`~org.hipparchus.stat.ranking.https:.docs.oracle.com.javase.8.docs.api.java.lang.IllegalArgumentException`: if this enum type has no constant with the specified name + :class:`~org.hipparchus.stat.ranking.https:.docs.oracle.com.javase.8.docs.api.java.lang.NullPointerException`: if the argument is null + + + """ + ... @staticmethod - def values() -> typing.MutableSequence['TiesStrategy']: ... + def values() -> typing.MutableSequence['TiesStrategy']: + """ + Returns an array containing the constants of this enum type, in the order they are declared. + + Returns: + an array containing the constants of this enum type, in the order they are declared + + + """ + ... class NaturalRanking(RankingAlgorithm): + """ + public classNaturalRanking extends :class:`~org.hipparchus.stat.ranking.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.stat.ranking.RankingAlgorithm` + + + Ranking based on the natural ordering on doubles. + + NaNs are treated according to the configured :class:`~org.hipparchus.stat.ranking.NaNStrategy` and ties are handled + using the selected :class:`~org.hipparchus.stat.ranking.TiesStrategy`. Configuration settings are supplied in optional + constructor arguments. Defaults are :meth:`~org.hipparchus.stat.ranking.NaNStrategy.FAILED` and + :meth:`~org.hipparchus.stat.ranking.TiesStrategy.AVERAGE`, respectively. When using + :meth:`~org.hipparchus.stat.ranking.TiesStrategy.RANDOM`, a + :class:`~org.hipparchus.stat.ranking.https:.www.hipparchus.org.hipparchus` may be supplied as a constructor argument. + """ DEFAULT_NAN_STRATEGY: typing.ClassVar[NaNStrategy] = ... + """ + public static final :class:`~org.hipparchus.stat.ranking.NaNStrategy` DEFAULT_NAN_STRATEGY + + default NaN strategy + + """ DEFAULT_TIES_STRATEGY: typing.ClassVar[TiesStrategy] = ... + """ + public static final :class:`~org.hipparchus.stat.ranking.TiesStrategy` DEFAULT_TIES_STRATEGY + + default ties strategy + + """ @typing.overload def __init__(self): ... @typing.overload @@ -62,9 +190,49 @@ class NaturalRanking(RankingAlgorithm): def __init__(self, naNStrategy: NaNStrategy, tiesStrategy: TiesStrategy): ... @typing.overload def __init__(self, tiesStrategy: TiesStrategy): ... - def getNanStrategy(self) -> NaNStrategy: ... - def getTiesStrategy(self) -> TiesStrategy: ... - def rank(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> typing.MutableSequence[float]: ... + def getNanStrategy(self) -> NaNStrategy: + """ + Return the NaNStrategy + + Returns: + returns the NaNStrategy + + + """ + ... + def getTiesStrategy(self) -> TiesStrategy: + """ + Return the TiesStrategy + + Returns: + the TiesStrategy + + + """ + ... + def rank(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> typing.MutableSequence[float]: + """ + Rank :code:`data` using the natural ordering on Doubles, with NaN values handled according to :code:`nanStrategy` and + ties resolved using :code:`tiesStrategy.` + + Specified by: + :meth:`~org.hipparchus.stat.ranking.RankingAlgorithm.rank` in + interface :class:`~org.hipparchus.stat.ranking.RankingAlgorithm` + + Parameters: + data (double[]): array to be ranked + + Returns: + array of ranks + + Raises: + :class:`~org.hipparchus.stat.ranking.https:.www.hipparchus.org.hipparchus`: if the selected :class:`~org.hipparchus.stat.ranking.NaNStrategy` is :code:`FAILED` and a + :meth:`~org.hipparchus.stat.ranking.https:.docs.oracle.com.javase.8.docs.api.java.lang.Double.NaN` is encountered in the + input data + + + """ + ... class __module_protocol__(Protocol): diff --git a/org-stubs/hipparchus/stat/regression/__init__.pyi b/org-stubs/hipparchus/stat/regression/__init__.pyi index f441bfa..e39aef6 100644 --- a/org-stubs/hipparchus/stat/regression/__init__.pyi +++ b/org-stubs/hipparchus/stat/regression/__init__.pyi @@ -13,66 +13,590 @@ import typing class MultipleLinearRegression: - def estimateRegressandVariance(self) -> float: ... - def estimateRegressionParameters(self) -> typing.MutableSequence[float]: ... - def estimateRegressionParametersStandardErrors(self) -> typing.MutableSequence[float]: ... - def estimateRegressionParametersVariance(self) -> typing.MutableSequence[typing.MutableSequence[float]]: ... - def estimateResiduals(self) -> typing.MutableSequence[float]: ... + """ + public interfaceMultipleLinearRegression + + The multiple linear regression can be represented in matrix-notation. + + .. code-block: java + + y=X*b+u + + where y is an :code:`n-vector` **regressand**, X is a :code:`[n,k]` matrix whose :code:`k` columns are called + **regressors**, b is :code:`k-vector` of **regression parameters** and :code:`u` is an :code:`n-vector` of **error + terms** or **residuals**. The notation is quite standard in literature, cf eg `Davidson and MacKinnon, Econometrics + Theory and Methods, 2004 <http://www.econ.queensu.ca/ETM>`. + """ + def estimateRegressandVariance(self) -> float: + """ + Returns the variance of the regressand, ie Var(y). + + Returns: + The double representing the variance of y + + + """ + ... + def estimateRegressionParameters(self) -> typing.MutableSequence[float]: + """ + Estimates the regression parameters b. + + Returns: + The [k,1] array representing b + + + """ + ... + def estimateRegressionParametersStandardErrors(self) -> typing.MutableSequence[float]: + """ + Returns the standard errors of the regression parameters. + + Returns: + standard errors of estimated regression parameters + + + """ + ... + def estimateRegressionParametersVariance(self) -> typing.MutableSequence[typing.MutableSequence[float]]: + """ + Estimates the variance of the regression parameters, ie Var(b). + + Returns: + The [k,k] array representing the variance of b + + + """ + ... + def estimateResiduals(self) -> typing.MutableSequence[float]: + """ + Estimates the residuals, ie u = y - X*b. + + Returns: + The [n,1] array representing the residuals + + + """ + ... class RegressionResults(java.io.Serializable): + """ + public classRegressionResults extends :class:`~org.hipparchus.stat.regression.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.stat.regression.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + Results of a Multiple Linear Regression model fit. + + Also see: + + - :meth:`~serialized` + """ def __init__(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[typing.MutableSequence[float]], jpype.JArray], boolean: bool, long: int, int: int, double3: float, double4: float, double5: float, boolean2: bool, boolean3: bool): ... - def getAdjustedRSquared(self) -> float: ... + def getAdjustedRSquared(self) -> float: + """ + + Returns the adjusted R-squared statistic, defined by the formula \( R_\mathrm{adj}^2 = 1 - \frac{\mathrm{SSR} (n - + 1)}{\mathrm{SSTO} (n - p)} \) where SSR is the sum of squared residuals}, SSTO is the total sum of squares}, n is the + number of observations and p is the number of parameters estimated (including the intercept). + + If the regression is estimated without an intercept term, what is returned is + + .. code-block: java + + :meth:`~org.hipparchus.stat.regression.RegressionResults.getRSquared` + + + Returns: + adjusted R-Squared statistic + + + """ + ... def getCovarianceOfParameters(self, int: int, int2: int) -> float: ... - def getErrorSumSquares(self) -> float: ... - def getMeanSquareError(self) -> float: ... - def getN(self) -> int: ... - def getNumberOfParameters(self) -> int: ... + def getErrorSumSquares(self) -> float: + """ + + Returns the ` sum of squared errors <http://www.xycoon.com/SumOfSquares.htm>` (SSE) associated with the regression + model. + + The return value is constrained to be non-negative - i.e., if due to rounding errors the computational formula returns a + negative result, 0 is returned. + + **Preconditions**: + + - numberOfParameters data pairs must have been added before invoking this method. If this method is invoked before a model + can be estimated, :code:`Double,NaN` is returned. + + + Returns: + sum of squared errors associated with the regression model + + + """ + ... + def getMeanSquareError(self) -> float: + """ + + Returns the sum of squared errors divided by the degrees of freedom, usually abbreviated MSE. + + If there are fewer than **numberOfParameters + 1** data pairs in the model, or if there is no variation in :code:`x`, + this returns :code:`Double.NaN`. + + Returns: + sum of squared deviations of y values + + + """ + ... + def getN(self) -> int: + """ + Returns the number of observations added to the regression model. + + Returns: + Number of observations, -1 if an error condition prevents estimation + + + """ + ... + def getNumberOfParameters(self) -> int: + """ + + Returns the number of parameters estimated in the model. + + This is the maximum number of regressors, some techniques may drop redundant parameters + + Returns: + number of regressors, -1 if not estimated + + + """ + ... def getParameterEstimate(self, int: int) -> float: ... - def getParameterEstimates(self) -> typing.MutableSequence[float]: ... - def getRSquared(self) -> float: ... - def getRegressionSumSquares(self) -> float: ... + def getParameterEstimates(self) -> typing.MutableSequence[float]: + """ + + Returns a copy of the regression parameters estimates. + + The parameter estimates are returned in the natural order of the data. + + A redundant regressor will have its redundancy flag set, as will a parameter estimate equal to :code:`Double.NaN`. + + Returns: + array of parameter estimates, null if no estimation occurred + + + """ + ... + def getRSquared(self) -> float: + """ + + Returns the ` coefficient of multiple determination <http://www.xycoon.com/coefficient1.htm>`, usually denoted r-square. + + **Preconditions**: + + - At least numberOfParameters observations (with at least numberOfParameters different x values) must have been added + before invoking this method. If this method is invoked before a model can be estimated, :code:`Double,NaN` is returned. + + + Returns: + r-square, a double in the interval [0, 1] + + + """ + ... + def getRegressionSumSquares(self) -> float: + """ + + Returns the sum of squared deviations of the predicted y values about their mean (which equals the mean of y). + + This is usually abbreviated SSR or SSM. It is defined as SSM `here <http://www.xycoon.com/SumOfSquares.htm>` + + **Preconditions**: + + - At least two observations (with at least two different x values) must have been added before invoking this method. If + this method is invoked before a model can be estimated, :code:`Double.NaN` is returned. + + + Returns: + sum of squared deviations of predicted y values + + + """ + ... def getStdErrorOfEstimate(self, int: int) -> float: ... - def getStdErrorOfEstimates(self) -> typing.MutableSequence[float]: ... - def getTotalSumSquares(self) -> float: ... - def hasIntercept(self) -> bool: ... + def getStdErrorOfEstimates(self) -> typing.MutableSequence[float]: + """ + + Returns the `standard error of the parameter estimates <http://www.xycoon.com/standerrorb(1).htm>`, usually denoted s(b + :sub:`i` ). + + If there are problems with an ill conditioned design matrix then the regressor which is redundant will be assigned + :code:`Double.NaN`. + + Returns: + an array standard errors associated with parameters estimates, null if no estimation occurred + + + """ + ... + def getTotalSumSquares(self) -> float: + """ + + Returns the sum of squared deviations of the y values about their mean. + + This is defined as SSTO `here <http://www.xycoon.com/SumOfSquares.htm>`. + + If :code:`n < 2`, this returns :code:`Double.NaN`. + + Returns: + sum of squared deviations of y values + + + """ + ... + def hasIntercept(self) -> bool: + """ + Returns true if the regression model has been computed including an intercept. In this case, the coefficient of the + intercept is the first element of the :meth:`~org.hipparchus.stat.regression.RegressionResults.getParameterEstimates`. + + Returns: + true if the model has an intercept term + + + """ + ... class UpdatingMultipleLinearRegression: + """ + public interfaceUpdatingMultipleLinearRegression + + An interface for regression models allowing for dynamic updating of the data. That is, the entire data set need not be + loaded into memory. As observations become available, they can be added to the regression model and an updated estimate + regression statistics can be calculated. + """ def addObservation(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], double2: float) -> None: ... def addObservations(self, doubleArray: typing.Union[typing.List[typing.MutableSequence[float]], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray]) -> None: ... - def clear(self) -> None: ... - def getN(self) -> int: ... - def hasIntercept(self) -> bool: ... + def clear(self) -> None: + """ + Clears internal buffers and resets the regression model. This means all data and derived values are initialized + + """ + ... + def getN(self) -> int: + """ + Returns the number of observations added to the regression model. + + Returns: + Number of observations + + + """ + ... + def hasIntercept(self) -> bool: + """ + Returns true if a constant has been included false otherwise. + + Returns: + true if constant exists, false otherwise + + + """ + ... @typing.overload def regress(self) -> RegressionResults: ... @typing.overload def regress(self, intArray: typing.Union[typing.List[int], jpype.JArray]) -> RegressionResults: ... class AbstractMultipleLinearRegression(MultipleLinearRegression): + """ + public abstract classAbstractMultipleLinearRegression extends :class:`~org.hipparchus.stat.regression.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.stat.regression.MultipleLinearRegression` + + Abstract base class for implementations of MultipleLinearRegression. + """ def __init__(self): ... - def estimateErrorVariance(self) -> float: ... - def estimateRegressandVariance(self) -> float: ... - def estimateRegressionParameters(self) -> typing.MutableSequence[float]: ... - def estimateRegressionParametersStandardErrors(self) -> typing.MutableSequence[float]: ... - def estimateRegressionParametersVariance(self) -> typing.MutableSequence[typing.MutableSequence[float]]: ... - def estimateRegressionStandardError(self) -> float: ... - def estimateResiduals(self) -> typing.MutableSequence[float]: ... - def isNoIntercept(self) -> bool: ... - def newSampleData(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, int2: int) -> None: ... - def setNoIntercept(self, boolean: bool) -> None: ... + def estimateErrorVariance(self) -> float: + """ + Estimates the variance of the error. + + Returns: + estimate of the error variance + + + """ + ... + def estimateRegressandVariance(self) -> float: + """ + Returns the variance of the regressand, ie Var(y). + + Specified by: + :meth:`~org.hipparchus.stat.regression.MultipleLinearRegression.estimateRegressandVariance` in + interface :class:`~org.hipparchus.stat.regression.MultipleLinearRegression` + + Returns: + The double representing the variance of y + + + """ + ... + def estimateRegressionParameters(self) -> typing.MutableSequence[float]: + """ + Estimates the regression parameters b. + + Specified by: + :meth:`~org.hipparchus.stat.regression.MultipleLinearRegression.estimateRegressionParameters` in + interface :class:`~org.hipparchus.stat.regression.MultipleLinearRegression` + + Returns: + The [k,1] array representing b + + + """ + ... + def estimateRegressionParametersStandardErrors(self) -> typing.MutableSequence[float]: + """ + Returns the standard errors of the regression parameters. + + Specified by: + :meth:`~org.hipparchus.stat.regression.MultipleLinearRegression.estimateRegressionParametersStandardErrors` in + interface :class:`~org.hipparchus.stat.regression.MultipleLinearRegression` + + Returns: + standard errors of estimated regression parameters + + + """ + ... + def estimateRegressionParametersVariance(self) -> typing.MutableSequence[typing.MutableSequence[float]]: + """ + Estimates the variance of the regression parameters, ie Var(b). + + Specified by: + :meth:`~org.hipparchus.stat.regression.MultipleLinearRegression.estimateRegressionParametersVariance` in + interface :class:`~org.hipparchus.stat.regression.MultipleLinearRegression` + + Returns: + The [k,k] array representing the variance of b + + + """ + ... + def estimateRegressionStandardError(self) -> float: + """ + Estimates the standard error of the regression. + + Returns: + regression standard error + + + """ + ... + def estimateResiduals(self) -> typing.MutableSequence[float]: + """ + Estimates the residuals, ie u = y - X*b. + + Specified by: + :meth:`~org.hipparchus.stat.regression.MultipleLinearRegression.estimateResiduals` in + interface :class:`~org.hipparchus.stat.regression.MultipleLinearRegression` + + Returns: + The [n,1] array representing the residuals + + + """ + ... + def isNoIntercept(self) -> bool: + """ + Chekc if the model has no intercept term. + + Returns: + true if the model has no intercept term; false otherwise + + + """ + ... + def newSampleData(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, int2: int) -> None: + """ + + Loads model x and y sample data from a flat input array, overriding any previous sample. + + Assumes that rows are concatenated with y values first in each row. For example, an input :code:`data` array containing + the sequence of values (1, 2, 3, 4, 5, 6, 7, 8, 9) with :code:`nobs = 3` and :code:`nvars = 2` creates a regression + dataset with two independent variables, as below: + + .. code-block: java + + y x[0] x[1] + -------------- + 1 2 3 + 4 5 6 + 7 8 9 + + + Note that there is no need to add an initial unitary column (column of 1's) when specifying a model including an + intercept term. If :meth:`~org.hipparchus.stat.regression.AbstractMultipleLinearRegression.isNoIntercept` is + :code:`true`, the X matrix will be created without an initial column of "1"s; otherwise this column will be added. + + Throws IllegalArgumentException if any of the following preconditions fail: + + - :code:`data` cannot be null + - :code:`data.length = nobs * (nvars + 1)` + - :code:`nobs > nvars` + + + Parameters: + data (double[]): input data array + nobs (int): number of observations (rows) + nvars (int): number of independent variables (columns, not counting y) + + Raises: + :class:`~org.hipparchus.stat.regression.https:.www.hipparchus.org.hipparchus`: if the data array is null + :class:`~org.hipparchus.stat.regression.https:.www.hipparchus.org.hipparchus`: if the length of the data array is not equal to :code:`nobs * (nvars + 1)` + :class:`~org.hipparchus.stat.regression.https:.www.hipparchus.org.hipparchus`: if :code:`nobs` is less than :code:`nvars + 1` + + + """ + ... + def setNoIntercept(self, boolean: bool) -> None: + """ + Set intercept flag. + + Parameters: + noIntercept (boolean): true means the model is to be estimated without an intercept term + + + """ + ... class MillerUpdatingRegression(UpdatingMultipleLinearRegression): + """ + public classMillerUpdatingRegression extends :class:`~org.hipparchus.stat.regression.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.stat.regression.UpdatingMultipleLinearRegression` + + This class is a concrete implementation of the :class:`~org.hipparchus.stat.regression.UpdatingMultipleLinearRegression` + interface. + + The algorithm is described in: + + .. code-block: java + + Algorithm AS 274: Least Squares Routines to Supplement Those of Gentleman + Author(s): Alan J. Miller + Source: Journal of the Royal Statistical Society. + Series C (Applied Statistics), Vol. 41, No. 2 + (1992), pp. 458-478 + Published by: Blackwell Publishing for the Royal Statistical Society + Stable URL: :class:`~org.hipparchus.stat.regression.https:.www.jstor.org.stable.2347583` + + This method for multiple regression forms the solution to the OLS problem by updating the QR decomposition as described + by Gentleman. + """ @typing.overload def __init__(self, int: int, boolean: bool): ... @typing.overload def __init__(self, int: int, boolean: bool, double: float): ... def addObservation(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], double2: float) -> None: ... def addObservations(self, doubleArray: typing.Union[typing.List[typing.MutableSequence[float]], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray]) -> None: ... - def clear(self) -> None: ... - def getDiagonalOfHatMatrix(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> float: ... - def getN(self) -> int: ... - def getOrderOfRegressors(self) -> typing.MutableSequence[int]: ... - def getPartialCorrelations(self, int: int) -> typing.MutableSequence[float]: ... - def hasIntercept(self) -> bool: ... + def clear(self) -> None: + """ + As the name suggests, clear wipes the internals and reorders everything in the canonical order. + + Specified by: + :meth:`~org.hipparchus.stat.regression.UpdatingMultipleLinearRegression.clear` in + interface :class:`~org.hipparchus.stat.regression.UpdatingMultipleLinearRegression` + + + """ + ... + def getDiagonalOfHatMatrix(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> float: + """ + Gets the diagonal of the Hat matrix also known as the leverage matrix. + + Parameters: + row_data (double[]): returns the diagonal of the hat matrix for this observation + + Returns: + the diagonal element of the hatmatrix + + + """ + ... + def getN(self) -> int: + """ + Gets the number of observations added to the regression model. + + Specified by: + :meth:`~org.hipparchus.stat.regression.UpdatingMultipleLinearRegression.getN` in + interface :class:`~org.hipparchus.stat.regression.UpdatingMultipleLinearRegression` + + Returns: + number of observations + + + """ + ... + def getOrderOfRegressors(self) -> typing.MutableSequence[int]: + """ + Gets the order of the regressors, useful if some type of reordering has been called. Calling regress with int[]{} args + will trigger a reordering. + + Returns: + int[] with the current order of the regressors + + + """ + ... + def getPartialCorrelations(self, int: int) -> typing.MutableSequence[float]: + """ + In the original algorithm only the partial correlations of the regressors is returned to the user. In this + implementation, we have + + .. code-block: java + + corr = + { + corrxx - lower triangular + corrxy - bottom row of the matrix + } + Replaces subroutines PCORR and COR of: + ALGORITHM AS274 APPL. STATIST. (1992) VOL.41, NO. 2 + + Calculate partial correlations after the variables in rows 1, 2, ..., IN have been forced into the regression. If IN = + 1, and the first row of R represents a constant in the model, then the usual simple correlations are returned. + + If IN = 0, the value returned in array CORMAT for the correlation of variables Xi & Xj is: + + .. code-block: java + + sum ( Xi.Xj ) / Sqrt ( sum (Xi^2) . sum (Xj^2) ) + + On return, array CORMAT contains the upper triangle of the matrix of partial correlations stored by rows, excluding the + 1's on the diagonal. e.g. if IN = 2, the consecutive elements returned are: (3,4) (3,5) ... (3,ncol), (4,5) (4,6) ... + (4,ncol), etc. Array YCORR stores the partial correlations with the Y-variable starting with YCORR(IN+1) = partial + correlation with the variable in position (IN+1). + + Parameters: + in (int): how many of the regressors to include (either in canonical order, or in the current reordered state) + + Returns: + an array with the partial correlations of the remainder of regressors with each other and the regressand, in lower + triangular form + + + """ + ... + def hasIntercept(self) -> bool: + """ + A getter method which determines whether a constant is included. + + Specified by: + :meth:`~org.hipparchus.stat.regression.UpdatingMultipleLinearRegression.hasIntercept` in + interface :class:`~org.hipparchus.stat.regression.UpdatingMultipleLinearRegression` + + Returns: + true regression has an intercept, false no intercept + + + """ + ... @typing.overload def regress(self) -> RegressionResults: ... @typing.overload @@ -81,66 +605,662 @@ class MillerUpdatingRegression(UpdatingMultipleLinearRegression): def regress(self, intArray: typing.Union[typing.List[int], jpype.JArray]) -> RegressionResults: ... class SimpleRegression(java.io.Serializable, UpdatingMultipleLinearRegression): + """ + public classSimpleRegression extends :class:`~org.hipparchus.stat.regression.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.stat.regression.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable`, :class:`~org.hipparchus.stat.regression.UpdatingMultipleLinearRegression` + + Estimates an ordinary least squares regression model with one independent variable. + + :code:`y = intercept + slope * x` + + Standard errors for :code:`intercept` and :code:`slope` are available as well as ANOVA, r-square and Pearson's r + statistics. + + Observations (x,y pairs) can be added to the model one at a time or they can be provided in a 2-dimensional array. The + observations are not stored in memory, so there is no limit to the number of observations that can be added to the + model. + + * **Usage Notes**: + + - When there are fewer than two observations in the model, or when there is no variation in the x values (i.e. all x + values are the same) all statistics return :code:`NaN`. At least two observations with different x coordinates are + required to estimate a bivariate regression model. + - Getters for the statistics always compute values based on the current set of observations -- i.e., you can get + statistics, then add more data and get updated statistics without using a new instance. There is no "compute" method + that updates all statistics. Each of the getters performs the necessary computations to return the requested statistic. + - The intercept term may be suppressed by passing :code:`false` to the + :meth:`~org.hipparchus.stat.regression.SimpleRegression.%3Cinit%3E` constructor. When the :code:`hasIntercept` property + is false, the model is estimated without a constant term and + :meth:`~org.hipparchus.stat.regression.SimpleRegression.getIntercept` returns :code:`0`. + + + Also see: + + - :meth:`~serialized` + """ @typing.overload def __init__(self): ... @typing.overload def __init__(self, boolean: bool): ... @typing.overload - def addData(self, double: float, double2: float) -> None: ... + def addData(self, double: float, double2: float) -> None: + """ + Adds the observation (x,y) to the regression data set. + + Uses updating formulas for means and sums of squares defined in "Algorithms for Computing the Sample Variance: Analysis + and Recommendations", Chan, T.F., Golub, G.H., and LeVeque, R.J. 1983, American Statistician, vol. 37, pp. 242-247, + referenced in Weisberg, S. "Applied Linear Regression". 2nd Ed. 1985. + + Parameters: + x (double): independent variable value + y (double): dependent variable value + + public void addData(double[][] data) throws :class:`~org.hipparchus.stat.regression.https:.www.hipparchus.org.hipparchus` + + Adds the observations represented by the elements in :code:`data`. + + :code:`(data[0][0],data[0][1])` will be the first observation, then :code:`(data[1][0],data[1][1])`, etc. + + This method does not replace data that has already been added. The observations represented by :code:`data` are added to + the existing dataset. + + To replace all data, use :code:`clear()` before adding the new data. + + Parameters: + data (double[][]): array of observations to be added + + Raises: + :class:`~org.hipparchus.stat.regression.https:.www.hipparchus.org.hipparchus`: if the length of :code:`data[i]` is not greater than or equal to 2 + + + """ + ... @typing.overload def addData(self, doubleArray: typing.Union[typing.List[typing.MutableSequence[float]], jpype.JArray]) -> None: ... def addObservation(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], double2: float) -> None: ... def addObservations(self, doubleArray: typing.Union[typing.List[typing.MutableSequence[float]], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray]) -> None: ... - def append(self, simpleRegression: 'SimpleRegression') -> None: ... - def clear(self) -> None: ... - def getIntercept(self) -> float: ... - def getInterceptStdErr(self) -> float: ... - def getMeanSquareError(self) -> float: ... - def getN(self) -> int: ... - def getR(self) -> float: ... - def getRSquare(self) -> float: ... - def getRegressionSumSquares(self) -> float: ... - def getSignificance(self) -> float: ... - def getSlope(self) -> float: ... + def append(self, simpleRegression: 'SimpleRegression') -> None: + """ + Appends data from another regression calculation to this one. + + The mean update formulae are based on a paper written by Philippe Pébay: ` Formulas for Robust, One-Pass Parallel + Computation of Covariances and Arbitrary-Order Statistical Moments + <http://prod.sandia.gov/techlib/access-control.cgi/2008/086212.pdf>`, 2008, Technical Report SAND2008-6212, Sandia + National Laboratories. + + Parameters: + reg (:class:`~org.hipparchus.stat.regression.SimpleRegression`): model to append data from + + + """ + ... + def clear(self) -> None: + """ + Clears all data from the model. + + Specified by: + :meth:`~org.hipparchus.stat.regression.UpdatingMultipleLinearRegression.clear` in + interface :class:`~org.hipparchus.stat.regression.UpdatingMultipleLinearRegression` + + + """ + ... + def getIntercept(self) -> float: + """ + Returns the intercept of the estimated regression line, if + :meth:`~org.hipparchus.stat.regression.SimpleRegression.hasIntercept` is true; otherwise 0. + + The least squares estimate of the intercept is computed using the `normal equations + <http://www.xycoon.com/estimation4.htm>`. The intercept is sometimes denoted b0. + + **Preconditions**: + + - At least two observations (with at least two different x values) must have been added before invoking this method. If + this method is invoked before a model can be estimated, :code:`Double,NaN` is returned. + + + Returns: + the intercept of the regression line if the model includes an intercept; 0 otherwise + + Also see: + + - :meth:`~org.hipparchus.stat.regression.SimpleRegression.%3Cinit%3E` + + + + """ + ... + def getInterceptStdErr(self) -> float: + """ + Returns the ` standard error of the intercept estimate <http://www.xycoon.com/standarderrorb0.htm>`, usually denoted + s(b0). + + If there are fewer that **three** observations in the model, or if there is no variation in x, this returns + :code:`Double.NaN`. + Additionally, a :code:`Double.NaN` is returned when the intercept is constrained to be zero + + Returns: + standard error associated with intercept estimate + + + """ + ... + def getMeanSquareError(self) -> float: + """ + Returns the sum of squared errors divided by the degrees of freedom, usually abbreviated MSE. + + If there are fewer than **three** data pairs in the model, or if there is no variation in :code:`x`, this returns + :code:`Double.NaN`. + + Returns: + sum of squared deviations of y values + + + """ + ... + def getN(self) -> int: + """ + Returns the number of observations that have been added to the model. + + Specified by: + :meth:`~org.hipparchus.stat.regression.UpdatingMultipleLinearRegression.getN` in + interface :class:`~org.hipparchus.stat.regression.UpdatingMultipleLinearRegression` + + Returns: + n number of observations that have been added. + + + """ + ... + def getR(self) -> float: + """ + Returns ` Pearson's product moment correlation coefficient <http://mathworld.wolfram.com/CorrelationCoefficient.html>`, + usually denoted r. + + * **Preconditions**: + + - At least two observations (with at least two different x values) must have been added before invoking this method. If + this method is invoked before a model can be estimated, :code:`Double,NaN` is returned. + + + Returns: + Pearson's r + + + """ + ... + def getRSquare(self) -> float: + """ + Returns the ` coefficient of determination <http://www.xycoon.com/coefficient1.htm>`, usually denoted r-square. + + * **Preconditions**: + + - At least two observations (with at least two different x values) must have been added before invoking this method. If + this method is invoked before a model can be estimated, :code:`Double,NaN` is returned. + + + Returns: + r-square + + + """ + ... + def getRegressionSumSquares(self) -> float: + """ + Returns the sum of squared deviations of the predicted y values about their mean (which equals the mean of y). + + This is usually abbreviated SSR or SSM. It is defined as SSM `here <http://www.xycoon.com/SumOfSquares.htm>` + + * **Preconditions**: + + - At least two observations (with at least two different x values) must have been added before invoking this method. If + this method is invoked before a model can be estimated, :code:`Double.NaN` is returned. + + + Returns: + sum of squared deviations of predicted y values + + + """ + ... + def getSignificance(self) -> float: + """ + Returns the significance level of the slope (equiv) correlation. + + Specifically, the returned value is the smallest :code:`alpha` such that the slope confidence interval with significance + level equal to :code:`alpha` does not include :code:`0`. On regression output, this is often denoted :code:`Prob(|t| > + 0)` + + **Usage Note**: + + + The validity of this statistic depends on the assumption that the observations included in the model are drawn from a ` + Bivariate Normal Distribution <http://mathworld.wolfram.com/BivariateNormalDistribution.html>`. + + If there are fewer that **three** observations in the model, or if there is no variation in x, this returns + :code:`Double.NaN`. + + Returns: + significance level for slope/correlation + + Raises: + :class:`~org.hipparchus.stat.regression.https:.www.hipparchus.org.hipparchus`: if the significance level can not be computed. + + + """ + ... + def getSlope(self) -> float: + """ + Returns the slope of the estimated regression line. + + The least squares estimate of the slope is computed using the `normal equations + <http://www.xycoon.com/estimation4.htm>`. The slope is sometimes denoted b1. + + * **Preconditions**: + + - At least two observations (with at least two different x values) must have been added before invoking this method. If + this method is invoked before a model can be estimated, :code:`Double.NaN` is returned. + + + Returns: + the slope of the regression line + + + """ + ... @typing.overload def getSlopeConfidenceInterval(self) -> float: ... @typing.overload def getSlopeConfidenceInterval(self, double: float) -> float: ... - def getSlopeStdErr(self) -> float: ... - def getSumOfCrossProducts(self) -> float: ... - def getSumSquaredErrors(self) -> float: ... - def getTotalSumSquares(self) -> float: ... - def getXSumSquares(self) -> float: ... - def hasIntercept(self) -> bool: ... - def predict(self, double: float) -> float: ... + def getSlopeStdErr(self) -> float: + """ + Returns the `standard error of the slope estimate <http://www.xycoon.com/standerrorb(1).htm>`, usually denoted s(b1). + + If there are fewer that **three** data pairs in the model, or if there is no variation in x, this returns + :code:`Double.NaN`. + + Returns: + standard error associated with slope estimate + + + """ + ... + def getSumOfCrossProducts(self) -> float: + """ + Returns the sum of crossproducts, x :sub:`i` *y :sub:`i` . + + Returns: + sum of cross products + + + """ + ... + def getSumSquaredErrors(self) -> float: + """ + Returns the ` sum of squared errors <http://www.xycoon.com/SumOfSquares.htm>` (SSE) associated with the regression + model. + + The sum is computed using the computational formula + + :code:`SSE = SYY - (SXY * SXY / SXX)` + + where :code:`SYY` is the sum of the squared deviations of the y values about their mean, :code:`SXX` is similarly + defined and :code:`SXY` is the sum of the products of x and y mean deviations. + + The sums are accumulated using the updating algorithm referenced in + :meth:`~org.hipparchus.stat.regression.SimpleRegression.addData`. + + The return value is constrained to be non-negative - i.e., if due to rounding errors the computational formula returns a + negative result, 0 is returned. + + * **Preconditions**: + + - At least two observations (with at least two different x values) must have been added before invoking this method. If + this method is invoked before a model can be estimated, :code:`Double,NaN` is returned. + + + Returns: + sum of squared errors associated with the regression model + + + """ + ... + def getTotalSumSquares(self) -> float: + """ + Returns the sum of squared deviations of the y values about their mean. + + This is defined as SSTO `here <http://www.xycoon.com/SumOfSquares.htm>`. + + If :code:`n < 2`, this returns :code:`Double.NaN`. + + Returns: + sum of squared deviations of y values + + + """ + ... + def getXSumSquares(self) -> float: + """ + Returns the sum of squared deviations of the x values about their mean. + + If :code:`n < 2`, this returns :code:`Double.NaN`. + + Returns: + sum of squared deviations of x values + + + """ + ... + def hasIntercept(self) -> bool: + """ + Returns true if the model includes an intercept term. + + Specified by: + :meth:`~org.hipparchus.stat.regression.UpdatingMultipleLinearRegression.hasIntercept` in + interface :class:`~org.hipparchus.stat.regression.UpdatingMultipleLinearRegression` + + Returns: + true if the regression includes an intercept; false otherwise + + Also see: + + - :meth:`~org.hipparchus.stat.regression.SimpleRegression.%3Cinit%3E` + + + + """ + ... + def predict(self, double: float) -> float: + """ + Returns the "predicted" :code:`y` value associated with the supplied :code:`x` value, based on the data that has been + added to the model when this method is activated. + + :code:`predict(x) = intercept + slope * x` + + * **Preconditions**: + + - At least two observations (with at least two different x values) must have been added before invoking this method. If + this method is invoked before a model can be estimated, :code:`Double,NaN` is returned. + + + Parameters: + x (double): input :code:`x` value + + Returns: + predicted :code:`y` value + + + """ + ... @typing.overload def regress(self) -> RegressionResults: ... @typing.overload def regress(self, intArray: typing.Union[typing.List[int], jpype.JArray]) -> RegressionResults: ... @typing.overload - def removeData(self, double: float, double2: float) -> None: ... + def removeData(self, double: float, double2: float) -> None: + """ + Removes the observation (x,y) from the regression data set. + + Mirrors the addData method. This method permits the use of SimpleRegression instances in streaming mode where the + regression is applied to a sliding "window" of observations, however the caller is responsible for maintaining the set + of observations in the window. + The method has no effect if there are no points of data (i.e. n=0) + + Parameters: + x (double): independent variable value + y (double): dependent variable value + + """ + ... @typing.overload - def removeData(self, doubleArray: typing.Union[typing.List[typing.MutableSequence[float]], jpype.JArray]) -> None: ... + def removeData(self, doubleArray: typing.Union[typing.List[typing.MutableSequence[float]], jpype.JArray]) -> None: + """ + Removes observations represented by the elements in :code:`data`. + + If the array is larger than the current n, only the first n elements are processed. This method permits the use of + SimpleRegression instances in streaming mode where the regression is applied to a sliding "window" of observations, + however the caller is responsible for maintaining the set of observations in the window. + + To remove all data, use :code:`clear()`. + + Parameters: + data (double[][]): array of observations to be removed + + + """ + ... class GLSMultipleLinearRegression(AbstractMultipleLinearRegression): + """ + public classGLSMultipleLinearRegression extends :class:`~org.hipparchus.stat.regression.AbstractMultipleLinearRegression` + + The GLS implementation of multiple linear regression. GLS assumes a general covariance matrix Omega of the error + + .. code-block: java + + u ~ N(0, Omega) + + Estimated by GLS, + + .. code-block: java + + b=(X' Omega^-1 X)^-1X'Omega^-1 y + + whose variance is + + .. code-block: java + + Var(b)=(X' Omega^-1 X)^-1 + """ def __init__(self): ... @typing.overload - def newSampleData(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, int2: int) -> None: ... + def newSampleData(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, int2: int) -> None: + """ + Replace sample data, overriding any previous sample. + + Parameters: + y (double[]): y values of the sample + x (double[][]): x values of the sample + covariance (double[][]): array representing the covariance matrix + + + """ + ... @typing.overload def newSampleData(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[typing.MutableSequence[float]], jpype.JArray], doubleArray3: typing.Union[typing.List[typing.MutableSequence[float]], jpype.JArray]) -> None: ... class OLSMultipleLinearRegression(AbstractMultipleLinearRegression): + """ + public classOLSMultipleLinearRegression extends :class:`~org.hipparchus.stat.regression.AbstractMultipleLinearRegression` + + + Implements ordinary least squares (OLS) to estimate the parameters of a multiple linear regression model. + + The regression coefficients, :code:`b`, satisfy the normal equations: + + .. code-block: java + + X :sup:`T` X b = X :sup:`T` y + + To solve the normal equations, this implementation uses QR decomposition of the :code:`X` matrix. (See + :class:`~org.hipparchus.stat.regression.https:.www.hipparchus.org.hipparchus` for details on the decomposition + algorithm.) The :code:`X` matrix, also known as the *design matrix,* has rows corresponding to sample observations and + columns corresponding to independent variables. When the model is estimated using an intercept term (i.e. when + :meth:`~org.hipparchus.stat.regression.AbstractMultipleLinearRegression.isNoIntercept` is false as it is by default), + the :code:`X` matrix includes an initial column identically equal to 1. We solve the normal equations as follows: + + .. code-block: java + + X :sup:`T` X b = X :sup:`T` y + (QR) :sup:`T` (QR) b = (QR) :sup:`T` y + R :sup:`T` (Q :sup:`T` Q) R b = R :sup:`T` Q :sup:`T` y + R :sup:`T` R b = R :sup:`T` Q :sup:`T` y + (R :sup:`T` ) :sup:`-1` R :sup:`T` R b = (R :sup:`T` ) :sup:`-1` R :sup:`T` Q :sup:`T` y + R b = Q :sup:`T` y + + Given :code:`Q` and :code:`R`, the last equation is solved by back-substitution. + """ @typing.overload def __init__(self): ... @typing.overload def __init__(self, double: float): ... - def calculateAdjustedRSquared(self) -> float: ... - def calculateHat(self) -> org.hipparchus.linear.RealMatrix: ... - def calculateRSquared(self) -> float: ... - def calculateResidualSumOfSquares(self) -> float: ... - def calculateTotalSumOfSquares(self) -> float: ... + def calculateAdjustedRSquared(self) -> float: + """ + + Returns the adjusted R-squared statistic, defined by the formula \(R_\mathrm{adj}^2 = 1 - \frac{\mathrm{SSR} (n - + 1)}{\mathrm{SSTO} (n - p)}\) where SSR is the + :meth:`~org.hipparchus.stat.regression.OLSMultipleLinearRegression.calculateResidualSumOfSquares`, SSTO is the + :meth:`~org.hipparchus.stat.regression.OLSMultipleLinearRegression.calculateTotalSumOfSquares`, n is the number of + observations and p is the number of parameters estimated (including the intercept). + + If the regression is estimated without an intercept term, what is returned is + + .. code-block: java + + :meth:`~org.hipparchus.stat.regression.OLSMultipleLinearRegression.calculateRSquared` + + + If there is no variance in y, i.e., SSTO = 0, NaN is returned. + + Returns: + adjusted R-Squared statistic + + Raises: + :class:`~org.hipparchus.stat.regression.https:.docs.oracle.com.javase.8.docs.api.java.lang.NullPointerException`: if the sample has not been set + :class:`~org.hipparchus.stat.regression.https:.www.hipparchus.org.hipparchus`: if the design matrix is singular + + Also see: + + - :meth:`~org.hipparchus.stat.regression.AbstractMultipleLinearRegression.isNoIntercept` + + + + """ + ... + def calculateHat(self) -> org.hipparchus.linear.RealMatrix: + """ + + Compute the "hat" matrix. + + The hat matrix is defined in terms of the design matrix X by X(X :sup:`T` X) :sup:`-1` X :sup:`T` + + The implementation here uses the QR decomposition to compute the hat matrix as Q I :sub:`p` Q :sup:`T` where I :sub:`p` + is the p-dimensional identity matrix augmented by 0's. This computational formula is from "The Hat Matrix in Regression + and ANOVA", David C. Hoaglin and Roy E. Welsch, *The American Statistician*, Vol. 32, No. 1 (Feb., 1978), pp. 17-22. + + Data for the model must have been successfully loaded using one of the :code:`newSampleData` methods before invoking + this method; otherwise a :code:`NullPointerException` will be thrown. + + Returns: + the hat matrix + + Raises: + :class:`~org.hipparchus.stat.regression.https:.docs.oracle.com.javase.8.docs.api.java.lang.NullPointerException`: unless method :code:`newSampleData` has been called beforehand. + + + """ + ... + def calculateRSquared(self) -> float: + """ + Returns the R-Squared statistic, defined by the formula \(R^2 = 1 - \frac{\mathrm{SSR}}{\mathrm{SSTO}}\) where SSR is + the :meth:`~org.hipparchus.stat.regression.OLSMultipleLinearRegression.calculateResidualSumOfSquares` and SSTO is the + :meth:`~org.hipparchus.stat.regression.OLSMultipleLinearRegression.calculateTotalSumOfSquares` + + If there is no variance in y, i.e., SSTO = 0, NaN is returned. + + Returns: + R-square statistic + + Raises: + :class:`~org.hipparchus.stat.regression.https:.docs.oracle.com.javase.8.docs.api.java.lang.NullPointerException`: if the sample has not been set + :class:`~org.hipparchus.stat.regression.https:.www.hipparchus.org.hipparchus`: if the design matrix is singular + + + """ + ... + def calculateResidualSumOfSquares(self) -> float: + """ + Returns the sum of squared residuals. + + Returns: + residual sum of squares + + Raises: + :class:`~org.hipparchus.stat.regression.https:.www.hipparchus.org.hipparchus`: if the design matrix is singular + :class:`~org.hipparchus.stat.regression.https:.docs.oracle.com.javase.8.docs.api.java.lang.NullPointerException`: if the data for the model have not been loaded + + + """ + ... + def calculateTotalSumOfSquares(self) -> float: + """ + + Returns the sum of squared deviations of Y from its mean. + + If the model has no intercept term, :code:`0` is used for the mean of Y - i.e., what is returned is the sum of the + squared Y values. + + The value returned by this method is the SSTO value used in the + :meth:`~org.hipparchus.stat.regression.OLSMultipleLinearRegression.calculateRSquared` computation. + + Returns: + SSTO - the total sum of squares + + Raises: + :class:`~org.hipparchus.stat.regression.https:.docs.oracle.com.javase.8.docs.api.java.lang.NullPointerException`: if the sample has not been set + + Also see: + + - :meth:`~org.hipparchus.stat.regression.AbstractMultipleLinearRegression.isNoIntercept` + + + + """ + ... @typing.overload - def newSampleData(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[typing.MutableSequence[float]], jpype.JArray]) -> None: ... + def newSampleData(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[typing.MutableSequence[float]], jpype.JArray]) -> None: + """ + + Loads model x and y sample data from a flat input array, overriding any previous sample. + + Assumes that rows are concatenated with y values first in each row. For example, an input :code:`data` array containing + the sequence of values (1, 2, 3, 4, 5, 6, 7, 8, 9) with :code:`nobs = 3` and :code:`nvars = 2` creates a regression + dataset with two independent variables, as below: + + .. code-block: java + + y x[0] x[1] + -------------- + 1 2 3 + 4 5 6 + 7 8 9 + + + Note that there is no need to add an initial unitary column (column of 1's) when specifying a model including an + intercept term. If :meth:`~org.hipparchus.stat.regression.AbstractMultipleLinearRegression.isNoIntercept` is + :code:`true`, the X matrix will be created without an initial column of "1"s; otherwise this column will be added. + + Throws IllegalArgumentException if any of the following preconditions fail: + + - :code:`data` cannot be null + - :code:`data.length = nobs * (nvars + 1)` + - :code:`nobs > nvars` + + + This implementation computes and caches the QR decomposition of the X matrix. + + Overrides: + :meth:`~org.hipparchus.stat.regression.AbstractMultipleLinearRegression.newSampleData` in + class :class:`~org.hipparchus.stat.regression.AbstractMultipleLinearRegression` + + Parameters: + data (double[]): input data array + nobs (int): number of observations (rows) + nvars (int): number of independent variables (columns, not counting y) + + + """ + ... @typing.overload def newSampleData(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, int2: int) -> None: ... diff --git a/org-stubs/hipparchus/util/__init__.pyi b/org-stubs/hipparchus/util/__init__.pyi index 3044deb..bbac738 100644 --- a/org-stubs/hipparchus/util/__init__.pyi +++ b/org-stubs/hipparchus/util/__init__.pyi @@ -23,14 +23,67 @@ import typing class AbstractOpenIntHashMap: - @typing.overload - def containsKey(self, int: int) -> bool: ... + """ + public abstract classAbstractOpenIntHashMap extends :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Base class for open addressed map from int. + + Since: + 3.1 + """ + @typing.overload + def containsKey(self, int: int) -> bool: + """ + Check if a value is associated with a key. + + Parameters: + key (int): key to check + + Returns: + true if a value is associated with key + + Check if the tables contain an element associated with specified key at specified index. + + Parameters: + key (int): key to check + index (int): index to check + + Returns: + true if an element is associated with key at index + + + """ + ... @typing.overload def containsKey(self, int: int, int2: int) -> bool: ... - def getSize(self) -> int: ... - def size(self) -> int: ... + def getSize(self) -> int: + """ + Get the number of elements stored in the map. + + Returns: + number of elements stored in the map + + + """ + ... + def size(self) -> int: + """ + Get the number of elements stored in the map. + + Returns: + number of elements stored in the map + + + """ + ... class ArithmeticUtils: + """ + public final classArithmeticUtils extends :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Some useful, arithmetics related, additions to the built-in functions in + :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Math`. + """ @typing.overload @staticmethod def addAndCheck(int: int, int2: int) -> int: ... @@ -39,7 +92,43 @@ class ArithmeticUtils: def addAndCheck(long: int, long2: int) -> int: ... @typing.overload @staticmethod - def divideUnsigned(int: int, int2: int) -> int: ... + def divideUnsigned(int: int, int2: int) -> int: + """ + Returns the unsigned quotient of dividing the first argument by the second where each argument and the result is + interpreted as an unsigned value. + + Note that in two's complement arithmetic, the three other basic arithmetic operations of add, subtract, and multiply are + bit-wise identical if the two operands are regarded as both being signed or both being unsigned. Therefore separate + :code:`addUnsigned`, etc. methods are not provided. + + This method does not use the :code:`long` datatype. + + Parameters: + dividend (int): the value to be divided + divisor (int): the value doing the dividing + + Returns: + the unsigned quotient of the first argument divided by the second argument + + Returns the unsigned quotient of dividing the first argument by the second where each argument and the result is + interpreted as an unsigned value. + + Note that in two's complement arithmetic, the three other basic arithmetic operations of add, subtract, and multiply are + bit-wise identical if the two operands are regarded as both being signed or both being unsigned. Therefore separate + :code:`addUnsigned`, etc. methods are not provided. + + This method does not use the :code:`BigInteger` datatype. + + Parameters: + dividend (long): the value to be divided + divisor (long): the value doing the dividing + + Returns: + the unsigned quotient of the first argument divided by the second argument. + + + """ + ... @typing.overload @staticmethod def divideUnsigned(long: int, long2: int) -> int: ... @@ -50,7 +139,19 @@ class ArithmeticUtils: @staticmethod def gcd(long: int, long2: int) -> int: ... @staticmethod - def isPowerOfTwo(long: int) -> bool: ... + def isPowerOfTwo(long: int) -> bool: + """ + Returns true if the argument is a power of two. + + Parameters: + n (long): the number to test + + Returns: + true if the argument is a power of two + + + """ + ... @typing.overload @staticmethod def lcm(int: int, int2: int) -> int: ... @@ -80,7 +181,35 @@ class ArithmeticUtils: def pow(long: int, int: int) -> int: ... @typing.overload @staticmethod - def remainderUnsigned(int: int, int2: int) -> int: ... + def remainderUnsigned(int: int, int2: int) -> int: + """ + Returns the unsigned remainder from dividing the first argument by the second where each argument and the result is + interpreted as an unsigned value. + + This method does not use the :code:`long` datatype. + + Parameters: + dividend (int): the value to be divided + divisor (int): the value doing the dividing + + Returns: + the unsigned remainder of the first argument divided by the second argument. + + Returns the unsigned remainder from dividing the first argument by the second where each argument and the result is + interpreted as an unsigned value. + + This method does not use the :code:`BigInteger` datatype. + + Parameters: + dividend (long): the value to be divided + divisor (long): the value doing the dividing + + Returns: + the unsigned remainder of the first argument divided by the second argument. + + + """ + ... @typing.overload @staticmethod def remainderUnsigned(long: int, long2: int) -> int: ... @@ -92,8 +221,33 @@ class ArithmeticUtils: def subAndCheck(long: int, long2: int) -> int: ... class BigReal(org.hipparchus.FieldElement['BigReal'], java.lang.Comparable['BigReal'], java.io.Serializable): + """ + public classBigReal extends :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.FieldElement`<:class:`~org.hipparchus.util.BigReal`>, :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Comparable`<:class:`~org.hipparchus.util.BigReal`>, :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + Arbitrary precision decimal number. + + This class is a simple wrapper around the standard :code:`BigDecimal` in order to implement the + :class:`~org.hipparchus.FieldElement` interface. + + Also see: + + - :meth:`~serialized` + """ ZERO: typing.ClassVar['BigReal'] = ... + """ + public static final :class:`~org.hipparchus.util.BigReal` ZERO + + A big real representing 0. + + """ ONE: typing.ClassVar['BigReal'] = ... + """ + public static final :class:`~org.hipparchus.util.BigReal` ONE + + A big real representing 1. + + """ @typing.overload def __init__(self, charArray: typing.Union[typing.List[str], jpype.JArray]): ... @typing.overload @@ -128,87 +282,958 @@ class BigReal(org.hipparchus.FieldElement['BigReal'], java.lang.Comparable['BigR def __init__(self, long: int): ... @typing.overload def __init__(self, long: int, mathContext: java.math.MathContext): ... - def add(self, bigReal: 'BigReal') -> 'BigReal': ... - def bigDecimalValue(self) -> java.math.BigDecimal: ... - def compareTo(self, bigReal: 'BigReal') -> int: ... + def add(self, bigReal: 'BigReal') -> 'BigReal': + """ + Compute this + a. + + Specified by: + :meth:`~org.hipparchus.FieldElement.add` in interface :class:`~org.hipparchus.FieldElement` + + Parameters: + a (:class:`~org.hipparchus.util.BigReal`): element to add + + Returns: + a new element representing this + a + + + """ + ... + def bigDecimalValue(self) -> java.math.BigDecimal: + """ + Get the BigDecimal value corresponding to the instance. + + Returns: + BigDecimal value corresponding to the instance + + + """ + ... + def compareTo(self, bigReal: 'BigReal') -> int: + """ + + Specified by: + :meth:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Comparable.compareTo` in + interface :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Comparable` + + + """ + ... def divide(self, bigReal: 'BigReal') -> 'BigReal': ... - def doubleValue(self) -> float: ... - def equals(self, object: typing.Any) -> bool: ... + def doubleValue(self) -> float: + """ + Get the double value corresponding to the instance. + + Returns: + double value corresponding to the instance + + + """ + ... + def equals(self, object: typing.Any) -> bool: + """ + + Overrides: + :meth:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.equals` in + class :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + + """ + ... def getField(self) -> org.hipparchus.Field['BigReal']: ... - def getReal(self) -> float: ... - def getRoundingMode(self) -> java.math.RoundingMode: ... - def getScale(self) -> int: ... - def hashCode(self) -> int: ... - @typing.overload - def multiply(self, int: int) -> 'BigReal': ... + def getReal(self) -> float: + """ + Get the real value of the number. + + Specified by: + :meth:`~org.hipparchus.FieldElement.getReal` in interface :class:`~org.hipparchus.FieldElement` + + Returns: + real value + + + """ + ... + def getRoundingMode(self) -> java.math.RoundingMode: + """ + Gets the rounding mode for division operations The default is :code:`RoundingMode.HALF_UP` + + Returns: + the rounding mode. + + + """ + ... + def getScale(self) -> int: + """ + Sets the scale for division operations. The default is 64 + + Returns: + the scale + + + """ + ... + def hashCode(self) -> int: + """ + + Overrides: + :meth:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.hashCode` in + class :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + + """ + ... + @typing.overload + def multiply(self, int: int) -> 'BigReal': + """ + Compute this × a. + + Specified by: + :meth:`~org.hipparchus.FieldElement.multiply` in interface :class:`~org.hipparchus.FieldElement` + + Parameters: + a (:class:`~org.hipparchus.util.BigReal`): element to multiply + + Returns: + a new element representing this × a + + Compute n × this. Multiplication by an integer number is defined as the following sum \[ n \times \mathrm{this} = + \sum_{i=1}^n \mathrm{this} \] + + Specified by: + :meth:`~org.hipparchus.FieldElement.multiply` in interface :class:`~org.hipparchus.FieldElement` + + Parameters: + n (int): Number of times :code:`this` must be added to itself. + + Returns: + A new element representing n × this. + + + """ + ... @typing.overload def multiply(self, bigReal: 'BigReal') -> 'BigReal': ... - def negate(self) -> 'BigReal': ... + def negate(self) -> 'BigReal': + """ + Returns the additive inverse of :code:`this` element. + + Specified by: + :meth:`~org.hipparchus.FieldElement.negate` in interface :class:`~org.hipparchus.FieldElement` + + Returns: + the opposite of :code:`this`. + + + """ + ... def reciprocal(self) -> 'BigReal': ... - def setRoundingMode(self, roundingMode: java.math.RoundingMode) -> None: ... - def setScale(self, int: int) -> None: ... - def subtract(self, bigReal: 'BigReal') -> 'BigReal': ... + def setRoundingMode(self, roundingMode: java.math.RoundingMode) -> None: + """ + Sets the rounding mode for decimal divisions. + + Parameters: + roundingMode (:class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.math.RoundingMode`): rounding mode for decimal divisions + + + """ + ... + def setScale(self, int: int) -> None: + """ + Sets the scale for division operations. + + Parameters: + scale (int): scale for division operations + + + """ + ... + def subtract(self, bigReal: 'BigReal') -> 'BigReal': + """ + Compute this - a. + + Specified by: + :meth:`~org.hipparchus.FieldElement.subtract` in interface :class:`~org.hipparchus.FieldElement` + + Parameters: + a (:class:`~org.hipparchus.util.BigReal`): element to subtract + + Returns: + a new element representing this - a + + + """ + ... class BigRealField(org.hipparchus.Field[BigReal], java.io.Serializable): - def equals(self, object: typing.Any) -> bool: ... - @staticmethod - def getInstance() -> 'BigRealField': ... - def getOne(self) -> BigReal: ... + """ + public classBigRealField extends :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.Field`<:class:`~org.hipparchus.util.BigReal`>, :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + Representation of real numbers with arbitrary precision field. + + This class is a singleton. + + Also see: + + - :class:`~org.hipparchus.util.BigReal` + - :meth:`~serialized` + """ + def equals(self, object: typing.Any) -> bool: + """ + + Overrides: + :meth:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.equals` in + class :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + + """ + ... + @staticmethod + def getInstance() -> 'BigRealField': + """ + Get the unique instance. + + Returns: + the unique instance + + + """ + ... + def getOne(self) -> BigReal: + """ + Get the multiplicative identity of the field. + + The multiplicative identity is the element e :sub:`1` of the field such that for all elements a of the field, the + equalities a × e :sub:`1` = e :sub:`1` × a = a hold. + + Specified by: + :meth:`~org.hipparchus.Field.getOne` in interface :class:`~org.hipparchus.Field` + + Returns: + multiplicative identity of the field + + + """ + ... def getRuntimeClass(self) -> typing.Type[BigReal]: ... - def getZero(self) -> BigReal: ... - def hashCode(self) -> int: ... + def getZero(self) -> BigReal: + """ + Get the additive identity of the field. + + The additive identity is the element e :sub:`0` of the field such that for all elements a of the field, the equalities a + + e :sub:`0` = e :sub:`0` + a = a hold. + + Specified by: + :meth:`~org.hipparchus.Field.getZero` in interface :class:`~org.hipparchus.Field` + + Returns: + additive identity of the field + + + """ + ... + def hashCode(self) -> int: + """ + + Overrides: + :meth:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.hashCode` in + class :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + + """ + ... class Binary64(java.lang.Number, org.hipparchus.CalculusFieldElement['Binary64'], java.lang.Comparable['Binary64']): + """ + public classBinary64 extends :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Number` + implements :class:`~org.hipparchus.CalculusFieldElement`<:class:`~org.hipparchus.util.Binary64`>, :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Comparable`<:class:`~org.hipparchus.util.Binary64`> + + This class wraps a :code:`double` value in an object. It is similar to the standard class + :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Double`, while also implementing the + :class:`~org.hipparchus.CalculusFieldElement` interface. + + Also see: + + - :meth:`~serialized` + """ ZERO: typing.ClassVar['Binary64'] = ... + """ + public static final :class:`~org.hipparchus.util.Binary64` ZERO + + The constant value of :code:`0d` as a :code:`Binary64`. + + """ ONE: typing.ClassVar['Binary64'] = ... + """ + public static final :class:`~org.hipparchus.util.Binary64` ONE + + The constant value of :code:`1d` as a :code:`Binary64`. + + """ PI: typing.ClassVar['Binary64'] = ... + """ + public static final :class:`~org.hipparchus.util.Binary64` PI + + The constant value of Ï€ as a :code:`Binary64`. + + """ NEGATIVE_INFINITY: typing.ClassVar['Binary64'] = ... + """ + public static final :class:`~org.hipparchus.util.Binary64` NEGATIVE_INFINITY + + The constant value of + :meth:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Double.NEGATIVE_INFINITY` as a + :code:`Binary64`. + + """ POSITIVE_INFINITY: typing.ClassVar['Binary64'] = ... + """ + public static final :class:`~org.hipparchus.util.Binary64` POSITIVE_INFINITY + + The constant value of + :meth:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Double.POSITIVE_INFINITY` as a + :code:`Binary64`. + + """ NAN: typing.ClassVar['Binary64'] = ... + """ + public static final :class:`~org.hipparchus.util.Binary64` NAN + + The constant value of :meth:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Double.NaN` as a + :code:`Binary64`. + + """ def __init__(self, double: float): ... - def abs(self) -> 'Binary64': ... - def acos(self) -> 'Binary64': ... - def acosh(self) -> 'Binary64': ... - @typing.overload - def add(self, double: float) -> 'Binary64': ... + def abs(self) -> 'Binary64': + """ + absolute value. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.abs` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + abs(this) + + + """ + ... + def acos(self) -> 'Binary64': + """ + Arc cosine operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.acos` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + acos(this) + + + """ + ... + def acosh(self) -> 'Binary64': + """ + Inverse hyperbolic cosine operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.acosh` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + acosh(this) + + + """ + ... + @typing.overload + def add(self, double: float) -> 'Binary64': + """ + Compute this + a. The current implementation strictly enforces :code:`this.add(a).equals(new Binary64(this.doubleValue() + + a.doubleValue()))`. + + Specified by: + :meth:`~org.hipparchus.FieldElement.add` in interface :class:`~org.hipparchus.FieldElement` + + Parameters: + a (:class:`~org.hipparchus.util.Binary64`): element to add + + Returns: + a new element representing this + a + + '+' operator. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.add` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + a (double): right hand side parameter of the operator + + Returns: + this+a + + + """ + ... @typing.overload def add(self, binary64: 'Binary64') -> 'Binary64': ... - def asin(self) -> 'Binary64': ... - def asinh(self) -> 'Binary64': ... - def atan(self) -> 'Binary64': ... - def atan2(self, binary64: 'Binary64') -> 'Binary64': ... - def atanh(self) -> 'Binary64': ... - def byteValue(self) -> int: ... - def cbrt(self) -> 'Binary64': ... - def ceil(self) -> 'Binary64': ... - def compareTo(self, binary64: 'Binary64') -> int: ... - @typing.overload - def copySign(self, double: float) -> 'Binary64': ... + def asin(self) -> 'Binary64': + """ + Arc sine operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.asin` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + asin(this) + + + """ + ... + def asinh(self) -> 'Binary64': + """ + Inverse hyperbolic sine operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.asinh` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + asin(this) + + + """ + ... + def atan(self) -> 'Binary64': + """ + Arc tangent operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.atan` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + atan(this) + + + """ + ... + def atan2(self, binary64: 'Binary64') -> 'Binary64': + """ + Two arguments arc tangent operation. + + Beware of the order or arguments! As this is based on a two-arguments functions, in order to be consistent with + arguments order, the instance is the *first* argument and the single provided argument is the *second* argument. In + order to be consistent with programming languages :code:`atan2`, this method computes :code:`atan2(this, x)`, i.e. the + instance represents the :code:`y` argument and the :code:`x` argument is the one passed as a single argument. This may + seem confusing especially for users of Wolfram alpha, as this site is *not* consistent with programming languages + :code:`atan2` two-arguments arc tangent and puts :code:`x` as its first argument. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.atan2` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + x (:class:`~org.hipparchus.util.Binary64`): second argument of the arc tangent + + Returns: + + """ + ... + def atanh(self) -> 'Binary64': + """ + Inverse hyperbolic tangent operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.atanh` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + atanh(this) + + + """ + ... + def byteValue(self) -> int: + """ + The current implementation performs casting to a :code:`byte`. + + Overrides: + :meth:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Number.byteValue` in + class :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Number` + + + """ + ... + def cbrt(self) -> 'Binary64': + """ + Cubic root. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.cbrt` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + cubic root of the instance + + + """ + ... + def ceil(self) -> 'Binary64': + """ + Get the smallest whole number larger than instance. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.ceil` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + ceil(this) + + + """ + ... + def compareTo(self, binary64: 'Binary64') -> int: + """ + The current implementation returns the same value as :code:`new Double(this.doubleValue()).compareTo(new + Double(o.doubleValue()))` + + Specified by: + :meth:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Comparable.compareTo` in + interface :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Comparable` + + Also see: + + - :meth:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Double.compareTo` + + + + """ + ... + @typing.overload + def copySign(self, double: float) -> 'Binary64': + """ + Returns the instance with the sign of the argument. A NaN :code:`sign` argument is treated as positive. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.copySign` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + sign (:class:`~org.hipparchus.util.Binary64`): the sign for the returned value + + Returns: + the instance with the same sign as the :code:`sign` argument + + Returns the instance with the sign of the argument. A NaN :code:`sign` argument is treated as positive. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.copySign` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + sign (double): the sign for the returned value + + Returns: + the instance with the same sign as the :code:`sign` argument + + + """ + ... @typing.overload def copySign(self, binary64: 'Binary64') -> 'Binary64': ... - def cos(self) -> 'Binary64': ... - def cosh(self) -> 'Binary64': ... - @typing.overload - def divide(self, double: float) -> 'Binary64': ... + def cos(self) -> 'Binary64': + """ + Cosine operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.cos` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + cos(this) + + + """ + ... + def cosh(self) -> 'Binary64': + """ + Hyperbolic cosine operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.cosh` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + cosh(this) + + + """ + ... + @typing.overload + def divide(self, double: float) -> 'Binary64': + """ + Compute this ÷ a. The current implementation strictly enforces :code:`this.divide(a).equals(new + Binary64(this.doubleValue() / a.doubleValue()))`. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.divide` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Specified by: + :meth:`~org.hipparchus.FieldElement.divide` in interface :class:`~org.hipparchus.FieldElement` + + Parameters: + a (:class:`~org.hipparchus.util.Binary64`): element to divide by + + Returns: + a new element representing this ÷ a + + '÷' operator. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.divide` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + a (double): right hand side parameter of the operator + + Returns: + this÷a + + + """ + ... @typing.overload def divide(self, binary64: 'Binary64') -> 'Binary64': ... - def doubleValue(self) -> float: ... - def equals(self, object: typing.Any) -> bool: ... - def exp(self) -> 'Binary64': ... - def expm1(self) -> 'Binary64': ... - def floatValue(self) -> float: ... - def floor(self) -> 'Binary64': ... + def doubleValue(self) -> float: + """ + + Specified by: + :meth:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Number.doubleValue` in + class :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Number` + + + """ + ... + def equals(self, object: typing.Any) -> bool: + """ + + Overrides: + :meth:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.equals` in + class :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + + """ + ... + def exp(self) -> 'Binary64': + """ + Exponential. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.exp` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + exponential of the instance + + + """ + ... + def expm1(self) -> 'Binary64': + """ + Exponential minus 1. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.expm1` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + exponential minus one of the instance + + + """ + ... + def floatValue(self) -> float: + """ + The current implementation performs casting to a :code:`float`. + + Specified by: + :meth:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Number.floatValue` in + class :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Number` + + + """ + ... + def floor(self) -> 'Binary64': + """ + Get the largest whole number smaller than instance. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.floor` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + floor(this) + + + """ + ... def getField(self) -> org.hipparchus.Field['Binary64']: ... - def getPi(self) -> 'Binary64': ... - def getReal(self) -> float: ... - def hashCode(self) -> int: ... - def hypot(self, binary64: 'Binary64') -> 'Binary64': ... - def intValue(self) -> int: ... - def isInfinite(self) -> bool: ... - def isNaN(self) -> bool: ... - def isZero(self) -> bool: ... - @typing.overload - def linearCombination(self, double: float, binary64: 'Binary64', double2: float, binary642: 'Binary64') -> 'Binary64': ... + def getPi(self) -> 'Binary64': + """ + Get the Archimedes constant Ï€. + + Archimedes constant is the ratio of a circle's circumference to its diameter. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.getPi` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + Archimedes constant Ï€ + + + """ + ... + def getReal(self) -> float: + """ + Get the real value of the number. + + Specified by: + :meth:`~org.hipparchus.FieldElement.getReal` in interface :class:`~org.hipparchus.FieldElement` + + Returns: + real value + + + """ + ... + def hashCode(self) -> int: + """ + The current implementation returns the same value as :code:`new Double(this.doubleValue()).hashCode()` + + Overrides: + :meth:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.hashCode` in + class :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Also see: + + - :meth:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Double.hashCode` + + + + """ + ... + def hypot(self, binary64: 'Binary64') -> 'Binary64': + """ + Returns the hypotenuse of a triangle with sides :code:`this` and :code:`y` - sqrt(*this* :sup:`2` +*y* :sup:`2` ) + avoiding intermediate overflow or underflow. + + - If either argument is infinite, then the result is positive infinity. + - else, if either argument is NaN then the result is NaN. + + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.hypot` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + y (:class:`~org.hipparchus.util.Binary64`): a value + + Returns: + sqrt(*this* :sup:`2` +*y* :sup:`2` ) + + + """ + ... + def intValue(self) -> int: + """ + The current implementation performs casting to a :code:`int`. + + Specified by: + :meth:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Number.intValue` in + class :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Number` + + + """ + ... + def isInfinite(self) -> bool: + """ + Returns :code:`true` if :code:`this` double precision number is infinite + (:meth:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Double.POSITIVE_INFINITY` or + :meth:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Double.NEGATIVE_INFINITY`). + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.isInfinite` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + :code:`true` if :code:`this` number is infinite + + + """ + ... + def isNaN(self) -> bool: + """ + Returns :code:`true` if :code:`this` double precision number is Not-a-Number (:code:`NaN`), false otherwise. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.isNaN` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + :code:`true` if :code:`this` is :code:`NaN` + + + """ + ... + def isZero(self) -> bool: + """ + Check if an element is semantically equal to zero. + + The default implementation simply calls :code:`equals(getField().getZero())`. However, this may need to be overridden in + some cases as due to compatibility with :code:`hashCode()` some classes implements :code:`equals(Object)` in such a way + that -0.0 and +0.0 are different, which may be a problem. It prevents for example identifying a diagonal element is zero + and should be avoided when doing partial pivoting in LU decomposition. + + This implementation considers +0.0 and -0.0 to be equal. + + Specified by: + :meth:`~org.hipparchus.FieldElement.isZero` in interface :class:`~org.hipparchus.FieldElement` + + Returns: + true if the element is semantically equal to zero + + Since: + 1.8 + + + """ + ... + @typing.overload + def linearCombination(self, double: float, binary64: 'Binary64', double2: float, binary642: 'Binary64') -> 'Binary64': + """ + Compute a linear combination. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` in + interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + a1 (:class:`~org.hipparchus.util.Binary64`): first factor of the first term + b1 (:class:`~org.hipparchus.util.Binary64`): second factor of the first term + a2 (:class:`~org.hipparchus.util.Binary64`): first factor of the second term + b2 (:class:`~org.hipparchus.util.Binary64`): second factor of the second term + + Returns: + a :sub:`1` ×b :sub:`1` + a :sub:`2` ×b :sub:`2` + + Also see: + + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + + + Compute a linear combination. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` in + interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + a1 (double): first factor of the first term + b1 (:class:`~org.hipparchus.util.Binary64`): second factor of the first term + a2 (double): first factor of the second term + b2 (:class:`~org.hipparchus.util.Binary64`): second factor of the second term + + Returns: + a :sub:`1` ×b :sub:`1` + a :sub:`2` ×b :sub:`2` + + Also see: + + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + + + Compute a linear combination. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` in + interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + a1 (:class:`~org.hipparchus.util.Binary64`): first factor of the first term + b1 (:class:`~org.hipparchus.util.Binary64`): second factor of the first term + a2 (:class:`~org.hipparchus.util.Binary64`): first factor of the second term + b2 (:class:`~org.hipparchus.util.Binary64`): second factor of the second term + a3 (:class:`~org.hipparchus.util.Binary64`): first factor of the third term + b3 (:class:`~org.hipparchus.util.Binary64`): second factor of the third term + + Returns: + a :sub:`1` ×b :sub:`1` + a :sub:`2` ×b :sub:`2` + a :sub:`3` ×b :sub:`3` + + Also see: + + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + + + Compute a linear combination. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` in + interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + a1 (double): first factor of the first term + b1 (:class:`~org.hipparchus.util.Binary64`): second factor of the first term + a2 (double): first factor of the second term + b2 (:class:`~org.hipparchus.util.Binary64`): second factor of the second term + a3 (double): first factor of the third term + b3 (:class:`~org.hipparchus.util.Binary64`): second factor of the third term + + Returns: + a :sub:`1` ×b :sub:`1` + a :sub:`2` ×b :sub:`2` + a :sub:`3` ×b :sub:`3` + + Also see: + + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + + + Compute a linear combination. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` in + interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + a1 (:class:`~org.hipparchus.util.Binary64`): first factor of the first term + b1 (:class:`~org.hipparchus.util.Binary64`): second factor of the first term + a2 (:class:`~org.hipparchus.util.Binary64`): first factor of the second term + b2 (:class:`~org.hipparchus.util.Binary64`): second factor of the second term + a3 (:class:`~org.hipparchus.util.Binary64`): first factor of the third term + b3 (:class:`~org.hipparchus.util.Binary64`): second factor of the third term + a4 (:class:`~org.hipparchus.util.Binary64`): first factor of the fourth term + b4 (:class:`~org.hipparchus.util.Binary64`): second factor of the fourth term + + Returns: + a :sub:`1` ×b :sub:`1` + a :sub:`2` ×b :sub:`2` + a :sub:`3` ×b :sub:`3` + a :sub:`4` ×b :sub:`4` + + Also see: + + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + + + Compute a linear combination. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` in + interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + a1 (double): first factor of the first term + b1 (:class:`~org.hipparchus.util.Binary64`): second factor of the first term + a2 (double): first factor of the second term + b2 (:class:`~org.hipparchus.util.Binary64`): second factor of the second term + a3 (double): first factor of the third term + b3 (:class:`~org.hipparchus.util.Binary64`): second factor of the third term + a4 (double): first factor of the fourth term + b4 (:class:`~org.hipparchus.util.Binary64`): second factor of the fourth term + + Returns: + a :sub:`1` ×b :sub:`1` + a :sub:`2` ×b :sub:`2` + a :sub:`3` ×b :sub:`3` + a :sub:`4` ×b :sub:`4` + + Also see: + + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + + + + """ + ... @typing.overload def linearCombination(self, double: float, binary64: 'Binary64', double2: float, binary642: 'Binary64', double3: float, binary643: 'Binary64') -> 'Binary64': ... @typing.overload @@ -223,75 +1248,650 @@ class Binary64(java.lang.Number, org.hipparchus.CalculusFieldElement['Binary64'] def linearCombination(self, binary64: 'Binary64', binary642: 'Binary64', binary643: 'Binary64', binary644: 'Binary64', binary645: 'Binary64', binary646: 'Binary64', binary647: 'Binary64', binary648: 'Binary64') -> 'Binary64': ... @typing.overload def linearCombination(self, binary64Array: typing.Union[typing.List['Binary64'], jpype.JArray], binary64Array2: typing.Union[typing.List['Binary64'], jpype.JArray]) -> 'Binary64': ... - def log(self) -> 'Binary64': ... - def log10(self) -> 'Binary64': ... - def log1p(self) -> 'Binary64': ... - def longValue(self) -> int: ... - @typing.overload - def multiply(self, double: float) -> 'Binary64': ... + def log(self) -> 'Binary64': + """ + Natural logarithm. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.log` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + logarithm of the instance + + + """ + ... + def log10(self) -> 'Binary64': + """ + Base 10 logarithm. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.log10` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + base 10 logarithm of the instance + + + """ + ... + def log1p(self) -> 'Binary64': + """ + Shifted natural logarithm. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.log1p` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + logarithm of one plus the instance + + + """ + ... + def longValue(self) -> int: + """ + The current implementation performs casting to a :code:`long`. + + Specified by: + :meth:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Number.longValue` in + class :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Number` + + + """ + ... + @typing.overload + def multiply(self, double: float) -> 'Binary64': + """ + Compute this × a. The current implementation strictly enforces :code:`this.multiply(a).equals(new + Binary64(this.doubleValue() * a.doubleValue()))`. + + Specified by: + :meth:`~org.hipparchus.FieldElement.multiply` in interface :class:`~org.hipparchus.FieldElement` + + Parameters: + a (:class:`~org.hipparchus.util.Binary64`): element to multiply + + Returns: + a new element representing this × a + + Compute n × this. Multiplication by an integer number is defined as the following sum \[ n \times \mathrm{this} = + \sum_{i=1}^n \mathrm{this} \] The current implementation strictly enforces :code:`this.multiply(n).equals(new Binary64(n + * this.doubleValue()))`. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.multiply` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Specified by: + :meth:`~org.hipparchus.FieldElement.multiply` in interface :class:`~org.hipparchus.FieldElement` + + Parameters: + n (int): Number of times :code:`this` must be added to itself. + + Returns: + A new element representing n × this. + + '×' operator. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.multiply` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + a (double): right hand side parameter of the operator + + Returns: + this×a + + + """ + ... @typing.overload def multiply(self, int: int) -> 'Binary64': ... @typing.overload def multiply(self, binary64: 'Binary64') -> 'Binary64': ... - def negate(self) -> 'Binary64': ... - def newInstance(self, double: float) -> 'Binary64': ... - @typing.overload - def pow(self, double: float) -> 'Binary64': ... + def negate(self) -> 'Binary64': + """ + Returns the additive inverse of :code:`this` element. The current implementation strictly enforces + :code:`this.negate().equals(new Binary64(-this.doubleValue()))`. + + Specified by: + :meth:`~org.hipparchus.FieldElement.negate` in interface :class:`~org.hipparchus.FieldElement` + + Returns: + the opposite of :code:`this`. + + + """ + ... + def newInstance(self, double: float) -> 'Binary64': + """ + Create an instance corresponding to a constant real value. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.newInstance` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + v (double): constant real value + + Returns: + instance corresponding to a constant real value + + + """ + ... + @typing.overload + def pow(self, double: float) -> 'Binary64': + """ + Power operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.pow` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + p (double): power to apply + + Returns: + this :sup:`p` + + Integer power operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.pow` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + n (int): power to apply + + Returns: + this :sup:`n` + + Power operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.pow` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + e (:class:`~org.hipparchus.util.Binary64`): exponent + + Returns: + this :sup:`e` + + + """ + ... @typing.overload def pow(self, int: int) -> 'Binary64': ... @typing.overload def pow(self, binary64: 'Binary64') -> 'Binary64': ... - def reciprocal(self) -> 'Binary64': ... - @typing.overload - def remainder(self, double: float) -> 'Binary64': ... + def reciprocal(self) -> 'Binary64': + """ + Returns the multiplicative inverse of :code:`this` element. The current implementation strictly enforces + :code:`this.reciprocal().equals(new Binary64(1.0 / this.doubleValue()))`. + + Specified by: + :meth:`~org.hipparchus.FieldElement.reciprocal` in interface :class:`~org.hipparchus.FieldElement` + + Returns: + the inverse of :code:`this`. + + + """ + ... + @typing.overload + def remainder(self, double: float) -> 'Binary64': + """ + IEEE remainder operator. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.remainder` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + a (double): right hand side parameter of the operator + + Returns: + this - n × a where n is the closest integer to this/a + + IEEE remainder operator. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.remainder` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + a (:class:`~org.hipparchus.util.Binary64`): right hand side parameter of the operator + + Returns: + this - n × a where n is the closest integer to this/a + + + """ + ... @typing.overload def remainder(self, binary64: 'Binary64') -> 'Binary64': ... - def rint(self) -> 'Binary64': ... - def rootN(self, int: int) -> 'Binary64': ... - def scalb(self, int: int) -> 'Binary64': ... - def shortValue(self) -> int: ... - def sign(self) -> 'Binary64': ... - def sin(self) -> 'Binary64': ... + def rint(self) -> 'Binary64': + """ + Get the whole number that is the nearest to the instance, or the even one if x is exactly half way between two integers. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.rint` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + a double number r such that r is an integer r - 0.5 ≤ this ≤ r + 0.5 + + + """ + ... + def rootN(self, int: int) -> 'Binary64': + """ + N :sup:`th` root. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.rootN` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + n (int): order of the root + + Returns: + n :sup:`th` root of the instance + + + """ + ... + def scalb(self, int: int) -> 'Binary64': + """ + Multiply the instance by a power of 2. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.scalb` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + n (int): power of 2 + + Returns: + this × 2 :sup:`n` + + + """ + ... + def shortValue(self) -> int: + """ + The current implementation performs casting to a :code:`short`. + + Overrides: + :meth:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Number.shortValue` in + class :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Number` + + + """ + ... + def sign(self) -> 'Binary64': + """ + Compute the sign of the instance. The sign is -1 for negative numbers, +1 for positive numbers and 0 otherwise, for + Complex number, it is extended on the unit circle (equivalent to z/|z|, with special handling for 0 and NaN) + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.sign` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + -1.0, -0.0, +0.0, +1.0 or NaN depending on sign of a + + + """ + ... + def sin(self) -> 'Binary64': + """ + Sine operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.sin` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + sin(this) + + + """ + ... def sinCos(self) -> 'FieldSinCos'['Binary64']: ... - def sinh(self) -> 'Binary64': ... + def sinh(self) -> 'Binary64': + """ + Hyperbolic sine operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.sinh` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + sinh(this) + + + """ + ... def sinhCosh(self) -> 'FieldSinhCosh'['Binary64']: ... - def sqrt(self) -> 'Binary64': ... - def square(self) -> 'Binary64': ... - @typing.overload - def subtract(self, double: float) -> 'Binary64': ... + def sqrt(self) -> 'Binary64': + """ + Square root. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.sqrt` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + square root of the instance + + + """ + ... + def square(self) -> 'Binary64': + """ + Description copied from interface: :meth:`~org.hipparchus.CalculusFieldElement.square` + Compute this × this. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.square` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + a new element representing this × this + + + """ + ... + @typing.overload + def subtract(self, double: float) -> 'Binary64': + """ + Compute this - a. The current implementation strictly enforces :code:`this.subtract(a).equals(new + Binary64(this.doubleValue() - a.doubleValue()))`. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.subtract` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Specified by: + :meth:`~org.hipparchus.FieldElement.subtract` in interface :class:`~org.hipparchus.FieldElement` + + Parameters: + a (:class:`~org.hipparchus.util.Binary64`): element to subtract + + Returns: + a new element representing this - a + + '-' operator. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.subtract` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + a (double): right hand side parameter of the operator + + Returns: + this-a + + + """ + ... @typing.overload def subtract(self, binary64: 'Binary64') -> 'Binary64': ... - def tan(self) -> 'Binary64': ... - def tanh(self) -> 'Binary64': ... - def toDegrees(self) -> 'Binary64': ... - def toRadians(self) -> 'Binary64': ... - def toString(self) -> str: ... - def ulp(self) -> 'Binary64': ... + def tan(self) -> 'Binary64': + """ + Tangent operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.tan` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + tan(this) + + + """ + ... + def tanh(self) -> 'Binary64': + """ + Hyperbolic tangent operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.tanh` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + tanh(this) + + + """ + ... + def toDegrees(self) -> 'Binary64': + """ + Convert radians to degrees, with error of less than 0.5 ULP + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.toDegrees` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + instance converted into degrees + + + """ + ... + def toRadians(self) -> 'Binary64': + """ + Convert degrees to radians, with error of less than 0.5 ULP + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.toRadians` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + instance converted into radians + + + """ + ... + def toString(self) -> str: + """ + The returned :code:`String` is equal to :code:`Double.toString(this.doubleValue())` + + Overrides: + :meth:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.toString` in + class :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Also see: + + - :meth:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Double.toString` + + + + """ + ... + def ulp(self) -> 'Binary64': + """ + Compute least significant bit (Unit in Last Position) for a number. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.ulp` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + ulp(this) + + + """ + ... class Binary64Field(org.hipparchus.Field[Binary64], java.io.Serializable): - def equals(self, object: typing.Any) -> bool: ... - @staticmethod - def getInstance() -> 'Binary64Field': ... - def getOne(self) -> Binary64: ... + """ + public classBinary64Field extends :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.Field`<:class:`~org.hipparchus.util.Binary64`>, :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + The field of :class:`~org.hipparchus.util.Binary64`. + + Also see: + + - :class:`~org.hipparchus.util.Binary64` + - :meth:`~serialized` + """ + def equals(self, object: typing.Any) -> bool: + """ + + Overrides: + :meth:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.equals` in + class :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + + """ + ... + @staticmethod + def getInstance() -> 'Binary64Field': + """ + Returns the unique instance of this class. + + Returns: + the unique instance of this class + + + """ + ... + def getOne(self) -> Binary64: + """ + Get the multiplicative identity of the field. + + The multiplicative identity is the element e :sub:`1` of the field such that for all elements a of the field, the + equalities a × e :sub:`1` = e :sub:`1` × a = a hold. + + Specified by: + :meth:`~org.hipparchus.Field.getOne` in interface :class:`~org.hipparchus.Field` + + Returns: + multiplicative identity of the field + + + """ + ... def getRuntimeClass(self) -> typing.Type[Binary64]: ... - def getZero(self) -> Binary64: ... - def hashCode(self) -> int: ... + def getZero(self) -> Binary64: + """ + Get the additive identity of the field. + + The additive identity is the element e :sub:`0` of the field such that for all elements a of the field, the equalities a + + e :sub:`0` = e :sub:`0` + a = a hold. + + Specified by: + :meth:`~org.hipparchus.Field.getZero` in interface :class:`~org.hipparchus.Field` + + Returns: + additive identity of the field + + + """ + ... + def hashCode(self) -> int: + """ + + Overrides: + :meth:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.hashCode` in + class :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + + """ + ... _Blendable__B = typing.TypeVar('_Blendable__B') # <B> class Blendable(typing.Generic[_Blendable__B]): + """ + public interfaceBlendable<B> + + Interface representing classes that can blend with other instances of themselves using a given blending value. + + The blending value is commonly given from a + :class:`~org.hipparchus.analysis.polynomials.SmoothStepFactory.SmoothStepFunction`. + """ def blendArithmeticallyWith(self, b: _Blendable__B, double: float) -> _Blendable__B: ... class Combinations(java.lang.Iterable[typing.MutableSequence[int]]): + """ + public classCombinations extends :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Iterable`<int[]> + + Utility to create combinations :code:`(n, k)` of :code:`k` elements in a set of :code:`n` elements. + + Also see: + + - ` Combination @ Wikipedia <http://en.wikipedia.org/wiki/Combination>` + """ def __init__(self, int: int, int2: int): ... - def comparator(self) -> java.util.Comparator[typing.MutableSequence[int]]: ... - def getK(self) -> int: ... - def getN(self) -> int: ... - def iterator(self) -> java.util.Iterator[typing.MutableSequence[int]]: ... + def comparator(self) -> java.util.Comparator[typing.MutableSequence[int]]: + """ + Defines a lexicographic ordering of combinations. The returned comparator allows to compare any two combinations that + can be produced by this instance's :meth:`~org.hipparchus.util.Combinations.iterator`. Its :code:`compare(int[],int[])` + method will throw exceptions if passed combinations that are inconsistent with this instance: + + - if the array lengths are not equal to :code:`k`, + - if an element of the array is not within the interval [0, :code:`n`). + + + Returns: + a lexicographic comparator. + + + """ + ... + def getK(self) -> int: + """ + Gets the number of elements in each combination. + + Returns: + the size of the subsets to be enumerated. + + + """ + ... + def getN(self) -> int: + """ + Gets the size of the set from which combinations are drawn. + + Returns: + the size of the universe. + + + """ + ... + def iterator(self) -> java.util.Iterator[typing.MutableSequence[int]]: + """ + + Specified by: + :meth:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Iterable.iterator` in + interface :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Iterable` + + + """ + ... class CombinatoricsUtils: + """ + public final classCombinatoricsUtils extends :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Combinatorial utilities. + """ MAX_BELL: typing.ClassVar[int] = ... - @staticmethod - def bellNumber(int: int) -> int: ... + """ + public static final int MAX_BELL + + Maximum index of Bell number that fits into a long. + + Since: + 2.2 + + Also see: + + - :meth:`~constant` + + + + """ + @staticmethod + def bellNumber(int: int) -> int: + """ + Compute the Bell number (number of partitions of a set). + + Parameters: + n (int): number of elements of the set + + Returns: + Bell number Bâ‚™ + + Since: + 2.2 + + + """ + ... @staticmethod def binomialCoefficient(int: int, int2: int) -> int: ... @staticmethod @@ -301,7 +1901,33 @@ class CombinatoricsUtils: @staticmethod def checkBinomial(int: int, int2: int) -> None: ... @staticmethod - def combinationsIterator(int: int, int2: int) -> java.util.Iterator[typing.MutableSequence[int]]: ... + def combinationsIterator(int: int, int2: int) -> java.util.Iterator[typing.MutableSequence[int]]: + """ + Returns an iterator whose range is the k-element subsets of {0, ..., n - 1} represented as :code:`int[]` arrays. + + The arrays returned by the iterator are sorted in descending order and they are visited in lexicographic order with + significance from right to left. For example, combinationsIterator(4, 2) returns an Iterator that will generate the + following sequence of arrays on successive calls to :code:`next()`: + + :code:`[0, 1], [0, 2], [1, 2], [0, 3], [1, 3], [2, 3]` + + If :code:`k == 0` an Iterator containing an empty array is returned and if :code:`k == n` an Iterator containing [0, + ..., n -1] is returned. + + Parameters: + n (int): Size of the set from which subsets are selected. + k (int): Size of the subsets to be enumerated. + + Returns: + an :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.util.Iterator` over the k-sets in n. + + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if :code:`n < 0`. + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if :code:`k > n`. + + + """ + ... @staticmethod def factorial(int: int) -> int: ... @staticmethod @@ -323,24 +1949,136 @@ class CombinatoricsUtils: def withCache(self, int: int) -> 'CombinatoricsUtils.FactorialLog': ... class CompositeFormat: - @staticmethod - def formatDouble(double: float, numberFormat: java.text.NumberFormat, stringBuffer: java.lang.StringBuffer, fieldPosition: java.text.FieldPosition) -> java.lang.StringBuffer: ... - @typing.overload - @staticmethod - def getDefaultNumberFormat() -> java.text.NumberFormat: ... - @typing.overload - @staticmethod - def getDefaultNumberFormat(locale: java.util.Locale) -> java.text.NumberFormat: ... - @staticmethod - def parseAndIgnoreWhitespace(string: str, parsePosition: java.text.ParsePosition) -> None: ... - @staticmethod - def parseFixedstring(string: str, string2: str, parsePosition: java.text.ParsePosition) -> bool: ... - @staticmethod - def parseNextCharacter(string: str, parsePosition: java.text.ParsePosition) -> str: ... - @staticmethod - def parseNumber(string: str, numberFormat: java.text.NumberFormat, parsePosition: java.text.ParsePosition) -> java.lang.Number: ... + """ + public classCompositeFormat extends :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Base class for formatters of composite objects (complex numbers, vectors ...). + """ + @staticmethod + def formatDouble(double: float, numberFormat: java.text.NumberFormat, stringBuffer: java.lang.StringBuffer, fieldPosition: java.text.FieldPosition) -> java.lang.StringBuffer: + """ + Formats a double value to produce a string. In general, the value is formatted using the formatting rules of + :code:`format`. There are three exceptions to this: + + 1. NaN is formatted as '(NaN)' + 2. Positive infinity is formatted as '(Infinity)' + 3. Negative infinity is formatted as '(-Infinity)' + + + Parameters: + value (double): the double to format. + format (:class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.text.NumberFormat`): the format used. + toAppendTo (:class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.StringBuffer`): where the text is to be appended + pos (:class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.text.FieldPosition`): On input: an alignment field, if desired. On output: the offsets of the alignment field + + Returns: + the value passed in as toAppendTo. + + + """ + ... + @typing.overload + @staticmethod + def getDefaultNumberFormat() -> java.text.NumberFormat: + """ + Create a default number format. The default number format is based on + :meth:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.text.NumberFormat.getInstance` with the only + customizing that the maximum number of fraction digits is set to 10. + + Returns: + the default number format. + + """ + ... + @typing.overload + @staticmethod + def getDefaultNumberFormat(locale: java.util.Locale) -> java.text.NumberFormat: + """ + Create a default number format. The default number format is based on + :meth:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.text.NumberFormat.getInstance` with the only + customizing that the maximum number of fraction digits is set to 10. + + Parameters: + locale (:class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.util.Locale`): the specific locale used by the format. + + Returns: + the default number format specific to the given locale. + + + """ + ... + @staticmethod + def parseAndIgnoreWhitespace(string: str, parsePosition: java.text.ParsePosition) -> None: + """ + Parses :code:`source` until a non-whitespace character is found. + + Parameters: + source (:class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.String`): the string to parse + pos (:class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.text.ParsePosition`): input/output parsing parameter. On output, :code:`pos` holds the index of the next non-whitespace character. + + + """ + ... + @staticmethod + def parseFixedstring(string: str, string2: str, parsePosition: java.text.ParsePosition) -> bool: + """ + Parse :code:`source` for an expected fixed string. + + Parameters: + source (:class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.String`): the string to parse + expected (:class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.String`): expected string + pos (:class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.text.ParsePosition`): input/output parsing parameter. + + Returns: + true if the expected string was there + + + """ + ... + @staticmethod + def parseNextCharacter(string: str, parsePosition: java.text.ParsePosition) -> str: + """ + Parses :code:`source` until a non-whitespace character is found. + + Parameters: + source (:class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.String`): the string to parse + pos (:class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.text.ParsePosition`): input/output parsing parameter. + + Returns: + the first non-whitespace character. + + + """ + ... + @staticmethod + def parseNumber(string: str, numberFormat: java.text.NumberFormat, parsePosition: java.text.ParsePosition) -> java.lang.Number: + """ + Parses :code:`source` for a number. This method can parse normal, numeric values as well as special values. These + special values include Double.NaN, Double.POSITIVE_INFINITY, Double.NEGATIVE_INFINITY. + + Parameters: + source (:class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.String`): the string to parse + format (:class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.text.NumberFormat`): the number format used to parse normal, numeric values. + pos (:class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.text.ParsePosition`): input/output parsing parameter. + + Returns: + the parsed number. + + + """ + ... class ContinuedFraction: + """ + public abstract classContinuedFraction extends :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Provides a generic means to evaluate continued fractions. Subclasses simply provided the a and b coefficients to + evaluate the continued fraction. + + References: + + - ` Continued Fraction <http://mathworld.wolfram.com/ContinuedFraction.html>` + """ @typing.overload def evaluate(self, double: float) -> float: ... @typing.overload @@ -351,23 +2089,203 @@ class ContinuedFraction: def evaluate(self, double: float, int: int) -> float: ... class FastMath: + """ + public classFastMath extends :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Faster, more accurate, portable alternative to + :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Math` and + :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.StrictMath` for large scale computation. + + FastMath is a drop-in replacement for both Math and StrictMath. This means that for any method in Math (say + :code:`Math.sin(x)` or :code:`Math.cbrt(y)`), user can directly change the class and use the methods as is (using + :code:`FastMath.sin(x)` or :code:`FastMath.cbrt(y)` in the previous example). + + FastMath speed is achieved by relying heavily on optimizing compilers to native code present in many JVMs today and use + of large tables. The larger tables are lazily initialized on first use, so that the setup time does not penalize methods + that don't need them. + + Note that FastMath is extensively used inside Hipparchus, so by calling some algorithms, the overhead when the the + tables need to be initialized will occur regardless of the end-user calling FastMath methods directly or not. + Performance figures for a specific JVM and hardware can be evaluated by running the FastMathTestPerformance tests in the + test directory of the source distribution. + + FastMath accuracy should be mostly independent of the JVM as it relies only on IEEE-754 basic operations and on embedded + tables. Almost all operations are accurate to about 0.5 ulp throughout the domain range. This statement, of course is + only a rough global observed behavior, it is *not* a guarantee for *every* double numbers input (see William Kahan's + `Table Maker's Dilemma <http://en.wikipedia.org/wiki/Rounding#The_table-maker.27s_dilemma>`). + + FastMath additionally implements the following methods not found in Math/StrictMath: + + - :meth:`~org.hipparchus.util.FastMath.asinh` + - :meth:`~org.hipparchus.util.FastMath.acosh` + - :meth:`~org.hipparchus.util.FastMath.atanh` + + The following methods are found in Math/StrictMath since 1.6 only, they are provided by FastMath even in 1.5 Java + virtual machines + + - :meth:`~org.hipparchus.util.FastMath.copySign` + - :meth:`~org.hipparchus.util.FastMath.getExponent` + - :meth:`~org.hipparchus.util.FastMath.nextAfter` + - :meth:`~org.hipparchus.util.FastMath.nextUp` + - :meth:`~org.hipparchus.util.FastMath.scalb` + - :meth:`~org.hipparchus.util.FastMath.copySign` + - :meth:`~org.hipparchus.util.FastMath.getExponent` + - :meth:`~org.hipparchus.util.FastMath.nextAfter` + - :meth:`~org.hipparchus.util.FastMath.nextUp` + - :meth:`~org.hipparchus.util.FastMath.scalb` + """ PI: typing.ClassVar[float] = ... + """ + public static final double PI + + Archimede's constant PI, ratio of circle circumference to diameter. + + Also see: + + - :meth:`~constant` + + + + """ E: typing.ClassVar[float] = ... + """ + public static final double E + + Napier's constant e, base of the natural logarithm. + + Also see: + + - :meth:`~constant` + + + + """ _IEEEremainder_1__T = typing.TypeVar('_IEEEremainder_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> _IEEEremainder_2__T = typing.TypeVar('_IEEEremainder_2__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload @staticmethod - def IEEEremainder(double: float, double2: float) -> float: ... - @typing.overload - @staticmethod - def IEEEremainder(t: _IEEEremainder_1__T, double: float) -> _IEEEremainder_1__T: ... + def IEEEremainder(double: float, double2: float) -> float: + """ + Computes the remainder as prescribed by the IEEE 754 standard. + + The remainder value is mathematically equal to :code:`x - y*n` where :code:`n` is the mathematical integer closest to + the exact mathematical value of the quotient :code:`x/y`. If two mathematical integers are equally close to :code:`x/y` + then :code:`n` is the integer that is even. + + - If either operand is NaN, the result is NaN. + - If the result is not NaN, the sign of the result equals the sign of the dividend. + - If the dividend is an infinity, or the divisor is a zero, or both, the result is NaN. + - If the dividend is finite and the divisor is an infinity, the result equals the dividend. + - If the dividend is a zero and the divisor is finite, the result equals the dividend. + + + Parameters: + dividend (double): the number to be divided + divisor (double): the number by which to divide + + Returns: + the remainder, rounded + + """ + ... + @typing.overload + @staticmethod + def IEEEremainder(t: _IEEEremainder_1__T, double: float) -> _IEEEremainder_1__T: + """ + Computes the remainder as prescribed by the IEEE 754 standard. + + The remainder value is mathematically equal to :code:`x - y*n` where :code:`n` is the mathematical integer closest to + the exact mathematical value of the quotient :code:`x/y`. If two mathematical integers are equally close to :code:`x/y` + then :code:`n` is the integer that is even. + + - If either operand is NaN, the result is NaN. + - If the result is not NaN, the sign of the result equals the sign of the dividend. + - If the dividend is an infinity, or the divisor is a zero, or both, the result is NaN. + - If the dividend is finite and the divisor is an infinity, the result equals the dividend. + - If the dividend is a zero and the divisor is finite, the result equals the dividend. + + + Parameters: + dividend (T): the number to be divided + divisor (double): the number by which to divide + + Returns: + the remainder, rounded + + Since: + 1.3 + + Computes the remainder as prescribed by the IEEE 754 standard. + + The remainder value is mathematically equal to :code:`x - y*n` where :code:`n` is the mathematical integer closest to + the exact mathematical value of the quotient :code:`x/y`. If two mathematical integers are equally close to :code:`x/y` + then :code:`n` is the integer that is even. + + - If either operand is NaN, the result is NaN. + - If the result is not NaN, the sign of the result equals the sign of the dividend. + - If the dividend is an infinity, or the divisor is a zero, or both, the result is NaN. + - If the dividend is finite and the divisor is an infinity, the result equals the dividend. + - If the dividend is a zero and the divisor is finite, the result equals the dividend. + + + Parameters: + dividend (T): the number to be divided + divisor (T): the number by which to divide + + Returns: + the remainder, rounded + + Since: + 1.3 + + + """ + ... @typing.overload @staticmethod def IEEEremainder(t: _IEEEremainder_2__T, t2: _IEEEremainder_2__T) -> _IEEEremainder_2__T: ... _abs_4__T = typing.TypeVar('_abs_4__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload @staticmethod - def abs(double: float) -> float: ... + def abs(double: float) -> float: + """ + Absolute value. + + Parameters: + x (int): number from which absolute value is requested + + Returns: + abs(x) + + Absolute value. + + Parameters: + x (long): number from which absolute value is requested + + Returns: + abs(x) + + Absolute value. + + Parameters: + x (float): number from which absolute value is requested + + Returns: + abs(x) + + Since: + 2.0 + + Absolute value. + + Parameters: + x (double): number from which absolute value is requested + + Returns: + abs(x) + + """ + ... @typing.overload @staticmethod def abs(float: float) -> float: ... @@ -379,27 +2297,120 @@ class FastMath: def abs(long: int) -> int: ... @typing.overload @staticmethod - def abs(t: _abs_4__T) -> _abs_4__T: ... - @typing.overload - @staticmethod - def absExact(int: int) -> int: ... + def abs(t: _abs_4__T) -> _abs_4__T: + """ + Absolute value. + + Parameters: + x (T): number from which absolute value is requested + + Returns: + abs(x) + + Since: + 2.0 + + + """ + ... + @typing.overload + @staticmethod + def absExact(int: int) -> int: + """ + Absolute value. + + Parameters: + x (int): number from which absolute value is requested + + Returns: + abs(x), or throws an exception for :code:`Integer.MIN_VALUE` + + Since: + 2.0 + + Absolute value. + + Parameters: + x (long): number from which absolute value is requested + + Returns: + abs(x), or throws an exception for :code:`Long.MIN_VALUE` + + Since: + 2.0 + + + """ + ... @typing.overload @staticmethod def absExact(long: int) -> int: ... _acos_1__T = typing.TypeVar('_acos_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload @staticmethod - def acos(double: float) -> float: ... - @typing.overload - @staticmethod - def acos(t: _acos_1__T) -> _acos_1__T: ... + def acos(double: float) -> float: + """ + Compute the arc cosine of a number. + + Parameters: + x (double): number on which evaluation is done + + Returns: + arc cosine of x + + """ + ... + @typing.overload + @staticmethod + def acos(t: _acos_1__T) -> _acos_1__T: + """ + Compute the arc cosine of a number. + + Parameters: + x (T): number on which evaluation is done + + Returns: + arc cosine of x + + Since: + 1.3 + + + """ + ... _acosh_1__T = typing.TypeVar('_acosh_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload @staticmethod - def acosh(double: float) -> float: ... - @typing.overload - @staticmethod - def acosh(t: _acosh_1__T) -> _acosh_1__T: ... + def acosh(double: float) -> float: + """ + Compute the inverse hyperbolic cosine of a number. + + Parameters: + a (double): number on which evaluation is done + + Returns: + inverse hyperbolic cosine of a + + """ + ... + @typing.overload + @staticmethod + def acosh(t: _acosh_1__T) -> _acosh_1__T: + """ + Compute the inverse hyperbolic cosine of a number. + + Parameters: + a (T): number on which evaluation is done + + Returns: + inverse hyperbolic cosine of a + + Since: + 1.3 + + + """ + ... @typing.overload @staticmethod def addExact(int: int, int2: int) -> int: ... @@ -409,52 +2420,236 @@ class FastMath: _asin_1__T = typing.TypeVar('_asin_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload @staticmethod - def asin(double: float) -> float: ... - @typing.overload - @staticmethod - def asin(t: _asin_1__T) -> _asin_1__T: ... + def asin(double: float) -> float: + """ + Compute the arc sine of a number. + + Parameters: + x (double): number on which evaluation is done + + Returns: + arc sine of x + + """ + ... + @typing.overload + @staticmethod + def asin(t: _asin_1__T) -> _asin_1__T: + """ + Compute the arc sine of a number. + + Parameters: + x (T): number on which evaluation is done + + Returns: + arc sine of x + + Since: + 1.3 + + + """ + ... _asinh_1__T = typing.TypeVar('_asinh_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload @staticmethod - def asinh(double: float) -> float: ... - @typing.overload - @staticmethod - def asinh(t: _asinh_1__T) -> _asinh_1__T: ... + def asinh(double: float) -> float: + """ + Compute the inverse hyperbolic sine of a number. + + Parameters: + a (double): number on which evaluation is done + + Returns: + inverse hyperbolic sine of a + + """ + ... + @typing.overload + @staticmethod + def asinh(t: _asinh_1__T) -> _asinh_1__T: + """ + Compute the inverse hyperbolic sine of a number. + + Parameters: + a (T): number on which evaluation is done + + Returns: + inverse hyperbolic sine of a + + Since: + 1.3 + + + """ + ... _atan_1__T = typing.TypeVar('_atan_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload @staticmethod - def atan(double: float) -> float: ... - @typing.overload - @staticmethod - def atan(t: _atan_1__T) -> _atan_1__T: ... + def atan(double: float) -> float: + """ + Arctangent function + + Parameters: + x (double): a number + + Returns: + atan(x) + + """ + ... + @typing.overload + @staticmethod + def atan(t: _atan_1__T) -> _atan_1__T: + """ + Arctangent function + + Parameters: + x (T): a number + + Returns: + atan(x) + + Since: + 1.3 + + + """ + ... _atan2_1__T = typing.TypeVar('_atan2_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload @staticmethod - def atan2(double: float, double2: float) -> float: ... - @typing.overload - @staticmethod - def atan2(t: _atan2_1__T, t2: _atan2_1__T) -> _atan2_1__T: ... + def atan2(double: float, double2: float) -> float: + """ + Two arguments arctangent function + + Parameters: + y (double): ordinate + x (double): abscissa + + Returns: + phase angle of point (x,y) between :code:`-PI` and :code:`PI` + + """ + ... + @typing.overload + @staticmethod + def atan2(t: _atan2_1__T, t2: _atan2_1__T) -> _atan2_1__T: + """ + Two arguments arctangent function + + Parameters: + y (T): ordinate + x (T): abscissa + + Returns: + phase angle of point (x,y) between :code:`-PI` and :code:`PI` + + Since: + 1.3 + + + """ + ... _atanh_1__T = typing.TypeVar('_atanh_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload @staticmethod - def atanh(double: float) -> float: ... - @typing.overload - @staticmethod - def atanh(t: _atanh_1__T) -> _atanh_1__T: ... + def atanh(double: float) -> float: + """ + Compute the inverse hyperbolic tangent of a number. + + Parameters: + a (double): number on which evaluation is done + + Returns: + inverse hyperbolic tangent of a + + """ + ... + @typing.overload + @staticmethod + def atanh(t: _atanh_1__T) -> _atanh_1__T: + """ + Compute the inverse hyperbolic tangent of a number. + + Parameters: + a (T): number on which evaluation is done + + Returns: + inverse hyperbolic tangent of a + + Since: + 1.3 + + + """ + ... _cbrt_1__T = typing.TypeVar('_cbrt_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload @staticmethod - def cbrt(double: float) -> float: ... - @typing.overload - @staticmethod - def cbrt(t: _cbrt_1__T) -> _cbrt_1__T: ... + def cbrt(double: float) -> float: + """ + Compute the cubic root of a number. + + Parameters: + x (double): number on which evaluation is done + + Returns: + cubic root of x + + """ + ... + @typing.overload + @staticmethod + def cbrt(t: _cbrt_1__T) -> _cbrt_1__T: + """ + Compute the cubic root of a number. + + Parameters: + x (T): number on which evaluation is done + + Returns: + cubic root of x + + Since: + 1.3 + + + """ + ... _ceil_1__T = typing.TypeVar('_ceil_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload @staticmethod - def ceil(double: float) -> float: ... - @typing.overload - @staticmethod - def ceil(t: _ceil_1__T) -> _ceil_1__T: ... + def ceil(double: float) -> float: + """ + Get the smallest whole number larger than x. + + Parameters: + x (double): number from which ceil is requested + + Returns: + a double number c such that c is an integer c - 1.0 < x <= c + + """ + ... + @typing.overload + @staticmethod + def ceil(t: _ceil_1__T) -> _ceil_1__T: + """ + Get the smallest whole number larger than x. + + Parameters: + x (T): number from which ceil is requested + + Returns: + a double number c such that c is an integer c - 1.0 < x <= c + + Since: + 1.3 + + + """ + ... @typing.overload @staticmethod def ceilDiv(int: int, int2: int) -> int: ... @@ -481,7 +2676,80 @@ class FastMath: def ceilMod(long: int, long2: int) -> int: ... @typing.overload @staticmethod - def clamp(double: float, double2: float, double3: float) -> float: ... + def clamp(double: float, double2: float, double3: float) -> float: + """ + Clamp a value within an interval. + + Parameters: + value (int): value to clamp + inf (int): lower bound of the clamping interval + sup (int): upper bound of the clamping interval + + Returns: + value clamped within [inf; sup], or value if already within bounds. + + Since: + 3.0 + + Clamp a value within an interval. + + Parameters: + value (long): value to clamp + inf (long): lower bound of the clamping interval + sup (long): upper bound of the clamping interval + + Returns: + value clamped within [inf; sup], or value if already within bounds. + + Since: + 3.0 + + Clamp a value within an interval. + + Parameters: + value (long): value to clamp + inf (int): lower bound of the clamping interval + sup (int): upper bound of the clamping interval + + Returns: + value clamped within [inf; sup], or value if already within bounds. + + Since: + 3.0 + + Clamp a value within an interval. + + This method assumes -0.0 is below +0.0 + + Parameters: + value (float): value to clamp + inf (float): lower bound of the clamping interval + sup (float): upper bound of the clamping interval + + Returns: + value clamped within [inf; sup], or value if already within bounds. + + Since: + 3.0 + + Clamp a value within an interval. + + This method assumes -0.0 is below +0.0 + + Parameters: + value (double): value to clamp + inf (double): lower bound of the clamping interval + sup (double): upper bound of the clamping interval + + Returns: + value clamped within [inf; sup], or value if already within bounds. + + Since: + 3.0 + + + """ + ... @typing.overload @staticmethod def clamp(float: float, float2: float, float3: float) -> float: ... @@ -498,30 +2766,131 @@ class FastMath: _copySign_3__T = typing.TypeVar('_copySign_3__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload @staticmethod - def copySign(double: float, double2: float) -> float: ... + def copySign(double: float, double2: float) -> float: + """ + Returns the first argument with the sign of the second argument. A NaN :code:`sign` argument is treated as positive. + + Parameters: + magnitude (double): the value to return + sign (double): the sign for the returned value + + Returns: + the magnitude with the same sign as the :code:`sign` argument + + Returns the first argument with the sign of the second argument. A NaN :code:`sign` argument is treated as positive. + + Parameters: + magnitude (float): the value to return + sign (float): the sign for the returned value + + Returns: + the magnitude with the same sign as the :code:`sign` argument + + """ + ... @typing.overload @staticmethod def copySign(float: float, float2: float) -> float: ... @typing.overload @staticmethod - def copySign(t: _copySign_2__T, double: float) -> _copySign_2__T: ... + def copySign(t: _copySign_2__T, double: float) -> _copySign_2__T: + """ + Returns the first argument with the sign of the second argument. A NaN :code:`sign` argument is treated as positive. + + Parameters: + magnitude (T): the value to return + sign (T): the sign for the returned value + + Returns: + the magnitude with the same sign as the :code:`sign` argument + + Since: + 1.3 + + Returns the first argument with the sign of the second argument. A NaN :code:`sign` argument is treated as positive. + + Parameters: + magnitude (T): the value to return + sign (double): the sign for the returned value + + Returns: + the magnitude with the same sign as the :code:`sign` argument + + Since: + 1.3 + + + """ + ... @typing.overload @staticmethod def copySign(t: _copySign_3__T, t2: _copySign_3__T) -> _copySign_3__T: ... _cos_1__T = typing.TypeVar('_cos_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload @staticmethod - def cos(double: float) -> float: ... - @typing.overload - @staticmethod - def cos(t: _cos_1__T) -> _cos_1__T: ... + def cos(double: float) -> float: + """ + Cosine function. + + Parameters: + x (double): Argument. + + Returns: + cos(x) + + """ + ... + @typing.overload + @staticmethod + def cos(t: _cos_1__T) -> _cos_1__T: + """ + Cosine function. + + Parameters: + x (T): Argument. + + Returns: + cos(x) + + Since: + 1.3 + + + """ + ... _cosh_1__T = typing.TypeVar('_cosh_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload @staticmethod - def cosh(double: float) -> float: ... - @typing.overload - @staticmethod - def cosh(t: _cosh_1__T) -> _cosh_1__T: ... + def cosh(double: float) -> float: + """ + Compute the hyperbolic cosine of a number. + + Parameters: + x (double): number on which evaluation is done + + Returns: + hyperbolic cosine of x + + """ + ... + @typing.overload + @staticmethod + def cosh(t: _cosh_1__T) -> _cosh_1__T: + """ + Compute the hyperbolic cosine of a number. + + Parameters: + x (T): number on which evaluation is done + + Returns: + hyperbolic cosine of x + + Since: + 1.3 + + + """ + ... @typing.overload @staticmethod def decrementExact(int: int) -> int: ... @@ -530,31 +2899,151 @@ class FastMath: def decrementExact(long: int) -> int: ... @typing.overload @staticmethod - def divideExact(int: int, int2: int) -> int: ... + def divideExact(int: int, int2: int) -> int: + """ + Divide two integers, checking for overflow. + + Parameters: + x (int): dividend + y (int): divisor + + Returns: + x / y + + Raises: + :class:`~org.hipparchus.exception.MathRuntimeException`: if an overflow occurs + + Since: + 3.0 + + Divide two long integers, checking for overflow. + + Parameters: + x (long): dividend + y (long): divisor + + Returns: + x / y + + Raises: + :class:`~org.hipparchus.exception.MathRuntimeException`: if an overflow occurs + + Since: + 3.0 + + + """ + ... @typing.overload @staticmethod def divideExact(long: int, long2: int) -> int: ... _exp_1__T = typing.TypeVar('_exp_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload @staticmethod - def exp(double: float) -> float: ... - @typing.overload - @staticmethod - def exp(t: _exp_1__T) -> _exp_1__T: ... + def exp(double: float) -> float: + """ + Exponential function. Computes exp(x), function result is nearly rounded. It will be correctly rounded to the + theoretical value for 99.9% of input values, otherwise it will have a 1 ULP error. Method: Lookup intVal = exp(int(x)) + Lookup fracVal = exp(int(x-int(x) / 1024.0) * 1024.0 ); Compute z as the exponential of the remaining bits by a + polynomial minus one exp(x) = intVal * fracVal * (1 + z) Accuracy: Calculation is done with 63 bits of precision, so + result should be correctly rounded for 99.9% of input values, with less than 1 ULP error otherwise. + + Parameters: + x (double): a double + + Returns: + double e :sup:`x` + + """ + ... + @typing.overload + @staticmethod + def exp(t: _exp_1__T) -> _exp_1__T: + """ + Exponential function. Computes exp(x), function result is nearly rounded. It will be correctly rounded to the + theoretical value for 99.9% of input values, otherwise it will have a 1 ULP error. Method: Lookup intVal = exp(int(x)) + Lookup fracVal = exp(int(x-int(x) / 1024.0) * 1024.0 ); Compute z as the exponential of the remaining bits by a + polynomial minus one exp(x) = intVal * fracVal * (1 + z) Accuracy: Calculation is done with 63 bits of precision, so + result should be correctly rounded for 99.9% of input values, with less than 1 ULP error otherwise. + + Parameters: + x (T): a double + + Returns: + double e :sup:`x` + + Since: + 1.3 + + + """ + ... _expm1_1__T = typing.TypeVar('_expm1_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload @staticmethod - def expm1(double: float) -> float: ... - @typing.overload - @staticmethod - def expm1(t: _expm1_1__T) -> _expm1_1__T: ... + def expm1(double: float) -> float: + """ + Compute exp(x) - 1 + + Parameters: + x (double): number to compute shifted exponential + + Returns: + exp(x) - 1 + + """ + ... + @typing.overload + @staticmethod + def expm1(t: _expm1_1__T) -> _expm1_1__T: + """ + Compute exp(x) - 1 + + Parameters: + x (T): number to compute shifted exponential + + Returns: + exp(x) - 1 + + Since: + 1.3 + + + """ + ... _floor_1__T = typing.TypeVar('_floor_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload @staticmethod - def floor(double: float) -> float: ... - @typing.overload - @staticmethod - def floor(t: _floor_1__T) -> _floor_1__T: ... + def floor(double: float) -> float: + """ + Get the largest whole number smaller than x. + + Parameters: + x (double): number from which floor is requested + + Returns: + a double number f such that f is an integer f <= x < f + 1.0 + + """ + ... + @typing.overload + @staticmethod + def floor(t: _floor_1__T) -> _floor_1__T: + """ + Get the largest whole number smaller than x. + + Parameters: + x (T): number from which floor is requested + + Returns: + a double number f such that f is an integer f <= x < f + 1.0 + + Since: + 1.3 + + + """ + ... @typing.overload @staticmethod def floorDiv(int: int, int2: int) -> int: ... @@ -572,7 +3061,54 @@ class FastMath: def floorDivExact(long: int, long2: int) -> int: ... @typing.overload @staticmethod - def floorMod(int: int, int2: int) -> int: ... + def floorMod(int: int, int2: int) -> int: + """ + Finds r such that :code:`a = q b + r` with :code:`0 <= r < b` if :code:`b > 0` and :code:`b < r <= 0` if :code:`b < 0`. + + This methods returns the same value as integer modulo when a and b are same signs, but returns a different value when + they are opposite (i.e. q is negative). + + Parameters: + a (long): dividend + b (int): divisor + + Returns: + r such that :code:`a = q b + r` with :code:`0 <= r < b` if :code:`b > 0` and :code:`b < r <= 0` if :code:`b < 0` + + Raises: + :class:`~org.hipparchus.exception.MathRuntimeException`: if b == 0 + + Since: + 1.3 + + Also see: + + - :meth:`~org.hipparchus.util.FastMath.floorDiv` + + + Finds r such that :code:`a = q b + r` with :code:`0 <= r < b` if :code:`b > 0` and :code:`b < r <= 0` if :code:`b < 0`. + + This methods returns the same value as integer modulo when a and b are same signs, but returns a different value when + they are opposite (i.e. q is negative). + + Parameters: + a (long): dividend + b (long): divisor + + Returns: + r such that :code:`a = q b + r` with :code:`0 <= r < b` if :code:`b > 0` and :code:`b < r <= 0` if :code:`b < 0` + + Raises: + :class:`~org.hipparchus.exception.MathRuntimeException`: if b == 0 + + Also see: + + - :meth:`~org.hipparchus.util.FastMath.floorDiv` + + + + """ + ... @typing.overload @staticmethod def floorMod(long: int, int: int) -> int: ... @@ -581,23 +3117,142 @@ class FastMath: def floorMod(long: int, long2: int) -> int: ... @typing.overload @staticmethod - def fma(double: float, double2: float, double3: float) -> float: ... + def fma(double: float, double2: float, double3: float) -> float: + """ + Compute Fused-multiply-add operation a * b + c. + + This method was introduced in the regular :code:`Math` and :code:`StrictMath` methods with Java 9, and then added to + Hipparchus for consistency. However, a more general method was available in Hipparchus that also allow to repeat this + computation across several terms: :meth:`~org.hipparchus.util.MathArrays.linearCombination`. The linear combination + method should probably be preferred in most cases. + + Parameters: + a (double): first factor + b (double): second factor + c (double): additive term + + Returns: + a * b + c, using extended precision in the multiplication + + Since: + 1.3 + + Also see: + + - :meth:`~org.hipparchus.util.MathArrays.linearCombination` + - :meth:`~org.hipparchus.util.MathArrays.linearCombination` + - :meth:`~org.hipparchus.util.MathArrays.linearCombination` + - :meth:`~org.hipparchus.util.MathArrays.linearCombination` + + + Compute Fused-multiply-add operation a * b + c. + + This method was introduced in the regular :code:`Math` and :code:`StrictMath` methods with Java 9, and then added to + Hipparchus for consistency. However, a more general method was available in Hipparchus that also allow to repeat this + computation across several terms: :meth:`~org.hipparchus.util.MathArrays.linearCombination`. The linear combination + method should probably be preferred in most cases. + + Parameters: + a (float): first factor + b (float): second factor + c (float): additive term + + Returns: + a * b + c, using extended precision in the multiplication + + Also see: + + - :meth:`~org.hipparchus.util.MathArrays.linearCombination` + - :meth:`~org.hipparchus.util.MathArrays.linearCombination` + - :meth:`~org.hipparchus.util.MathArrays.linearCombination` + - :meth:`~org.hipparchus.util.MathArrays.linearCombination` + + + + """ + ... @typing.overload @staticmethod def fma(float: float, float2: float, float3: float) -> float: ... @typing.overload @staticmethod - def getExponent(double: float) -> int: ... + def getExponent(double: float) -> int: + """ + Return the exponent of a double number, removing the bias. + + For double numbers of the form 2 :sup:`x` , the unbiased exponent is exactly x. + + Parameters: + d (double): number from which exponent is requested + + Returns: + exponent for d in IEEE754 representation, without bias + + Return the exponent of a float number, removing the bias. + + For float numbers of the form 2 :sup:`x` , the unbiased exponent is exactly x. + + Parameters: + f (float): number from which exponent is requested + + Returns: + exponent for d in IEEE754 representation, without bias + + + """ + ... @typing.overload @staticmethod def getExponent(float: float) -> int: ... _hypot_1__T = typing.TypeVar('_hypot_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload @staticmethod - def hypot(double: float, double2: float) -> float: ... - @typing.overload - @staticmethod - def hypot(t: _hypot_1__T, t2: _hypot_1__T) -> _hypot_1__T: ... + def hypot(double: float, double2: float) -> float: + """ + Returns the hypotenuse of a triangle with sides :code:`x` and :code:`y` - sqrt(*x* :sup:`2` +*y* :sup:`2` ) + + + avoiding intermediate overflow or underflow. + + - If either argument is infinite, then the result is positive infinity. + - else, if either argument is NaN then the result is NaN. + + + Parameters: + x (double): a value + y (double): a value + + Returns: + sqrt(*x* :sup:`2` +*y* :sup:`2` ) + + """ + ... + @typing.overload + @staticmethod + def hypot(t: _hypot_1__T, t2: _hypot_1__T) -> _hypot_1__T: + """ + Returns the hypotenuse of a triangle with sides :code:`x` and :code:`y` - sqrt(*x* :sup:`2` +*y* :sup:`2` ) + + + avoiding intermediate overflow or underflow. + + - If either argument is infinite, then the result is positive infinity. + - else, if either argument is NaN then the result is NaN. + + + Parameters: + x (T): a value + y (T): a value + + Returns: + sqrt(*x* :sup:`2` +*y* :sup:`2` ) + + Since: + 1.3 + + + """ + ... @typing.overload @staticmethod def incrementExact(int: int) -> int: ... @@ -607,32 +3262,160 @@ class FastMath: _log_2__T = typing.TypeVar('_log_2__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload @staticmethod - def log(double: float) -> float: ... + def log(double: float) -> float: + """ + Natural logarithm. + + Parameters: + x (double): a double + + Returns: + log(x) + + Computes the ` logarithm <http://mathworld.wolfram.com/Logarithm.html>` in a given base. Returns :code:`NaN` if either + argument is negative. If :code:`base` is 0 and :code:`x` is positive, 0 is returned. If :code:`base` is positive and + :code:`x` is 0, :code:`Double.NEGATIVE_INFINITY` is returned. If both arguments are 0, the result is :code:`NaN`. + + Parameters: + base (double): Base of the logarithm, must be greater than 0. + x (double): Argument, must be greater than 0. + + Returns: + the value of the logarithm, i.e. the number :code:`y` such that :code:`base :sup:`y` = x`. + + """ + ... @typing.overload @staticmethod def log(double: float, double2: float) -> float: ... @typing.overload @staticmethod - def log(t: _log_2__T) -> _log_2__T: ... + def log(t: _log_2__T) -> _log_2__T: + """ + Natural logarithm. + + Parameters: + x (T): a double + + Returns: + log(x) + + Since: + 1.3 + + + """ + ... _log10_1__T = typing.TypeVar('_log10_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload @staticmethod - def log10(double: float) -> float: ... - @typing.overload - @staticmethod - def log10(t: _log10_1__T) -> _log10_1__T: ... + def log10(double: float) -> float: + """ + Compute the base 10 logarithm. + + Parameters: + x (double): a number + + Returns: + log10(x) + + """ + ... + @typing.overload + @staticmethod + def log10(t: _log10_1__T) -> _log10_1__T: + """ + Compute the base 10 logarithm. + + Parameters: + x (T): a number + + Returns: + log10(x) + + Since: + 1.3 + + + """ + ... _log1p_1__T = typing.TypeVar('_log1p_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload @staticmethod - def log1p(double: float) -> float: ... - @typing.overload - @staticmethod - def log1p(t: _log1p_1__T) -> _log1p_1__T: ... + def log1p(double: float) -> float: + """ + Computes log(1 + x). + + Parameters: + x (double): Number. + + Returns: + :code:`log(1 + x)`. + + """ + ... + @typing.overload + @staticmethod + def log1p(t: _log1p_1__T) -> _log1p_1__T: + """ + Computes log(1 + x). + + Parameters: + x (T): Number. + + Returns: + :code:`log(1 + x)`. + + Since: + 1.3 + + + """ + ... _max_4__T = typing.TypeVar('_max_4__T', bound=org.hipparchus.CalculusFieldElement) # <T> _max_5__T = typing.TypeVar('_max_5__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload @staticmethod - def max(double: float, double2: float) -> float: ... + def max(double: float, double2: float) -> float: + """ + Compute the maximum of two values + + Parameters: + a (int): first value + b (int): second value + + Returns: + b if a is lesser or equal to b, a otherwise + + Compute the maximum of two values + + Parameters: + a (long): first value + b (long): second value + + Returns: + b if a is lesser or equal to b, a otherwise + + Compute the maximum of two values + + Parameters: + a (float): first value + b (float): second value + + Returns: + b if a is lesser or equal to b, a otherwise + + Compute the maximum of two values + + Parameters: + a (double): first value + b (double): second value + + Returns: + b if a is lesser or equal to b, a otherwise + + """ + ... @typing.overload @staticmethod def max(float: float, float2: float) -> float: ... @@ -644,7 +3427,35 @@ class FastMath: def max(long: int, long2: int) -> int: ... @typing.overload @staticmethod - def max(t: _max_4__T, double: float) -> _max_4__T: ... + def max(t: _max_4__T, double: float) -> _max_4__T: + """ + Compute the maximum of two values + + Parameters: + a (T): first value + b (T): second value + + Returns: + b if a is lesser or equal to b, a otherwise + + Since: + 1.3 + + Compute the maximum of two values + + Parameters: + a (T): first value + b (double): second value + + Returns: + b if a is lesser or equal to b, a otherwise + + Since: + 1.3 + + + """ + ... @typing.overload @staticmethod def max(t: _max_5__T, t2: _max_5__T) -> _max_5__T: ... @@ -652,7 +3463,46 @@ class FastMath: _min_5__T = typing.TypeVar('_min_5__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload @staticmethod - def min(double: float, double2: float) -> float: ... + def min(double: float, double2: float) -> float: + """ + Compute the minimum of two values + + Parameters: + a (int): first value + b (int): second value + + Returns: + a if a is lesser or equal to b, b otherwise + + Compute the minimum of two values + + Parameters: + a (long): first value + b (long): second value + + Returns: + a if a is lesser or equal to b, b otherwise + + Compute the minimum of two values + + Parameters: + a (float): first value + b (float): second value + + Returns: + a if a is lesser or equal to b, b otherwise + + Compute the minimum of two values + + Parameters: + a (double): first value + b (double): second value + + Returns: + a if a is lesser or equal to b, b otherwise + + """ + ... @typing.overload @staticmethod def min(float: float, float2: float) -> float: ... @@ -664,13 +3514,84 @@ class FastMath: def min(long: int, long2: int) -> int: ... @typing.overload @staticmethod - def min(t: _min_4__T, double: float) -> _min_4__T: ... + def min(t: _min_4__T, double: float) -> _min_4__T: + """ + Compute the minimum of two values + + Parameters: + a (T): first value + b (T): second value + + Returns: + a if a is lesser or equal to b, b otherwise + + Since: + 1.3 + + Compute the minimum of two values + + Parameters: + a (T): first value + b (double): second value + + Returns: + a if a is lesser or equal to b, b otherwise + + Since: + 1.3 + + + """ + ... @typing.overload @staticmethod def min(t: _min_5__T, t2: _min_5__T) -> _min_5__T: ... @typing.overload @staticmethod - def multiplyExact(int: int, int2: int) -> int: ... + def multiplyExact(int: int, int2: int) -> int: + """ + Multiply two numbers, detecting overflows. + + Parameters: + a (int): first number to multiply + b (int): second number to multiply + + Returns: + a*b if no overflows occur + + Raises: + :class:`~org.hipparchus.exception.MathRuntimeException`: if an overflow occurs + + Multiply two numbers, detecting overflows. + + Parameters: + a (long): first number to multiply + b (int): second number to multiply + + Returns: + a*b if no overflows occur + + Raises: + :class:`~org.hipparchus.exception.MathRuntimeException`: if an overflow occurs + + Since: + 1.3 + + Multiply two numbers, detecting overflows. + + Parameters: + a (long): first number to multiply + b (long): second number to multiply + + Returns: + a*b if no overflows occur + + Raises: + :class:`~org.hipparchus.exception.MathRuntimeException`: if an overflow occurs + + + """ + ... @typing.overload @staticmethod def multiplyExact(long: int, int: int) -> int: ... @@ -678,42 +3599,251 @@ class FastMath: @staticmethod def multiplyExact(long: int, long2: int) -> int: ... @staticmethod - def multiplyFull(int: int, int2: int) -> int: ... - @staticmethod - def multiplyHigh(long: int, long2: int) -> int: ... - @typing.overload - @staticmethod - def negateExact(int: int) -> int: ... + def multiplyFull(int: int, int2: int) -> int: + """ + Multiply two integers and give an exact result without overflow. + + Parameters: + a (int): first factor + b (int): second factor + + Returns: + a * b exactly + + Since: + 1.3 + + + """ + ... + @staticmethod + def multiplyHigh(long: int, long2: int) -> int: + """ + Multiply two long integers and give the 64 most significant bits of the result. + + Beware that as Java primitive long are always considered to be signed, there are some intermediate values :code:`a` and + :code:`b` for which :code:`a * b` exceeds :code:`Long.MAX_VALUE` but this method will still return 0l. This happens for + example for :code:`a = 2³¹` and :code:`b = 2³²` as :code:`a * b = 2â¶Â³ = Long.MAX_VALUE + 1`, so it exceeds the + max value for a long, but still fits in 64 bits, so this method correctly returns 0l in this case, but multiplication + result would be considered negative (and in fact equal to :code:`Long.MIN_VALUE` + + Parameters: + a (long): first factor + b (long): second factor + + Returns: + a * b / 2 :sup:`64` + + Since: + 1.3 + + + """ + ... + @typing.overload + @staticmethod + def negateExact(int: int) -> int: + """ + Negates the argument. + + Parameters: + x (int): number from which opposite value is requested + + Returns: + -x, or throws an exception for :code:`Integer.MIN_VALUE` + + Since: + 2.0 + + Negates the argument. + + Parameters: + x (long): number from which opposite value is requested + + Returns: + -x, or throws an exception for :code:`Long.MIN_VALUE` + + Since: + 2.0 + + + """ + ... @typing.overload @staticmethod def negateExact(long: int) -> int: ... @typing.overload @staticmethod - def nextAfter(double: float, double2: float) -> float: ... + def nextAfter(double: float, double2: float) -> float: + """ + Get the next machine representable number after a number, moving in the direction of another number. + + The ordering is as follows (increasing): + + - -INFINITY + - -MAX_VALUE + - -MIN_VALUE + - -0.0 + - +0.0 + - +MIN_VALUE + - +MAX_VALUE + - +INFINITY + + + If arguments compare equal, then the second argument is returned. + + If :code:`direction` is greater than :code:`d`, the smallest machine representable number strictly greater than + :code:`d` is returned; if less, then the largest representable number strictly less than :code:`d` is returned. + + If :code:`d` is infinite and direction does not bring it back to finite numbers, it is returned unchanged. + + Parameters: + d (double): base number + direction (double): (the only important thing is whether :code:`direction` is greater or smaller than :code:`d`) + + Returns: + the next machine representable number in the specified direction + + Get the next machine representable number after a number, moving in the direction of another number. + + * The ordering is as follows (increasing): + + - -INFINITY + - -MAX_VALUE + - -MIN_VALUE + - -0.0 + - +0.0 + - +MIN_VALUE + - +MAX_VALUE + - +INFINITY + + + If arguments compare equal, then the second argument is returned. + + If :code:`direction` is greater than :code:`f`, the smallest machine representable number strictly greater than + :code:`f` is returned; if less, then the largest representable number strictly less than :code:`f` is returned. + + If :code:`f` is infinite and direction does not bring it back to finite numbers, it is returned unchanged. + + Parameters: + f (float): base number + direction (double): (the only important thing is whether :code:`direction` is greater or smaller than :code:`f`) + + Returns: + the next machine representable number in the specified direction + + + """ + ... @typing.overload @staticmethod def nextAfter(float: float, double: float) -> float: ... @typing.overload @staticmethod - def nextDown(double: float) -> float: ... + def nextDown(double: float) -> float: + """ + Compute next number towards negative infinity. + + Parameters: + a (double): number to which neighbor should be computed + + Returns: + neighbor of a towards negative infinity + + Compute next number towards negative infinity. + + Parameters: + a (float): number to which neighbor should be computed + + Returns: + neighbor of a towards negative infinity + + + """ + ... @typing.overload @staticmethod def nextDown(float: float) -> float: ... @typing.overload @staticmethod - def nextUp(double: float) -> float: ... + def nextUp(double: float) -> float: + """ + Compute next number towards positive infinity. + + Parameters: + a (double): number to which neighbor should be computed + + Returns: + neighbor of a towards positive infinity + + Compute next number towards positive infinity. + + Parameters: + a (float): number to which neighbor should be computed + + Returns: + neighbor of a towards positive infinity + + + """ + ... @typing.overload @staticmethod def nextUp(float: float) -> float: ... _norm__T = typing.TypeVar('_norm__T', bound=org.hipparchus.CalculusFieldElement) # <T> @staticmethod - def norm(t: _norm__T) -> float: ... + def norm(t: _norm__T) -> float: + """ + Norm. + + Parameters: + x (T): number from which norm is requested + + Returns: + norm(x) + + Since: + 2.0 + + + """ + ... _pow_3__T = typing.TypeVar('_pow_3__T', bound=org.hipparchus.CalculusFieldElement) # <T> _pow_4__T = typing.TypeVar('_pow_4__T', bound=org.hipparchus.CalculusFieldElement) # <T> _pow_5__T = typing.TypeVar('_pow_5__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload @staticmethod - def pow(double: float, double2: float) -> float: ... + def pow(double: float, double2: float) -> float: + """ + Power function. Compute x^y. + + Parameters: + x (double): a double + y (double): a double + + Returns: + double + + Raise a double to an int power. + + Parameters: + d (double): Number to raise. + e (int): Exponent. + + Returns: + d :sup:`e` + + Raise a double to a long power. + + Parameters: + d (double): Number to raise. + e (long): Exponent. + + Returns: + d :sup:`e` + + """ + ... @typing.overload @staticmethod def pow(double: float, int: int) -> float: ... @@ -722,7 +3852,47 @@ class FastMath: def pow(double: float, long: int) -> float: ... @typing.overload @staticmethod - def pow(t: _pow_3__T, double: float) -> _pow_3__T: ... + def pow(t: _pow_3__T, double: float) -> _pow_3__T: + """ + Power function. Compute x :sup:`y` . + + Parameters: + x (T): a double + y (T): a double + + Returns: + x :sup:`y` + + Since: + 1.3 + + Power function. Compute x :sup:`y` . + + Parameters: + x (T): a double + y (double): a double + + Returns: + x :sup:`y` + + Since: + 1.7 + + Raise a double to an int power. + + Parameters: + d (T): Number to raise. + e (int): Exponent. + + Returns: + d :sup:`e` + + Since: + 1.3 + + + """ + ... @typing.overload @staticmethod def pow(t: _pow_4__T, int: int) -> _pow_4__T: ... @@ -730,133 +3900,608 @@ class FastMath: @staticmethod def pow(t: _pow_5__T, t2: _pow_5__T) -> _pow_5__T: ... @staticmethod - def random() -> float: ... + def random() -> float: + """ + Returns a pseudo-random number between 0.0 and 1.0. + + **Note:** this implementation currently delegates to + :meth:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Math.random` + + Returns: + a random number between 0.0 and 1.0 + + + """ + ... _rint_1__T = typing.TypeVar('_rint_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload @staticmethod - def rint(double: float) -> float: ... - @typing.overload - @staticmethod - def rint(t: _rint_1__T) -> _rint_1__T: ... + def rint(double: float) -> float: + """ + Get the whole number that is the nearest to x, or the even one if x is exactly half way between two integers. + + Parameters: + x (double): number from which nearest whole number is requested + + Returns: + a double number r such that r is an integer r - 0.5 <= x <= r + 0.5 + + """ + ... + @typing.overload + @staticmethod + def rint(t: _rint_1__T) -> _rint_1__T: + """ + Get the whole number that is the nearest to x, or the even one if x is exactly half way between two integers. + + Parameters: + x (T): number from which nearest whole number is requested + + Returns: + a double number r such that r is an integer r - 0.5 <= x <= r + 0.5 + + Since: + 1.3 + + + """ + ... _round_2__T = typing.TypeVar('_round_2__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload @staticmethod - def round(float: float) -> int: ... + def round(float: float) -> int: + """ + Get the closest long to x. + + Parameters: + x (double): number from which closest long is requested + + Returns: + closest long to x + + Get the closest int to x. + + Parameters: + x (float): number from which closest int is requested + + Returns: + closest int to x + + """ + ... @typing.overload @staticmethod def round(double: float) -> int: ... @typing.overload @staticmethod - def round(t: _round_2__T) -> int: ... + def round(t: _round_2__T) -> int: + """ + Get the closest long to x. + + Parameters: + x (T): number from which closest long is requested + + Returns: + closest long to x + + Since: + 1.3 + + + """ + ... _scalb_2__T = typing.TypeVar('_scalb_2__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload @staticmethod - def scalb(double: float, int: int) -> float: ... + def scalb(double: float, int: int) -> float: + """ + Multiply a double number by a power of 2. + + Parameters: + d (double): number to multiply + n (int): power of 2 + + Returns: + d × 2 :sup:`n` + + Multiply a float number by a power of 2. + + Parameters: + f (float): number to multiply + n (int): power of 2 + + Returns: + f × 2 :sup:`n` + + """ + ... @typing.overload @staticmethod def scalb(float: float, int: int) -> float: ... @typing.overload @staticmethod - def scalb(t: _scalb_2__T, int: int) -> _scalb_2__T: ... + def scalb(t: _scalb_2__T, int: int) -> _scalb_2__T: + """ + Multiply a double number by a power of 2. + + Parameters: + d (T): number to multiply + n (int): power of 2 + + Returns: + d × 2 :sup:`n` + + Since: + 1.3 + + + """ + ... _sign__T = typing.TypeVar('_sign__T', bound=org.hipparchus.CalculusFieldElement) # <T> @staticmethod - def sign(t: _sign__T) -> _sign__T: ... - @typing.overload - @staticmethod - def signum(double: float) -> float: ... + def sign(t: _sign__T) -> _sign__T: + """ + Compute the sign of a number. The sign is -1 for negative numbers, +1 for positive numbers and 0 otherwise, for Complex + number, it is extended on the unit circle (equivalent to z/|z|, with special handling for 0 and NaN) + + Parameters: + a (T): number on which evaluation is done + + Returns: + -1.0, -0.0, +0.0, +1.0 or NaN depending on sign of a + + Since: + 2.0 + + + """ + ... + @typing.overload + @staticmethod + def signum(double: float) -> float: + """ + Compute the signum of a number. The signum is -1 for negative numbers, +1 for positive numbers and 0 otherwise + + Parameters: + a (double): number on which evaluation is done + + Returns: + -1.0, -0.0, +0.0, +1.0 or NaN depending on sign of a + + Compute the signum of a number. The signum is -1 for negative numbers, +1 for positive numbers and 0 otherwise + + Parameters: + a (float): number on which evaluation is done + + Returns: + -1.0, -0.0, +0.0, +1.0 or NaN depending on sign of a + + + """ + ... @typing.overload @staticmethod def signum(float: float) -> float: ... _sin_1__T = typing.TypeVar('_sin_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload @staticmethod - def sin(double: float) -> float: ... - @typing.overload - @staticmethod - def sin(t: _sin_1__T) -> _sin_1__T: ... + def sin(double: float) -> float: + """ + Sine function. + + Parameters: + x (double): Argument. + + Returns: + sin(x) + + """ + ... + @typing.overload + @staticmethod + def sin(t: _sin_1__T) -> _sin_1__T: + """ + Sine function. + + Parameters: + x (T): Argument. + + Returns: + sin(x) + + Since: + 1.3 + + + """ + ... _sinCos_0__T = typing.TypeVar('_sinCos_0__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload @staticmethod - def sinCos(t: _sinCos_0__T) -> 'FieldSinCos'[_sinCos_0__T]: ... - @typing.overload - @staticmethod - def sinCos(double: float) -> 'SinCos': ... + def sinCos(t: _sinCos_0__T) -> 'FieldSinCos'[_sinCos_0__T]: + """ + Combined Sine and Cosine function. + + Parameters: + x (T): Argument. + + Returns: + [sin(x), cos(x)] + + Since: + 1.4 + + + """ + ... + @typing.overload + @staticmethod + def sinCos(double: float) -> 'SinCos': + """ + Combined Sine and Cosine function. + + Parameters: + x (double): Argument. + + Returns: + [sin(x), cos(x)] + + """ + ... _sinh_1__T = typing.TypeVar('_sinh_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload @staticmethod - def sinh(double: float) -> float: ... - @typing.overload - @staticmethod - def sinh(t: _sinh_1__T) -> _sinh_1__T: ... + def sinh(double: float) -> float: + """ + Compute the hyperbolic sine of a number. + + Parameters: + x (double): number on which evaluation is done + + Returns: + hyperbolic sine of x + + """ + ... + @typing.overload + @staticmethod + def sinh(t: _sinh_1__T) -> _sinh_1__T: + """ + Compute the hyperbolic sine of a number. + + Parameters: + x (T): number on which evaluation is done + + Returns: + hyperbolic sine of x + + Since: + 1.3 + + + """ + ... _sinhCosh_0__T = typing.TypeVar('_sinhCosh_0__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload @staticmethod - def sinhCosh(t: _sinhCosh_0__T) -> 'FieldSinhCosh'[_sinhCosh_0__T]: ... - @typing.overload - @staticmethod - def sinhCosh(double: float) -> 'SinhCosh': ... + def sinhCosh(t: _sinhCosh_0__T) -> 'FieldSinhCosh'[_sinhCosh_0__T]: + """ + Combined hyperbolic sine and hyperbolic cosine function. + + Parameters: + x (T): Argument. + + Returns: + [sinh(x), cosh(x)] + + + """ + ... + @typing.overload + @staticmethod + def sinhCosh(double: float) -> 'SinhCosh': + """ + Combined hyperbolic sine and hyperbolic cosine function. + + Parameters: + x (double): Argument. + + Returns: + [sinh(x), cosh(x)] + + """ + ... _sqrt_1__T = typing.TypeVar('_sqrt_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload @staticmethod - def sqrt(double: float) -> float: ... - @typing.overload - @staticmethod - def sqrt(t: _sqrt_1__T) -> _sqrt_1__T: ... - @typing.overload - @staticmethod - def subtractExact(int: int, int2: int) -> int: ... + def sqrt(double: float) -> float: + """ + Compute the square root of a number. + + **Note:** this implementation currently delegates to + :meth:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Math.sqrt` + + Parameters: + a (double): number on which evaluation is done + + Returns: + square root of a + + """ + ... + @typing.overload + @staticmethod + def sqrt(t: _sqrt_1__T) -> _sqrt_1__T: + """ + Compute the square root of a number. + + Parameters: + a (T): number on which evaluation is done + + Returns: + square root of a + + Since: + 1.3 + + + """ + ... + @typing.overload + @staticmethod + def subtractExact(int: int, int2: int) -> int: + """ + Subtract two numbers, detecting overflows. + + Parameters: + a (int): first number + b (int): second number to subtract from a + + Returns: + a-b if no overflows occur + + Raises: + :class:`~org.hipparchus.exception.MathRuntimeException`: if an overflow occurs + + Subtract two numbers, detecting overflows. + + Parameters: + a (long): first number + b (long): second number to subtract from a + + Returns: + a-b if no overflows occur + + Raises: + :class:`~org.hipparchus.exception.MathRuntimeException`: if an overflow occurs + + + """ + ... @typing.overload @staticmethod def subtractExact(long: int, long2: int) -> int: ... _tan_1__T = typing.TypeVar('_tan_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload @staticmethod - def tan(double: float) -> float: ... - @typing.overload - @staticmethod - def tan(t: _tan_1__T) -> _tan_1__T: ... + def tan(double: float) -> float: + """ + Tangent function. + + Parameters: + x (double): Argument. + + Returns: + tan(x) + + """ + ... + @typing.overload + @staticmethod + def tan(t: _tan_1__T) -> _tan_1__T: + """ + Tangent function. + + Parameters: + x (T): Argument. + + Returns: + tan(x) + + Since: + 1.3 + + + """ + ... _tanh_1__T = typing.TypeVar('_tanh_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload @staticmethod - def tanh(double: float) -> float: ... - @typing.overload - @staticmethod - def tanh(t: _tanh_1__T) -> _tanh_1__T: ... + def tanh(double: float) -> float: + """ + Compute the hyperbolic tangent of a number. + + Parameters: + x (double): number on which evaluation is done + + Returns: + hyperbolic tangent of x + + """ + ... + @typing.overload + @staticmethod + def tanh(t: _tanh_1__T) -> _tanh_1__T: + """ + Compute the hyperbolic tangent of a number. + + Parameters: + x (T): number on which evaluation is done + + Returns: + hyperbolic tangent of x + + Since: + 1.3 + + + """ + ... _toDegrees_1__T = typing.TypeVar('_toDegrees_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload @staticmethod - def toDegrees(double: float) -> float: ... - @typing.overload - @staticmethod - def toDegrees(t: _toDegrees_1__T) -> _toDegrees_1__T: ... + def toDegrees(double: float) -> float: + """ + Convert radians to degrees, with error of less than 0.5 ULP + + Parameters: + x (double): angle in radians + + Returns: + x converted into degrees + + """ + ... + @typing.overload + @staticmethod + def toDegrees(t: _toDegrees_1__T) -> _toDegrees_1__T: + """ + Convert radians to degrees, with error of less than 0.5 ULP + + Parameters: + x (T): angle in radians + + Returns: + x converted into degrees + + + """ + ... @staticmethod def toIntExact(long: int) -> int: ... _toRadians_1__T = typing.TypeVar('_toRadians_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload @staticmethod - def toRadians(double: float) -> float: ... - @typing.overload - @staticmethod - def toRadians(t: _toRadians_1__T) -> _toRadians_1__T: ... + def toRadians(double: float) -> float: + """ + Convert degrees to radians, with error of less than 0.5 ULP + + Parameters: + x (double): angle in degrees + + Returns: + x converted into radians + + """ + ... + @typing.overload + @staticmethod + def toRadians(t: _toRadians_1__T) -> _toRadians_1__T: + """ + Convert degrees to radians, with error of less than 0.5 ULP + + Parameters: + x (T): angle in degrees + + Returns: + x converted into radians + + + """ + ... _ulp_2__T = typing.TypeVar('_ulp_2__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload @staticmethod - def ulp(double: float) -> float: ... + def ulp(double: float) -> float: + """ + Compute least significant bit (Unit in Last Position) for a number. + + Parameters: + x (double): number from which ulp is requested + + Returns: + ulp(x) + + Compute least significant bit (Unit in Last Position) for a number. + + Parameters: + x (float): number from which ulp is requested + + Returns: + ulp(x) + + """ + ... @typing.overload @staticmethod def ulp(float: float) -> float: ... @typing.overload @staticmethod - def ulp(t: _ulp_2__T) -> _ulp_2__T: ... - @staticmethod - def unsignedMultiplyHigh(long: int, long2: int) -> int: ... + def ulp(t: _ulp_2__T) -> _ulp_2__T: + """ + Compute least significant bit (Unit in Last Position) for a number. + + Parameters: + x (T): number from which ulp is requested + + Returns: + ulp(x) + + Since: + 2.0 + + + """ + ... + @staticmethod + def unsignedMultiplyHigh(long: int, long2: int) -> int: + """ + Multiply two long unsigned integers and give the 64 most significant bits of the unsigned result. + + Beware that as Java primitive long are always considered to be signed, there are some intermediate values :code:`a` and + :code:`b` for which :code:`a * b` exceeds :code:`Long.MAX_VALUE` but this method will still return 0l. This happens for + example for :code:`a = 2³¹` and :code:`b = 2³²` as :code:`a * b = 2â¶Â³ = Long.MAX_VALUE + 1`, so it exceeds the + max value for a long, but still fits in 64 bits, so this method correctly returns 0l in this case, but multiplication + result would be considered negative (and in fact equal to :code:`Long.MIN_VALUE` + + Parameters: + a (long): first factor + b (long): second factor + + Returns: + a * b / 2 :sup:`64` + + Since: + 3.0 + + + """ + ... _FieldBlendable__B = typing.TypeVar('_FieldBlendable__B') # <B> _FieldBlendable__T = typing.TypeVar('_FieldBlendable__T', bound=org.hipparchus.FieldElement) # <T> class FieldBlendable(typing.Generic[_FieldBlendable__B, _FieldBlendable__T]): + """ + public interfaceFieldBlendable<B,T extends :class:`~org.hipparchus.FieldElement`<T>> + + Interface representing classes that can blend with other instances of themselves using a given blending value. + + The blending value is commonly given from a + :class:`~org.hipparchus.analysis.polynomials.SmoothStepFactory.FieldSmoothStepFunction`. + """ def blendArithmeticallyWith(self, b: _FieldBlendable__B, t: _FieldBlendable__T) -> _FieldBlendable__B: ... class FieldContinuedFraction: + """ + public abstract classFieldContinuedFraction extends :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Provides a generic means to evaluate continued fractions. Subclasses simply provided the a and b coefficients to + evaluate the continued fraction. + + References: + + - ` Continued Fraction <http://mathworld.wolfram.com/ContinuedFraction.html>` + """ _evaluate_0__T = typing.TypeVar('_evaluate_0__T', bound=org.hipparchus.CalculusFieldElement) # <T> _evaluate_1__T = typing.TypeVar('_evaluate_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> _evaluate_2__T = typing.TypeVar('_evaluate_2__T', bound=org.hipparchus.CalculusFieldElement) # <T> @@ -876,30 +4521,161 @@ class FieldContinuedFraction: _FieldSinCos__T = typing.TypeVar('_FieldSinCos__T') # <T> class FieldSinCos(typing.Generic[_FieldSinCos__T]): + """ + public classFieldSinCos<T> extends :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Holder for both sine and cosine values. + + This class is a simple container, it does not provide any computational method. + + Since: + 1.4 + + Also see: + + - :meth:`~org.hipparchus.util.FastMath.sinCos` + """ def __init__(self, t: _FieldSinCos__T, t2: _FieldSinCos__T): ... - def cos(self) -> _FieldSinCos__T: ... + def cos(self) -> _FieldSinCos__T: + """ + Get the value of the cosine. + + Returns: + value of the cosine + + + """ + ... _difference__S = typing.TypeVar('_difference__S', bound=org.hipparchus.CalculusFieldElement) # <S> @staticmethod - def difference(fieldSinCos: 'FieldSinCos'[_difference__S], fieldSinCos2: 'FieldSinCos'[_difference__S]) -> 'FieldSinCos'[_difference__S]: ... - def sin(self) -> _FieldSinCos__T: ... + def difference(fieldSinCos: 'FieldSinCos'[_difference__S], fieldSinCos2: 'FieldSinCos'[_difference__S]) -> 'FieldSinCos'[_difference__S]: + """ + Compute sine and cosine of angles difference. + + Parameters: + scAlpha (:class:`~org.hipparchus.util.FieldSinCos`<S> scAlpha): \((\sin \alpha, \cos \alpha)\) + scBeta (:class:`~org.hipparchus.util.FieldSinCos`<S> scBeta): \((\sin \beta, \cos \beta)\) + + Returns: + \((\sin \alpha+\beta, \cos \alpha-\beta)\) + + Since: + 1.8 + + + """ + ... + def sin(self) -> _FieldSinCos__T: + """ + Get the value of the sine. + + Returns: + value of the sine + + + """ + ... _sum__S = typing.TypeVar('_sum__S', bound=org.hipparchus.CalculusFieldElement) # <S> @staticmethod - def sum(fieldSinCos: 'FieldSinCos'[_sum__S], fieldSinCos2: 'FieldSinCos'[_sum__S]) -> 'FieldSinCos'[_sum__S]: ... + def sum(fieldSinCos: 'FieldSinCos'[_sum__S], fieldSinCos2: 'FieldSinCos'[_sum__S]) -> 'FieldSinCos'[_sum__S]: + """ + Compute sine and cosine of angles sum. + + Parameters: + scAlpha (:class:`~org.hipparchus.util.FieldSinCos`<S> scAlpha): \((\sin \alpha, \cos \alpha)\) + scBeta (:class:`~org.hipparchus.util.FieldSinCos`<S> scBeta): \((\sin \beta, \cos \beta)\) + + Returns: + \((\sin \alpha+\beta, \cos \alpha+\beta)\) + + Since: + 1.8 + + + """ + ... _FieldSinhCosh__T = typing.TypeVar('_FieldSinhCosh__T') # <T> class FieldSinhCosh(typing.Generic[_FieldSinhCosh__T]): + """ + public classFieldSinhCosh<T> extends :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Holder for both hyperbolic sine and hyperbolic cosine values. + + This class is a simple container, it does not provide any computational method. + + Since: + 2.0 + + Also see: + + - :meth:`~org.hipparchus.util.FastMath.sinhCosh` + """ def __init__(self, t: _FieldSinhCosh__T, t2: _FieldSinhCosh__T): ... - def cosh(self) -> _FieldSinhCosh__T: ... + def cosh(self) -> _FieldSinhCosh__T: + """ + Get the value of the hyperbolic cosine. + + Returns: + value of the hyperbolic cosine + + + """ + ... _difference__S = typing.TypeVar('_difference__S', bound=org.hipparchus.CalculusFieldElement) # <S> @staticmethod - def difference(fieldSinhCosh: 'FieldSinhCosh'[_difference__S], fieldSinhCosh2: 'FieldSinhCosh'[_difference__S]) -> 'FieldSinhCosh'[_difference__S]: ... - def sinh(self) -> _FieldSinhCosh__T: ... + def difference(fieldSinhCosh: 'FieldSinhCosh'[_difference__S], fieldSinhCosh2: 'FieldSinhCosh'[_difference__S]) -> 'FieldSinhCosh'[_difference__S]: + """ + Compute hyperbolic sine and hyperbolic cosine of angles difference. + + Parameters: + schAlpha (:class:`~org.hipparchus.util.FieldSinhCosh`<S> schAlpha): \((\sinh \alpha, \cosh \alpha)\) + schBeta (:class:`~org.hipparchus.util.FieldSinhCosh`<S> schBeta): \((\sinh \beta, \cosh \beta)\) + + Returns: + \((\sinh \alpha+\beta, \cosh \alpha-\beta)\) + + + """ + ... + def sinh(self) -> _FieldSinhCosh__T: + """ + Get the value of the hyperbolic sine. + + Returns: + value of the hyperbolic sine + + + """ + ... _sum__S = typing.TypeVar('_sum__S', bound=org.hipparchus.CalculusFieldElement) # <S> @staticmethod - def sum(fieldSinhCosh: 'FieldSinhCosh'[_sum__S], fieldSinhCosh2: 'FieldSinhCosh'[_sum__S]) -> 'FieldSinhCosh'[_sum__S]: ... + def sum(fieldSinhCosh: 'FieldSinhCosh'[_sum__S], fieldSinhCosh2: 'FieldSinhCosh'[_sum__S]) -> 'FieldSinhCosh'[_sum__S]: + """ + Compute hyperbolic sine and hyperbolic cosine of angles sum. + + Parameters: + schAlpha (:class:`~org.hipparchus.util.FieldSinhCosh`<S> schAlpha): \((\sinh \alpha, \cosh \alpha)\) + schBeta (:class:`~org.hipparchus.util.FieldSinhCosh`<S> schBeta): \((\sinh \beta, \cosh \beta)\) + + Returns: + \((\sinh \alpha+\beta, \cosh \alpha+\beta)\) + + + """ + ... _FieldTuple__T = typing.TypeVar('_FieldTuple__T', bound=org.hipparchus.CalculusFieldElement) # <T> class FieldTuple(org.hipparchus.CalculusFieldElement['FieldTuple'[_FieldTuple__T]], typing.Generic[_FieldTuple__T]): + """ + public classFieldTuple<T extends :class:`~org.hipparchus.CalculusFieldElement`<T>> extends :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.CalculusFieldElement`<:class:`~org.hipparchus.util.FieldTuple`<T>> + + This class allows to perform the same computation of all components of a Tuple at once. + + Since: + 1.2 + """ def __init__(self, *t: _FieldTuple__T): ... def abs(self) -> 'FieldTuple'[_FieldTuple__T]: ... def acos(self) -> 'FieldTuple'[_FieldTuple__T]: ... @@ -925,17 +4701,77 @@ class FieldTuple(org.hipparchus.CalculusFieldElement['FieldTuple'[_FieldTuple__T def divide(self, double: float) -> 'FieldTuple'[_FieldTuple__T]: ... @typing.overload def divide(self, fieldTuple: 'FieldTuple'[_FieldTuple__T]) -> 'FieldTuple'[_FieldTuple__T]: ... - def equals(self, object: typing.Any) -> bool: ... + def equals(self, object: typing.Any) -> bool: + """ + + Overrides: + :meth:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.equals` in + class :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + + """ + ... def exp(self) -> 'FieldTuple'[_FieldTuple__T]: ... def expm1(self) -> 'FieldTuple'[_FieldTuple__T]: ... def floor(self) -> 'FieldTuple'[_FieldTuple__T]: ... - def getComponent(self, int: int) -> _FieldTuple__T: ... - def getComponents(self) -> typing.MutableSequence[_FieldTuple__T]: ... - def getDimension(self) -> int: ... + def getComponent(self, int: int) -> _FieldTuple__T: + """ + Get one component of the tuple. + + Parameters: + index (int): index of the component, between 0 and :meth:`~org.hipparchus.util.FieldTuple.getDimension` - 1 + + Returns: + value of the component + + + """ + ... + def getComponents(self) -> typing.MutableSequence[_FieldTuple__T]: + """ + Get all components of the tuple. + + Returns: + all components + + + """ + ... + def getDimension(self) -> int: + """ + Get the dimension of the tuple. + + Returns: + dimension of the tuple + + + """ + ... def getField(self) -> org.hipparchus.Field['FieldTuple'[_FieldTuple__T]]: ... def getPi(self) -> 'FieldTuple'[_FieldTuple__T]: ... - def getReal(self) -> float: ... - def hashCode(self) -> int: ... + def getReal(self) -> float: + """ + Get the real value of the number. + + Specified by: + :meth:`~org.hipparchus.FieldElement.getReal` in interface :class:`~org.hipparchus.FieldElement` + + Returns: + real value + + + """ + ... + def hashCode(self) -> int: + """ + + Overrides: + :meth:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.hashCode` in + class :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + + """ + ... def hypot(self, fieldTuple: 'FieldTuple'[_FieldTuple__T]) -> 'FieldTuple'[_FieldTuple__T]: ... @typing.overload def linearCombination(self, double: float, fieldTuple: 'FieldTuple'[_FieldTuple__T], double2: float, fieldTuple2: 'FieldTuple'[_FieldTuple__T]) -> 'FieldTuple'[_FieldTuple__T]: ... @@ -996,6 +4832,14 @@ class FieldTuple(org.hipparchus.CalculusFieldElement['FieldTuple'[_FieldTuple__T def ulp(self) -> 'FieldTuple'[_FieldTuple__T]: ... class Incrementor: + """ + public classIncrementor extends :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Utility that increments a counter until a maximum is reached, at which point, the instance will by default throw a + :class:`~org.hipparchus.exception.MathIllegalStateException`. However, the user is able to override this behaviour by + defining a custom :class:`~org.hipparchus.util.Incrementor.MaxCountExceededCallback`, in order to e.g. select which + exception must be thrown. + """ @typing.overload def __init__(self): ... @typing.overload @@ -1003,63 +4847,406 @@ class Incrementor: @typing.overload def __init__(self, int: int, maxCountExceededCallback: typing.Union['Incrementor.MaxCountExceededCallback', typing.Callable]): ... @typing.overload - def canIncrement(self) -> bool: ... - @typing.overload - def canIncrement(self, int: int) -> bool: ... - def getCount(self) -> int: ... - def getMaximalCount(self) -> int: ... - @typing.overload - def increment(self) -> None: ... - @typing.overload - def increment(self, int: int) -> None: ... - def reset(self) -> None: ... - def withCallback(self, maxCountExceededCallback: typing.Union['Incrementor.MaxCountExceededCallback', typing.Callable]) -> 'Incrementor': ... - def withCount(self, int: int) -> 'Incrementor': ... - def withMaximalCount(self, int: int) -> 'Incrementor': ... + def canIncrement(self) -> bool: + """ + Checks whether incrementing the counter :code:`nTimes` is allowed. + + Returns: + :code:`false` if calling :meth:`~org.hipparchus.util.Incrementor.increment` will trigger a + :code:`MathIllegalStateException`, :code:`true` otherwise. + + """ + ... + @typing.overload + def canIncrement(self, int: int) -> bool: + """ + Checks whether incrementing the counter several times is allowed. + + Parameters: + nTimes (int): Number of increments. + + Returns: + :code:`false` if calling :meth:`~org.hipparchus.util.Incrementor.increment` would call the + :class:`~org.hipparchus.util.Incrementor.MaxCountExceededCallback` :code:`true` otherwise. + + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if :code:`nTimes` is negative. + + + """ + ... + def getCount(self) -> int: + """ + Gets the current count. + + Returns: + the current count. + + + """ + ... + def getMaximalCount(self) -> int: + """ + Gets the upper limit of the counter. + + Returns: + the counter upper limit. + + + """ + ... + @typing.overload + def increment(self) -> None: + """ + Adds the increment value to the current iteration count. At counter exhaustion, this method will call the + :meth:`~org.hipparchus.util.Incrementor.MaxCountExceededCallback.trigger` method of the callback object passed to the + :meth:`~org.hipparchus.util.Incrementor.withCallback` method. + + Also see: + + - :meth:`~org.hipparchus.util.Incrementor.increment` + + + + """ + ... + @typing.overload + def increment(self, int: int) -> None: + """ + Performs multiple increments. + + Parameters: + nTimes (int): Number of increments. + + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if :code:`nTimes` is negative. + + Also see: + + - :meth:`~org.hipparchus.util.Incrementor.increment` + + + """ + ... + def reset(self) -> None: + """ + Resets the counter to 0. + + """ + ... + def withCallback(self, maxCountExceededCallback: typing.Union['Incrementor.MaxCountExceededCallback', typing.Callable]) -> 'Incrementor': + """ + Creates a new instance with a given callback. The counter is reset to 0. + + Parameters: + cb (:class:`~org.hipparchus.util.Incrementor.MaxCountExceededCallback`): Callback to be called at counter exhaustion. + + Returns: + a new instance. + + + """ + ... + def withCount(self, int: int) -> 'Incrementor': + """ + Creates a new instance and set the counter to the given value. + + Parameters: + value (int): Value of the counter. + + Returns: + a new instance. + + + """ + ... + def withMaximalCount(self, int: int) -> 'Incrementor': + """ + Creates a new instance with a given maximal count. The counter is reset to 0. + + Parameters: + max (int): Maximal count. + + Returns: + a new instance. + + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if :code:`max` is negative. + + + """ + ... class MaxCountExceededCallback: def trigger(self, int: int) -> None: ... class IterationEvent(java.util.EventObject): + """ + public classIterationEvent extends :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.util.EventObject` + + The root class from which all events occurring while running an :class:`~org.hipparchus.util.IterationManager` should be + derived. + + Also see: + + - :meth:`~serialized` + """ def __init__(self, object: typing.Any, int: int): ... - def getIterations(self) -> int: ... + def getIterations(self) -> int: + """ + Returns the number of iterations performed at the time :code:`this` event is created. + + Returns: + the number of iterations performed + + + """ + ... class IterationListener(java.util.EventListener): - def initializationPerformed(self, iterationEvent: IterationEvent) -> None: ... - def iterationPerformed(self, iterationEvent: IterationEvent) -> None: ... - def iterationStarted(self, iterationEvent: IterationEvent) -> None: ... - def terminationPerformed(self, iterationEvent: IterationEvent) -> None: ... + """ + public interfaceIterationListenerextends :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.util.EventListener` + + The listener interface for receiving events occurring in an iterative algorithm. + """ + def initializationPerformed(self, iterationEvent: IterationEvent) -> None: + """ + Invoked after completion of the initial phase of the iterative algorithm (prior to the main iteration loop). + + Parameters: + e (:class:`~org.hipparchus.util.IterationEvent`): The :class:`~org.hipparchus.util.IterationEvent` object. + + + """ + ... + def iterationPerformed(self, iterationEvent: IterationEvent) -> None: + """ + Invoked each time an iteration is completed (in the main iteration loop). + + Parameters: + e (:class:`~org.hipparchus.util.IterationEvent`): The :class:`~org.hipparchus.util.IterationEvent` object. + + + """ + ... + def iterationStarted(self, iterationEvent: IterationEvent) -> None: + """ + Invoked each time a new iteration is completed (in the main iteration loop). + + Parameters: + e (:class:`~org.hipparchus.util.IterationEvent`): The :class:`~org.hipparchus.util.IterationEvent` object. + + + """ + ... + def terminationPerformed(self, iterationEvent: IterationEvent) -> None: + """ + Invoked after completion of the operations which occur after breaking out of the main iteration loop. + + Parameters: + e (:class:`~org.hipparchus.util.IterationEvent`): The :class:`~org.hipparchus.util.IterationEvent` object. + + + """ + ... class IterationManager: + """ + public classIterationManager extends :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + This abstract class provides a general framework for managing iterative algorithms. The maximum number of iterations can + be set, and methods are provided to monitor the current iteration count. A lightweight event framework is also provided. + """ @typing.overload def __init__(self, int: int): ... @typing.overload def __init__(self, int: int, maxCountExceededCallback: typing.Union[Incrementor.MaxCountExceededCallback, typing.Callable]): ... - def addIterationListener(self, iterationListener: IterationListener) -> None: ... - def fireInitializationEvent(self, iterationEvent: IterationEvent) -> None: ... - def fireIterationPerformedEvent(self, iterationEvent: IterationEvent) -> None: ... - def fireIterationStartedEvent(self, iterationEvent: IterationEvent) -> None: ... - def fireTerminationEvent(self, iterationEvent: IterationEvent) -> None: ... - def getIterations(self) -> int: ... - def getMaxIterations(self) -> int: ... + def addIterationListener(self, iterationListener: IterationListener) -> None: + """ + Attaches a listener to this manager. + + Parameters: + listener (:class:`~org.hipparchus.util.IterationListener`): A :code:`IterationListener` object. + + + """ + ... + def fireInitializationEvent(self, iterationEvent: IterationEvent) -> None: + """ + Informs all registered listeners that the initial phase (prior to the main iteration loop) has been completed. + + Parameters: + e (:class:`~org.hipparchus.util.IterationEvent`): The :class:`~org.hipparchus.util.IterationEvent` object. + + + """ + ... + def fireIterationPerformedEvent(self, iterationEvent: IterationEvent) -> None: + """ + Informs all registered listeners that a new iteration (in the main iteration loop) has been performed. + + Parameters: + e (:class:`~org.hipparchus.util.IterationEvent`): The :class:`~org.hipparchus.util.IterationEvent` object. + + + """ + ... + def fireIterationStartedEvent(self, iterationEvent: IterationEvent) -> None: + """ + Informs all registered listeners that a new iteration (in the main iteration loop) has been started. + + Parameters: + e (:class:`~org.hipparchus.util.IterationEvent`): The :class:`~org.hipparchus.util.IterationEvent` object. + + + """ + ... + def fireTerminationEvent(self, iterationEvent: IterationEvent) -> None: + """ + Informs all registered listeners that the final phase (post-iterations) has been completed. + + Parameters: + e (:class:`~org.hipparchus.util.IterationEvent`): The :class:`~org.hipparchus.util.IterationEvent` object. + + + """ + ... + def getIterations(self) -> int: + """ + Returns the number of iterations of this solver, 0 if no iterations has been performed yet. + + Returns: + the number of iterations. + + + """ + ... + def getMaxIterations(self) -> int: + """ + Returns the maximum number of iterations. + + Returns: + the maximum number of iterations. + + + """ + ... def incrementIterationCount(self) -> None: ... - def removeIterationListener(self, iterationListener: IterationListener) -> None: ... - def resetIterationCount(self) -> None: ... + def removeIterationListener(self, iterationListener: IterationListener) -> None: + """ + Removes the specified iteration listener from the list of listeners currently attached to :code:`this` object. + Attempting to remove a listener which was *not* previously registered does not cause any error. + + Parameters: + listener (:class:`~org.hipparchus.util.IterationListener`): The :class:`~org.hipparchus.util.IterationListener` to be removed. + + + """ + ... + def resetIterationCount(self) -> None: + """ + Sets the iteration count to 0. This method must be called during the initial phase. + + """ + ... class KthSelector(java.io.Serializable): + """ + public classKthSelector extends :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + A Simple K :sup:`th` selector implementation to pick up the K :sup:`th` ordered element from a work array containing the + input numbers. + + Also see: + + - :meth:`~serialized` + """ @typing.overload def __init__(self): ... @typing.overload def __init__(self, pivotingStrategy: 'PivotingStrategy'): ... - def getPivotingStrategy(self) -> 'PivotingStrategy': ... - def select(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], intArray: typing.Union[typing.List[int], jpype.JArray], int2: int) -> float: ... + def getPivotingStrategy(self) -> 'PivotingStrategy': + """ + Get the pivoting strategy. + + Returns: + pivoting strategy + + + """ + ... + def select(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], intArray: typing.Union[typing.List[int], jpype.JArray], int2: int) -> float: + """ + Select K :sup:`th` value in the array. + + Parameters: + work (double[]): work array to use to find out the K :sup:`th` value + pivotsHeap (int[]): cached pivots heap that can be used for efficient estimation + k (int): the index whose value in the array is of interest + + Returns: + K :sup:`th` value + + + """ + ... class MathArrays: + """ + public classMathArrays extends :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Arrays utilities. + """ _buildArray_0__T = typing.TypeVar('_buildArray_0__T', bound=org.hipparchus.FieldElement) # <T> _buildArray_1__T = typing.TypeVar('_buildArray_1__T', bound=org.hipparchus.FieldElement) # <T> _buildArray_2__T = typing.TypeVar('_buildArray_2__T', bound=org.hipparchus.FieldElement) # <T> @typing.overload @staticmethod - def buildArray(field: org.hipparchus.Field[_buildArray_0__T], int: int) -> typing.MutableSequence[_buildArray_0__T]: ... + def buildArray(field: org.hipparchus.Field[_buildArray_0__T], int: int) -> typing.MutableSequence[_buildArray_0__T]: + """ + Build an array of elements. + + Arrays are filled with :code:`field.getZero()` + + Parameters: + field (:class:`~org.hipparchus.Field`<T> field): field to which array elements belong + length (int): of the array + + Returns: + a new array + + Build a double dimension array of elements. + + Arrays are filled with :code:`field.getZero()` + + Parameters: + field (:class:`~org.hipparchus.Field`<T> field): field to which array elements belong + rows (int): number of rows in the array + columns (int): number of columns (may be negative to build partial arrays in the same way :code:`new Field[rows][]` works) + + Returns: + a new array + + Build a triple dimension array of elements. + + Arrays are filled with :code:`field.getZero()` + + Parameters: + field (:class:`~org.hipparchus.Field`<T> field): field to which array elements belong + l1 (int): number of elements along first dimension + l2 (int): number of elements along second dimension + l3 (int): number of elements along third dimension (may be negative to build partial arrays in the same way :code:`new + Field[l1][l2][]` works) + + Returns: + a new array + + Since: + 1.4 + + + """ + ... @typing.overload @staticmethod def buildArray(field: org.hipparchus.Field[_buildArray_1__T], int: int, int2: int) -> typing.MutableSequence[typing.MutableSequence[_buildArray_1__T]]: ... @@ -1070,22 +5257,107 @@ class MathArrays: _checkEqualLength_5__T = typing.TypeVar('_checkEqualLength_5__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload @staticmethod - def checkEqualLength(doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray], boolean: bool) -> bool: ... + def checkEqualLength(doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray], boolean: bool) -> bool: + """ + Check that both arrays have the same length. + + Parameters: + a (double[]): Array. + b (double[]): Array. + abort (boolean): Whether to throw an exception if the check fails. + + Returns: + :code:`true` if the arrays have the same length. + + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if the lengths differ and :code:`abort` is :code:`true`. + + Check that both arrays have the same length. + + Parameters: + a (int[]): Array. + b (int[]): Array. + abort (boolean): Whether to throw an exception if the check fails. + + Returns: + :code:`true` if the arrays have the same length. + + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if the lengths differ and :code:`abort` is :code:`true`. + + """ + ... @typing.overload @staticmethod def checkEqualLength(intArray: typing.Union[typing.List[int], jpype.JArray], intArray2: typing.Union[typing.List[int], jpype.JArray], boolean: bool) -> bool: ... @typing.overload @staticmethod - def checkEqualLength(tArray: typing.Union[typing.List[_checkEqualLength_2__T], jpype.JArray], tArray2: typing.Union[typing.List[_checkEqualLength_2__T], jpype.JArray], boolean: bool) -> bool: ... - @typing.overload - @staticmethod - def checkEqualLength(doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray]) -> None: ... + def checkEqualLength(tArray: typing.Union[typing.List[_checkEqualLength_2__T], jpype.JArray], tArray2: typing.Union[typing.List[_checkEqualLength_2__T], jpype.JArray], boolean: bool) -> bool: + """ + Check that both arrays have the same length. + + Parameters: + a (T[]): Array. + b (T[]): Array. + abort (boolean): Whether to throw an exception if the check fails. + + Returns: + :code:`true` if the arrays have the same length. + + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if the lengths differ and :code:`abort` is :code:`true`. + + Since: + 1.5 + + """ + ... + @typing.overload + @staticmethod + def checkEqualLength(doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray]) -> None: + """ + Check that both arrays have the same length. + + Parameters: + a (double[]): Array. + b (double[]): Array. + + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if the lengths differ. + + Check that both arrays have the same length. + + Parameters: + a (int[]): Array. + b (int[]): Array. + + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if the lengths differ. + + + """ + ... @typing.overload @staticmethod def checkEqualLength(intArray: typing.Union[typing.List[int], jpype.JArray], intArray2: typing.Union[typing.List[int], jpype.JArray]) -> None: ... @typing.overload @staticmethod - def checkEqualLength(tArray: typing.Union[typing.List[_checkEqualLength_5__T], jpype.JArray], tArray2: typing.Union[typing.List[_checkEqualLength_5__T], jpype.JArray]) -> None: ... + def checkEqualLength(tArray: typing.Union[typing.List[_checkEqualLength_5__T], jpype.JArray], tArray2: typing.Union[typing.List[_checkEqualLength_5__T], jpype.JArray]) -> None: + """ + Check that both arrays have the same length. + + Parameters: + a (T[]): Array. + b (T[]): Array. + + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if the lengths differ. + + Since: + 1.5 + + """ + ... @typing.overload @staticmethod def checkNonNegative(longArray: typing.Union[typing.List[int], jpype.JArray]) -> None: ... @@ -1124,7 +5396,20 @@ class MathArrays: @staticmethod def convolve(doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray]) -> typing.MutableSequence[float]: ... @staticmethod - def cosAngle(doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray]) -> float: ... + def cosAngle(doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray]) -> float: + """ + Calculates the cosine of the angle between two vectors. + + Parameters: + v1 (double[]): Cartesian coordinates of the first vector. + v2 (double[]): Cartesian coordinates of the second vector. + + Returns: + the cosine of the angle between the vectors. + + + """ + ... @typing.overload @staticmethod def distance(doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray]) -> float: ... @@ -1155,7 +5440,67 @@ class MathArrays: def equals(self, object: typing.Any) -> bool: ... @typing.overload @staticmethod - def equals(byteArray: typing.Union[typing.List[int], jpype.JArray, bytes], byteArray2: typing.Union[typing.List[int], jpype.JArray, bytes]) -> bool: ... + def equals(byteArray: typing.Union[typing.List[int], jpype.JArray, bytes], byteArray2: typing.Union[typing.List[int], jpype.JArray, bytes]) -> bool: + """ + Returns true iff both arguments are null or have same dimensions and all their elements are equal as defined by + :meth:`~org.hipparchus.util.Precision.equals`. + + Parameters: + x (float[]): first array + y (float[]): second array + + Returns: + true if the values are both null or have same dimension and equal elements. + + Returns :code:`true` iff both arguments are :code:`null` or have same dimensions and all their elements are equal as + defined by :meth:`~org.hipparchus.util.Precision.equals`. + + Parameters: + x (double[]): First array. + y (double[]): Second array. + + Returns: + :code:`true` if the values are both :code:`null` or have same dimension and equal elements. + + Returns :code:`true` if both arguments are :code:`null` or have same dimensions and all their elements are equals. + + Parameters: + x (long[]): First array. + y (long[]): Second array. + + Returns: + :code:`true` if the values are both :code:`null` or have same dimension and equal elements. + + Returns :code:`true` if both arguments are :code:`null` or have same dimensions and all their elements are equals. + + Parameters: + x (int[]): First array. + y (int[]): Second array. + + Returns: + :code:`true` if the values are both :code:`null` or have same dimension and equal elements. + + Returns :code:`true` if both arguments are :code:`null` or have same dimensions and all their elements are equals. + + Parameters: + x (byte[]): First array. + y (byte[]): Second array. + + Returns: + :code:`true` if the values are both :code:`null` or have same dimension and equal elements. + + Returns :code:`true` if both arguments are :code:`null` or have same dimensions and all their elements are equals. + + Parameters: + x (short[]): First array. + y (short[]): Second array. + + Returns: + :code:`true` if the values are both :code:`null` or have same dimension and equal elements. + + + """ + ... @typing.overload @staticmethod def equals(doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray]) -> bool: ... @@ -1173,20 +5518,149 @@ class MathArrays: def equals(shortArray: typing.Union[typing.List[int], jpype.JArray], shortArray2: typing.Union[typing.List[int], jpype.JArray]) -> bool: ... @typing.overload @staticmethod - def equalsIncludingNaN(doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray]) -> bool: ... + def equalsIncludingNaN(doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray]) -> bool: + """ + Returns true iff both arguments are null or have same dimensions and all their elements are equal as defined by + :meth:`~org.hipparchus.util.Precision.equalsIncludingNaN`. + + Parameters: + x (float[]): first array + y (float[]): second array + + Returns: + true if the values are both null or have same dimension and equal elements + + Returns :code:`true` iff both arguments are :code:`null` or have same dimensions and all their elements are equal as + defined by :meth:`~org.hipparchus.util.Precision.equalsIncludingNaN`. + + Parameters: + x (double[]): First array. + y (double[]): Second array. + + Returns: + :code:`true` if the values are both :code:`null` or have same dimension and equal elements. + + + """ + ... @typing.overload @staticmethod def equalsIncludingNaN(floatArray: typing.Union[typing.List[float], jpype.JArray], floatArray2: typing.Union[typing.List[float], jpype.JArray]) -> bool: ... _isMonotonic_1__T = typing.TypeVar('_isMonotonic_1__T', bound=java.lang.Comparable) # <T> @typing.overload @staticmethod - def isMonotonic(doubleArray: typing.Union[typing.List[float], jpype.JArray], orderDirection: 'MathArrays.OrderDirection', boolean: bool) -> bool: ... - @typing.overload - @staticmethod - def isMonotonic(tArray: typing.Union[typing.List[_isMonotonic_1__T], jpype.JArray], orderDirection: 'MathArrays.OrderDirection', boolean: bool) -> bool: ... - @typing.overload - @staticmethod - def linearCombination(double: float, double2: float, double3: float, double4: float) -> float: ... + def isMonotonic(doubleArray: typing.Union[typing.List[float], jpype.JArray], orderDirection: 'MathArrays.OrderDirection', boolean: bool) -> bool: + """ + Check that an array is monotonically increasing or decreasing. + + Parameters: + val (double[]): Values. + dir (:class:`~org.hipparchus.util.MathArrays.OrderDirection`): Ordering direction. + strict (boolean): Whether the order should be strict. + + Returns: + :code:`true` if sorted, :code:`false` otherwise. + + + """ + ... + @typing.overload + @staticmethod + def isMonotonic(tArray: typing.Union[typing.List[_isMonotonic_1__T], jpype.JArray], orderDirection: 'MathArrays.OrderDirection', boolean: bool) -> bool: + """ + Check that an array is monotonically increasing or decreasing. + + Parameters: + val (T[]): Values. + dir (:class:`~org.hipparchus.util.MathArrays.OrderDirection`): Ordering direction. + strict (boolean): Whether the order should be strict. + + Returns: + :code:`true` if sorted, :code:`false` otherwise. + + """ + ... + @typing.overload + @staticmethod + def linearCombination(double: float, double2: float, double3: float, double4: float) -> float: + """ + Compute a linear combination accurately. + + This method computes a :sub:`1` ×b :sub:`1` + a :sub:`2` ×b :sub:`2` to high accuracy. It does so by using specific + multiplication and addition algorithms to preserve accuracy and reduce cancellation effects. It is based on the 2005 + paper ` Accurate Sum and Dot Product <http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.2.1547>` by Takeshi Ogita, + Siegfried M. Rump, and Shin'ichi Oishi published in SIAM J. Sci. Comput. + + Parameters: + a1 (double): first factor of the first term + b1 (double): second factor of the first term + a2 (double): first factor of the second term + b2 (double): second factor of the second term + + Returns: + a :sub:`1` ×b :sub:`1` + a :sub:`2` ×b :sub:`2` + + Also see: + + - :meth:`~org.hipparchus.util.MathArrays.linearCombination` + - :meth:`~org.hipparchus.util.MathArrays.linearCombination` + + + Compute a linear combination accurately. + + This method computes a :sub:`1` ×b :sub:`1` + a :sub:`2` ×b :sub:`2` + a :sub:`3` ×b :sub:`3` to high accuracy. It + does so by using specific multiplication and addition algorithms to preserve accuracy and reduce cancellation effects. + It is based on the 2005 paper ` Accurate Sum and Dot Product + <http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.2.1547>` by Takeshi Ogita, Siegfried M. Rump, and Shin'ichi + Oishi published in SIAM J. Sci. Comput. + + Parameters: + a1 (double): first factor of the first term + b1 (double): second factor of the first term + a2 (double): first factor of the second term + b2 (double): second factor of the second term + a3 (double): first factor of the third term + b3 (double): second factor of the third term + + Returns: + a :sub:`1` ×b :sub:`1` + a :sub:`2` ×b :sub:`2` + a :sub:`3` ×b :sub:`3` + + Also see: + + - :meth:`~org.hipparchus.util.MathArrays.linearCombination` + - :meth:`~org.hipparchus.util.MathArrays.linearCombination` + + + Compute a linear combination accurately. + + This method computes a :sub:`1` ×b :sub:`1` + a :sub:`2` ×b :sub:`2` + a :sub:`3` ×b :sub:`3` + a :sub:`4` ×b + :sub:`4` to high accuracy. It does so by using specific multiplication and addition algorithms to preserve accuracy and + reduce cancellation effects. It is based on the 2005 paper ` Accurate Sum and Dot Product + <http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.2.1547>` by Takeshi Ogita, Siegfried M. Rump, and Shin'ichi + Oishi published in SIAM J. Sci. Comput. + + Parameters: + a1 (double): first factor of the first term + b1 (double): second factor of the first term + a2 (double): first factor of the second term + b2 (double): second factor of the second term + a3 (double): first factor of the third term + b3 (double): second factor of the third term + a4 (double): first factor of the third term + b4 (double): second factor of the third term + + Returns: + a :sub:`1` ×b :sub:`1` + a :sub:`2` ×b :sub:`2` + a :sub:`3` ×b :sub:`3` + a :sub:`4` ×b :sub:`4` + + Also see: + + - :meth:`~org.hipparchus.util.MathArrays.linearCombination` + - :meth:`~org.hipparchus.util.MathArrays.linearCombination` + + + + """ + ... @typing.overload @staticmethod def linearCombination(double: float, double2: float, double3: float, double4: float, double5: float, double6: float) -> float: ... @@ -1197,29 +5671,180 @@ class MathArrays: @staticmethod def linearCombination(doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray]) -> float: ... @staticmethod - def natural(int: int) -> typing.MutableSequence[int]: ... + def natural(int: int) -> typing.MutableSequence[int]: + """ + Returns an array representing the natural number :code:`n`. + + Parameters: + n (int): Natural number. + + Returns: + an array whose entries are the numbers 0, 1, ..., :code:`n`-1. If :code:`n == 0`, the returned array is empty. + + + """ + ... @staticmethod def normalizeArray(doubleArray: typing.Union[typing.List[float], jpype.JArray], double2: float) -> typing.MutableSequence[float]: ... @staticmethod - def safeNorm(doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> float: ... - @staticmethod - def scale(double: float, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> typing.MutableSequence[float]: ... - @staticmethod - def scaleInPlace(double: float, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> None: ... - @staticmethod - def sequence(int: int, int2: int, int3: int) -> typing.MutableSequence[int]: ... - @typing.overload - @staticmethod - def shuffle(intArray: typing.Union[typing.List[int], jpype.JArray]) -> None: ... - @typing.overload - @staticmethod - def shuffle(intArray: typing.Union[typing.List[int], jpype.JArray], int2: int, position: 'MathArrays.Position') -> None: ... + def safeNorm(doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> float: + """ + Returns the Cartesian norm (2-norm), handling both overflow and underflow. Translation of the minpack enorm subroutine. + + The redistribution policy for MINPACK is available `here <http://www.netlib.org/minpack/disclaimer>`, for convenience, + it is reproduced below. + + Minpack Copyright Notice (1999) University of Chicago. All rights reserved + + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the + following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following + disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the distribution. + 3. The end-user documentation included with the redistribution, if any, must include the following acknowledgment: + :code:`This product includes software developed by the University of Chicago, as Operator of Argonne National + Laboratory.` Alternately, this acknowledgment may appear in the software itself, if and wherever such third-party + acknowledgments normally appear. + 4. **WARRANTY DISCLAIMER. THE SOFTWARE IS SUPPLIED "AS IS" WITHOUT WARRANTY OF ANY KIND. THE COPYRIGHT HOLDER, THE UNITED + STATES, THE UNITED STATES DEPARTMENT OF ENERGY, AND THEIR EMPLOYEES: (1) DISCLAIM ANY WARRANTIES, EXPRESS OR IMPLIED, + INCLUDING BUT NOT LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE OR + NON-INFRINGEMENT, (2) DO NOT ASSUME ANY LEGAL LIABILITY OR RESPONSIBILITY FOR THE ACCURACY, COMPLETENESS, OR USEFULNESS + OF THE SOFTWARE, (3) DO NOT REPRESENT THAT USE OF THE SOFTWARE WOULD NOT INFRINGE PRIVATELY OWNED RIGHTS, (4) DO NOT + WARRANT THAT THE SOFTWARE WILL FUNCTION UNINTERRUPTED, THAT IT IS ERROR-FREE OR THAT ANY ERRORS WILL BE CORRECTED.** + 5. **LIMITATION OF LIABILITY. IN NO EVENT WILL THE COPYRIGHT HOLDER, THE UNITED STATES, THE UNITED STATES DEPARTMENT OF + ENERGY, OR THEIR EMPLOYEES: BE LIABLE FOR ANY INDIRECT, INCIDENTAL, CONSEQUENTIAL, SPECIAL OR PUNITIVE DAMAGES OF ANY + KIND OR NATURE, INCLUDING BUT NOT LIMITED TO LOSS OF PROFITS OR LOSS OF DATA, FOR ANY REASON WHATSOEVER, WHETHER SUCH + LIABILITY IS ASSERTED ON THE BASIS OF CONTRACT, TORT (INCLUDING NEGLIGENCE OR STRICT LIABILITY), OR OTHERWISE, EVEN IF + ANY OF SAID PARTIES HAS BEEN WARNED OF THE POSSIBILITY OF SUCH LOSS OR DAMAGES.** + + + Parameters: + v (double[]): Vector of doubles. + + Returns: + the 2-norm of the vector. + + + """ + ... + @staticmethod + def scale(double: float, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> typing.MutableSequence[float]: + """ + Create a copy of an array scaled by a value. + + Parameters: + arr (double): Array to scale. + val (double[]): Scalar. + + Returns: + scaled copy of array with each entry multiplied by val. + + + """ + ... + @staticmethod + def scaleInPlace(double: float, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> None: + """ + Multiply each element of an array by a value. + + The array is modified in place (no copy is created). + + Parameters: + arr (double): Array to scale + val (double[]): Scalar + + + """ + ... + @staticmethod + def sequence(int: int, int2: int, int3: int) -> typing.MutableSequence[int]: + """ + Returns an array of :code:`size` integers starting at :code:`start`, skipping :code:`stride` numbers. + + Parameters: + size (int): Natural number. + start (int): Natural number. + stride (int): Natural number. + + Returns: + an array whose entries are the numbers :code:`start, start + stride, ..., start + (size - 1) * stride`. If :code:`size + == 0`, the returned array is empty. + + + """ + ... + @typing.overload + @staticmethod + def shuffle(intArray: typing.Union[typing.List[int], jpype.JArray]) -> None: + """ + Shuffle the entries of the given array. + + Parameters: + list (int[]): Array whose entries will be shuffled (in-place). + + Also see: + + - :meth:`~org.hipparchus.util.MathArrays.shuffle` + + + + """ + ... + @typing.overload + @staticmethod + def shuffle(intArray: typing.Union[typing.List[int], jpype.JArray], int2: int, position: 'MathArrays.Position') -> None: + """ + Shuffle the entries of the given array. The :code:`start` and :code:`pos` parameters select which portion of the array + is randomized and which is left untouched. + + Parameters: + list (int[]): Array whose entries will be shuffled (in-place). + start (int): Index at which shuffling begins. + pos (:class:`~org.hipparchus.util.MathArrays.Position`): Shuffling is performed for index positions between :code:`start` and either the end (if + :meth:`~org.hipparchus.util.MathArrays.Position.TAIL`) or the beginning (if + :meth:`~org.hipparchus.util.MathArrays.Position.HEAD`) of the array. + + Also see: + + - :meth:`~org.hipparchus.util.MathArrays.shuffle` + + + Shuffle the entries of the given array, using the :meth:`~org.hipparchus.util.https:.en.wikipedia.org.wiki.Fisher` + algorithm. The :code:`start` and :code:`pos` parameters select which portion of the array is randomized and which is + left untouched. + + Parameters: + list (int[]): Array whose entries will be shuffled (in-place). + start (int): Index at which shuffling begins. + pos (:class:`~org.hipparchus.util.MathArrays.Position`): Shuffling is performed for index positions between :code:`start` and either the end (if + :meth:`~org.hipparchus.util.MathArrays.Position.TAIL`) or the beginning (if + :meth:`~org.hipparchus.util.MathArrays.Position.HEAD`) of the array. + rng (:class:`~org.hipparchus.random.RandomGenerator`): Random number generator. + + """ + ... @typing.overload @staticmethod def shuffle(intArray: typing.Union[typing.List[int], jpype.JArray], int2: int, position: 'MathArrays.Position', randomGenerator: org.hipparchus.random.RandomGenerator) -> None: ... @typing.overload @staticmethod - def shuffle(intArray: typing.Union[typing.List[int], jpype.JArray], randomGenerator: org.hipparchus.random.RandomGenerator) -> None: ... + def shuffle(intArray: typing.Union[typing.List[int], jpype.JArray], randomGenerator: org.hipparchus.random.RandomGenerator) -> None: + """ + Shuffle the entries of the given array. + + Parameters: + list (int[]): Array whose entries will be shuffled (in-place). + rng (:class:`~org.hipparchus.random.RandomGenerator`): Random number generator. + + Also see: + + - :meth:`~org.hipparchus.util.MathArrays.shuffle` + + + """ + ... @typing.overload @staticmethod def sortInPlace(doubleArray: typing.Union[typing.List[float], jpype.JArray], *doubleArray2: typing.Union[typing.List[float], jpype.JArray]) -> None: ... @@ -1227,7 +5852,25 @@ class MathArrays: @staticmethod def sortInPlace(doubleArray: typing.Union[typing.List[float], jpype.JArray], orderDirection: 'MathArrays.OrderDirection', *doubleArray2: typing.Union[typing.List[float], jpype.JArray]) -> None: ... @staticmethod - def unique(doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> typing.MutableSequence[float]: ... + def unique(doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> typing.MutableSequence[float]: + """ + Returns an array consisting of the unique values in :code:`data`. The return array is sorted in descending order. Empty + arrays are allowed, but null arrays result in NullPointerException. Infinities are allowed. NaN values are allowed with + maximum sort order - i.e., if there are NaN values in :code:`data`, :code:`Double.NaN` will be the first element of the + output array, even if the array also contains :code:`Double.POSITIVE_INFINITY`. + + Parameters: + data (double[]): array to scan + + Returns: + descending list of values included in the input array + + Raises: + :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.NullPointerException`: if data is null + + + """ + ... @typing.overload @staticmethod def verifyValues(doubleArray: typing.Union[typing.List[float], jpype.JArray], doubleArray2: typing.Union[typing.List[float], jpype.JArray], int: int, int2: int) -> bool: ... @@ -1272,11 +5915,71 @@ class MathArrays: _MathUtils__FieldSumAndResidual__T = typing.TypeVar('_MathUtils__FieldSumAndResidual__T', bound=org.hipparchus.FieldElement) # <T> class MathUtils: + """ + public final classMathUtils extends :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Miscellaneous utility functions. + + Also see: + + - :class:`~org.hipparchus.util.ArithmeticUtils` + - :class:`~org.hipparchus.util.Precision` + - :class:`~org.hipparchus.util.MathArrays` + """ TWO_PI: typing.ClassVar[float] = ... + """ + public static final double TWO_PI + + \(2\pi\) + + Also see: + + - :meth:`~constant` + + + + """ PI_SQUARED: typing.ClassVar[float] = ... + """ + public static final double PI_SQUARED + + \(\pi^2\) + + Also see: + + - :meth:`~constant` + + + + """ SEMI_PI: typing.ClassVar[float] = ... - @staticmethod - def checkDimension(int: int, int2: int) -> None: ... + """ + public static final double SEMI_PI + + \(\pi/2\). + + Also see: + + - :meth:`~constant` + + + + """ + @staticmethod + def checkDimension(int: int, int2: int) -> None: + """ + Checks that the given dimensions match. + + Parameters: + dimension (int): the first dimension. + otherDimension (int): the second dimension. + + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if length != otherLength. + + + """ + ... @typing.overload @staticmethod def checkFinite(double: float) -> None: ... @@ -1291,7 +5994,31 @@ class MathUtils: def checkNotNull(object: typing.Any, localizable: org.hipparchus.exception.Localizable, *object2: typing.Any) -> None: ... @typing.overload @staticmethod - def checkRangeInclusive(double: float, double2: float, double3: float) -> None: ... + def checkRangeInclusive(double: float, double2: float, double3: float) -> None: + """ + Checks that the given value is strictly within the range [lo, hi]. + + Parameters: + value (long): value to be checked. + lo (long): the lower bound (inclusive). + hi (long): the upper bound (inclusive). + + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if :code:`value` is strictly outside [lo, hi]. + + Checks that the given value is strictly within the range [lo, hi]. + + Parameters: + value (double): value to be checked. + lo (double): the lower bound (inclusive). + hi (double): the upper bound (inclusive). + + Raises: + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if :code:`value` is strictly outside [lo, hi]. + + + """ + ... @typing.overload @staticmethod def checkRangeInclusive(long: int, long2: int, long3: int) -> None: ... @@ -1308,38 +6035,224 @@ class MathUtils: @staticmethod def copySign(short: int, short2: int) -> int: ... @typing.overload - def equals(self, object: typing.Any) -> bool: ... + def equals(self, object: typing.Any) -> bool: + """ + Returns :code:`true` if the values are equal according to semantics of + :meth:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Double.equals`. + + Parameters: + x (double): Value + y (double): Value + + Returns: + :code:`Double.valueOf(x).equals(Double.valueOf(y))` + + + """ + ... @typing.overload @staticmethod def equals(double: float, double2: float) -> bool: ... @typing.overload @staticmethod - def hash(double: float) -> int: ... + def hash(double: float) -> int: + """ + Returns an integer hash code representing the given double value. + + Parameters: + value (double): the value to be hashed + + Returns: + the hash code + + Returns an integer hash code representing the given double array. + + Parameters: + value (double[]): the value to be hashed (may be null) + + Returns: + the hash code + + + """ + ... @typing.overload @staticmethod def hash(doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> int: ... _max__T = typing.TypeVar('_max__T', bound=org.hipparchus.CalculusFieldElement) # <T> @staticmethod - def max(t: _max__T, t2: _max__T) -> _max__T: ... + def max(t: _max__T, t2: _max__T) -> _max__T: + """ + Find the maximum of two field elements. + + Parameters: + e1 (T): first element + e2 (T): second element + + Returns: + max(a1, e2) + + + """ + ... _min__T = typing.TypeVar('_min__T', bound=org.hipparchus.CalculusFieldElement) # <T> @staticmethod - def min(t: _min__T, t2: _min__T) -> _min__T: ... + def min(t: _min__T, t2: _min__T) -> _min__T: + """ + Find the minimum of two field elements. + + Parameters: + e1 (T): first element + e2 (T): second element + + Returns: + min(a1, e2) + + + """ + ... _normalizeAngle_1__T = typing.TypeVar('_normalizeAngle_1__T', bound=org.hipparchus.CalculusFieldElement) # <T> @typing.overload @staticmethod - def normalizeAngle(double: float, double2: float) -> float: ... - @typing.overload - @staticmethod - def normalizeAngle(t: _normalizeAngle_1__T, t2: _normalizeAngle_1__T) -> _normalizeAngle_1__T: ... - @staticmethod - def reduce(double: float, double2: float, double3: float) -> float: ... + def normalizeAngle(double: float, double2: float) -> float: + """ + Normalize an angle in a 2Ï€ wide interval around a center value. + + This method has three main uses: + + - normalize an angle between 0 and 2Ï€: + + + :code:`a = MathUtils.normalizeAngle(a, FastMath.PI);` + - normalize an angle between -Ï€ and +Ï€ + + + :code:`a = MathUtils.normalizeAngle(a, 0.0);` + - compute the angle between two defining angular positions: + + + :code:`angle = MathUtils.normalizeAngle(end, start) - start;` + + + Note that due to numerical accuracy and since Ï€ cannot be represented exactly, the result interval is *closed*, it + cannot be half-closed as would be more satisfactory in a purely mathematical view. + + Parameters: + a (double): angle to normalize + center (double): center of the desired 2Ï€ interval for the result + + Returns: + a-2kÏ€ with integer k and center-Ï€ <= a-2kÏ€ <= center+Ï€ + + """ + ... + @typing.overload + @staticmethod + def normalizeAngle(t: _normalizeAngle_1__T, t2: _normalizeAngle_1__T) -> _normalizeAngle_1__T: + """ + Normalize an angle in a 2Ï€ wide interval around a center value. + + This method has three main uses: + + - normalize an angle between 0 and 2Ï€: + + + :code:`a = MathUtils.normalizeAngle(a, FastMath.PI);` + - normalize an angle between -Ï€ and +Ï€ + + + :code:`a = MathUtils.normalizeAngle(a, zero);` + - compute the angle between two defining angular positions: + + + :code:`angle = MathUtils.normalizeAngle(end, start).subtract(start);` + + + Note that due to numerical accuracy and since Ï€ cannot be represented exactly, the result interval is *closed*, it + cannot be half-closed as would be more satisfactory in a purely mathematical view. + + Parameters: + a (T): angle to normalize + center (T): center of the desired 2Ï€ interval for the result + + Returns: + a-2kÏ€ with integer k and center-Ï€ <= a-2kÏ€ <= center+Ï€ + + + """ + ... + @staticmethod + def reduce(double: float, double2: float, double3: float) -> float: + """ + + Reduce :code:`|a - offset|` to the primary interval :code:`[0, |period|)`. + + Specifically, the value returned is + + + :code:`a - |period| * floor((a - offset) / |period|) - offset`. + + If any of the parameters are :code:`NaN` or infinite, the result is :code:`NaN`. + + Parameters: + a (double): Value to reduce. + period (double): Period. + offset (double): Value that will be mapped to :code:`0`. + + Returns: + the value, within the interval :code:`[0 |period|)`, that corresponds to :code:`a`. + + + """ + ... _twoSum_0__T = typing.TypeVar('_twoSum_0__T', bound=org.hipparchus.FieldElement) # <T> @typing.overload @staticmethod - def twoSum(t: _twoSum_0__T, t2: _twoSum_0__T) -> 'MathUtils.FieldSumAndResidual'[_twoSum_0__T]: ... - @typing.overload - @staticmethod - def twoSum(double: float, double2: float) -> 'MathUtils.SumAndResidual': ... + def twoSum(t: _twoSum_0__T, t2: _twoSum_0__T) -> 'MathUtils.FieldSumAndResidual'[_twoSum_0__T]: + """ + Sums :code:`a` and :code:`b` using Møller's 2Sum algorithm. + + References: + + - Møller, Ole. "Quasi double-precision in floating point addition." BIT 5, 37–50 (1965). + - Shewchuk, Richard J. "Adaptive Precision Floating-Point Arithmetic and Fast Robust Geometric Predicates." Discrete & + Computational Geometry 18, 305–363 (1997). + - :class:`~org.hipparchus.util.https:.en.wikipedia.org.wiki.2Sum` + + + Parameters: + a (T): first summand + b (T): second summand + + Returns: + sum and residual error in the sum + + + """ + ... + @typing.overload + @staticmethod + def twoSum(double: float, double2: float) -> 'MathUtils.SumAndResidual': + """ + Sums :code:`a` and :code:`b` using Møller's 2Sum algorithm. + + References: + + - Møller, Ole. "Quasi double-precision in floating point addition." BIT 5, 37–50 (1965). + - Shewchuk, Richard J. "Adaptive Precision Floating-Point Arithmetic and Fast Robust Geometric Predicates." Discrete & + Computational Geometry 18, 305–363 (1997). + - :class:`~org.hipparchus.util.https:.en.wikipedia.org.wiki.2Sum` + + + Parameters: + a (double): first summand + b (double): second summand + + Returns: + sum and residual error in the sum + + """ + ... class FieldSumAndResidual(typing.Generic[_MathUtils__FieldSumAndResidual__T]): def getResidual(self) -> _MathUtils__FieldSumAndResidual__T: ... def getSum(self) -> _MathUtils__FieldSumAndResidual__T: ... @@ -1348,14 +6261,81 @@ class MathUtils: def getSum(self) -> float: ... class MultidimensionalCounter(java.lang.Iterable[int]): + """ + public classMultidimensionalCounter extends :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Iterable`<:class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Integer`> + + Converter between unidimensional storage structure and multidimensional conceptual structure. This utility will convert + from indices in a multidimensional structure to the corresponding index in a one-dimensional array. For example, + assuming that the ranges (in 3 dimensions) of indices are 2, 4 and 3, the following correspondences, between 3-tuples + indices and unidimensional indices, will hold: + + - (0, 0, 0) corresponds to 0 + - (0, 0, 1) corresponds to 1 + - (0, 0, 2) corresponds to 2 + - (0, 1, 0) corresponds to 3 + - ... + - (1, 0, 0) corresponds to 12 + - ... + - (1, 3, 2) corresponds to 23 + """ def __init__(self, *int: int): ... def getCount(self, *int: int) -> int: ... def getCounts(self, int: int) -> typing.MutableSequence[int]: ... - def getDimension(self) -> int: ... - def getSize(self) -> int: ... - def getSizes(self) -> typing.MutableSequence[int]: ... - def iterator(self) -> 'MultidimensionalCounter.Iterator': ... - def toString(self) -> str: ... + def getDimension(self) -> int: + """ + Get the number of dimensions of the multidimensional counter. + + Returns: + the number of dimensions. + + + """ + ... + def getSize(self) -> int: + """ + Get the total number of elements. + + Returns: + the total size of the unidimensional counter. + + + """ + ... + def getSizes(self) -> typing.MutableSequence[int]: + """ + Get the number of multidimensional counter slots in each dimension. + + Returns: + the sizes of the multidimensional counter in each dimension. + + + """ + ... + def iterator(self) -> 'MultidimensionalCounter.Iterator': + """ + Create an iterator over this counter. + + Specified by: + :meth:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Iterable.iterator` in + interface :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Iterable` + + Returns: + the iterator. + + + """ + ... + def toString(self) -> str: + """ + + Overrides: + :meth:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.toString` in + class :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + + """ + ... class Iterator(java.util.Iterator[int]): @typing.overload def getCount(self) -> int: ... @@ -1369,6 +6349,14 @@ class MultidimensionalCounter(java.lang.Iterable[int]): _Pair__K = typing.TypeVar('_Pair__K') # <K> _Pair__V = typing.TypeVar('_Pair__V') # <V> class Pair(typing.Generic[_Pair__K, _Pair__V]): + """ + public classPair<K,V> extends :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Generic pair. + + Although the instances of this class are immutable, it is impossible to ensure that the references passed to the + constructor will not be modified by the caller. + """ @typing.overload def __init__(self, k: _Pair__K, v: _Pair__V): ... @typing.overload @@ -1376,16 +6364,108 @@ class Pair(typing.Generic[_Pair__K, _Pair__V]): _create__K = typing.TypeVar('_create__K') # <K> _create__V = typing.TypeVar('_create__V') # <V> @staticmethod - def create(k: _create__K, v: _create__V) -> 'Pair'[_create__K, _create__V]: ... - def equals(self, object: typing.Any) -> bool: ... - def getFirst(self) -> _Pair__K: ... - def getKey(self) -> _Pair__K: ... - def getSecond(self) -> _Pair__V: ... - def getValue(self) -> _Pair__V: ... - def hashCode(self) -> int: ... - def toString(self) -> str: ... + def create(k: _create__K, v: _create__V) -> 'Pair'[_create__K, _create__V]: + """ + Convenience factory method that calls the :meth:`~org.hipparchus.util.Pair.%3Cinit%3E`. + + Parameters: + k (K): First element of the pair. + v (V): Second element of the pair. + + Returns: + a new :code:`Pair` containing :code:`k` and :code:`v`. + + + """ + ... + def equals(self, object: typing.Any) -> bool: + """ + Compare the specified object with this entry for equality. + + Overrides: + :meth:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.equals` in + class :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Parameters: + o (:class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object`): Object. + + Returns: + :code:`true` if the given object is also a map entry and the two entries represent the same mapping. + + + """ + ... + def getFirst(self) -> _Pair__K: + """ + Get the first element of the pair. + + Returns: + the first element of the pair. + + + """ + ... + def getKey(self) -> _Pair__K: + """ + Get the key. + + Returns: + the key (first element of the pair). + + + """ + ... + def getSecond(self) -> _Pair__V: + """ + Get the second element of the pair. + + Returns: + the second element of the pair. + + + """ + ... + def getValue(self) -> _Pair__V: + """ + Get the value. + + Returns: + the value (second element of the pair). + + + """ + ... + def hashCode(self) -> int: + """ + Compute a hash code. + + Overrides: + :meth:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.hashCode` in + class :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Returns: + the hash code value. + + + """ + ... + def toString(self) -> str: + """ + + Overrides: + :meth:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.toString` in + class :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + + """ + ... class PivotingStrategy(java.lang.Enum['PivotingStrategy']): + """ + public enumPivotingStrategy extends :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Enum`<:class:`~org.hipparchus.util.PivotingStrategy`> + + A strategy to pick a pivoting index of an array for doing partitioning. + """ CENTRAL: typing.ClassVar['PivotingStrategy'] = ... MEDIAN_OF_3: typing.ClassVar['PivotingStrategy'] = ... def pivotIndex(self, doubleArray: typing.Union[typing.List[float], jpype.JArray], int: int, int2: int) -> int: ... @@ -1395,21 +6475,187 @@ class PivotingStrategy(java.lang.Enum['PivotingStrategy']): def valueOf(class_: typing.Type[_valueOf_0__T], string: str) -> _valueOf_0__T: ... @typing.overload @staticmethod - def valueOf(string: str) -> 'PivotingStrategy': ... - @staticmethod - def values() -> typing.MutableSequence['PivotingStrategy']: ... + def valueOf(string: str) -> 'PivotingStrategy': + """ + Returns the enum constant of this type with the specified name. The string must match *exactly* an identifier used to + declare an enum constant in this type. (Extraneous whitespace characters are not permitted.) + + Parameters: + name (:class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.String`): the name of the enum constant to be returned. + + Returns: + the enum constant with the specified name + + Raises: + :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.IllegalArgumentException`: if this enum type has no constant with the specified name + :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.NullPointerException`: if the argument is null + + + """ + ... + @staticmethod + def values() -> typing.MutableSequence['PivotingStrategy']: + """ + Returns an array containing the constants of this enum type, in the order they are declared. + + Returns: + an array containing the constants of this enum type, in the order they are declared + + + """ + ... class Precision: + """ + public classPrecision extends :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Utilities for comparing numbers. + """ EPSILON: typing.ClassVar[float] = ... + """ + public static final double EPSILON + + Largest double-precision floating-point number such that :code:`1 + EPSILON` is numerically equal to 1. This value is an + upper bound on the relative error due to rounding real numbers to double precision floating-point numbers. + + In IEEE 754 arithmetic, this is 2 :sup:`-53` . + + Also see: + + - `Machine epsilon <http://en.wikipedia.org/wiki/Machine_epsilon>` + + + + """ SAFE_MIN: typing.ClassVar[float] = ... - @typing.overload - @staticmethod - def compareTo(double: float, double2: float, double3: float) -> int: ... + """ + public static final double SAFE_MIN + + Safe minimum, such that :code:`1 / SAFE_MIN` does not overflow. + + + In IEEE 754 arithmetic, this is also the smallest normalized number 2 :sup:`-1022` . + + """ + @typing.overload + @staticmethod + def compareTo(double: float, double2: float, double3: float) -> int: + """ + Compares two numbers given some amount of allowed error. + + Parameters: + x (double): the first number + y (double): the second number + eps (double): the amount of error to allow when checking for equality + + Returns: + + - 0 if :meth:`~org.hipparchus.util.Precision.equals` + - < 0 if !:meth:`~org.hipparchus.util.Precision.equals` && x < y + - > 0 if !:meth:`~org.hipparchus.util.Precision.equals` && x > y or either argument is NaN + + + Compares two numbers given some amount of allowed error. Two float numbers are considered equal if there are + :code:`(maxUlps - 1)` (or fewer) floating point numbers between them, i.e. two adjacent floating point numbers are + considered equal. Adapted from ` Bruce Dawson + <http://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/>`. Returns :code:`false` if + either of the arguments is NaN. + + Parameters: + x (double): first value + y (double): second value + maxUlps (int): :code:`(maxUlps - 1)` is the number of floating point values between :code:`x` and :code:`y`. + + Returns: + + - 0 if :meth:`~org.hipparchus.util.Precision.equals` + - < 0 if !:meth:`~org.hipparchus.util.Precision.equals` && x < y + - > 0 if !:meth:`~org.hipparchus.util.Precision.equals` && x > y or either argument is NaN + + + + """ + ... @typing.overload @staticmethod def compareTo(double: float, double2: float, int: int) -> int: ... @typing.overload - def equals(self, object: typing.Any) -> bool: ... + def equals(self, object: typing.Any) -> bool: + """ + Returns true iff they are equal as defined by :meth:`~org.hipparchus.util.Precision.equals`. + + Parameters: + x (float): first value + y (float): second value + + Returns: + :code:`true` if the values are equal. + + Returns true if the arguments are equal or within the range of allowed error (inclusive). Returns :code:`false` if + either of the arguments is NaN. + + Parameters: + x (float): first value + y (float): second value + eps (float): the amount of absolute error to allow. + + Returns: + :code:`true` if the values are equal or within range of each other. + + Returns true if the arguments are equal or within the range of allowed error (inclusive). Two float numbers are + considered equal if there are :code:`(maxUlps - 1)` (or fewer) floating point numbers between them, i.e. two adjacent + floating point numbers are considered equal. Adapted from ` Bruce Dawson + <http://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/>`. Returns :code:`false` if + either of the arguments is NaN. + + Parameters: + x (float): first value + y (float): second value + maxUlps (int): :code:`(maxUlps - 1)` is the number of floating point values between :code:`x` and :code:`y`. + + Returns: + :code:`true` if there are fewer than :code:`maxUlps` floating point values between :code:`x` and :code:`y`. + + Returns true iff they are equal as defined by :meth:`~org.hipparchus.util.Precision.equals`. + + Parameters: + x (double): first value + y (double): second value + + Returns: + :code:`true` if the values are equal. + + Returns :code:`true` if there is no double value strictly between the arguments or the difference between them is within + the range of allowed error (inclusive). Returns :code:`false` if either of the arguments is NaN. + + Parameters: + x (double): First value. + y (double): Second value. + eps (double): Amount of allowed absolute error. + + Returns: + :code:`true` if the values are two adjacent floating point numbers or they are within range of each other. + + Returns true if the arguments are equal or within the range of allowed error (inclusive). + + Two float numbers are considered equal if there are :code:`(maxUlps - 1)` (or fewer) floating point numbers between + them, i.e. two adjacent floating point numbers are considered equal. + + Adapted from ` Bruce Dawson + <http://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/>`. Returns :code:`false` if + either of the arguments is NaN. + + Parameters: + x (double): first value + y (double): second value + maxUlps (int): :code:`(maxUlps - 1)` is the number of floating point values between :code:`x` and :code:`y`. + + Returns: + :code:`true` if there are fewer than :code:`maxUlps` floating point values between :code:`x` and :code:`y`. + + + """ + ... @typing.overload @staticmethod def equals(double: float, double2: float) -> bool: ... @@ -1430,7 +6676,73 @@ class Precision: def equals(float: float, float2: float, int: int) -> bool: ... @typing.overload @staticmethod - def equalsIncludingNaN(double: float, double2: float) -> bool: ... + def equalsIncludingNaN(double: float, double2: float) -> bool: + """ + Returns true if both arguments are NaN or they are equal as defined by :meth:`~org.hipparchus.util.Precision.equals`. + + Parameters: + x (float): first value + y (float): second value + + Returns: + :code:`true` if the values are equal or both are NaN. + + Returns true if the arguments are both NaN, are equal, or are within the range of allowed error (inclusive). + + Parameters: + x (float): first value + y (float): second value + eps (float): the amount of absolute error to allow. + + Returns: + :code:`true` if the values are equal or within range of each other, or both are NaN. + + Returns true if the arguments are both NaN or if they are equal as defined by + :meth:`~org.hipparchus.util.Precision.equals`. + + Parameters: + x (float): first value + y (float): second value + maxUlps (int): :code:`(maxUlps - 1)` is the number of floating point values between :code:`x` and :code:`y`. + + Returns: + :code:`true` if both arguments are NaN or if there are less than :code:`maxUlps` floating point values between :code:`x` + and :code:`y`. + + Returns true if the arguments are both NaN or they are equal as defined by + :meth:`~org.hipparchus.util.Precision.equals`. + + Parameters: + x (double): first value + y (double): second value + + Returns: + :code:`true` if the values are equal or both are NaN. + + Returns true if the arguments are both NaN, are equal or are within the range of allowed error (inclusive). + + Parameters: + x (double): first value + y (double): second value + eps (double): the amount of absolute error to allow. + + Returns: + :code:`true` if the values are equal or within range of each other, or both are NaN. + + Returns true if both arguments are NaN or if they are equal as defined by :meth:`~org.hipparchus.util.Precision.equals`. + + Parameters: + x (double): first value + y (double): second value + maxUlps (int): :code:`(maxUlps - 1)` is the number of floating point values between :code:`x` and :code:`y`. + + Returns: + :code:`true` if both arguments are NaN or if there are less than :code:`maxUlps` floating point values between :code:`x` + and :code:`y`. + + + """ + ... @typing.overload @staticmethod def equalsIncludingNaN(double: float, double2: float, double3: float) -> bool: ... @@ -1447,18 +6759,139 @@ class Precision: @staticmethod def equalsIncludingNaN(float: float, float2: float, int: int) -> bool: ... @staticmethod - def equalsWithRelativeTolerance(double: float, double2: float, double3: float) -> bool: ... - @typing.overload - @staticmethod - def isMathematicalInteger(double: float) -> bool: ... + def equalsWithRelativeTolerance(double: float, double2: float, double3: float) -> bool: + """ + Returns :code:`true` if there is no double value strictly between the arguments or the relative difference between them + is less than or equal to the given tolerance. Returns :code:`false` if either of the arguments is NaN. + + Parameters: + x (double): First value. + y (double): Second value. + eps (double): Amount of allowed relative error. + + Returns: + :code:`true` if the values are two adjacent floating point numbers or they are within range of each other. + + + """ + ... + @typing.overload + @staticmethod + def isMathematicalInteger(double: float) -> bool: + """ + Check is x is a mathematical integer. + + Parameters: + x (double): number to check + + Returns: + true if x is a mathematical integer + + Since: + 1.7 + + Check is x is a mathematical integer. + + Parameters: + x (float): number to check + + Returns: + true if x is a mathematical integer + + Since: + 1.7 + + + """ + ... @typing.overload @staticmethod def isMathematicalInteger(float: float) -> bool: ... @staticmethod - def representableDelta(double: float, double2: float) -> float: ... - @typing.overload - @staticmethod - def round(double: float, int: int) -> float: ... + def representableDelta(double: float, double2: float) -> float: + """ + Computes a number :code:`delta` close to :code:`originalDelta` with the property that + + .. code-block: java + + x + delta - x + + is exactly machine-representable. This is useful when computing numerical derivatives, in order to reduce roundoff + errors. + + Parameters: + x (double): Value. + originalDelta (double): Offset value. + + Returns: + a number :code:`delta` so that :code:`x + delta` and :code:`x` differ by a representable floating number. + + + """ + ... + @typing.overload + @staticmethod + def round(double: float, int: int) -> float: + """ + Rounds the given value to the specified number of decimal places. The value is rounded using the + :meth:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.math.BigDecimal.ROUND_HALF_UP` method. + + Parameters: + x (double): Value to round. + scale (int): Number of digits to the right of the decimal point. + + Returns: + the rounded value. + + Rounds the given value to the specified number of decimal places. The value is rounded using the given method which is + any method defined in :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.math.BigDecimal`. If + :code:`x` is infinite or :code:`NaN`, then the value of :code:`x` is returned unchanged, regardless of the other + parameters. + + Parameters: + x (double): Value to round. + scale (int): Number of digits to the right of the decimal point. + roundingMethod (:class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.math.RoundingMode`): Rounding method as defined in + :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.math.BigDecimal`. + + Returns: + the rounded value. + + Raises: + :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.ArithmeticException`: if :code:`roundingMethod == ROUND_UNNECESSARY` and the specified scaling operation would require rounding. + :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.IllegalArgumentException`: if :code:`roundingMethod` does not represent a valid rounding mode. + + Rounds the given value to the specified number of decimal places. The value is rounded using the + :meth:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.math.BigDecimal.ROUND_HALF_UP` method. + + Parameters: + x (float): Value to round. + scale (int): Number of digits to the right of the decimal point. + + Returns: + the rounded value. + + public static float round(float x, int scale, :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.math.RoundingMode` roundingMethod) throws :class:`~org.hipparchus.exception.MathRuntimeException`, :class:`~org.hipparchus.exception.MathIllegalArgumentException` + + Rounds the given value to the specified number of decimal places. The value is rounded using the given method which is + any method defined in :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.math.BigDecimal`. + + Parameters: + x (float): Value to round. + scale (int): Number of digits to the right of the decimal point. + roundingMethod (:class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.math.RoundingMode`): Rounding method as defined in + :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.math.BigDecimal`. + + Returns: + the rounded value. + + Raises: + :class:`~org.hipparchus.exception.MathRuntimeException`: if an exact operation is required but result is not exact + :class:`~org.hipparchus.exception.MathIllegalArgumentException`: if :code:`roundingMethod` is not a valid rounding method. + + + """ + ... @typing.overload @staticmethod def round(double: float, int: int, roundingMode: java.math.RoundingMode) -> float: ... @@ -1470,6 +6903,45 @@ class Precision: def round(float: float, int: int, roundingMode: java.math.RoundingMode) -> float: ... class ResizableDoubleArray(java.io.Serializable): + """ + public classResizableDoubleArray extends :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + A variable length primitive double array implementation that automatically handles expanding and contracting its + internal storage array as elements are added and removed. + + The internal storage array starts with capacity determined by the :code:`initialCapacity` property, which can be set by + the constructor. The default initial capacity is 16. Adding elements using + :meth:`~org.hipparchus.util.ResizableDoubleArray.addElement` appends elements to the end of the array. When there are no + open entries at the end of the internal storage array, the array is expanded. The size of the expanded array depends on + the :code:`expansionMode` and :code:`expansionFactor` properties. The :code:`expansionMode` determines whether the size + of the array is multiplied by the :code:`expansionFactor` + (:meth:`~org.hipparchus.util.ResizableDoubleArray.ExpansionMode.MULTIPLICATIVE`) or if the expansion is additive + (:meth:`~org.hipparchus.util.ResizableDoubleArray.ExpansionMode.ADDITIVE` -- :code:`expansionFactor` storage locations + added). The default :code:`expansionMode` is :code:`MULTIPLICATIVE` and the default :code:`expansionFactor` is 2. + + The :meth:`~org.hipparchus.util.ResizableDoubleArray.addElementRolling` method adds a new element to the end of the + internal storage array and adjusts the "usable window" of the internal array forward by one position (effectively making + what was the second element the first, and so on). Repeated activations of this method (or activation of + :meth:`~org.hipparchus.util.ResizableDoubleArray.discardFrontElements`) will effectively orphan the storage locations at + the beginning of the internal storage array. To reclaim this storage, each time one of these methods is activated, the + size of the internal storage array is compared to the number of addressable elements (the :code:`numElements` property) + and if the difference is too large, the internal array is contracted to size :code:`numElements + 1`. The determination + of when the internal storage array is "too large" depends on the :code:`expansionMode` and :code:`contractionFactor` + properties. If the :code:`expansionMode` is :code:`MULTIPLICATIVE`, contraction is triggered when the ratio between + storage array length and :code:`numElements` exceeds :code:`contractionFactor.` If the :code:`expansionMode` is + :code:`ADDITIVE`, the number of excess storage locations is compared to :code:`contractionFactor`. + + To avoid cycles of expansions and contractions, the :code:`expansionFactor` must not exceed the + :code:`contractionFactor`. Constructors and mutators for both of these properties enforce this requirement, throwing a + :code:`MathIllegalArgumentException` if it is violated. + + **Note:** this class is **NOT** thread-safe. + + Also see: + + - :meth:`~serialized` + """ @typing.overload def __init__(self): ... @typing.overload @@ -1484,25 +6956,224 @@ class ResizableDoubleArray(java.io.Serializable): def __init__(self, int: int, double: float, double2: float, expansionMode: 'ResizableDoubleArray.ExpansionMode', *double3: float): ... @typing.overload def __init__(self, resizableDoubleArray: 'ResizableDoubleArray'): ... - def addElement(self, double: float) -> None: ... - def addElementRolling(self, double: float) -> float: ... - def addElements(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> None: ... - def clear(self) -> None: ... - def compute(self, function: MathArrays.Function) -> float: ... - def contract(self) -> None: ... - def copy(self) -> 'ResizableDoubleArray': ... + def addElement(self, double: float) -> None: + """ + Adds an element to the end of this expandable array. + + Parameters: + value (double): Value to be added to end of array. + + + """ + ... + def addElementRolling(self, double: float) -> float: + """ + Adds an element to the end of the array and removes the first element in the array. Returns the discarded first element. + + The effect is similar to a push operation in a FIFO queue. + + Example: If the array contains the elements 1, 2, 3, 4 (in that order) and addElementRolling(5) is invoked, the result + is an array containing the entries 2, 3, 4, 5 and the value returned is 1. + + Parameters: + value (double): Value to be added to the array. + + Returns: + the value which has been discarded or "pushed" out of the array by this rolling insert. + + + """ + ... + def addElements(self, doubleArray: typing.Union[typing.List[float], jpype.JArray]) -> None: + """ + Adds several element to the end of this expandable array. + + Parameters: + values (double[]): Values to be added to end of array. + + + """ + ... + def clear(self) -> None: + """ + Clear the array contents, resetting the number of elements to zero. + + """ + ... + def compute(self, function: MathArrays.Function) -> float: + """ + Performs an operation on the addressable elements of the array. + + Parameters: + f (:class:`~org.hipparchus.util.MathArrays.Function`): Function to be applied on this array. + + Returns: + the result. + + + """ + ... + def contract(self) -> None: + """ + Contracts the storage array to the (size of the element set) + 1 - to avoid a zero length array. This function also + resets the startIndex to zero. + + """ + ... + def copy(self) -> 'ResizableDoubleArray': + """ + Returns a copy of the ResizableDoubleArray. Does not contract before the copy, so the returned object is an exact copy + of this. + + Returns: + a new ResizableDoubleArray with the same data and configuration properties as this + + + """ + ... def discardFrontElements(self, int: int) -> None: ... def discardMostRecentElements(self, int: int) -> None: ... - def equals(self, object: typing.Any) -> bool: ... - def getCapacity(self) -> int: ... - def getContractionCriterion(self) -> float: ... - def getElement(self, int: int) -> float: ... - def getElements(self) -> typing.MutableSequence[float]: ... - def getExpansionFactor(self) -> float: ... - def getExpansionMode(self) -> 'ResizableDoubleArray.ExpansionMode': ... - def getNumElements(self) -> int: ... - def hashCode(self) -> int: ... - def setElement(self, int: int, double: float) -> None: ... + def equals(self, object: typing.Any) -> bool: + """ + Returns true iff object is a ResizableDoubleArray with the same properties as this and an identical internal storage + array. + + Overrides: + :meth:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.equals` in + class :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Parameters: + object (:class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object`): object to be compared for equality with this + + Returns: + true iff object is a ResizableDoubleArray with the same data and properties as this + + + """ + ... + def getCapacity(self) -> int: + """ + Gets the currently allocated size of the internal data structure used for storing elements. This is not to be confused + with :meth:`~org.hipparchus.util.ResizableDoubleArray.getNumElements`. + + Returns: + the length of the internal array. + + + """ + ... + def getContractionCriterion(self) -> float: + """ + The contraction criterion defines when the internal array will contract to store only the number of elements in the + element array. + + If the :code:`expansionMode` is :code:`MULTIPLICATIVE`, contraction is triggered when the ratio between storage array + length and :code:`numElements` exceeds :code:`contractionFactor`. If the :code:`expansionMode` is :code:`ADDITIVE`, the + number of excess storage locations is compared to :code:`contractionFactor`. + + Returns: + the contraction criterion used to reclaim memory. + + + """ + ... + def getElement(self, int: int) -> float: + """ + Returns the element at the specified index. + + Parameters: + index (int): index to fetch a value from + + Returns: + value stored at the specified index + + Raises: + :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.ArrayIndexOutOfBoundsException`: if :code:`index` is less than zero or is greater than :code:`getNumElements() - 1`. + + + """ + ... + def getElements(self) -> typing.MutableSequence[float]: + """ + Returns a double array containing the elements of this ResizableArray. + + This method returns a copy, not a reference to the underlying array, so that changes made to the returned array have no + effect on this ResizableArray. + + Returns: + the double array. + + + """ + ... + def getExpansionFactor(self) -> float: + """ + The expansion factor controls the size of a new array when an array needs to be expanded. + + The :code:`expansionMode` determines whether the size of the array is multiplied by the :code:`expansionFactor` + (MULTIPLICATIVE) or if the expansion is additive (ADDITIVE -- :code:`expansionFactor` storage locations added). The + default :code:`expansionMode` is MULTIPLICATIVE and the default :code:`expansionFactor` is 2.0. + + Returns: + the expansion factor of this expandable double array + + + """ + ... + def getExpansionMode(self) -> 'ResizableDoubleArray.ExpansionMode': + """ + The expansion mode determines whether the internal storage array grows additively or multiplicatively when it is + expanded. + + Returns: + the expansion mode. + + + """ + ... + def getNumElements(self) -> int: + """ + Returns the number of elements currently in the array. Please note that this is different from the length of the + internal storage array. + + Returns: + the number of elements. + + + """ + ... + def hashCode(self) -> int: + """ + Returns a hash code consistent with equals. + + Overrides: + :meth:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.hashCode` in + class :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Returns: + the hash code representing this :code:`ResizableDoubleArray`. + + + """ + ... + def setElement(self, int: int, double: float) -> None: + """ + Sets the element at the specified index. + + If the specified index is greater than :code:`getNumElements() - 1`, the :code:`numElements` property is increased to + :code:`index +1` and additional storage is allocated (if necessary) for the new element and all (uninitialized) elements + between the new element and the previous end of the array). + + Parameters: + index (int): index to store a value in + value (double): value to store at the specified index + + Raises: + :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.ArrayIndexOutOfBoundsException`: if :code:`index < 0`. + + + """ + ... def setNumElements(self, int: int) -> None: ... def substituteMostRecentElement(self, double: float) -> float: ... class ExpansionMode(java.lang.Enum['ResizableDoubleArray.ExpansionMode']): @@ -1519,77 +7190,840 @@ class ResizableDoubleArray(java.io.Serializable): def values() -> typing.MutableSequence['ResizableDoubleArray.ExpansionMode']: ... class RosenNumberPartitionIterator(java.util.Iterator[typing.MutableSequence[int]]): + """ + public classRosenNumberPartitionIterator extends :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.util.Iterator`<int[]> + + An iterator that generates all partitions of :code:`n` elements, into :code:`k` parts containing the number of elements + in each part, based on Rosen's algorithm. + + This is a copy of the class (with slight edits) with the same name from the + :class:`~org.hipparchus.util.https:.github.com.axkr.symja_android_library`. The original file was published under the + terms of the GPLV3 license, but the Hipparchus project was :meth:`~org.hipparchus.util.https:.github.com.Hipparchus` to + include it relicensed to Apache V2. + + See Kenneth H. Rosen, Discrete Mathematics and Its Applications, 2nd edition (NY: McGraw-Hill, 1991), pp. 284-286 + """ def __init__(self, int: int, int2: int): ... - def hasNext(self) -> bool: ... - def next(self) -> typing.MutableSequence[int]: ... - def reset(self) -> None: ... + def hasNext(self) -> bool: + """ + + Specified by: + :meth:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.util.Iterator.hasNext` in + interface :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.util.Iterator` + + Also see: + + - :meth:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.util.Iterator.hasNext` + + + + """ + ... + def next(self) -> typing.MutableSequence[int]: + """ + + Specified by: + :meth:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.util.Iterator.next` in + interface :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.util.Iterator` + + Also see: + + - :meth:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.util.Iterator.next` + + + + """ + ... + def reset(self) -> None: + """ + Reset this iterator to the start condition. + + """ + ... class RyuDouble: + """ + public final classRyuDouble extends :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + An implementation of RyÅ« for double. + + RyÅ« generates the shortest decimal representation of a floating point number that maintains round-trip safety. That is, + a correct parser can recover the exact original number. RyÅ« is very fast (about 10 time faster than + :code:`Double.toString()`). + + Also see: + + - :class:`~org.hipparchus.util.https:.dl.acm.org.citation.cfm?doid=3296979.3192369` + """ DEFAULT_LOW_EXP: typing.ClassVar[int] = ... + """ + public static final int DEFAULT_LOW_EXP + + Default low switch level to scientific notation. + + Also see: + + - :meth:`~constant` + + + + """ DEFAULT_HIGH_EXP: typing.ClassVar[int] = ... - @typing.overload - @staticmethod - def doubleToString(double: float) -> str: ... + """ + public static final int DEFAULT_HIGH_EXP + + Default high switch level to scientific notation. + + Also see: + + - :meth:`~constant` + + + + """ + @typing.overload + @staticmethod + def doubleToString(double: float) -> str: + """ + Convert a double to shortest string representation, preserving full accuracy. + + This implementation uses the same specifications as :code:`Double.toString()`, i.e. it uses scientific notation if for + numbers smaller than 10â»Â³ or larger than 10âºâ·, and decimal notion in between. That is it call + :meth:`~org.hipparchus.util.RyuDouble.doubleToString`. + + Parameters: + value (double): double number to convert + + Returns: + shortest string representation + + Also see: + + - :meth:`~org.hipparchus.util.RyuDouble.doubleToString` + - :meth:`~org.hipparchus.util.RyuDouble.DEFAULT_LOW_EXP` + - :meth:`~org.hipparchus.util.RyuDouble.DEFAULT_HIGH_EXP` + + + Convert a double to shortest string representation, preserving full accuracy. + + Number inside of the interval [10 :sup:`lowExp` , 10 :sup:`highExp` ] are represented using decimal notation, numbers + outside of this range are represented using scientific notation. + + Parameters: + value (double): double number to convert + lowExp (int): lowest decimal exponent for which decimal notation can be used + highExp (int): highest decimal exponent for which decimal notation can be used + + Returns: + shortest string representation + + Also see: + + - :meth:`~org.hipparchus.util.RyuDouble.doubleToString` + - :meth:`~org.hipparchus.util.RyuDouble.DEFAULT_LOW_EXP` + - :meth:`~org.hipparchus.util.RyuDouble.DEFAULT_HIGH_EXP` + + + + """ + ... @typing.overload @staticmethod def doubleToString(double: float, int: int, int2: int) -> str: ... class SinCos: - def cos(self) -> float: ... - @staticmethod - def difference(sinCos: 'SinCos', sinCos2: 'SinCos') -> 'SinCos': ... - def sin(self) -> float: ... - @staticmethod - def sum(sinCos: 'SinCos', sinCos2: 'SinCos') -> 'SinCos': ... + """ + public classSinCos extends :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Holder for both sine and cosine values. + + This class is a simple container, it does not provide any computational method. + + Since: + 1.3 + + Also see: + + - :meth:`~org.hipparchus.util.FastMath.sinCos` + """ + def cos(self) -> float: + """ + Get the value of the cosine. + + Returns: + value of the cosine + + + """ + ... + @staticmethod + def difference(sinCos: 'SinCos', sinCos2: 'SinCos') -> 'SinCos': + """ + Compute sine and cosine of angles difference. + + Parameters: + scAlpha (:class:`~org.hipparchus.util.SinCos`): \((\sin \alpha, \cos \alpha)\) + scBeta (:class:`~org.hipparchus.util.SinCos`): \((\sin \beta, \cos \beta)\) + + Returns: + \((\sin \alpha+\beta, \cos \alpha-\beta)\) + + Since: + 1.8 + + + """ + ... + def sin(self) -> float: + """ + Get the value of the sine. + + Returns: + value of the sine + + + """ + ... + @staticmethod + def sum(sinCos: 'SinCos', sinCos2: 'SinCos') -> 'SinCos': + """ + Compute sine and cosine of angles sum. + + Parameters: + scAlpha (:class:`~org.hipparchus.util.SinCos`): \((\sin \alpha, \cos \alpha)\) + scBeta (:class:`~org.hipparchus.util.SinCos`): \((\sin \beta, \cos \beta)\) + + Returns: + \((\sin \alpha+\beta, \cos \alpha+\beta)\) + + Since: + 1.8 + + + """ + ... class SinhCosh: - def cosh(self) -> float: ... - @staticmethod - def difference(sinhCosh: 'SinhCosh', sinhCosh2: 'SinhCosh') -> 'SinhCosh': ... - def sinh(self) -> float: ... - @staticmethod - def sum(sinhCosh: 'SinhCosh', sinhCosh2: 'SinhCosh') -> 'SinhCosh': ... + """ + public classSinhCosh extends :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + Holder for both hyperbolic sine and hyperbolic cosine values. + + This class is a simple container, it does not provide any computational method. + + Since: + 2.0 + + Also see: + + - :meth:`~org.hipparchus.util.FastMath.sinhCosh` + """ + def cosh(self) -> float: + """ + Get the value of the hyperbolic cosine. + + Returns: + value of the hyperbolic cosine + + + """ + ... + @staticmethod + def difference(sinhCosh: 'SinhCosh', sinhCosh2: 'SinhCosh') -> 'SinhCosh': + """ + Compute hyperbolic sine and hyperbolic cosine of angles difference. + + Parameters: + schAlpha (:class:`~org.hipparchus.util.SinhCosh`): \((\sinh \alpha, \cosh \alpha)\) + schBeta (:class:`~org.hipparchus.util.SinhCosh`): \((\sinh \beta, \cosh \beta)\) + + Returns: + \((\sinh \alpha+\beta, \cosh \alpha-\beta)\) + + + """ + ... + def sinh(self) -> float: + """ + Get the value of the hyperbolic sine. + + Returns: + value of the hyperbolic sine + + + """ + ... + @staticmethod + def sum(sinhCosh: 'SinhCosh', sinhCosh2: 'SinhCosh') -> 'SinhCosh': + """ + Compute hyperbolic sine and hyperbolic cosine of angles sum. + + Parameters: + schAlpha (:class:`~org.hipparchus.util.SinhCosh`): \((\sinh \alpha, \cosh \alpha)\) + schBeta (:class:`~org.hipparchus.util.SinhCosh`): \((\sinh \beta, \cosh \beta)\) + + Returns: + \((\sinh \alpha+\beta, \cosh \alpha+\beta)\) + + + """ + ... class Tuple(org.hipparchus.CalculusFieldElement['Tuple']): + """ + public classTuple extends :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.CalculusFieldElement`<:class:`~org.hipparchus.util.Tuple`> + + This class allows to perform the same computation of all components of a Tuple at once. + + Since: + 1.2 + """ def __init__(self, *double: float): ... - def abs(self) -> 'Tuple': ... - def acos(self) -> 'Tuple': ... - def acosh(self) -> 'Tuple': ... - @typing.overload - def add(self, double: float) -> 'Tuple': ... + def abs(self) -> 'Tuple': + """ + absolute value. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.abs` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + abs(this) + + + """ + ... + def acos(self) -> 'Tuple': + """ + Arc cosine operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.acos` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + acos(this) + + + """ + ... + def acosh(self) -> 'Tuple': + """ + Inverse hyperbolic cosine operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.acosh` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + acosh(this) + + + """ + ... + @typing.overload + def add(self, double: float) -> 'Tuple': + """ + Compute this + a. + + Specified by: + :meth:`~org.hipparchus.FieldElement.add` in interface :class:`~org.hipparchus.FieldElement` + + Parameters: + a (:class:`~org.hipparchus.util.Tuple`): element to add + + Returns: + a new element representing this + a + + '+' operator. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.add` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + a (double): right hand side parameter of the operator + + Returns: + this+a + + + """ + ... @typing.overload def add(self, tuple: 'Tuple') -> 'Tuple': ... - def asin(self) -> 'Tuple': ... - def asinh(self) -> 'Tuple': ... - def atan(self) -> 'Tuple': ... - def atan2(self, tuple: 'Tuple') -> 'Tuple': ... - def atanh(self) -> 'Tuple': ... - def cbrt(self) -> 'Tuple': ... - def ceil(self) -> 'Tuple': ... - @typing.overload - def copySign(self, double: float) -> 'Tuple': ... + def asin(self) -> 'Tuple': + """ + Arc sine operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.asin` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + asin(this) + + + """ + ... + def asinh(self) -> 'Tuple': + """ + Inverse hyperbolic sine operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.asinh` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + asin(this) + + + """ + ... + def atan(self) -> 'Tuple': + """ + Arc tangent operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.atan` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + atan(this) + + + """ + ... + def atan2(self, tuple: 'Tuple') -> 'Tuple': + """ + Two arguments arc tangent operation. + + Beware of the order or arguments! As this is based on a two-arguments functions, in order to be consistent with + arguments order, the instance is the *first* argument and the single provided argument is the *second* argument. In + order to be consistent with programming languages :code:`atan2`, this method computes :code:`atan2(this, x)`, i.e. the + instance represents the :code:`y` argument and the :code:`x` argument is the one passed as a single argument. This may + seem confusing especially for users of Wolfram alpha, as this site is *not* consistent with programming languages + :code:`atan2` two-arguments arc tangent and puts :code:`x` as its first argument. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.atan2` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + x (:class:`~org.hipparchus.util.Tuple`): second argument of the arc tangent + + Returns: + + """ + ... + def atanh(self) -> 'Tuple': + """ + Inverse hyperbolic tangent operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.atanh` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + atanh(this) + + + """ + ... + def cbrt(self) -> 'Tuple': + """ + Cubic root. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.cbrt` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + cubic root of the instance + + + """ + ... + def ceil(self) -> 'Tuple': + """ + Get the smallest whole number larger than instance. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.ceil` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + ceil(this) + + + """ + ... + @typing.overload + def copySign(self, double: float) -> 'Tuple': + """ + Returns the instance with the sign of the argument. A NaN :code:`sign` argument is treated as positive. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.copySign` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + sign (:class:`~org.hipparchus.util.Tuple`): the sign for the returned value + + Returns: + the instance with the same sign as the :code:`sign` argument + + Returns the instance with the sign of the argument. A NaN :code:`sign` argument is treated as positive. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.copySign` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + sign (double): the sign for the returned value + + Returns: + the instance with the same sign as the :code:`sign` argument + + + """ + ... @typing.overload def copySign(self, tuple: 'Tuple') -> 'Tuple': ... - def cos(self) -> 'Tuple': ... - def cosh(self) -> 'Tuple': ... - @typing.overload - def divide(self, double: float) -> 'Tuple': ... + def cos(self) -> 'Tuple': + """ + Cosine operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.cos` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + cos(this) + + + """ + ... + def cosh(self) -> 'Tuple': + """ + Hyperbolic cosine operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.cosh` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + cosh(this) + + + """ + ... + @typing.overload + def divide(self, double: float) -> 'Tuple': + """ + Compute this ÷ a. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.divide` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Specified by: + :meth:`~org.hipparchus.FieldElement.divide` in interface :class:`~org.hipparchus.FieldElement` + + Parameters: + a (:class:`~org.hipparchus.util.Tuple`): element to divide by + + Returns: + a new element representing this ÷ a + + '÷' operator. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.divide` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + a (double): right hand side parameter of the operator + + Returns: + this÷a + + + """ + ... @typing.overload def divide(self, tuple: 'Tuple') -> 'Tuple': ... - def equals(self, object: typing.Any) -> bool: ... - def exp(self) -> 'Tuple': ... - def expm1(self) -> 'Tuple': ... - def floor(self) -> 'Tuple': ... - def getComponent(self, int: int) -> float: ... - def getComponents(self) -> typing.MutableSequence[float]: ... - def getDimension(self) -> int: ... + def equals(self, object: typing.Any) -> bool: + """ + + Overrides: + :meth:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.equals` in + class :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + + """ + ... + def exp(self) -> 'Tuple': + """ + Exponential. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.exp` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + exponential of the instance + + + """ + ... + def expm1(self) -> 'Tuple': + """ + Exponential minus 1. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.expm1` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + exponential minus one of the instance + + + """ + ... + def floor(self) -> 'Tuple': + """ + Get the largest whole number smaller than instance. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.floor` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + floor(this) + + + """ + ... + def getComponent(self, int: int) -> float: + """ + Get one component of the tuple. + + Parameters: + index (int): index of the component, between 0 and :meth:`~org.hipparchus.util.Tuple.getDimension` - 1 + + Returns: + value of the component + + + """ + ... + def getComponents(self) -> typing.MutableSequence[float]: + """ + Get all components of the tuple. + + Returns: + all components + + + """ + ... + def getDimension(self) -> int: + """ + Get the dimension of the tuple. + + Returns: + dimension of the tuple + + + """ + ... def getField(self) -> org.hipparchus.Field['Tuple']: ... - def getPi(self) -> 'Tuple': ... - def getReal(self) -> float: ... - def hashCode(self) -> int: ... - def hypot(self, tuple: 'Tuple') -> 'Tuple': ... - @typing.overload - def linearCombination(self, double: float, tuple: 'Tuple', double2: float, tuple2: 'Tuple') -> 'Tuple': ... + def getPi(self) -> 'Tuple': + """ + Get the Archimedes constant Ï€. + + Archimedes constant is the ratio of a circle's circumference to its diameter. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.getPi` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + Archimedes constant Ï€ + + + """ + ... + def getReal(self) -> float: + """ + Get the real value of the number. + + Specified by: + :meth:`~org.hipparchus.FieldElement.getReal` in interface :class:`~org.hipparchus.FieldElement` + + Returns: + real value + + + """ + ... + def hashCode(self) -> int: + """ + + Overrides: + :meth:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.hashCode` in + class :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + + """ + ... + def hypot(self, tuple: 'Tuple') -> 'Tuple': + """ + Returns the hypotenuse of a triangle with sides :code:`this` and :code:`y` - sqrt(*this* :sup:`2` +*y* :sup:`2` ) + avoiding intermediate overflow or underflow. + + - If either argument is infinite, then the result is positive infinity. + - else, if either argument is NaN then the result is NaN. + + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.hypot` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + y (:class:`~org.hipparchus.util.Tuple`): a value + + Returns: + sqrt(*this* :sup:`2` +*y* :sup:`2` ) + + + """ + ... + @typing.overload + def linearCombination(self, double: float, tuple: 'Tuple', double2: float, tuple2: 'Tuple') -> 'Tuple': + """ + Compute a linear combination. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` in + interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + a1 (:class:`~org.hipparchus.util.Tuple`): first factor of the first term + b1 (:class:`~org.hipparchus.util.Tuple`): second factor of the first term + a2 (:class:`~org.hipparchus.util.Tuple`): first factor of the second term + b2 (:class:`~org.hipparchus.util.Tuple`): second factor of the second term + + Returns: + a :sub:`1` ×b :sub:`1` + a :sub:`2` ×b :sub:`2` + + Also see: + + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + + + Compute a linear combination. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` in + interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + a1 (double): first factor of the first term + b1 (:class:`~org.hipparchus.util.Tuple`): second factor of the first term + a2 (double): first factor of the second term + b2 (:class:`~org.hipparchus.util.Tuple`): second factor of the second term + + Returns: + a :sub:`1` ×b :sub:`1` + a :sub:`2` ×b :sub:`2` + + Also see: + + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + + + Compute a linear combination. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` in + interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + a1 (:class:`~org.hipparchus.util.Tuple`): first factor of the first term + b1 (:class:`~org.hipparchus.util.Tuple`): second factor of the first term + a2 (:class:`~org.hipparchus.util.Tuple`): first factor of the second term + b2 (:class:`~org.hipparchus.util.Tuple`): second factor of the second term + a3 (:class:`~org.hipparchus.util.Tuple`): first factor of the third term + b3 (:class:`~org.hipparchus.util.Tuple`): second factor of the third term + + Returns: + a :sub:`1` ×b :sub:`1` + a :sub:`2` ×b :sub:`2` + a :sub:`3` ×b :sub:`3` + + Also see: + + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + + + Compute a linear combination. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` in + interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + a1 (double): first factor of the first term + b1 (:class:`~org.hipparchus.util.Tuple`): second factor of the first term + a2 (double): first factor of the second term + b2 (:class:`~org.hipparchus.util.Tuple`): second factor of the second term + a3 (double): first factor of the third term + b3 (:class:`~org.hipparchus.util.Tuple`): second factor of the third term + + Returns: + a :sub:`1` ×b :sub:`1` + a :sub:`2` ×b :sub:`2` + a :sub:`3` ×b :sub:`3` + + Also see: + + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + + + Compute a linear combination. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` in + interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + a1 (:class:`~org.hipparchus.util.Tuple`): first factor of the first term + b1 (:class:`~org.hipparchus.util.Tuple`): second factor of the first term + a2 (:class:`~org.hipparchus.util.Tuple`): first factor of the second term + b2 (:class:`~org.hipparchus.util.Tuple`): second factor of the second term + a3 (:class:`~org.hipparchus.util.Tuple`): first factor of the third term + b3 (:class:`~org.hipparchus.util.Tuple`): second factor of the third term + a4 (:class:`~org.hipparchus.util.Tuple`): first factor of the fourth term + b4 (:class:`~org.hipparchus.util.Tuple`): second factor of the fourth term + + Returns: + a :sub:`1` ×b :sub:`1` + a :sub:`2` ×b :sub:`2` + a :sub:`3` ×b :sub:`3` + a :sub:`4` ×b :sub:`4` + + Also see: + + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + + + Compute a linear combination. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` in + interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + a1 (double): first factor of the first term + b1 (:class:`~org.hipparchus.util.Tuple`): second factor of the first term + a2 (double): first factor of the second term + b2 (:class:`~org.hipparchus.util.Tuple`): second factor of the second term + a3 (double): first factor of the third term + b3 (:class:`~org.hipparchus.util.Tuple`): second factor of the third term + a4 (double): first factor of the fourth term + b4 (:class:`~org.hipparchus.util.Tuple`): second factor of the fourth term + + Returns: + a :sub:`1` ×b :sub:`1` + a :sub:`2` ×b :sub:`2` + a :sub:`3` ×b :sub:`3` + a :sub:`4` ×b :sub:`4` + + Also see: + + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + - :meth:`~org.hipparchus.CalculusFieldElement.linearCombination` + + + + """ + ... @typing.overload def linearCombination(self, double: float, tuple: 'Tuple', double2: float, tuple2: 'Tuple', double3: float, tuple3: 'Tuple') -> 'Tuple': ... @typing.overload @@ -1604,81 +8038,693 @@ class Tuple(org.hipparchus.CalculusFieldElement['Tuple']): def linearCombination(self, tuple: 'Tuple', tuple2: 'Tuple', tuple3: 'Tuple', tuple4: 'Tuple', tuple5: 'Tuple', tuple6: 'Tuple', tuple7: 'Tuple', tuple8: 'Tuple') -> 'Tuple': ... @typing.overload def linearCombination(self, tupleArray: typing.Union[typing.List['Tuple'], jpype.JArray], tupleArray2: typing.Union[typing.List['Tuple'], jpype.JArray]) -> 'Tuple': ... - def log(self) -> 'Tuple': ... - def log10(self) -> 'Tuple': ... - def log1p(self) -> 'Tuple': ... - @typing.overload - def multiply(self, double: float) -> 'Tuple': ... + def log(self) -> 'Tuple': + """ + Natural logarithm. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.log` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + logarithm of the instance + + + """ + ... + def log10(self) -> 'Tuple': + """ + Base 10 logarithm. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.log10` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + base 10 logarithm of the instance + + + """ + ... + def log1p(self) -> 'Tuple': + """ + Shifted natural logarithm. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.log1p` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + logarithm of one plus the instance + + + """ + ... + @typing.overload + def multiply(self, double: float) -> 'Tuple': + """ + Compute this × a. + + Specified by: + :meth:`~org.hipparchus.FieldElement.multiply` in interface :class:`~org.hipparchus.FieldElement` + + Parameters: + a (:class:`~org.hipparchus.util.Tuple`): element to multiply + + Returns: + a new element representing this × a + + Compute n × this. Multiplication by an integer number is defined as the following sum \[ n \times \mathrm{this} = + \sum_{i=1}^n \mathrm{this} \] + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.multiply` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Specified by: + :meth:`~org.hipparchus.FieldElement.multiply` in interface :class:`~org.hipparchus.FieldElement` + + Parameters: + n (int): Number of times :code:`this` must be added to itself. + + Returns: + A new element representing n × this. + + '×' operator. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.multiply` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + a (double): right hand side parameter of the operator + + Returns: + this×a + + + """ + ... @typing.overload def multiply(self, int: int) -> 'Tuple': ... @typing.overload def multiply(self, tuple: 'Tuple') -> 'Tuple': ... - def negate(self) -> 'Tuple': ... - def newInstance(self, double: float) -> 'Tuple': ... - @typing.overload - def pow(self, double: float) -> 'Tuple': ... + def negate(self) -> 'Tuple': + """ + Returns the additive inverse of :code:`this` element. + + Specified by: + :meth:`~org.hipparchus.FieldElement.negate` in interface :class:`~org.hipparchus.FieldElement` + + Returns: + the opposite of :code:`this`. + + + """ + ... + def newInstance(self, double: float) -> 'Tuple': + """ + Create an instance corresponding to a constant real value. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.newInstance` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + value (double): constant real value + + Returns: + instance corresponding to a constant real value + + + """ + ... + @typing.overload + def pow(self, double: float) -> 'Tuple': + """ + Power operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.pow` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + p (double): power to apply + + Returns: + this :sup:`p` + + Integer power operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.pow` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + n (int): power to apply + + Returns: + this :sup:`n` + + Power operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.pow` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + e (:class:`~org.hipparchus.util.Tuple`): exponent + + Returns: + this :sup:`e` + + + """ + ... @typing.overload def pow(self, int: int) -> 'Tuple': ... @typing.overload def pow(self, tuple: 'Tuple') -> 'Tuple': ... - def reciprocal(self) -> 'Tuple': ... - @typing.overload - def remainder(self, double: float) -> 'Tuple': ... + def reciprocal(self) -> 'Tuple': + """ + Returns the multiplicative inverse of :code:`this` element. + + Specified by: + :meth:`~org.hipparchus.FieldElement.reciprocal` in interface :class:`~org.hipparchus.FieldElement` + + Returns: + the inverse of :code:`this`. + + + """ + ... + @typing.overload + def remainder(self, double: float) -> 'Tuple': + """ + IEEE remainder operator. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.remainder` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + a (double): right hand side parameter of the operator + + Returns: + this - n × a where n is the closest integer to this/a + + IEEE remainder operator. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.remainder` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + a (:class:`~org.hipparchus.util.Tuple`): right hand side parameter of the operator + + Returns: + this - n × a where n is the closest integer to this/a + + + """ + ... @typing.overload def remainder(self, tuple: 'Tuple') -> 'Tuple': ... - def rint(self) -> 'Tuple': ... - def rootN(self, int: int) -> 'Tuple': ... - def scalb(self, int: int) -> 'Tuple': ... - def sign(self) -> 'Tuple': ... - def sin(self) -> 'Tuple': ... + def rint(self) -> 'Tuple': + """ + Get the whole number that is the nearest to the instance, or the even one if x is exactly half way between two integers. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.rint` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + a double number r such that r is an integer r - 0.5 ≤ this ≤ r + 0.5 + + + """ + ... + def rootN(self, int: int) -> 'Tuple': + """ + N :sup:`th` root. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.rootN` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + n (int): order of the root + + Returns: + n :sup:`th` root of the instance + + + """ + ... + def scalb(self, int: int) -> 'Tuple': + """ + Multiply the instance by a power of 2. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.scalb` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + n (int): power of 2 + + Returns: + this × 2 :sup:`n` + + + """ + ... + def sign(self) -> 'Tuple': + """ + Compute the sign of the instance. The sign is -1 for negative numbers, +1 for positive numbers and 0 otherwise, for + Complex number, it is extended on the unit circle (equivalent to z/|z|, with special handling for 0 and NaN) + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.sign` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + -1.0, -0.0, +0.0, +1.0 or NaN depending on sign of a + + + """ + ... + def sin(self) -> 'Tuple': + """ + Sine operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.sin` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + sin(this) + + + """ + ... def sinCos(self) -> FieldSinCos['Tuple']: ... - def sinh(self) -> 'Tuple': ... + def sinh(self) -> 'Tuple': + """ + Hyperbolic sine operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.sinh` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + sinh(this) + + + """ + ... def sinhCosh(self) -> FieldSinhCosh['Tuple']: ... - def sqrt(self) -> 'Tuple': ... - def square(self) -> 'Tuple': ... - @typing.overload - def subtract(self, double: float) -> 'Tuple': ... + def sqrt(self) -> 'Tuple': + """ + Square root. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.sqrt` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + square root of the instance + + + """ + ... + def square(self) -> 'Tuple': + """ + Compute this × this. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.square` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + a new element representing this × this + + + """ + ... + @typing.overload + def subtract(self, double: float) -> 'Tuple': + """ + Compute this - a. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.subtract` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Specified by: + :meth:`~org.hipparchus.FieldElement.subtract` in interface :class:`~org.hipparchus.FieldElement` + + Parameters: + a (:class:`~org.hipparchus.util.Tuple`): element to subtract + + Returns: + a new element representing this - a + + '-' operator. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.subtract` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Parameters: + a (double): right hand side parameter of the operator + + Returns: + this-a + + + """ + ... @typing.overload def subtract(self, tuple: 'Tuple') -> 'Tuple': ... - def tan(self) -> 'Tuple': ... - def tanh(self) -> 'Tuple': ... - def toDegrees(self) -> 'Tuple': ... - def toRadians(self) -> 'Tuple': ... - def ulp(self) -> 'Tuple': ... + def tan(self) -> 'Tuple': + """ + Tangent operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.tan` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + tan(this) + + + """ + ... + def tanh(self) -> 'Tuple': + """ + Hyperbolic tangent operation. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.tanh` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + tanh(this) + + + """ + ... + def toDegrees(self) -> 'Tuple': + """ + Convert radians to degrees, with error of less than 0.5 ULP + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.toDegrees` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + instance converted into degrees + + + """ + ... + def toRadians(self) -> 'Tuple': + """ + Convert degrees to radians, with error of less than 0.5 ULP + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.toRadians` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + instance converted into radians + + + """ + ... + def ulp(self) -> 'Tuple': + """ + Compute least significant bit (Unit in Last Position) for a number. + + Specified by: + :meth:`~org.hipparchus.CalculusFieldElement.ulp` in interface :class:`~org.hipparchus.CalculusFieldElement` + + Returns: + ulp(this) + + + """ + ... class UnscentedTransformProvider: - def getUnscentedCovariance(self, realVectorArray: typing.Union[typing.List[org.hipparchus.linear.RealVector], jpype.JArray], realVector2: org.hipparchus.linear.RealVector) -> org.hipparchus.linear.RealMatrix: ... - def getUnscentedMeanState(self, realVectorArray: typing.Union[typing.List[org.hipparchus.linear.RealVector], jpype.JArray]) -> org.hipparchus.linear.RealVector: ... - def getWc(self) -> org.hipparchus.linear.RealVector: ... - def getWm(self) -> org.hipparchus.linear.RealVector: ... + """ + public interfaceUnscentedTransformProvider + + Provider for unscented transform. + + Since: + 2.2 + """ + def getUnscentedCovariance(self, realVectorArray: typing.Union[typing.List[org.hipparchus.linear.RealVector], jpype.JArray], realVector2: org.hipparchus.linear.RealVector) -> org.hipparchus.linear.RealMatrix: + """ + Computes the unscented covariance matrix from a weighted mean state and a set of sigma points. + + This method can be used for computing both the predicted state covariance matrix and the innovation covariance matrix in + an Unscented Kalman filter. + + It corresponds to Equation 18 of "Wan, E. A., & Van Der Merwe, R. The unscented Kalman filter for nonlinear estimation" + + Parameters: + sigmaPoints (:class:`~org.hipparchus.linear.RealVector`[]): input sigma points + meanState (:class:`~org.hipparchus.linear.RealVector`): weighted mean state + + Returns: + the unscented covariance matrix + + + """ + ... + def getUnscentedMeanState(self, realVectorArray: typing.Union[typing.List[org.hipparchus.linear.RealVector], jpype.JArray]) -> org.hipparchus.linear.RealVector: + """ + Computes a weighted mean state from a given set of sigma points. + + This method can be used for computing both the mean state and the mean measurement in an Unscented Kalman filter. + + It corresponds to Equation 17 of "Wan, E. A., & Van Der Merwe, R. The unscented Kalman filter for nonlinear estimation" + + Parameters: + sigmaPoints (:class:`~org.hipparchus.linear.RealVector`[]): input samples + + Returns: + weighted mean state + + + """ + ... + def getWc(self) -> org.hipparchus.linear.RealVector: + """ + Get the covariance weights. + + Returns: + the covariance weights + + + """ + ... + def getWm(self) -> org.hipparchus.linear.RealVector: + """ + Get the mean weights. + + Returns: + the mean weights + + + """ + ... def inverseUnscentedTransform(self, realVectorArray: typing.Union[typing.List[org.hipparchus.linear.RealVector], jpype.JArray]) -> Pair[org.hipparchus.linear.RealVector, org.hipparchus.linear.RealMatrix]: ... - def unscentedTransform(self, realVector: org.hipparchus.linear.RealVector, realMatrix: org.hipparchus.linear.RealMatrix) -> typing.MutableSequence[org.hipparchus.linear.RealVector]: ... + def unscentedTransform(self, realVector: org.hipparchus.linear.RealVector, realMatrix: org.hipparchus.linear.RealMatrix) -> typing.MutableSequence[org.hipparchus.linear.RealVector]: + """ + Perform the unscented transform from a state and its covariance. + + Parameters: + state (:class:`~org.hipparchus.linear.RealVector`): process state + covariance (:class:`~org.hipparchus.linear.RealMatrix`): covariance associated with the process state + + Returns: + an array containing the sigma points of the unscented transform + + + """ + ... class AbstractUnscentedTransform(UnscentedTransformProvider): + """ + public abstract classAbstractUnscentedTransform extends :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + implements :class:`~org.hipparchus.util.UnscentedTransformProvider` + + Base class for unscented transform providers. + + Since: + 2.2 + """ def __init__(self, int: int): ... - def unscentedTransform(self, realVector: org.hipparchus.linear.RealVector, realMatrix: org.hipparchus.linear.RealMatrix) -> typing.MutableSequence[org.hipparchus.linear.RealVector]: ... + def unscentedTransform(self, realVector: org.hipparchus.linear.RealVector, realMatrix: org.hipparchus.linear.RealMatrix) -> typing.MutableSequence[org.hipparchus.linear.RealVector]: + """ + Perform the unscented transform from a state and its covariance. + + Let n be the state dimension and Si be the ith row of the covariance matrix square root. The returned array is organized + as follow. Element 0 contains the process state, also called the mean state. Elements from 1 to n contain the process + state + Si. Finally, elements from n + 1 to 2n contain the process state - Si + + Specified by: + :meth:`~org.hipparchus.util.UnscentedTransformProvider.unscentedTransform` in + interface :class:`~org.hipparchus.util.UnscentedTransformProvider` + + Parameters: + state (:class:`~org.hipparchus.linear.RealVector`): process state + covariance (:class:`~org.hipparchus.linear.RealMatrix`): covariance associated with the process state + + Returns: + an array containing the sigma points of the unscented transform + + + """ + ... class JulierUnscentedTransform(AbstractUnscentedTransform): + """ + public classJulierUnscentedTransform extends :class:`~org.hipparchus.util.AbstractUnscentedTransform` + + Unscented transform as defined by Julier and Uhlmann. + + The unscented transform uses three parameters: alpha, beta and kappa. Alpha determines the spread of the sigma points + around the process state, kappa is a secondary scaling parameter, and beta is used to incorporate prior knowledge of the + distribution of the process state. + + The Julier transform is a particular case of :class:`~org.hipparchus.util.MerweUnscentedTransform` with alpha = 1 and + beta = 0. + + Since: + 2.2 + + Also see: + + - "S. J. Julier and J. K. Uhlmann. A New Extension of the Kalman Filter to Nonlinear Systems. Proc. SPIE 3068, Signal + Processing, Sensor Fusion, and Target Recognition VI, 182 (July 28, 1997)" + """ DEFAULT_KAPPA: typing.ClassVar[float] = ... + """ + public static final double DEFAULT_KAPPA + + Default value for kappa, (0.0, see reference). + + Also see: + + - :meth:`~constant` + + + + """ @typing.overload def __init__(self, int: int): ... @typing.overload def __init__(self, int: int, double: float): ... - def getWc(self) -> org.hipparchus.linear.RealVector: ... - def getWm(self) -> org.hipparchus.linear.RealVector: ... + def getWc(self) -> org.hipparchus.linear.RealVector: + """ + Get the covariance weights. + + Returns: + the covariance weights + + + """ + ... + def getWm(self) -> org.hipparchus.linear.RealVector: + """ + Get the mean weights. + + Returns: + the mean weights + + + """ + ... class MerweUnscentedTransform(AbstractUnscentedTransform): + """ + public classMerweUnscentedTransform extends :class:`~org.hipparchus.util.AbstractUnscentedTransform` + + Unscented transform as defined by Merwe and Wan. + + The unscented transform uses three parameters: alpha, beta and kappa. Alpha determines the spread of the sigma points + around the process state, kappa is a secondary scaling parameter, and beta is used to incorporate prior knowledge of the + distribution of the process state. + + Since: + 2.2 + + Also see: + + - "E. A. Wan and R. Van der Merwe, The unscented Kalman filter for nonlinear estimation, in Proc. Symp. Adaptive Syst. + Signal Process., Commun. Contr., Lake Louise, AB, Canada, Oct. 2000." + """ DEFAULT_ALPHA: typing.ClassVar[float] = ... + """ + public static final double DEFAULT_ALPHA + + Default value for alpha (0.5, see reference). + + Also see: + + - :meth:`~constant` + + + + """ DEFAULT_BETA: typing.ClassVar[float] = ... + """ + public static final double DEFAULT_BETA + + Default value for beta (2.0, see reference). + + Also see: + + - :meth:`~constant` + + + + """ DEFAULT_KAPPA: typing.ClassVar[float] = ... + """ + public static final double DEFAULT_KAPPA + + Default value for kappa, (0.0, see reference). + + Also see: + + - :meth:`~constant` + + + + """ @typing.overload def __init__(self, int: int): ... @typing.overload def __init__(self, int: int, double: float, double2: float, double3: float): ... - def getWc(self) -> org.hipparchus.linear.RealVector: ... - def getWm(self) -> org.hipparchus.linear.RealVector: ... + def getWc(self) -> org.hipparchus.linear.RealVector: + """ + Get the covariance weights. + + Returns: + the covariance weights + + + """ + ... + def getWm(self) -> org.hipparchus.linear.RealVector: + """ + Get the mean weights. + + Returns: + the mean weights + + + """ + ... class OpenIntToDoubleHashMap(AbstractOpenIntHashMap, java.io.Serializable): + """ + public classOpenIntToDoubleHashMap extends :class:`~org.hipparchus.util.AbstractOpenIntHashMap` + implements :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + Open addressed map from int to double. + + This class provides a dedicated map from integers to doubles with a much smaller memory overhead than standard + :code:`java.util.Map`. + + This class is not synchronized. The specialized iterators returned by + :meth:`~org.hipparchus.util.OpenIntToDoubleHashMap.iterator` are fail-fast: they throw a + :code:`ConcurrentModificationException` when they detect the map has been modified during iteration. + + Also see: + + - :meth:`~serialized` + """ @typing.overload def __init__(self): ... @typing.overload @@ -1689,18 +8735,102 @@ class OpenIntToDoubleHashMap(AbstractOpenIntHashMap, java.io.Serializable): def __init__(self, int: int, double: float): ... @typing.overload def __init__(self, openIntToDoubleHashMap: 'OpenIntToDoubleHashMap'): ... - def equals(self, object: typing.Any) -> bool: ... - def get(self, int: int) -> float: ... - def hashCode(self) -> int: ... - def iterator(self) -> 'OpenIntToDoubleHashMap.Iterator': ... - def put(self, int: int, double: float) -> float: ... - def remove(self, int: int) -> float: ... + def equals(self, object: typing.Any) -> bool: + """ + + Overrides: + :meth:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.equals` in + class :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + + """ + ... + def get(self, int: int) -> float: + """ + Get the stored value associated with the given key + + Parameters: + key (int): key associated with the data + + Returns: + data associated with the key + + + """ + ... + def hashCode(self) -> int: + """ + + Overrides: + :meth:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.hashCode` in + class :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + + """ + ... + def iterator(self) -> 'OpenIntToDoubleHashMap.Iterator': + """ + Get an iterator over map elements. + + The specialized iterators returned are fail-fast: they throw a :code:`ConcurrentModificationException` when they detect + the map has been modified during iteration. + + Returns: + iterator over the map elements + + + """ + ... + def put(self, int: int, double: float) -> float: + """ + Put a value associated with a key in the map. + + Parameters: + key (int): key to which value is associated + value (double): value to put in the map + + Returns: + previous value associated with the key + + + """ + ... + def remove(self, int: int) -> float: + """ + Remove the value associated with a key. + + Parameters: + key (int): key to which the value is associated + + Returns: + removed value + + + """ + ... class Iterator(org.hipparchus.util.AbstractOpenIntHashMap.BaseIterator): def __init__(self, openIntToDoubleHashMap: 'OpenIntToDoubleHashMap'): ... def value(self) -> float: ... _OpenIntToFieldHashMap__T = typing.TypeVar('_OpenIntToFieldHashMap__T', bound=org.hipparchus.FieldElement) # <T> class OpenIntToFieldHashMap(AbstractOpenIntHashMap, java.io.Serializable, typing.Generic[_OpenIntToFieldHashMap__T]): + """ + public classOpenIntToFieldHashMap<T extends :class:`~org.hipparchus.FieldElement`<T>> extends :class:`~org.hipparchus.util.AbstractOpenIntHashMap` + implements :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.io.Serializable` + + Open addressed map from int to FieldElement. + + This class provides a dedicated map from integers to FieldElements with a much smaller memory overhead than standard + :code:`java.util.Map`. + + This class is not synchronized. The specialized iterators returned by + :meth:`~org.hipparchus.util.OpenIntToFieldHashMap.iterator` are fail-fast: they throw a + :code:`ConcurrentModificationException` when they detect the map has been modified during iteration. + + Also see: + + - :meth:`~serialized` + """ @typing.overload def __init__(self, field: org.hipparchus.Field[_OpenIntToFieldHashMap__T]): ... @typing.overload @@ -1711,12 +8841,67 @@ class OpenIntToFieldHashMap(AbstractOpenIntHashMap, java.io.Serializable, typing def __init__(self, field: org.hipparchus.Field[_OpenIntToFieldHashMap__T], t: _OpenIntToFieldHashMap__T): ... @typing.overload def __init__(self, openIntToFieldHashMap: 'OpenIntToFieldHashMap'[_OpenIntToFieldHashMap__T]): ... - def equals(self, object: typing.Any) -> bool: ... - def get(self, int: int) -> _OpenIntToFieldHashMap__T: ... - def hashCode(self) -> int: ... + def equals(self, object: typing.Any) -> bool: + """ + + Overrides: + :meth:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.equals` in + class :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + + """ + ... + def get(self, int: int) -> _OpenIntToFieldHashMap__T: + """ + Get the stored value associated with the given key + + Parameters: + key (int): key associated with the data + + Returns: + data associated with the key + + + """ + ... + def hashCode(self) -> int: + """ + + Overrides: + :meth:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object.hashCode` in + class :class:`~org.hipparchus.util.https:.docs.oracle.com.javase.8.docs.api.java.lang.Object` + + + """ + ... def iterator(self) -> 'OpenIntToFieldHashMap.Iterator': ... - def put(self, int: int, t: _OpenIntToFieldHashMap__T) -> _OpenIntToFieldHashMap__T: ... - def remove(self, int: int) -> _OpenIntToFieldHashMap__T: ... + def put(self, int: int, t: _OpenIntToFieldHashMap__T) -> _OpenIntToFieldHashMap__T: + """ + Put a value associated with a key in the map. + + Parameters: + key (int): key to which value is associated + value (:class:`~org.hipparchus.util.OpenIntToFieldHashMap`): value to put in the map + + Returns: + previous value associated with the key + + + """ + ... + def remove(self, int: int) -> _OpenIntToFieldHashMap__T: + """ + Remove the value associated with a key. + + Parameters: + key (int): key to which the value is associated + + Returns: + removed value + + + """ + ... class Iterator(org.hipparchus.util.AbstractOpenIntHashMap.BaseIterator): def __init__(self, openIntToFieldHashMap: 'OpenIntToFieldHashMap'): ... def value(self) -> _OpenIntToFieldHashMap__T: ... -- GitLab