public class Tuple extends Object implements CalculusFieldElement<Tuple>
Constructor and Description |
---|
Tuple(double... x)
Creates a new instance from its components.
|
Modifier and Type | Method and Description |
---|---|
Tuple |
abs()
absolute value.
|
Tuple |
acos()
Arc cosine operation.
|
Tuple |
acosh()
Inverse hyperbolic cosine operation.
|
Tuple |
add(double a)
'+' operator.
|
Tuple |
add(Tuple a)
Compute this + a.
|
Tuple |
asin()
Arc sine operation.
|
Tuple |
asinh()
Inverse hyperbolic sine operation.
|
Tuple |
atan()
Arc tangent operation.
|
Tuple |
atan2(Tuple x)
Two arguments arc tangent operation.
|
Tuple |
atanh()
Inverse hyperbolic tangent operation.
|
Tuple |
cbrt()
Cubic root.
|
Tuple |
ceil()
Get the smallest whole number larger than instance.
|
Tuple |
copySign(double sign)
Returns the instance with the sign of the argument.
|
Tuple |
copySign(Tuple sign)
Returns the instance with the sign of the argument.
|
Tuple |
cos()
Cosine operation.
|
Tuple |
cosh()
Hyperbolic cosine operation.
|
Tuple |
divide(double a)
'÷' operator.
|
Tuple |
divide(Tuple a)
Compute this ÷ a.
|
boolean |
equals(Object obj) |
Tuple |
exp()
Exponential.
|
Tuple |
expm1()
Exponential minus 1.
|
Tuple |
floor()
Get the largest whole number smaller than instance.
|
double |
getComponent(int index)
Get one component of the tuple.
|
double[] |
getComponents()
Get all components of the tuple.
|
int |
getDimension()
Get the dimension of the tuple.
|
Field<Tuple> |
getField()
Get the
Field to which the instance belongs. |
Tuple |
getPi()
Get the Archimedes constant π.
|
double |
getReal()
Get the real value of the number.
|
int |
hashCode() |
Tuple |
hypot(Tuple y)
Returns the hypotenuse of a triangle with sides
this and y
- sqrt(this2 +y2)
avoiding intermediate overflow or underflow. |
Tuple |
linearCombination(double[] a,
Tuple[] b)
Compute a linear combination.
|
Tuple |
linearCombination(double a1,
Tuple b1,
double a2,
Tuple b2)
Compute a linear combination.
|
Tuple |
linearCombination(double a1,
Tuple b1,
double a2,
Tuple b2,
double a3,
Tuple b3)
Compute a linear combination.
|
Tuple |
linearCombination(double a1,
Tuple b1,
double a2,
Tuple b2,
double a3,
Tuple b3,
double a4,
Tuple b4)
Compute a linear combination.
|
Tuple |
linearCombination(Tuple[] a,
Tuple[] b)
Compute a linear combination.
|
Tuple |
linearCombination(Tuple a1,
Tuple b1,
Tuple a2,
Tuple b2)
Compute a linear combination.
|
Tuple |
linearCombination(Tuple a1,
Tuple b1,
Tuple a2,
Tuple b2,
Tuple a3,
Tuple b3)
Compute a linear combination.
|
Tuple |
linearCombination(Tuple a1,
Tuple b1,
Tuple a2,
Tuple b2,
Tuple a3,
Tuple b3,
Tuple a4,
Tuple b4)
Compute a linear combination.
|
Tuple |
log()
Natural logarithm.
|
Tuple |
log10()
Base 10 logarithm.
|
Tuple |
log1p()
Shifted natural logarithm.
|
Tuple |
multiply(double a)
'×' operator.
|
Tuple |
multiply(int n)
Compute n × this.
|
Tuple |
multiply(Tuple a)
Compute this × a.
|
Tuple |
negate()
Returns the additive inverse of
this element. |
Tuple |
newInstance(double value)
Create an instance corresponding to a constant real value.
|
Tuple |
pow(double p)
Power operation.
|
Tuple |
pow(int n)
Integer power operation.
|
Tuple |
pow(Tuple e)
Power operation.
|
Tuple |
reciprocal()
Returns the multiplicative inverse of
this element. |
Tuple |
remainder(double a)
IEEE remainder operator.
|
Tuple |
remainder(Tuple a)
IEEE remainder operator.
|
Tuple |
rint()
Get the whole number that is the nearest to the instance, or the even one if x is exactly half way between two integers.
|
Tuple |
rootN(int n)
Nth root.
|
Tuple |
scalb(int n)
Multiply the instance by a power of 2.
|
Tuple |
sign()
Compute the sign of the instance.
|
Tuple |
sin()
Sine operation.
|
FieldSinCos<Tuple> |
sinCos()
Combined Sine and Cosine operation.
|
Tuple |
sinh()
Hyperbolic sine operation.
|
FieldSinhCosh<Tuple> |
sinhCosh()
Combined hyperbolic sine and sosine operation.
|
Tuple |
sqrt()
Square root.
|
Tuple |
subtract(double a)
'-' operator.
|
Tuple |
subtract(Tuple a)
Compute this - a.
|
Tuple |
tan()
Tangent operation.
|
Tuple |
tanh()
Hyperbolic tangent operation.
|
Tuple |
toDegrees()
Convert radians to degrees, with error of less than 0.5 ULP
|
Tuple |
toRadians()
Convert degrees to radians, with error of less than 0.5 ULP
|
Tuple |
ulp()
Compute least significant bit (Unit in Last Position) for a number.
|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
getExponent, isFinite, isInfinite, isNaN, norm, round
isZero
public Tuple(double... x)
x
- components of the tuplepublic Tuple newInstance(double value)
newInstance
in interface CalculusFieldElement<Tuple>
value
- constant real valuepublic int getDimension()
public double getComponent(int index)
index
- index of the component, between 0 and getDimension()
- 1public double[] getComponents()
public Field<Tuple> getField()
Field
to which the instance belongs.getField
in interface FieldElement<Tuple>
Field
to which the instance belongspublic Tuple add(Tuple a)
add
in interface FieldElement<Tuple>
a
- element to addpublic Tuple subtract(Tuple a)
subtract
in interface FieldElement<Tuple>
a
- element to subtractpublic Tuple negate()
this
element.negate
in interface FieldElement<Tuple>
this
.public Tuple multiply(Tuple a)
multiply
in interface FieldElement<Tuple>
a
- element to multiplypublic Tuple multiply(int n)
multiply
in interface FieldElement<Tuple>
n
- Number of times this
must be added to itself.public Tuple divide(Tuple a)
divide
in interface FieldElement<Tuple>
a
- element to divide bypublic Tuple reciprocal()
this
element.reciprocal
in interface CalculusFieldElement<Tuple>
reciprocal
in interface FieldElement<Tuple>
this
.public double getReal()
getReal
in interface FieldElement<Tuple>
public Tuple add(double a)
add
in interface CalculusFieldElement<Tuple>
a
- right hand side parameter of the operatorpublic Tuple subtract(double a)
subtract
in interface CalculusFieldElement<Tuple>
a
- right hand side parameter of the operatorpublic Tuple multiply(double a)
multiply
in interface CalculusFieldElement<Tuple>
a
- right hand side parameter of the operatorpublic Tuple divide(double a)
divide
in interface CalculusFieldElement<Tuple>
a
- right hand side parameter of the operatorpublic Tuple remainder(double a)
remainder
in interface CalculusFieldElement<Tuple>
a
- right hand side parameter of the operatorpublic Tuple remainder(Tuple a)
remainder
in interface CalculusFieldElement<Tuple>
a
- right hand side parameter of the operatorpublic Tuple abs()
Just another name for CalculusFieldElement.norm()
abs
in interface CalculusFieldElement<Tuple>
public Tuple ceil()
ceil
in interface CalculusFieldElement<Tuple>
public Tuple floor()
floor
in interface CalculusFieldElement<Tuple>
public Tuple rint()
rint
in interface CalculusFieldElement<Tuple>
public Tuple sign()
sign
in interface CalculusFieldElement<Tuple>
public Tuple copySign(Tuple sign)
sign
argument is treated as positive.copySign
in interface CalculusFieldElement<Tuple>
sign
- the sign for the returned valuesign
argumentpublic Tuple copySign(double sign)
sign
argument is treated as positive.copySign
in interface CalculusFieldElement<Tuple>
sign
- the sign for the returned valuesign
argumentpublic Tuple scalb(int n)
scalb
in interface CalculusFieldElement<Tuple>
n
- power of 2public Tuple ulp()
ulp
in interface CalculusFieldElement<Tuple>
public Tuple hypot(Tuple y)
this
and y
- sqrt(this2 +y2)
avoiding intermediate overflow or underflow.
hypot
in interface CalculusFieldElement<Tuple>
y
- a valuepublic Tuple sqrt()
sqrt
in interface CalculusFieldElement<Tuple>
public Tuple cbrt()
cbrt
in interface CalculusFieldElement<Tuple>
public Tuple rootN(int n)
rootN
in interface CalculusFieldElement<Tuple>
n
- order of the rootpublic Tuple pow(double p)
pow
in interface CalculusFieldElement<Tuple>
p
- power to applypublic Tuple pow(int n)
pow
in interface CalculusFieldElement<Tuple>
n
- power to applypublic Tuple pow(Tuple e)
pow
in interface CalculusFieldElement<Tuple>
e
- exponentpublic Tuple exp()
exp
in interface CalculusFieldElement<Tuple>
public Tuple expm1()
expm1
in interface CalculusFieldElement<Tuple>
public Tuple log()
log
in interface CalculusFieldElement<Tuple>
public Tuple log1p()
log1p
in interface CalculusFieldElement<Tuple>
public Tuple log10()
log10
in interface CalculusFieldElement<Tuple>
public Tuple cos()
cos
in interface CalculusFieldElement<Tuple>
public Tuple sin()
sin
in interface CalculusFieldElement<Tuple>
public FieldSinCos<Tuple> sinCos()
sinCos
in interface CalculusFieldElement<Tuple>
public Tuple tan()
tan
in interface CalculusFieldElement<Tuple>
public Tuple acos()
acos
in interface CalculusFieldElement<Tuple>
public Tuple asin()
asin
in interface CalculusFieldElement<Tuple>
public Tuple atan()
atan
in interface CalculusFieldElement<Tuple>
public Tuple atan2(Tuple x)
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 atan2
,
this method computes atan2(this, x)
, i.e. the instance
represents the y
argument and the 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 atan2
two-arguments arc tangent
and puts x
as its first argument.
atan2
in interface CalculusFieldElement<Tuple>
x
- second argument of the arc tangentpublic Tuple cosh()
cosh
in interface CalculusFieldElement<Tuple>
public Tuple sinh()
sinh
in interface CalculusFieldElement<Tuple>
public FieldSinhCosh<Tuple> sinhCosh()
sinhCosh
in interface CalculusFieldElement<Tuple>
public Tuple tanh()
tanh
in interface CalculusFieldElement<Tuple>
public Tuple acosh()
acosh
in interface CalculusFieldElement<Tuple>
public Tuple asinh()
asinh
in interface CalculusFieldElement<Tuple>
public Tuple atanh()
atanh
in interface CalculusFieldElement<Tuple>
public Tuple toDegrees()
toDegrees
in interface CalculusFieldElement<Tuple>
public Tuple toRadians()
toRadians
in interface CalculusFieldElement<Tuple>
public Tuple linearCombination(Tuple[] a, Tuple[] b) throws MathIllegalArgumentException
linearCombination
in interface CalculusFieldElement<Tuple>
a
- Factors.b
- Factors.Σi ai bi
.MathIllegalArgumentException
- if arrays dimensions don't matchpublic Tuple linearCombination(double[] a, Tuple[] b) throws MathIllegalArgumentException
linearCombination
in interface CalculusFieldElement<Tuple>
a
- Factors.b
- Factors.Σi ai bi
.MathIllegalArgumentException
- if arrays dimensions don't matchpublic Tuple linearCombination(Tuple a1, Tuple b1, Tuple a2, Tuple b2)
linearCombination
in interface CalculusFieldElement<Tuple>
a1
- first factor of the first termb1
- second factor of the first terma2
- first factor of the second termb2
- second factor of the second termCalculusFieldElement.linearCombination(FieldElement, FieldElement, FieldElement, FieldElement, FieldElement, FieldElement)
,
CalculusFieldElement.linearCombination(FieldElement, FieldElement, FieldElement, FieldElement, FieldElement, FieldElement, FieldElement, FieldElement)
public Tuple linearCombination(double a1, Tuple b1, double a2, Tuple b2)
linearCombination
in interface CalculusFieldElement<Tuple>
a1
- first factor of the first termb1
- second factor of the first terma2
- first factor of the second termb2
- second factor of the second termCalculusFieldElement.linearCombination(double, FieldElement, double, FieldElement, double, FieldElement)
,
CalculusFieldElement.linearCombination(double, FieldElement, double, FieldElement, double, FieldElement, double, FieldElement)
public Tuple linearCombination(Tuple a1, Tuple b1, Tuple a2, Tuple b2, Tuple a3, Tuple b3)
linearCombination
in interface CalculusFieldElement<Tuple>
a1
- first factor of the first termb1
- second factor of the first terma2
- first factor of the second termb2
- second factor of the second terma3
- first factor of the third termb3
- second factor of the third termCalculusFieldElement.linearCombination(FieldElement, FieldElement, FieldElement, FieldElement)
,
CalculusFieldElement.linearCombination(FieldElement, FieldElement, FieldElement, FieldElement, FieldElement, FieldElement, FieldElement, FieldElement)
public Tuple linearCombination(double a1, Tuple b1, double a2, Tuple b2, double a3, Tuple b3)
linearCombination
in interface CalculusFieldElement<Tuple>
a1
- first factor of the first termb1
- second factor of the first terma2
- first factor of the second termb2
- second factor of the second terma3
- first factor of the third termb3
- second factor of the third termCalculusFieldElement.linearCombination(double, FieldElement, double, FieldElement)
,
CalculusFieldElement.linearCombination(double, FieldElement, double, FieldElement, double, FieldElement, double, FieldElement)
public Tuple linearCombination(Tuple a1, Tuple b1, Tuple a2, Tuple b2, Tuple a3, Tuple b3, Tuple a4, Tuple b4)
linearCombination
in interface CalculusFieldElement<Tuple>
a1
- first factor of the first termb1
- second factor of the first terma2
- first factor of the second termb2
- second factor of the second terma3
- first factor of the third termb3
- second factor of the third terma4
- first factor of the fourth termb4
- second factor of the fourth termCalculusFieldElement.linearCombination(FieldElement, FieldElement, FieldElement, FieldElement)
,
CalculusFieldElement.linearCombination(FieldElement, FieldElement, FieldElement, FieldElement, FieldElement, FieldElement)
public Tuple linearCombination(double a1, Tuple b1, double a2, Tuple b2, double a3, Tuple b3, double a4, Tuple b4)
linearCombination
in interface CalculusFieldElement<Tuple>
a1
- first factor of the first termb1
- second factor of the first terma2
- first factor of the second termb2
- second factor of the second terma3
- first factor of the third termb3
- second factor of the third terma4
- first factor of the fourth termb4
- second factor of the fourth termCalculusFieldElement.linearCombination(double, FieldElement, double, FieldElement)
,
CalculusFieldElement.linearCombination(double, FieldElement, double, FieldElement, double, FieldElement)
public Tuple getPi()
Archimedes constant is the ratio of a circle's circumference to its diameter.
getPi
in interface CalculusFieldElement<Tuple>
Copyright © 2016-2021 CS GROUP. All rights reserved.