Package space.kscience.kmath.complex

Types

Link copied to clipboard
data class Complex(re: Double, im: Double)

Represents double-based complex number.

Link copied to clipboard

A field of Complex.

Link copied to clipboard
Link copied to clipboard

An optimized nd-field for complex numbers

Link copied to clipboard
data class Quaternion(w: Double, x: Double, y: Double, z: Double)

Represents double-based quaternion.

Functions

Link copied to clipboard
inline fun Buffer.Companion.complex(size: Int, init: (Int) -> Complex): Buffer<Complex>
inline fun MutableBuffer.Companion.complex(size: Int, init: (Int) -> Complex): MutableBuffer<Complex>

Creates a new buffer of complex numbers with the specified size, where each element is calculated by calling the specified init function.

Link copied to clipboard
fun ComplexField.ndAlgebra(vararg shape: Int): ComplexFieldND
Link copied to clipboard
inline fun Buffer.Companion.quaternion(size: Int, init: (Int) -> Quaternion): Buffer<Quaternion>
inline fun MutableBuffer.Companion.quaternion(size: Int, init: (Int) -> Quaternion): MutableBuffer<Quaternion>

Creates a new buffer of quaternions with the specified size, where each element is calculated by calling the specified init function.

Link copied to clipboard
fun Number.toComplex(): Complex

Creates a complex number with real part equal to this real.

Link copied to clipboard
fun Number.toQuaternion(): Quaternion

Creates a quaternion with real part equal to this real.

fun Complex.toQuaternion(): Quaternion

Creates a quaternion with w-component equal to re-component of given complex and x-component equal to im-component of given complex.

Link copied to clipboard
inline fun <R> ComplexField.withNdAlgebra(vararg shape: Int, action: ComplexFieldND.() -> R): R

Produce a context for n-dimensional operations inside this real field

Properties

Link copied to clipboard
val Complex.Companion.algebra: ComplexField
Link copied to clipboard
Link copied to clipboard
val Complex.conjugate: Complex

This complex's conjugate.

Link copied to clipboard
val Quaternion.conjugate: Quaternion

This quaternion's conjugate.

Link copied to clipboard
val ComplexField.ndAlgebra: ComplexFieldOpsND
Link copied to clipboard
val Complex.r: Double

Absolute value of complex number.

Link copied to clipboard
val Quaternion.r: Double

Absolute value of the quaternion.

Link copied to clipboard
val Complex.reciprocal: Complex

This complex's reciprocal.

Link copied to clipboard
val Quaternion.reciprocal: Quaternion

This quaternion's reciprocal.

Link copied to clipboard
val Complex.theta: Double

An angle between vector represented by complex number and X axis.