kumulant

DenseVector

@Serializable
@SerialName(value = "DenseVector")
class DenseVector : VectorView(source)

Dense double-precision vector backed by a flat DoubleArray. The default carrier when the caller already has a dense array or expects most entries to be populated.

Construction goes through the Companion factories: DenseVector.of (copy a DoubleArray) or DenseVector.zero (allocate a zero vector of given size). Direct constructors are restricted to keep the mutable backing array out of caller hands; DenseVector is intended to be effectively immutable after the factory call, even though internal kumulant code may mutate it for in-place updates.

Constructors

Link copied to clipboard
constructor(size: Int)

Types

Link copied to clipboard
object Companion

Factory entrypoints for DenseVector.

Properties

Link copied to clipboard
open override val size: Int

Number of entries (including stored zeros for sparse).

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open operator override fun get(i: Int): Double

Read entry at i. O(1) for DenseVector, O(nnz) linear scan for SparseVector. Use the internal forEachStored extension when you want to walk the populated entries without per-index lookup cost.

Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun toDoubleArray(): DoubleArray

Materialise into a fresh dense DoubleArray. Always allocates; the returned array is independent of any internal storage, so the caller is free to mutate it.

Link copied to clipboard
open override fun toString(): String

DenseVector

constructor(size: Int)(source)

equals

open operator override fun equals(other: Any?): Boolean(source)

get

open operator override fun get(i: Int): Double(source)

Read entry at i. O(1) for DenseVector, O(nnz) linear scan for SparseVector. Use the internal forEachStored extension when you want to walk the populated entries without per-index lookup cost.

hashCode

open override fun hashCode(): Int(source)

size

open override val size: Int(source)

Number of entries (including stored zeros for sparse).

toDoubleArray

open override fun toDoubleArray(): DoubleArray(source)

Materialise into a fresh dense DoubleArray. Always allocates; the returned array is independent of any internal storage, so the caller is free to mutate it.

toString

open override fun toString(): String(source)