Packages

class Tensor3D extends Error with Serializable

The Tensor3D class is a simple implementation for 3-dimensional tensors. The names of the dimensions corresponds to MATLAB (row, column, sheet).

Linear Supertypes
Serializable, Serializable, Error, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Tensor3D
  2. Serializable
  3. Serializable
  4. Error
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Tensor3D(u: Array[Array[Array[Double]]])

    Construct a tensor from three dimensional array.

    Construct a tensor from three dimensional array.

    u

    the three dimensional array

  2. new Tensor3D(dim1: Int)

    Construct a 'dim1' by 'dim1' by 'dim1' cubic tensor.

    Construct a 'dim1' by 'dim1' by 'dim1' cubic tensor.

    dim1

    the row and column dimension

  3. new Tensor3D(dim1: Int, dim2: Int, dim3: Int, v: Array[Array[Array[Double]]] = null)

    dim1

    size of the 1st level/dimension (row) of the tensor (height)

    dim2

    size of the 2nd level/dimension (column) of the tensor (width)

    dim3

    size of the 3rd level/dimension (sheet) of the tensor (depth)

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. def *(b: MatrixD, c: MatrixD, d: MatrixD): Tensor3D

    Multiply (multilinear product) 'this' tensor by three matrices 'b', 'c' and 'd'.

    Multiply (multilinear product) 'this' tensor by three matrices 'b', 'c' and 'd'.

    this * (a, b, c)

    b

    the first matrix to multiply by (requires 'leDimensions')

    c

    the second matrix to multiply by (requires 'leDimensions')

    d

    the thrid matrix to multiply by (requires 'leDimensions')

    See also

    www.stat.uchicago.edu/~lekheng/work/icm1.pdf - equation 15.1

  4. def *(s: Double): Tensor3D

    Multiply 'this' tensor by scalar 's'.

    Multiply 'this' tensor by scalar 's'.

    s

    the scalar to multiply by

  5. def **(b: Tensor3D): Tensor3D

    Multiply elementwise (Hadamard product) 'this' tensor by tensor 'b'.

    Multiply elementwise (Hadamard product) 'this' tensor by tensor 'b'.

    b

    the tensor to add (requires 'leDimensions')

  6. def +(s: Double): Tensor3D

    Add 'this' tensor and scalar 's'.

    Add 'this' tensor and scalar 's'.

    s

    the scalar to add

  7. def +(b: Tensor3D): Tensor3D

    Add 'this' tensor and tensor 'b'.

    Add 'this' tensor and tensor 'b'.

    b

    the tensor to add (requires 'leDimensions')

  8. def -(s: Double): Tensor3D

    From 'this' tensor subtract scalar 's'.

    From 'this' tensor subtract scalar 's'.

    s

    the scalar to add

  9. def -(b: Tensor3D): Tensor3D

    From 'this' tensor subtract tensor 'b'.

    From 'this' tensor subtract tensor 'b'.

    b

    the tensor to add (requires 'leDimensions')

  10. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  11. def apply(is: Ints, js: Ints, ks: Ints): Tensor3D

    Retrieve the 'is, js, ks' row-column-sheet selections from the tensor.

    Retrieve the 'is, js, ks' row-column-sheet selections from the tensor.

    is

    1st dimension (row) indices of the tensor (null => all)

    js

    2nd dimension (column) indices of the tensor (null => all)

    ks

    3rd dimension (sheet) indices of the tensor

  12. def apply(is: Ints, js: Ints): Tensor3D

    Retrieve the 'is, js' row-column selections from the tensor.

    Retrieve the 'is, js' row-column selections from the tensor.

    is

    1st dimension (row) indices of the tensor (null => all)

    js

    2nd dimension (column) indices of the tensor

  13. def apply(is: Ints): Tensor3D

    Retrieve the 'is' row selections from the tensor.

    Retrieve the 'is' row selections from the tensor.

    is

    1st dimension (row) indices of the tensor

  14. def apply(ii: Int2, jj: Int2, kk: Int2): Tensor3D

    Retrieve the 'ii._1' to 'ii._2', 'jj._1' to 'jj._2', 'kk._1' to 'kk._2' row-column-sheet slice of the tensor.

    Retrieve the 'ii._1' to 'ii._2', 'jj._1' to 'jj._2', 'kk._1' to 'kk._2' row-column-sheet slice of the tensor.

    ii

    1st dimension (row) indices of the tensor (null => all)

    jj

    2nd dimension (column) indices of the tensor (null => all)

    kk

    3rd dimension (sheet) indices of the tensor

  15. def apply(ii: Int2, jj: Int2): Tensor3D

    Retrieve the 'ii._1' to 'ii._2', 'jj._1' to 'jj._2' row-column slice of the tensor.

    Retrieve the 'ii._1' to 'ii._2', 'jj._1' to 'jj._2' row-column slice of the tensor.

    ii

    1st dimension (row) indices of the tensor (null => all)

    jj

    2nd dimension (column) indices of the tensor

  16. def apply(ii: Int2): Tensor3D

    Retrieve the 'ii._1' to 'ii._2' row slice of the tensor.

    Retrieve the 'ii._1' to 'ii._2' row slice of the tensor.

    ii

    1st dimension (row) indices of the tensor

  17. def apply(i: Int): MatriD

    Retrieve the 'i' matrix from the tensor.

    Retrieve the 'i' matrix from the tensor.

    i

    1st dimension (row) index of the tensor

  18. def apply(i: Int, j: Int): VectoD

    Retrieve the 'i, j' vector from the tensor.

    Retrieve the 'i, j' vector from the tensor.

    i

    1st dimension (row) index of the tensor

    j

    2nd dimension (column) index of the tensor

  19. def apply(i: Int, j: Int, k: Int): Double

    Retrieve the 'i, j, k' element from the tensor.

    Retrieve the 'i, j, k' element from the tensor.

    i

    1st dimension (row) index of the tensor

    j

    2nd dimension (column) index of the tensor

    k

    3rd dimension (sheet) index of the tensor

  20. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  21. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native() @HotSpotIntrinsicCandidate()
  22. val dim1: Int
  23. val dim2: Int
  24. val dim3: Int
  25. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  26. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  27. var fString: String

    Format string used for printing vector values (change using 'setFormat')

    Format string used for printing vector values (change using 'setFormat')

    Attributes
    protected
  28. final def flaw(method: String, message: String): Unit
    Definition Classes
    Error
  29. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  30. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  31. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  32. def leDimensions(b: Tensor3D): Boolean

    Check whether the dimensions of 'this' tensor are less than or equal to 'le' those of the other tensor 'b'.

    Check whether the dimensions of 'this' tensor are less than or equal to 'le' those of the other tensor 'b'.

    b

    the other matrix

  33. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  34. def not(is: Ints, js: Ints, ks: Ints): Tensor3D

    Retrieve the complement of the 'is' row selections from the tensor.

    Retrieve the complement of the 'is' row selections from the tensor.

    is

    1st dimension (row) indices of the tensor

    js

    2nd dimension (column) indices of the tensor

    ks

    3rd dimension (sheet) indices of the tensor

  35. def not(is: Ints, js: Ints): Tensor3D

    Retrieve the complement of the 'is' row selections from the tensor.

    Retrieve the complement of the 'is' row selections from the tensor.

    is

    1st dimension (row) indices of the tensor

    js

    2nd dimension (column) indices of the tensor

  36. def not(is: Ints): Tensor3D

    Retrieve the complement of the 'is' row selections from the tensor.

    Retrieve the complement of the 'is' row selections from the tensor.

    is

    1st dimension (row) indices of the tensor

  37. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  38. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  39. val range1: Range
  40. val range2: Range
  41. val range3: Range
  42. def set(x: Double): Unit

    Set all the tensor element values to 'x'.

    Set all the tensor element values to 'x'.

    x

    the value to set all elements to

  43. def setFormat(newFormat: String): Unit

    Set the format to the 'newFormat'.

    Set the format to the 'newFormat'.

    newFormat

    the new format string

  44. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  45. def toString(): String

    Convert 'this' tensor to a string with a double line break after each sheet and a single line break after each row.

    Convert 'this' tensor to a string with a double line break after each sheet and a single line break after each row.

    Definition Classes
    Tensor3D → AnyRef → Any
  46. def toString2: String

    Convert 'this' tensor to a string with a line break after each sheet.

  47. def update(i: Int, x: MatrixD): Unit

    Update a single matrix of the tensor to the given matrix.

    Update a single matrix of the tensor to the given matrix.

    i

    1st dimension (row) index of the tensor

    x

    the matrix to be updated at the above position in the tensor

  48. def update(i: Int, j: Int, x: VectorD): Unit

    Update a single vector of the tensor to the given vector.

    Update a single vector of the tensor to the given vector.

    i

    1st dimension (row) index of the tensor

    j

    2nd dimension (column) index of the tensor

    x

    the vector to be updated at the above position in the tensor

  49. def update(i: Int, j: Int, k: Int, x: Double): Unit

    Update a single element of the tensor to the given value.

    Update a single element of the tensor to the given value.

    i

    1st dimension (row) index of the tensor

    j

    2nd dimension (column) index of the tensor

    k

    3rd dimension (sheet) index of the tensor

    x

    the value to be updated at the above position in the tensor

  50. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  51. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  52. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] ) @Deprecated
    Deprecated

Inherited from Serializable

Inherited from Serializable

Inherited from Error

Inherited from AnyRef

Inherited from Any

Ungrouped