Encoder

trait Encoder[T]

For encoding counters as vectors and decoding vectors back to counters

Companion:
object
class Object
trait Matchable
class Any

Value members

Concrete methods

def decode(v: Vector[Double], keepZeros: Boolean): Counter[T, Double]

Decodes a vector back to a Counter[T,Double]

Decodes a vector back to a Counter[T,Double]

def decode[V](array: Array[V]): Map[T, V]

Converts an array into a Map from T's to whatever was in the array.

Converts an array into a Map from T's to whatever was in the array.

def decode[V](array: SparseArray[V]): Map[T, V]
def encode(c: Tensor[T, Double], ignoreOutOfIndex: Boolean): Vector[Double]

Encodes a DoubleCounter as a Vector[Double]. All elements in the counter must be in the index unless ignoreOutOfIndex is true

Encodes a DoubleCounter as a Vector[Double]. All elements in the counter must be in the index unless ignoreOutOfIndex is true

Encodes a Tensor[(T,T),Double] as a DenseMatrix[Double]. All elements in the counter must be in the index unless ignoreOutOfIndex is true

Encodes a Tensor[(T,T),Double] as a DenseMatrix[Double]. All elements in the counter must be in the index unless ignoreOutOfIndex is true

def encodeDense(c: Tensor[T, Double], ignoreOutOfIndex: Boolean): DenseVector[Double]

Encodes a DoubleCounter as a Vector[Double]. All elements in the counter must be in the index unless ignoreOutOfIndex is true

Encodes a DoubleCounter as a Vector[Double]. All elements in the counter must be in the index unless ignoreOutOfIndex is true

def encodeSparse(c: Tensor[T, Double], ignoreOutOfIndex: Boolean): SparseVector[Double]

Encodes a DoubleCounter as a SparseVector[Double]. All elements in the counter must be in the index unless ignoreOutOfIndex is true

Encodes a DoubleCounter as a SparseVector[Double]. All elements in the counter must be in the index unless ignoreOutOfIndex is true

def fillArray[V : ClassTag](default: => V): Array[V]

Fills an array of arbitrary type with the value provided and with the index's size.

Fills an array of arbitrary type with the value provided and with the index's size.

def mkArray[V : ClassTag]: Array[V]

Creates an array of arbitrary type with the index's size.

Creates an array of arbitrary type with the index's size.

final def mkDenseVector(default: Double): DenseVector[Double]

Creates a DenseVector[Double] with the index's size

Creates a DenseVector[Double] with the index's size

makes a matrix of some sort with the index's size as rows and cols

makes a matrix of some sort with the index's size as rows and cols

Creates a SparseVector[Double] with the index's size

Creates a SparseVector[Double] with the index's size

final def mkVector(): Vector[Double]

Creates a Vector[Double] of some sort with the index's size.

Creates a Vector[Double] of some sort with the index's size.

def tabulateArray[V : ClassTag](f: T => V): Array[V]

Fills an array of arbitrary type by tabulating the function

Fills an array of arbitrary type by tabulating the function

Fills a DenseVector[Double] with each index given by the result of the function.

Fills a DenseVector[Double] with each index given by the result of the function.

Abstract fields

val index: Index[T]