DenseVector
A vector that stores every one of its entries, addressed as a buffer, an origin and a step.
Dense is about what is stored, not about how it is spaced: a run of adjacent entries and every second entry of a longer buffer are both dense, and a BLAS call takes either as a pointer and an increment without knowing the difference. That is why this is the operand type the dense matrix routines declare. A vector storing a pattern is a different thing with no increment to hand over, so SparseVector is deliberately not one of these and does not compile where one is wanted.
Sealed because the two shapes are the whole set: entries laid out one after another, or entries a fixed step apart. A caller that must tell them apart can do so exhaustively.
Neither shape implies ownership. of and zero allocate, while wrap and the StridedVector constructor borrow an array the caller keeps; mutations stay visible through every reference either way. So a vector here says how its entries are spaced, and says nothing about who owns them.
Inheritors
Functions
set
A borrowed view over this whole vector, keeping whatever origin and spacing it already has.
y = y + alpha * x. A sparse x touches only the positions it stores. A dense x with an identical mapping is read directly; other dense overlaps, or sparse values sharing the destination buffer, are snapshotted before writing. Custom Vector implementations are also snapshotted, since their backing storage is opaque.
Visit each stored entry as (index, value), in ascending index order for any storage. A SparseVector may present numerical zeros as stored, and any other Vector has every index visited.
Zero-based logical index of the maximum absolute value (BLAS idamax), or -1 when empty. Dense vectors use DenseVectorKernels.iamax; sparse vectors visit only their stored entries. All-zero nonempty inputs return 0, as do sparse inputs whose maximum is an implicit zero. Strided views report their logical index rather than a backing-array offset.
a - b, allocating. axpy with alpha = -1.0 accumulates into an existing operand.
Whether these vectors address at least one common buffer entry.
a + b, allocating. axpy accumulates into an existing operand.
v = alpha * v.
alpha * x, allocating. scale multiplies in place.
Materialise into a fresh dense DoubleArray, independent of the internal storage.
-x, allocating.
A borrowed strided slice, addressed in this vector's logical indices rather than its buffer's positions.