Package-level declarations

Types

Link copied to clipboard
interface Algebra<T>

Represents an algebraic structure.

Link copied to clipboard
Link copied to clipboard

Kotlin Multiplatform implementation of Big Integer numbers (KBigInteger).

Link copied to clipboard

An implementation of LogicAlgebra for primitive booleans

Link copied to clipboard
interface BufferAlgebra<T, out A : Algebra<T>> : Algebra<Buffer<T>>

An algebra over Buffer

Link copied to clipboard
class BufferField<T, A : Field<T>>(elementAlgebra: A, val size: Int) : BufferFieldOps<T, A> , Field<Buffer<T>> , WithSize
Link copied to clipboard
open class BufferFieldOps<T, A : Field<T>>(elementAlgebra: A) : BufferRingOps<T, A> , BufferAlgebra<T, A> , FieldOps<Buffer<T>> , ScaleOperations<Buffer<T>>
Link copied to clipboard
open class BufferRingOps<T, A : Ring<T>>(val elementAlgebra: A) : BufferAlgebra<T, A> , RingOps<Buffer<T>>
Link copied to clipboard
fun interface BufferTransform<T, R>

Type alias for buffer transformations.

Link copied to clipboard

A field for Byte without boxing. Does not produce appropriate ring element.

Link copied to clipboard

A field for Double without boxing. Does not produce appropriate field element.

Link copied to clipboard
Link copied to clipboard

A container for operations related to exp and ln functions.

Link copied to clipboard

Advanced Number-like field that implements basic operations.

Link copied to clipboard

Advanced Number-like semifield that implements basic operations.

Link copied to clipboard

Represents field i.e., algebraic structure with three operations: associative, commutative addition and multiplication, and division. This interface differs from the eponymous mathematical definition: fields in KMath also support associative multiplication by scalar.

Link copied to clipboard
interface FieldOps<T> : RingOps<T>

Represents field without multiplicative and additive identities i.e., algebraic structure with associative, binary, commutative operations add and multiply; binary operation divide as multiplication of left operand by reciprocal of right one.

Link copied to clipboard

A field for Float without boxing. Does not produce appropriate field element.

Link copied to clipboard
interface Group<T> : GroupOps<T>

Represents group i.e., algebraic structure with associative, binary operation add.

Link copied to clipboard
interface GroupOps<T> : Algebra<T>

Represents group without neutral element (also known as inverse semigroup) i.e., algebraic structure with associative, binary operation add.

Link copied to clipboard

A field for Int without boxing. Does not produce corresponding ring element.

Link copied to clipboard
class JBigDecimalField(mathContext: MathContext = MathContext.DECIMAL64) : JBigDecimalFieldBase

A field over BigDecimal.

Link copied to clipboard
Link copied to clipboard

An algebra for generic boolean logic

Link copied to clipboard

A field for Double without boxing. Does not produce appropriate ring element.

Link copied to clipboard
interface Norm<in T : Any, out R>

A container for norm functional on element.

Link copied to clipboard

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

Link copied to clipboard
interface NumericAlgebra<T> : Algebra<T>

An algebraic structure where elements can have numeric representation.

Link copied to clipboard
interface PowerOperations<T> : FieldOps<T>

A context extension to include power operations based on exponentiation.

Link copied to clipboard
interface Ring<T> : Group<T> , RingOps<T>

Represents ring i.e., algebraic structure with two associative binary operations called "addition" and "multiplication" and their neutral elements.

Link copied to clipboard
interface RingOps<T> : GroupOps<T>

Represents ring without multiplicative and additive identities i.e., algebraic structure with associative, binary, commutative operation add and associative, operation multiply distributive over add.

Link copied to clipboard
interface ScaleOperations<T> : Algebra<T>

Scale by scalar operations

Link copied to clipboard

A field for Short without boxing. Does not produce appropriate ring element.

Link copied to clipboard

A container for trigonometric operations for specific type.

Link copied to clipboard
interface WithSize

Functions

Link copied to clipboard
fun abs(x: BigInt): BigInt

Returns the absolute value of the given value x.

Link copied to clipboard
fun <T : Comparable<T>> Group<T>.abs(value: T): T

Absolute of the comparable value

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Creates an iterable that returns all elements from this Buffer.

Link copied to clipboard

Creates a sequence that returns all elements from this Buffer.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun <T, S : Group<T>, ScaleOperations<T>> S.average(data: Iterable<T>): T
@PerformancePitfall(message = "Potential boxing access to buffer elements")
fun <T, S : Group<T>, ScaleOperations<T>> S.average(data: Buffer<T>): T

Returns an average value of elements in the iterable in this Group.

fun <T, S : Group<T>, ScaleOperations<T>> S.average(data: Sequence<T>): T

Returns an average value of elements in the sequence in this Group.

Link copied to clipboard
inline fun <T> DoubleBufferOps.averageOf(buffer: Buffer<T>, conversion: (T) -> Double): Double

Average of elements using given conversion

Link copied to clipboard
fun <T, S : Group<T>, ScaleOperations<T>> Iterable<T>.averageWith(space: S): T

Returns an average value of elements in the iterable in this Group.

fun <T, S : Group<T>, ScaleOperations<T>> Sequence<T>.averageWith(space: S): T

Returns an average value of elements in the sequence in this Group.

Link copied to clipboard
fun <T> Algebra<T>.bindSymbol(symbol: Symbol): T
Link copied to clipboard
fun <T> Algebra<T>.bindSymbolOrNull(symbol: Symbol): T?
Link copied to clipboard
fun <T, A : BufferAlgebra<T, *>, WithSize> A.buffer(initializer: (Int) -> T): Buffer<T>
fun BufferField<Double, *>.buffer(vararg elements: Number): Buffer<Double>
inline fun BigInt.Companion.buffer(size: Int, initializer: (Int) -> BigInt): Buffer<BigInt>
fun <T> BufferAlgebra<T, *>.buffer(size: Int, initializer: (Int) -> T): Buffer<T>
Link copied to clipboard
inline fun <T1, T2, R> Buffer<T1>.combineToBuffer(other: Buffer<T2>, bufferFactory: BufferFactory<R>, crossinline transform: (T1, T2) -> R): Buffer<R>

Zip two buffers using given transform.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
inline fun <T, R> Buffer<T>.fold(initial: R, operation: (acc: R, T) -> R): R

Fold given buffer according to operation

Link copied to clipboard
inline fun <T : Any, R> Buffer<T>.foldIndexed(initial: R, operation: (index: Int, acc: R, T) -> R): R

Fold given buffer according to indexed operation

Link copied to clipboard
inline operator fun <A : Algebra<*>, R> A.invoke(block: A.() -> R): R

Call a block with an Algebra as receiver.

Link copied to clipboard
expect fun Number.isInteger(): Boolean

Check if number is an integer from platform point of view

actual fun Number.isInteger(): Boolean

Check if number is an integer

actual fun Number.isInteger(): Boolean

Check if number is an integer

actual fun Number.isInteger(): Boolean

Check if number is an integer

actual fun Number.isInteger(): Boolean

Check if number is an integer from platform point of view

Link copied to clipboard
Link copied to clipboard
inline fun <T, R> Buffer<T>.mapIndexedToBuffer(bufferFactory: BufferFactory<R>, crossinline block: (index: Int, value: T) -> R): Buffer<R>

Create a new buffer from this one with the given mapping (indexed) function. Provided bufferFactory is used to construct the new buffer.

Link copied to clipboard
inline fun <T, R> Buffer<T>.mapToBuffer(bufferFactory: BufferFactory<R>, crossinline block: (T) -> R): Buffer<R>

Create a new buffer from this one with the given mapping function. Provided bufferFactory is used to construct the new buffer.

Link copied to clipboard
inline fun BigInt.Companion.mutableBuffer(size: Int, initializer: (Int) -> BigInt): Buffer<BigInt>
Link copied to clipboard

Returns null if a valid number cannot be read from a string

Link copied to clipboard
fun <T, A : PowerOperations<T>> BufferAlgebra<T, A>.pow(arg: Buffer<T>, pow: Number): Buffer<T>
Link copied to clipboard
inline fun <T> Buffer<T>.reduce(operation: (left: T, value: T) -> T): T

Reduce a buffer from left to right according to operation

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

fun <T> Group<T>.sum(data: Iterable<T>): T
@PerformancePitfall(message = "Potential boxing access to buffer elements")
fun <T> Group<T>.sum(data: Buffer<T>): T

Returns the sum of all elements in the iterable in this Group.

fun <T> Group<T>.sum(data: Sequence<T>): T

Returns the sum of all elements in the sequence in this Group.

Link copied to clipboard
inline fun <T> DoubleBufferOps.sumOf(buffer: Buffer<T>, conversion: (T) -> Double): Double

Sum of elements using given conversion

Link copied to clipboard
fun <T> Iterable<T>.sumWith(group: Group<T>): T

Returns the sum of all elements in the iterable in provided space.

fun <T> Sequence<T>.sumWith(group: Group<T>): T

Returns the sum of all elements in the sequence in provided space.

Link copied to clipboard
inline fun <T, R> Iterable<T>.sumWithGroupOf(group: Group<R>, extractor: (T) -> R): R

Sum extracted elements of Iterable with given group

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Convert this Int to BigInt

Convert this Long to BigInt

Convert UInt to BigInt

Convert ULong to BigInt

Create a BigInt with this array of magnitudes with protective copy

Link copied to clipboard
fun <T> Buffer<T>.toList(): List<T>

Returns a new List containing all elements of this buffer.

Link copied to clipboard

Returns a new MutableList filled with all elements of this buffer. NOTE: this method uses a protective copy, so it should not be used in performance-critical code.

Link copied to clipboard

Returns a new Array containing all elements of this buffer. NOTE: this method uses a protective copy, so it should not be used in performance-critical code.

Link copied to clipboard
fun <T, A : Field<T>> BufferFieldOps<T, A>.withSize(size: Int): BufferField<T, A>

Generate full buffer field from given buffer operations

Properties

Link copied to clipboard
val <T> NumericAlgebra<T>.e: T

The e mathematical constant.

Link copied to clipboard
Link copied to clipboard

The π mathematical constant.