Package space.kscience.kmath.complex

Types

Complex
Link copied to clipboard
data class Complex(re: Double, im: Double)
Represents double-based complex number.
ComplexField
Link copied to clipboard
A field of Complex.
ComplexFieldND
Link copied to clipboard
An optimized nd-field for complex numbers
Quaternion
Link copied to clipboard
data class Quaternion(w: Double, x: Double, y: Double, z: Double)
Represents double-based quaternion.

Functions

bufferAlgebra
Link copied to clipboard
complex
Link copied to clipboard
inline fun Buffer.Companion.complex(size: Int, init: (Int) -> Complex): Buffer<Complex>
Creates a new buffer of complex numbers with the specified size, where each element is calculated by calling the specified init function.
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.
ndAlgebra
Link copied to clipboard
fun ComplexField.ndAlgebra(vararg shape: Int): ComplexFieldND
produceInline
Link copied to clipboard
inline fun BufferedFieldND<Complex, ComplexField>.produceInline(initializer: ComplexField.(Int) -> Complex): BufferND<Complex>
Fast element production using function inlining
quaternion
Link copied to clipboard
inline fun Buffer.Companion.quaternion(size: Int, init: (Int) -> Quaternion): Buffer<Quaternion>
Creates a new buffer of quaternions with the specified size, where each element is calculated by calling the specified init function.
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.
toComplex
Link copied to clipboard
fun Number.toComplex(): Complex
Creates a complex number with real part equal to this real.
toQuaternion
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.
withNdAlgebra
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

algebra
Link copied to clipboard
val Complex.Companion.algebra: ComplexField
conjugate
Link copied to clipboard
val Complex.conjugate: Complex
This complex's conjugate.
conjugate
Link copied to clipboard
val Quaternion.conjugate: Quaternion
This quaternion's conjugate.
r
Link copied to clipboard
val Complex.r: Double
Absolute value of complex number.
r
Link copied to clipboard
val Quaternion.r: Double
Absolute value of the quaternion.
reciprocal
Link copied to clipboard
val Complex.reciprocal: Complex
This complex's reciprocal.
reciprocal
Link copied to clipboard
val Quaternion.reciprocal: Quaternion
This quaternion's reciprocal.
theta
Link copied to clipboard
val Complex.theta: Double
An angle between vector represented by complex number and X axis.