A VectorBuilder is basically an unsorted Sparse Vector. Two parallel arrays are maintained, one of indices, and another of values. The indices are not sorted. Moreover, <B> indices are not unique in the index array</b>. Furthermore, apply(i) and update(i, v) are linear in the number of active values in the array.
- and - are linear operations: they just append to the end. Component wise multiply, divide, and dot product are also linear, but require creating a HashVector copy. (TODO: maybe a SparseVector?)
In general, these should never be used, except for building, or for doing feature vector type things where you just need a sparse vector with a fast dot product with a "real" vector.
- Companion
- object
Value members
Constructors
Concrete methods
Only gives true if isActive would return true for all i. (May be false anyway)
Only gives true if isActive would return true for all i. (May be false anyway)
Sets the underlying sparse array to use this data
Sets the underlying sparse array to use this data
- Value Params
- activeSize
number of active elements. The first activeSize will be used.
- data
values corresponding to the index
- index
must be a sorted list of indices
Inherited methods
Alias for :%(b) when b is a scalar.
Alias for :%(b) when b is a scalar.
- Inherited from
- ImmutableNumericOps
Element-wise modulo of this and b.
Element-wise modulo of this and b.
- Inherited from
- ImmutableNumericOps
Element-wise logical "and" operator -- returns true if corresponding elements are non-zero.
Element-wise logical "and" operator -- returns true if corresponding elements are non-zero.
- Inherited from
- ImmutableNumericOps
Mutates this by element-wise and of this and b.
Mutates this by element-wise and of this and b.
- Inherited from
- NumericOps
Element-wise product of this and b.
Element-wise product of this and b.
- Inherited from
- ImmutableNumericOps
Element-wise difference of this and b.
Element-wise difference of this and b.
- Inherited from
- ImmutableNumericOps
Alias for :/(b) when b is a scalar.
Alias for :/(b) when b is a scalar.
- Inherited from
- ImmutableNumericOps
Element-wise quotient of this and b.
Element-wise quotient of this and b.
- Inherited from
- ImmutableNumericOps
Element-wise inequality comparator of this and b.
Element-wise inequality comparator of this and b.
- Inherited from
- ImmutableNumericOps
Mutates this by element-wise modulo of b into this.
Mutates this by element-wise modulo of b into this.
- Inherited from
- NumericOps
Mutates this by element-wise and of this and b.
Mutates this by element-wise and of this and b.
- Inherited from
- NumericOps
Mutates this by element-wise multiplication of b into this.
Mutates this by element-wise multiplication of b into this.
- Inherited from
- NumericOps
Mutates this by element-wise addition of b into this.
Mutates this by element-wise addition of b into this.
- Inherited from
- NumericOps
Mutates this by element-wise subtraction of b from this
Mutates this by element-wise subtraction of b from this
- Inherited from
- NumericOps
Mutates this by element-wise division of b into this
Mutates this by element-wise division of b into this
- Inherited from
- NumericOps
Mutates this by element-wise assignment of b into this.
Mutates this by element-wise assignment of b into this.
- Inherited from
- NumericOps
Element-wise equality comparator of this and b.
Element-wise equality comparator of this and b.
- Inherited from
- ImmutableNumericOps
Mutates this by element-wise exponentiation of this by b.
Mutates this by element-wise exponentiation of this by b.
- Inherited from
- NumericOps
Mutates this by element-wise xor of this and b.
Mutates this by element-wise xor of this and b.
- Inherited from
- NumericOps
Mutates this by element-wise or of this and b.
Mutates this by element-wise or of this and b.
- Inherited from
- NumericOps
Element-wise less=than comparator of this and b.
Element-wise less=than comparator of this and b.
- Inherited from
- NumericOps
Element-wise less-than-or-equal-to comparator of this and b.
Element-wise less-than-or-equal-to comparator of this and b.
- Inherited from
- NumericOps
Element-wise greater-than-or-equal-to comparator of this and b.
Element-wise greater-than-or-equal-to comparator of this and b.
- Inherited from
- NumericOps
Element-wise greater-than comparator of this and b.
Element-wise greater-than comparator of this and b.
- Inherited from
- NumericOps
Element-wise exponentiation of this and b.
Element-wise exponentiation of this and b.
- Inherited from
- ImmutableNumericOps
Element-wise logical "xor" operator -- returns true if only one of the corresponding elements is non-zero.
Element-wise logical "xor" operator -- returns true if only one of the corresponding elements is non-zero.
- Inherited from
- ImmutableNumericOps
Mutates this by element-wise xor of this and b.
Mutates this by element-wise xor of this and b.
- Inherited from
- NumericOps
A transposed view of this object, followed by a slice. Sadly frequently necessary.
A transposed view of this object, followed by a slice. Sadly frequently necessary.
- Inherited from
- ImmutableNumericOps
A transposed view of this object, followed by a slice. Sadly frequently necessary.
A transposed view of this object, followed by a slice. Sadly frequently necessary.
- Inherited from
- ImmutableNumericOps
A transposed view of this object.
A transposed view of this object.
- Inherited from
- ImmutableNumericOps
Element-wise logical "or" operator -- returns true if either element is non-zero.
Element-wise logical "or" operator -- returns true if either element is non-zero.
- Inherited from
- ImmutableNumericOps
Mutates this by element-wise or of this and b.
Mutates this by element-wise or of this and b.
- Inherited from
- NumericOps