Package space.kscience.kmath.operations

Types

Algebra
Link copied to clipboard
common
interface Algebra<T>
Represents an algebraic structure.
AlgebraElement
Link copied to clipboard
common
interface AlgebraElement<T, C : Algebra<T>>
The generic mathematics elements which is able to store its context
BigInt
Link copied to clipboard
common
class BigInt : Comparable<BigInt>
BigIntField
Link copied to clipboard
common
object BigIntField : Field<BigInt> , RingWithNumbers<BigInt>
Kotlin Multiplatform implementation of Big Integer numbers (KBigInteger).
ByteRing
Link copied to clipboard
common
object ByteRing : Ring<Byte> , Norm<Byte, Byte> , NumericAlgebra<Byte>
A field for Byte without boxing.
ExponentialOperations
Link copied to clipboard
common
interface ExponentialOperations<T> : Algebra<T>
A container for operations related to exp and ln functions.
ExtendedField
Link copied to clipboard
common
interface ExtendedField<T> : ExtendedFieldOperations<T> , Field<T> , NumericAlgebra<T>
Advanced Number-like field that implements basic operations.
ExtendedFieldOperations
Link copied to clipboard
common
Advanced Number-like semifield that implements basic operations.
Field
Link copied to clipboard
common
interface Field<T> : Ring<T> , FieldOperations<T>
Represents field, i.e.
FieldElement
Link copied to clipboard
common
interface FieldElement<T : FieldElement<T, F>, F : Field<T>> : RingElement<T, F>
The element of Field.
FieldOperations
Link copied to clipboard
common
interface FieldOperations<T> : RingOperations<T>
Represents field without identity elements, i.e.
FloatField
Link copied to clipboard
common
object FloatField : ExtendedField<Float> , Norm<Float, Float>
A field for Float without boxing.
HyperbolicOperations
Link copied to clipboard
common
interface HyperbolicOperations<T> : Algebra<T>
A container for hyperbolic trigonometric operations for specific type.
IntRing
Link copied to clipboard
common
object IntRing : Ring<Int> , Norm<Int, Int> , NumericAlgebra<Int>
A field for Int without boxing.
JBigDecimalField
Link copied to clipboard
class JBigDecimalField(mathContext: MathContext) : JBigDecimalFieldBase
A field over BigDecimal.
JBigDecimalFieldBase
Link copied to clipboard
abstract class JBigDecimalFieldBase : Field<BigDecimal> , PowerOperations<BigDecimal> , NumericAlgebra<BigDecimal>
An abstract field over BigDecimal.
JBigIntegerField
Link copied to clipboard
object JBigIntegerField : Field<BigInteger> , NumericAlgebra<BigInteger>
A field over BigInteger.
KMathContext
Link copied to clipboard
common
annotation class KMathContext
Stub for DSL the Algebra is.
LongRing
Link copied to clipboard
common
object LongRing : Ring<Long> , Norm<Long, Long> , NumericAlgebra<Long>
A field for Double without boxing.
Magnitude
Link copied to clipboard
common
typealias Magnitude = UIntArray
Norm
Link copied to clipboard
common
interface Norm<in T : Any, out R>
A container for norm functional on element.
NumericAlgebra
Link copied to clipboard
common
interface NumericAlgebra<T> : Algebra<T>
An algebraic structure where elements can have numeric representation.
PowerOperations
Link copied to clipboard
common
interface PowerOperations<T> : Algebra<T>
A context extension to include power operations based on exponentiation.
RealField
Link copied to clipboard
common
object RealField : ExtendedField<Double> , Norm<Double, Double>
A field for Double without boxing.
Ring
Link copied to clipboard
common
interface Ring<T> : Space<T> , RingOperations<T>
Represents ring, i.e.
RingElement
Link copied to clipboard
common
interface RingElement<T : RingElement<T, R>, R : Ring<T>> : SpaceElement<T, R>
The element of Ring.
RingOperations
Link copied to clipboard
common
interface RingOperations<T> : SpaceOperations<T>
Represents rng, i.e.
RingWithNumbers
Link copied to clipboard
common
interface RingWithNumbers<T> : Ring<T> , NumericAlgebra<T>
A combination of NumericAlgebra and Ring that adds intrinsic simple operations on numbers like T+1 TODO to be removed and replaced by extensions after multiple receivers are there
ShortRing
Link copied to clipboard
common
object ShortRing : Ring<Short> , Norm<Short, Short> , NumericAlgebra<Short>
A field for Short without boxing.
Space
Link copied to clipboard
common
interface Space<T> : SpaceOperations<T>
Represents linear space with neutral element, i.e.
SpaceElement
Link copied to clipboard
common
interface SpaceElement<T : SpaceElement<T, S>, S : Space<T>> : AlgebraElement<T, S>
The element of Space.
SpaceOperations
Link copied to clipboard
common
interface SpaceOperations<T> : Algebra<T>
Represents linear space without neutral element, i.e.
TBase
Link copied to clipboard
common
typealias TBase = ULong
TrigonometricOperations
Link copied to clipboard
common
interface TrigonometricOperations<T> : Algebra<T>
A container for trigonometric operations for specific type.

Functions

abs
Link copied to clipboard
common
fun abs(x: BigInt): BigInt
fun <T : Comparable<T>> Space<T>.abs(value: T): T
Absolute of the comparable value
acos
Link copied to clipboard
common
fun <T : AlgebraElement<T, out TrigonometricOperations<T>>> acos(arg: T): T
Computes the inverse cosine of arg.
acosh
Link copied to clipboard
common
fun <T : AlgebraElement<T, out HyperbolicOperations<T>>> acosh(arg: T): T
Computes the inverse hyperbolic cosine of arg.
asin
Link copied to clipboard
common
fun <T : AlgebraElement<T, out TrigonometricOperations<T>>> asin(arg: T): T
Computes the inverse sine of arg.
asinh
Link copied to clipboard
common
fun <T : AlgebraElement<T, out HyperbolicOperations<T>>> asinh(arg: T): T
Computes the inverse hyperbolic sine of arg.
atan
Link copied to clipboard
common
fun <T : AlgebraElement<T, out TrigonometricOperations<T>>> atan(arg: T): T
Computes the inverse tangent of arg.
atanh
Link copied to clipboard
common
fun <T : AlgebraElement<T, out HyperbolicOperations<T>>> atanh(arg: T): T
Computes the inverse hyperbolic tangent of arg.
average
Link copied to clipboard
common
fun <T> Space<T>.average(data: Iterable<T>): T
Returns an average value of elements in the iterable in this Space.
fun <T> Space<T>.average(data: Sequence<T>): T
Returns an average value of elements in the sequence in this Space.
averageWith
Link copied to clipboard
common
fun <T> Iterable<T>.averageWith(space: Space<T>): T
Returns an average value of elements in the iterable in this Space.
fun <T> Sequence<T>.averageWith(space: Space<T>): T
Returns an average value of elements in the sequence in this Space.
bigInt
Link copied to clipboard
common
fun NDAlgebra.Companion.bigInt(vararg shape: Int): BufferedNDRing<BigInt, BigIntField>
inline fun Buffer.Companion.bigInt(size: Int, initializer: (Int) -> BigInt): Buffer<BigInt>
inline fun MutableBuffer.Companion.bigInt(size: Int, initializer: (Int) -> BigInt): MutableBuffer<BigInt>
bindSymbol
Link copied to clipboard
common
fun <T : Any> Algebra<T>.bindSymbol(symbol: Symbol): T
cos
Link copied to clipboard
common
fun <T : AlgebraElement<T, out TrigonometricOperations<T>>> cos(arg: T): T
Computes the cosine of arg.
cosh
Link copied to clipboard
common
fun <T : AlgebraElement<T, out HyperbolicOperations<T>>> cosh(arg: T): T
Computes the hyperbolic cosine of arg.
div
Link copied to clipboard
common
operator fun <T : AlgebraElement<T, F>, F : Field<T>> T.div(b: T): T
Divides this element by another one.
operator fun <T : AlgebraElement<T, S>, S : Space<T>> T.div(k: Number): T
Divides this element by number.
exp
Link copied to clipboard
common
fun <T : AlgebraElement<T, out ExponentialOperations<T>>> exp(arg: T): T
The identifier of exponential function.
invoke
Link copied to clipboard
common
inline operator fun <A : Algebra<*>, R> A.invoke(block: A.() -> R): R
Call a block with an Algebra as receiver.
ln
Link copied to clipboard
common
fun <T : AlgebraElement<T, out ExponentialOperations<T>>> ln(arg: T): T
The identifier of natural logarithm.
minus
Link copied to clipboard
common
operator fun <T : AlgebraElement<T, S>, S : Space<T>> T.minus(b: T): T
Subtracts element from this one.
norm
Link copied to clipboard
common
fun <T : AlgebraElement<T, out Norm<T, R>>, R> norm(arg: T): R
Computes the norm of arg (i.e.
parseBigInteger
Link copied to clipboard
common
fun String.parseBigInteger(): BigInt?
Returns null if a valid number can not be read from a string
plus
Link copied to clipboard
common
operator fun <T : AlgebraElement<T, S>, S : Space<T>> T.plus(b: T): T
Adds element to this one.
pow
Link copied to clipboard
common
infix fun <T : AlgebraElement<T, out PowerOperations<T>>> T.pow(power: Double): T
Raises this element to the power pow.
power
Link copied to clipboard
common
fun <T> Field<T>.power(arg: T, power: Int): T
Raises arg to the integer power power.
fun <T> Ring<T>.power(arg: T, power: Int): T
Raises arg to the natural power power.
sin
Link copied to clipboard
common
fun <T : AlgebraElement<T, out TrigonometricOperations<T>>> sin(arg: T): T
Computes the sine of arg.
sinh
Link copied to clipboard
common
fun <T : AlgebraElement<T, out HyperbolicOperations<T>>> sinh(arg: T): T
Computes the hyperbolic sine of arg.
sqr
Link copied to clipboard
common
fun <T : AlgebraElement<T, out PowerOperations<T>>> sqr(arg: T): T
Computes the square of the value arg.
sqrt
Link copied to clipboard
common
fun <T : AlgebraElement<T, out PowerOperations<T>>> sqrt(arg: T): T
Computes the square root of the value arg.
sum
Link copied to clipboard
common
fun <T> Space<T>.sum(data: Iterable<T>): T
Returns the sum of all elements in the iterable in this Space.
fun <T> Space<T>.sum(data: Sequence<T>): T
Returns the sum of all elements in the sequence in this Space.
sumWith
Link copied to clipboard
common
fun <T> Iterable<T>.sumWith(space: Space<T>): T
Returns the sum of all elements in the iterable in provided space.
fun <T> Sequence<T>.sumWith(space: Space<T>): T
Returns the sum of all elements in the sequence in provided space.
tan
Link copied to clipboard
common
fun <T : AlgebraElement<T, out TrigonometricOperations<T>>> tan(arg: T): T
Computes the tangent of arg.
tanh
Link copied to clipboard
common
fun <T : AlgebraElement<T, out HyperbolicOperations<T>>> tanh(arg: T): T
Computes the hyperbolic tangent of arg.
times
Link copied to clipboard
common
operator fun <T : AlgebraElement<T, R>, R : Ring<T>> T.times(b: T): T
Multiplies this element by another one.
operator fun <T : AlgebraElement<T, S>, S : Space<T>> T.times(k: Number): T
Multiplies this element by number.
operator fun <T : AlgebraElement<T, S>, S : Space<T>> Number.times(element: T): T
Number times element
toBigInt
Link copied to clipboard
common
fun Int.toBigInt(): BigInt
Convert this Int to BigInt
fun Long.toBigInt(): BigInt
Convert this Long to BigInt
fun UInt.toBigInt(): BigInt
Convert UInt to BigInt
fun ULong.toBigInt(): BigInt
Convert ULong to BigInt
fun UIntArray.toBigInt(sign: Byte): BigInt
Create a BigInt with this array of magnitudes with protective copy