Package org.ojalgo.scalar
Interface Scalar<N extends Comparable<N>>
- All Superinterfaces:
AccessScalar<N>
,Comparable<N>
,Field<Scalar<N>>
,Group
,Group.Additive<Scalar<N>>
,Group.Multiplicative<Scalar<N>>
,NormedVectorSpace<Scalar<N>,
,N> NumberDefinition
,Operation
,Operation.Addition<Scalar<N>>
,Operation.Division<Scalar<N>>
,Operation.Multiplication<Scalar<N>>
,Operation.Subtraction<Scalar<N>>
,Ring<Scalar<N>>
,ScalarOperation
,ScalarOperation.Addition<Scalar<N>,
,N> ScalarOperation.Division<Scalar<N>,
,N> ScalarOperation.Multiplication<Scalar<N>,
,N> ScalarOperation.Subtraction<Scalar<N>,
,N> Tensor<N,
,Scalar<N>> VectorSpace<Scalar<N>,
N>
- All Known Subinterfaces:
SelfDeclaringScalar<S>
- All Known Implementing Classes:
Amount
,BigScalar
,ComplexNumber
,ExactDecimal
,Money
,Price
,PrimitiveScalar
,Quadruple
,Quantity
,Quaternion
,RationalNumber
public interface Scalar<N extends Comparable<N>>
extends AccessScalar<N>, Field<Scalar<N>>, ScalarOperation.Addition<Scalar<N>,N>, ScalarOperation.Division<Scalar<N>,N>, ScalarOperation.Subtraction<Scalar<N>,N>, Comparable<N>, Tensor<N,Scalar<N>>
A Scalar is:
- An abstraction of a vector/matrix element.
- A Comparable decorator, increasing the number of things you can do with them.
Theoretically it is a Field or at least a Division ring.
The intention is that implementors should be final immutable subclasses of Comparable
and that they
should be inline with the requirements for ValueBased classes.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface org.ojalgo.algebra.Group
Group.Additive<T>, Group.Multiplicative<T>
Nested classes/interfaces inherited from interface org.ojalgo.algebra.Operation
Operation.Addition<T>, Operation.Division<T>, Operation.Multiplication<T>, Operation.Subtraction<T>
Nested classes/interfaces inherited from interface org.ojalgo.algebra.ScalarOperation
ScalarOperation.Addition<T,
N extends Comparable<N>>, ScalarOperation.Division<T, N extends Comparable<N>>, ScalarOperation.Multiplication<T, N extends Comparable<N>>, ScalarOperation.Subtraction<T, N extends Comparable<N>> -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
booleanValue
(Comparable<?> number) static byte
byteValue
(Comparable<?> number) default int
The range of the indices that identify the scalar components.static double
doubleValue
(Comparable<?> number) static float
floatValue
(Comparable<?> number) static int
intValue
(Comparable<?> number) boolean
static long
longValue
(Comparable<?> number) default int
rank()
The total number of indices required to uniquely identify each scalar component is called the order, degree or rank of the tensor.static short
shortValue
(Comparable<?> number) default String
toPlainString
(NumberContext context) toString
(NumberContext context) Methods inherited from interface org.ojalgo.structure.AccessScalar
get
Methods inherited from interface java.lang.Comparable
compareTo
Methods inherited from interface org.ojalgo.algebra.Group.Additive
negate
Methods inherited from interface org.ojalgo.algebra.Group.Multiplicative
invert
Methods inherited from interface org.ojalgo.algebra.NormedVectorSpace
isSmall, norm, signum
Methods inherited from interface org.ojalgo.type.NumberDefinition
booleanValue, byteValue, doubleValue, floatValue, intValue, longValue, shortValue
Methods inherited from interface org.ojalgo.algebra.Operation.Multiplication
power
Methods inherited from interface org.ojalgo.algebra.ScalarOperation.Addition
add, add, add
Methods inherited from interface org.ojalgo.algebra.ScalarOperation.Division
divide, divide, divide
Methods inherited from interface org.ojalgo.algebra.ScalarOperation.Multiplication
multiply, multiply, multiply
Methods inherited from interface org.ojalgo.algebra.ScalarOperation.Subtraction
subtract, subtract, subtract
Methods inherited from interface org.ojalgo.tensor.Tensor
components, isSameShape
Methods inherited from interface org.ojalgo.algebra.VectorSpace
conjugate
-
Method Details
-
booleanValue
-
byteValue
-
doubleValue
-
floatValue
-
intValue
-
longValue
-
shortValue
-
add
- Specified by:
add
in interfaceOperation.Addition<N extends Comparable<N>>
- Parameters:
addend
- What to add- Returns:
this + addend
-
dimensions
default int dimensions()Description copied from interface:Tensor
The range of the indices that identify the scalar components. Each index of a tensor ranges over the number of dimensions.- Specified by:
dimensions
in interfaceTensor<N extends Comparable<N>,
Scalar<N extends Comparable<N>>>
-
divide
- Specified by:
divide
in interfaceOperation.Division<N extends Comparable<N>>
- Parameters:
divisor
- The divisor- Returns:
this / divisor
.
-
isAbsolute
boolean isAbsolute()- Returns:
- true if this is equal to its own norm, modulus or absolute value (non-negative real part and no imaginary part); otherwise false.
- See Also:
-
multiply
- Specified by:
multiply
in interfaceOperation.Multiplication<N extends Comparable<N>>
- Parameters:
multiplicand
- The multiplicand- Returns:
this * multiplicand
.
-
rank
default int rank()Description copied from interface:Tensor
The total number of indices required to uniquely identify each scalar component is called the order, degree or rank of the tensor.- Specified by:
rank
in interfaceTensor<N extends Comparable<N>,
Scalar<N extends Comparable<N>>>
-
subtract
- Specified by:
subtract
in interfaceOperation.Subtraction<N extends Comparable<N>>
- Parameters:
subtrahend
- The subtrahend- Returns:
this - subtrahend
.
-
toBigDecimal
BigDecimal toBigDecimal() -
toPlainString
-
toString
-