HashVector

class HashVector[@specialized(Double, Int, Float, Long) E](val array: OpenAddressHashArray[E]) extends Vector[E] with VectorLike[E, HashVector[E]] with Serializable

A HashVector is a sparse vector backed by an OpenAddressHashArray

Companion
object
trait Serializable
trait Vector[E]
trait VectorLike[E, HashVector[E]]
trait Tensor[Int, E]
trait TensorLike[Int, E, HashVector[E]]
trait QuasiTensor[Int, E]
trait HasOps
class Object
trait Matchable
class Any

Value members

Concrete methods

def activeIterator: Iterator[(Int, E)]
def activeKeysIterator: Iterator[Int]
def activeSize: Int
def activeValuesIterator: Iterator[E]
def apply(i: Int): E
def clear(): Unit
def copy: HashVector[E]
def data: Array[E]
def default: E
override def hashCode(): Int
Definition Classes
final def index: Array[Int]
final def isActive(i: Int): Boolean
final def iterableSize: Int
def length: Int
def repr: HashVector[E]
override def toString: String
Definition Classes
Any
def update(i: Int, v: E): Unit

Inherited methods

final def %[B, That](b: B)(implicit op: Impl2[HashVector[E], B, That]): That

Alias for :%(b) when b is a scalar.

Alias for :%(b) when b is a scalar.

Inherited from
ImmutableNumericOps
final def %:%[B, That](b: B)(implicit op: Impl2[HashVector[E], B, That]): That

Element-wise modulo of this and b.

Element-wise modulo of this and b.

Inherited from
ImmutableNumericOps
final def %=[B](b: B)(implicit op: InPlaceImpl2[HashVector[E], B]): HashVector[E]

Alias for :%=(b) when b is a scalar.

Alias for :%=(b) when b is a scalar.

Inherited from
NumericOps
final def &[B, That](b: B)(implicit op: Impl2[HashVector[E], B, That]): That

Alias for &:&(b) for all b.

Alias for &:&(b) for all b.

Inherited from
ImmutableNumericOps
final def &:&[B, That](b: B)(implicit op: Impl2[HashVector[E], B, That]): That

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
final def &=[B](b: B)(implicit op: InPlaceImpl2[HashVector[E], B]): HashVector[E]

Mutates this by element-wise and of this and b.

Mutates this by element-wise and of this and b.

Inherited from
NumericOps
final def *[B, That](b: B)(implicit op: Impl2[HashVector[E], B, That]): That

Matrix multiplication

Matrix multiplication

Inherited from
ImmutableNumericOps
final def *:*[B, That](b: B)(implicit op: Impl2[HashVector[E], B, That]): That

Element-wise product of this and b.

Element-wise product of this and b.

Inherited from
ImmutableNumericOps
final def *=[B](b: B)(implicit op: InPlaceImpl2[HashVector[E], B]): HashVector[E]

Alias for :*=(b) when b is a scalar.

Alias for :*=(b) when b is a scalar.

Inherited from
NumericOps
final def +[B, C, That](b: B)(implicit op: Impl2[HashVector[E], B, That]): That

Alias for :+(b) for all b.

Alias for :+(b) for all b.

Inherited from
NumericOps
final def +:+[B, That](b: B)(implicit op: Impl2[HashVector[E], B, That]): That

Element-wise sum of this and b.

Element-wise sum of this and b.

Inherited from
ImmutableNumericOps
final def +=[B](b: B)(implicit op: InPlaceImpl2[HashVector[E], B]): HashVector[E]

Alias for :+=(b) for all b.

Alias for :+=(b) for all b.

Inherited from
NumericOps
final def -[B, That](b: B)(implicit op: Impl2[HashVector[E], B, That]): That

Alias for -:-(b) for all b.

Alias for -:-(b) for all b.

Inherited from
ImmutableNumericOps
final def -:-[B, That](b: B)(implicit op: Impl2[HashVector[E], B, That]): That

Element-wise difference of this and b.

Element-wise difference of this and b.

Inherited from
ImmutableNumericOps
final def -=[B](b: B)(implicit op: InPlaceImpl2[HashVector[E], B]): HashVector[E]

Alias for :-=(b) for all b.

Alias for :-=(b) for all b.

Inherited from
NumericOps
final def /[B, That](b: B)(implicit op: Impl2[HashVector[E], B, That]): That

Alias for :/(b) when b is a scalar.

Alias for :/(b) when b is a scalar.

Inherited from
ImmutableNumericOps
final def /:/[B, That](b: B)(implicit op: Impl2[HashVector[E], B, That]): That

Element-wise quotient of this and b.

Element-wise quotient of this and b.

Inherited from
ImmutableNumericOps
final def /=[B](b: B)(implicit op: InPlaceImpl2[HashVector[E], B]): HashVector[E]

Alias for :/=(b) when b is a scalar.

Alias for :/=(b) when b is a scalar.

Inherited from
NumericOps
final def :!=[B, That](b: B)(implicit op: Impl2[HashVector[E], B, That]): That

Element-wise inequality comparator of this and b.

Element-wise inequality comparator of this and b.

Inherited from
ImmutableNumericOps
final def :%=[B](b: B)(implicit op: InPlaceImpl2[HashVector[E], B]): HashVector[E]

Mutates this by element-wise modulo of b into this.

Mutates this by element-wise modulo of b into this.

Inherited from
NumericOps
final def :&=[B](b: B)(implicit op: InPlaceImpl2[HashVector[E], B]): HashVector[E]

Mutates this by element-wise and of this and b.

Mutates this by element-wise and of this and b.

Inherited from
NumericOps
final def :*=[B](b: B)(implicit op: InPlaceImpl2[HashVector[E], B]): HashVector[E]

Mutates this by element-wise multiplication of b into this.

Mutates this by element-wise multiplication of b into this.

Inherited from
NumericOps
final def :+=[B](b: B)(implicit op: InPlaceImpl2[HashVector[E], B]): HashVector[E]

Mutates this by element-wise addition of b into this.

Mutates this by element-wise addition of b into this.

Inherited from
NumericOps
final def :-=[B](b: B)(implicit op: InPlaceImpl2[HashVector[E], B]): HashVector[E]

Mutates this by element-wise subtraction of b from this

Mutates this by element-wise subtraction of b from this

Inherited from
NumericOps
final def :/=[B](b: B)(implicit op: InPlaceImpl2[HashVector[E], B]): HashVector[E]

Mutates this by element-wise division of b into this

Mutates this by element-wise division of b into this

Inherited from
NumericOps
final def :=[B](b: B)(implicit op: InPlaceImpl2[HashVector[E], B]): HashVector[E]

Mutates this by element-wise assignment of b into this.

Mutates this by element-wise assignment of b into this.

Inherited from
NumericOps
final def :==[B, That](b: B)(implicit op: Impl2[HashVector[E], B, That]): That

Element-wise equality comparator of this and b.

Element-wise equality comparator of this and b.

Inherited from
ImmutableNumericOps
final def :^=[B](b: B)(implicit op: InPlaceImpl2[HashVector[E], B]): HashVector[E]

Mutates this by element-wise exponentiation of this by b.

Mutates this by element-wise exponentiation of this by b.

Inherited from
NumericOps
final def :^^=[B](b: B)(implicit op: InPlaceImpl2[HashVector[E], B]): HashVector[E]

Mutates this by element-wise xor of this and b.

Mutates this by element-wise xor of this and b.

Inherited from
NumericOps
final def :|=[B](b: B)(implicit op: InPlaceImpl2[HashVector[E], B]): HashVector[E]

Mutates this by element-wise or of this and b.

Mutates this by element-wise or of this and b.

Inherited from
NumericOps
final def <:<[B, That](b: B)(implicit op: Impl2[HashVector[E], B, That]): That

Element-wise less=than comparator of this and b.

Element-wise less=than comparator of this and b.

Inherited from
NumericOps
final def <:=[B, That](b: B)(implicit op: Impl2[HashVector[E], B, That]): That

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
final def >:=[B, That](b: B)(implicit op: Impl2[HashVector[E], B, That]): That

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
final def >:>[B, That](b: B)(implicit op: Impl2[HashVector[E], B, That]): That

Element-wise greater-than comparator of this and b.

Element-wise greater-than comparator of this and b.

Inherited from
NumericOps
def \[B, That](b: B)(implicit op: Impl2[HashVector[E], B, That]): That

Shaped solve of this by b.

Shaped solve of this by b.

Inherited from
ImmutableNumericOps
final def ^:^[B, That](b: B)(implicit op: Impl2[HashVector[E], B, That]): That

Element-wise exponentiation of this and b.

Element-wise exponentiation of this and b.

Inherited from
ImmutableNumericOps
final def ^^[B, That](b: B)(implicit op: Impl2[HashVector[E], B, That]): That

Alias for :^^(b) for all b.

Alias for :^^(b) for all b.

Inherited from
ImmutableNumericOps
final def ^^:^^[B, That](b: B)(implicit op: Impl2[HashVector[E], B, That]): That

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
final def ^^=[B](b: B)(implicit op: InPlaceImpl2[HashVector[E], B]): HashVector[E]

Mutates this by element-wise xor of this and b.

Mutates this by element-wise xor of this and b.

Inherited from
NumericOps
def active: TensorActive[Int, E, HashVector[E]]
Inherited from
TensorLike
def apply[Slice1, Slice2, Result](slice1: Slice1, slice2: Slice2)(implicit canSlice: CanSlice2[HashVector[E], Slice1, Slice2, Result]): Result

Method for slicing that is tuned for Matrices.

Method for slicing that is tuned for Matrices.

Inherited from
TensorLike
def apply[Result](a: Int, b: Int, c: Int, slice: Int*)(implicit canSlice: CanSlice[HashVector[E], Seq[Int], Result]): Result

Slice a sequence of elements. Must be at least 2.

Slice a sequence of elements. Must be at least 2.

Inherited from
TensorLike
def apply[Slice, Result](slice: Slice)(implicit canSlice: CanSlice[HashVector[E], Slice, Result]): Result

method for slicing a tensor. For instance, DenseVectors support efficient slicing by a Range object.

method for slicing a tensor. For instance, DenseVectors support efficient slicing by a Range object.

Inherited from
TensorLike
final def dot[B, BB >: B, That](b: B)(implicit op: Impl2[HashVector[E], BB, That]): That

Inner product of this and b.

Inner product of this and b.

Inherited from
ImmutableNumericOps
override def equals(p1: Any): Boolean
Definition Classes
Vector -> Any
Inherited from
Vector
def exists(f: E => Boolean): Boolean
Inherited from
Vector
def findAll(f: E => Boolean): IndexedSeq[Int]

Returns all indices k whose value satisfies a predicate.

Returns all indices k whose value satisfies a predicate.

Inherited from
QuasiTensor
def fold[E1 >: E](z: E1)(op: (E1, E1) => E1): E1

See scala.collection.mutable.ArrayOps.fold.

See scala.collection.mutable.ArrayOps.fold.

Inherited from
Vector
def foldLeft[B](z: B)(op: (B, E) => B): B

See scala.collection.mutable.ArrayOps.foldLeft.

See scala.collection.mutable.ArrayOps.foldLeft.

Inherited from
Vector
def foldRight[B](z: B)(op: (E, B) => B): B

See scala.collection.mutable.ArrayOps.foldRight.

See scala.collection.mutable.ArrayOps.foldRight.

Inherited from
Vector
override def forall(f: E => Boolean): Boolean
Definition Classes
Inherited from
Vector
def forall(fn: (Int, E) => Boolean): Boolean

Returns true if and only if the given predicate is true for all elements.

Returns true if and only if the given predicate is true for all elements.

Inherited from
TensorLike
def foreach[U](fn: E => U): Unit
Inherited from
VectorLike
def foreachKey[U](fn: Int => U): Unit

Applies the given function to each key in the tensor.

Applies the given function to each key in the tensor.

Inherited from
TensorLike
def foreachPair[U](fn: (Int, E) => U): Unit

Applies the given function to each key and its corresponding value.

Applies the given function to each key and its corresponding value.

Inherited from
TensorLike
def foreachValue[U](fn: E => U): Unit

Applies the given function to each value in the map (one for each element of the domain, including zeros).

Applies the given function to each value in the map (one for each element of the domain, including zeros).

Inherited from
TensorLike
def iterator: Iterator[(Int, E)]
Inherited from
Vector
def keySet: Set[Int]
Returns

the set of keys in this vector (0 until length)

Inherited from
Vector
def keys: TensorKeys[Int, E, HashVector[E]]
Inherited from
TensorLike
def keysIterator: Iterator[Int]
Inherited from
Vector
def map[V2, That](fn: E => V2)(implicit canMapValues: CanMapValues[HashVector[E], E, V2, That]): That
Inherited from
VectorLike
def mapActivePairs[O, That](f: (Int, E) => O)(implicit bf: CanMapKeyValuePairs[HashVector[E], Int, E, O, That]): That

Maps all active key-value pairs values.

Maps all active key-value pairs values.

Inherited from
TensorLike
def mapActiveValues[O, That](f: E => O)(implicit bf: CanMapValues[HashVector[E], E, O, That]): That

Maps all non-zero values.

Maps all non-zero values.

Inherited from
TensorLike
def mapPairs[O, That](f: (Int, E) => O)(implicit bf: CanMapKeyValuePairs[HashVector[E], Int, E, O, That]): That

Creates a new map containing a transformed copy of this map.

Creates a new map containing a transformed copy of this map.

Inherited from
TensorLike
def mapValues[O, That](f: E => O)(implicit bf: CanMapValues[HashVector[E], E, O, That]): That

Creates a new map containing a transformed copy of this map.

Creates a new map containing a transformed copy of this map.

Inherited from
TensorLike
def padTo(len: Int, elem: E)(implicit cm: ClassTag[E]): Vector[E]

See scala.collection.mutable.ArrayOps.padTo.

See scala.collection.mutable.ArrayOps.padTo.

Inherited from
Vector
def pairs: TensorPairs[Int, E, HashVector[E]]
Inherited from
TensorLike
def reduce[E1 >: E](op: (E1, E1) => E1): E1

See scala.collection.mutable.ArrayOps.reduce.

See scala.collection.mutable.ArrayOps.reduce.

Inherited from
Vector
def reduceLeft[B >: E](op: (B, E) => B): B

See scala.collection.mutable.ArrayOps.reduceLeft.

See scala.collection.mutable.ArrayOps.reduceLeft.

Inherited from
Vector
def reduceRight[B >: E](op: (E, B) => B): B

See scala.collection.mutable.ArrayOps.reduceRight.

See scala.collection.mutable.ArrayOps.reduceRight.

Inherited from
Vector
def scan[E1 >: E](z: E1)(op: (E1, E1) => E1)(implicit cm: ClassTag[E], cm1: ClassTag[E1]): Vector[E1]

See scala.collection.mutable.ArrayOps.scan.

See scala.collection.mutable.ArrayOps.scan.

Inherited from
Vector
def scanLeft[B](z: B)(op: (B, E) => B)(implicit cm1: ClassTag[B]): Vector[B]

See scala.collection.mutable.ArrayOps.scanLeft.

See scala.collection.mutable.ArrayOps.scanLeft.

Inherited from
Vector
def scanRight[B](z: B)(op: (E, B) => B)(implicit cm1: ClassTag[B]): Vector[B]

See scala.collection.mutable.ArrayOps.scanRight.

See scala.collection.mutable.ArrayOps.scanRight.

Inherited from
Vector
override def size: Int
Definition Classes
Inherited from
Vector
final def t[That, Slice1, Result](a: Slice1)(implicit op: CanTranspose[HashVector[E], That], canSlice: CanSlice[That, Slice1, Result]): Result

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
final def t[That, Slice1, Slice2, Result](a: Slice1, b: Slice2)(implicit op: CanTranspose[HashVector[E], That], canSlice: CanSlice2[That, Slice1, Slice2, Result]): Result

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
final def t[That](implicit op: CanTranspose[HashVector[E], That]): That

A transposed view of this object.

A transposed view of this object.

Inherited from
ImmutableNumericOps
def toArray(implicit cm: ClassTag[E]): Array[E]

Returns copy of this breeze.linalg.Vector as a scala.Array

Returns copy of this breeze.linalg.Vector as a scala.Array

Inherited from
Vector
def toDenseVector(implicit cm: ClassTag[E]): DenseVector[E]
Inherited from
Vector
def toScalaVector: Vector[E]

Returns copy of this breeze.linalg.Vector as a scala.Vector

Returns copy of this breeze.linalg.Vector as a scala.Vector

Inherited from
Vector
def toVector(implicit cm: ClassTag[E]): Vector[E]

Returns copy of this breeze.linalg.Vector as a scala.Vector

Returns copy of this breeze.linalg.Vector as a scala.Vector

Inherited from
Vector
final def unary_![That](implicit op: Impl[HashVector[E], That]): That
Inherited from
ImmutableNumericOps
final def unary_-[That](implicit op: Impl[HashVector[E], That]): That
Inherited from
ImmutableNumericOps
def values: TensorValues[Int, E, HashVector[E]]
Inherited from
TensorLike
def valuesIterator: Iterator[E]
Inherited from
Vector
final def |[B, That](b: B)(implicit op: Impl2[HashVector[E], B, That]): That

Alias for :||(b) for all b.

Alias for :||(b) for all b.

Inherited from
ImmutableNumericOps
final def |:|[B, That](b: B)(implicit op: Impl2[HashVector[E], B, That]): That

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
final def |=[B](b: B)(implicit op: InPlaceImpl2[HashVector[E], B]): HashVector[E]

Mutates this by element-wise or of this and b.

Mutates this by element-wise or of this and b.

Inherited from
NumericOps

Concrete fields