Trait/Object

com.twitter.scalding.mathematics

Matrix2

Related Docs: object Matrix2 | package mathematics

Permalink

sealed trait Matrix2[R, C, V] extends Serializable

This is the future Matrix API. The old one will be removed in scalding 0.10.0 (or 1.0.0).

Create Matrix2 instances with methods in the Matrix2 object. Note that this code optimizes the order in which it evaluates matrices, and replaces equivalent terms to avoid recomputation. Also, this code puts the parenthesis in the optimal place in terms of size according to the sizeHints. For instance: (A*B)*C == A*(B*C) but if B is a 10 x 106 matrix, and C is 106 x 100, it is better to do the B*C product first in order to avoid storing as much intermediate output.

NOTE THIS REQUIREMENT: for each formula, you can only have one Ring[V] in scope. If you evaluate part of the formula with one Ring, and another part with another, you must go through a TypedPipe (call toTypedPipe) or the result may not be correct.

Source
Matrix2.scala
Linear Supertypes
Serializable, AnyRef, Any
Known Subclasses
Type Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Matrix2
  2. Serializable
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. implicit abstract def colOrd: Ordering[C]

    Permalink
  2. abstract def negate(implicit g: Group[V]): Matrix2[R, C, V]

    Permalink
  3. implicit abstract def rowOrd: Ordering[R]

    Permalink
  4. abstract def toTypedPipe: TypedPipe[(R, C, V)]

    Permalink

    Convert the current Matrix to a TypedPipe

  5. abstract def transpose: Matrix2[C, R, V]

    Permalink

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. def #*#(that: Matrix2[R, C, V])(implicit ring: Ring[V]): Matrix2[R, C, V]

    Permalink

    Represents the pointwise, or Hadamard, product of two matrices.

  4. def *(that: Scalar2[V])(implicit ring: Ring[V], mj: MatrixJoiner2): Matrix2[R, C, V]

    Permalink
  5. def *[C2](that: Matrix2[C, C2, V])(implicit ring: Ring[V], mj: MatrixJoiner2): Matrix2[R, C2, V]

    Permalink
  6. def +(that: Matrix2[R, C, V])(implicit mon: Monoid[V]): Matrix2[R, C, V]

    Permalink
  7. def -(that: Matrix2[R, C, V])(implicit g: Group[V]): Matrix2[R, C, V]

    Permalink
  8. def /(that: Scalar2[V])(implicit field: algebird.Field[V]): Matrix2[R, C, V]

    Permalink
  9. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  10. def ^(power: Int)(implicit ev: =:=[R, C], ring: Ring[V], mj: MatrixJoiner2): Matrix2[R, R, V]

    Permalink

    equivalent to multiplying this matrix by itself, power times

  11. def asCol[C2](c2: C2)(implicit ev: =:=[C, Unit], colOrd: Ordering[C2]): Matrix2[R, C2, V]

    Permalink
  12. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  13. def asRow[R2](r2: R2)(implicit ev: =:=[R, Unit], rowOrd: Ordering[R2]): Matrix2[R2, C, V]

    Permalink

    Consider this Matrix as the r2 row of a matrix.

    Consider this Matrix as the r2 row of a matrix. The current matrix must be a row, which is to say, its row type must be Unit.

  14. def binarizeAs[NewValT](implicit mon: Monoid[V], ring: Ring[NewValT]): Matrix2[R, C, NewValT]

    Permalink
  15. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  16. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  17. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  18. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  19. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  20. def getColumn(index: C): Matrix2[R, Unit, V]

    Permalink
  21. def getRow(index: R): Matrix2[Unit, C, V]

    Permalink
  22. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  23. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  24. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  25. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  26. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  27. def optimizedSelf: Matrix2[R, C, V]

    Permalink

    Users should never need this.

    Users should never need this. This is the current Matrix2, but in most optimized form. Usually, you will just do matrix operations until you eventually call write or toTypedPipe

  28. def propagate[C2, VecV](vec: Matrix2[C, C2, VecV])(implicit ev: =:=[V, Boolean], mon: Monoid[VecV], mj: MatrixJoiner2): Matrix2[R, C2, VecV]

    Permalink

    the result is the same as considering everything on the this to be like a 1 value so we just sum, using only a monoid on VecV, where this Matrix has the value true.

    the result is the same as considering everything on the this to be like a 1 value so we just sum, using only a monoid on VecV, where this Matrix has the value true. This is useful for graph propagation of monoids, such as sketchs like HyperLogLog, BloomFilters or CountMinSketch. TODO This is a special kind of product that could be optimized like Product is

  29. def propagateRow[C2](mat: Matrix2[C, C2, Boolean])(implicit ev: =:=[R, Unit], mon: Monoid[V], mj: MatrixJoiner2): Matrix2[Unit, C2, V]

    Permalink
  30. def rowL1Normalize(implicit num: Numeric[V], mj: MatrixJoiner2): Matrix2[R, C, Double]

    Permalink

    Row L1 normalization After this operation, the sum(|x|) alone each row will be 1.

  31. def rowL2Normalize(implicit num: Numeric[V], mj: MatrixJoiner2): Matrix2[R, C, Double]

    Permalink

    Row L2 normalization After this operation, the sum(|x|^2) along each row will be 1.

  32. val sizeHint: SizeHint

    Permalink
  33. def sumColVectors(implicit ring: Ring[V], mj: MatrixJoiner2): Matrix2[R, Unit, V]

    Permalink
  34. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  35. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  36. def trace(implicit mon: Monoid[V], ev: =:=[R, C]): Scalar2[V]

    Permalink
  37. def unary_-(implicit g: Group[V]): Matrix2[R, C, V]

    Permalink
  38. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  39. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  40. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  41. def write(sink: TypedSink[(R, C, V)])(implicit fd: FlowDef, m: Mode): Matrix2[R, C, V]

    Permalink

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped