public abstract class ExactDecimal<S extends ExactDecimal<S>> extends Number implements Scalar<S>, NumberContext.Enforceable<S>
Modifier and Type | Class and Description |
---|---|
static class |
ExactDecimal.Descriptor |
Scalar.Factory<N extends Number>
ScalarOperation.Addition<T,N extends Number>, ScalarOperation.Division<T,N extends Number>, ScalarOperation.Multiplication<T,N extends Number>, ScalarOperation.Subtraction<T,N extends Number>
Modifier | Constructor and Description |
---|---|
protected |
ExactDecimal(long numerator) |
Modifier and Type | Method and Description |
---|---|
S |
add(double scalarAddend) |
S |
add(S scalarAddend) |
int |
compareTo(S reference) |
S |
conjugate()
This method will (most likely) be moved to some other interface in the future! Just have to figure
out where it fits...
|
protected abstract ExactDecimal.Descriptor |
descriptor() |
S |
divide(double scalarDivisor) |
S |
divide(S scalarDivisor) |
double |
doubleValue() |
S |
enforce(NumberContext context) |
protected static long |
extractUnscaledValue(BigDecimal decimal,
NumberContext cntxt) |
float |
floatValue() |
S |
get() |
int |
intValue() |
S |
invert()
The multiplicative inverse.
|
boolean |
isAbsolute() |
boolean |
isSmall(double comparedTo) |
long |
longValue() |
S |
multiply(double scalarMultiplicand) |
S |
multiply(S scalarMultiplicand) |
S |
negate()
The additive inverse of this.
|
double |
norm()
this == this.signum().multiply(this.norm()) |
S |
signum()
this == this.signum().multiply(this.norm()) |
S |
subtract(double scalarSubtrahend) |
S |
subtract(S scalarSubtrahend) |
BigDecimal |
toBigDecimal() |
String |
toString() |
String |
toString(NumberContext context) |
protected abstract S |
wrap(long numerator) |
byteValue, shortValue
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
add, divide, multiply, subtract, toPlainString
byteValue, shortValue
protected static long extractUnscaledValue(BigDecimal decimal, NumberContext cntxt)
public final S add(double scalarAddend)
add
in interface ScalarOperation.Addition<Scalar<S extends ExactDecimal<S>>,S extends ExactDecimal<S>>
this + scalarAddend
.public final S add(S scalarAddend)
add
in interface ScalarOperation.Addition<Scalar<S extends ExactDecimal<S>>,S extends ExactDecimal<S>>
this + scalarAddend
.public final int compareTo(S reference)
compareTo
in interface Comparable<S extends ExactDecimal<S>>
public final S conjugate()
VectorSpace
This method will (most likely) be moved to some other interface in the future! Just have to figure out where it fits...
The conjugate transpose of a matrix and/or the conjugate of a scalar/field like ComplexNumber or Quaternion.
The conjugate transpose of a real matrix is simply its transpose.
conjugate
in interface VectorSpace<Scalar<S extends ExactDecimal<S>>,S extends ExactDecimal<S>>
public final S divide(double scalarDivisor)
divide
in interface ScalarOperation.Division<Scalar<S extends ExactDecimal<S>>,S extends ExactDecimal<S>>
this / scalarDivisor
.public final S divide(S scalarDivisor)
divide
in interface ScalarOperation.Division<Scalar<S extends ExactDecimal<S>>,S extends ExactDecimal<S>>
this / scalarDivisor
.public final double doubleValue()
doubleValue
in interface AccessScalar<S extends ExactDecimal<S>>
doubleValue
in class Number
Number.doubleValue()
public final S enforce(NumberContext context)
enforce
in interface NumberContext.Enforceable<S extends ExactDecimal<S>>
public final float floatValue()
floatValue
in interface AccessScalar<S extends ExactDecimal<S>>
floatValue
in class Number
Number.floatValue()
public final S get()
get
in interface AccessScalar<S extends ExactDecimal<S>>
public final int intValue()
intValue
in interface AccessScalar<S extends ExactDecimal<S>>
intValue
in class Number
Number.intValue()
public final S invert()
Group.Multiplicative
invert
in interface Group.Multiplicative<Scalar<S extends ExactDecimal<S>>>
IDENTITY / this
.public final boolean isAbsolute()
isAbsolute
in interface Scalar<S extends ExactDecimal<S>>
Scalar.isAbsolute()
public final boolean isSmall(double comparedTo)
isSmall
in interface NormedVectorSpace<Scalar<S extends ExactDecimal<S>>,S extends ExactDecimal<S>>
comparedTo
- What to compare withpublic final long longValue()
longValue
in interface AccessScalar<S extends ExactDecimal<S>>
longValue
in class Number
Number.longValue()
public final S multiply(double scalarMultiplicand)
multiply
in interface ScalarOperation.Multiplication<Scalar<S extends ExactDecimal<S>>,S extends ExactDecimal<S>>
this * scalarMultiplicand
.public final S multiply(S scalarMultiplicand)
multiply
in interface ScalarOperation.Multiplication<Scalar<S extends ExactDecimal<S>>,S extends ExactDecimal<S>>
this * multiplicand
.public final S negate()
Group.Additive
negate
in interface Group.Additive<Scalar<S extends ExactDecimal<S>>>
-this
.public final double norm()
NormedVectorSpace
this == this.signum().multiply(this.norm())
norm
in interface NormedVectorSpace<Scalar<S extends ExactDecimal<S>>,S extends ExactDecimal<S>>
public final S signum()
NormedVectorSpace
this == this.signum().multiply(this.norm())
signum
in interface NormedVectorSpace<Scalar<S extends ExactDecimal<S>>,S extends ExactDecimal<S>>
public final S subtract(double scalarSubtrahend)
subtract
in interface ScalarOperation.Subtraction<Scalar<S extends ExactDecimal<S>>,S extends ExactDecimal<S>>
this - scalarSubtrahend
.public final S subtract(S scalarSubtrahend)
subtract
in interface ScalarOperation.Subtraction<Scalar<S extends ExactDecimal<S>>,S extends ExactDecimal<S>>
this - scalarSubtrahend
.public final BigDecimal toBigDecimal()
toBigDecimal
in interface Scalar<S extends ExactDecimal<S>>
public final String toString(NumberContext context)
toString
in interface Scalar<S extends ExactDecimal<S>>
protected abstract ExactDecimal.Descriptor descriptor()
protected abstract S wrap(long numerator)
Copyright © 2019 Optimatika. All rights reserved.