The TensorD
class is a simple implementation for 3-dimensional tensors. The names of the dimensions corresponds to MATLAB (row, column, sheet).
Value parameters
- dim
-
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)
- v
-
the 3D array for holding the tensor elements
Attributes
- See also
-
www.kolda.net/publication/TensorReview.pdf for details on layout
RTensorD
for non-rectangular (ragged) tensors. - Companion
- object
- Graph
-
- Supertypes
-
trait Serializableclass Objecttrait Matchableclass Any
Members list
Value members
Constructors
Construct a dim by dim by dim cubic tensor.
Construct a dim by dim by dim cubic tensor.
Value parameters
- dim
-
the row and column dimension
Attributes
Construct a tensor from three dimensional array.
Construct a tensor from three dimensional array.
Value parameters
- u
-
the three dimensional array
Attributes
Concrete methods
Multiply this tensor by scalar s.
Multiply this tensor by scalar s.
Value parameters
- s
-
the scalar to multiply by
Attributes
Multiply (multi-linear product) this tensor by three matrices b, c and d. this * (a, b, c)
Multiply (multi-linear product) this tensor by three matrices b, c and d. this * (a, b, c)
Value parameters
- b
-
the first matrix to multiply by (requires leDimensions)
- c
-
the second matrix to multiply by (requires leDimensions)
- d
-
the third matrix to multiply by (requires leDimensions)
Attributes
- See also
-
www.stat.uchicago.edu/~lekheng/work/icm1.pdf - equation 15.1
Multiply element-wise (Hadamard product) this tensor by tensor b.
Multiply element-wise (Hadamard product) this tensor by tensor b.
Value parameters
- b
-
the tensor to add (requires leDimensions)
Attributes
Add this tensor and tensor b.
Add this tensor and tensor b.
Value parameters
- b
-
the tensor to add (requires leDimensions)
Attributes
Add this tensor and scalar s.
Add this tensor and scalar s.
Value parameters
- s
-
the scalar to add
Attributes
From this tensor subtract tensor b.
From this tensor subtract tensor b.
Value parameters
- b
-
the tensor to add (requires leDimensions)
Attributes
From this tensor subtract scalar s.
From this tensor subtract scalar s.
Value parameters
- s
-
the scalar to add
Attributes
Retrieve the i, j, k-th SCALAR element from the tensor x_ijk.
Retrieve the i, j, k-th SCALAR element from the tensor x_ijk.
Value parameters
- i
-
the 1st dimension (row) index of the tensor
- j
-
the 2nd dimension (column) index of the tensor
- k
-
the 3rd dimension (sheet) index of the tensor
Attributes
Retrieve the i, j-th VECTOR from the tensor x_ij:.
Retrieve the i, j-th VECTOR from the tensor x_ij:.
Value parameters
- i
-
the 1st dimension (row) index of the tensor
- j
-
the 2nd dimension (column) index of the tensor
Attributes
Retrieve the i, k-th VECTOR from the tensor x_i:k.
Retrieve the i, k-th VECTOR from the tensor x_i:k.
Value parameters
- all
-
use the all columns indicator ?
- i
-
the 1st dimension (row) index of the tensor
- k
-
the 3rd dimension (sheet) index of the tensor
Attributes
Retrieve the j, k-th VECTOR from the tensor x_:jk.
Retrieve the j, k-th VECTOR from the tensor x_:jk.
Value parameters
- all
-
use the all rows indicator ?
- j
-
the 2nd dimension (column) index of the tensor
- k
-
the 3rd dimension (sheet) index of the tensor
Attributes
Return the i-th ROW FIXED MATRIX from the tensor (horizontal slice x_i::).
Return the i-th ROW FIXED MATRIX from the tensor (horizontal slice x_i::).
Value parameters
- i
-
the 1st dimension (row) index of the tensor
Attributes
- See also
Retrieve the j-th COLUMN FIXED MATRIX from the tensor (lateral slice x_:j:).
Retrieve the j-th COLUMN FIXED MATRIX from the tensor (lateral slice x_:j:).
Value parameters
- all
-
use the all rows indicator ?
- j
-
the 2nd dimension (column) index of the tensor
Attributes
- See also
Retrieve the k-th SHEET FIXED MATRIX from the tensor (frontal slice x_::k).
Retrieve the k-th SHEET FIXED MATRIX from the tensor (frontal slice x_::k).
Value parameters
- all
-
use the all rows indicator ?
- all2
-
use the all columns indicator ?
- k
-
the 3rd dimension (sheet) index of the tensor
Attributes
- See also
Retrieve the ii._1 to ii._2 row slice of the tensor.
Retrieve the ii._1 to ii._2 row slice of the tensor.
Value parameters
- ii
-
1st dimension (row) indices of the tensor
Attributes
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.
Value parameters
- ii
-
1st dimension (row) indices of the tensor (null => all)
- jj
-
2nd dimension (column) indices of the tensor
Attributes
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.
Value parameters
- 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
Attributes
Retrieve the is row selections from the tensor.
Retrieve the is row selections from the tensor.
Value parameters
- is
-
1st dimension (row) indices of the tensor
Attributes
Retrieve the is, js row-column selections from the tensor.
Retrieve the is, js row-column selections from the tensor.
Value parameters
- is
-
1st dimension (row) indices of the tensor (null => all)
- js
-
2nd dimension (column) indices of the tensor
Attributes
Retrieve the is, js, ks row-column-sheet selections from the tensor.
Retrieve the is, js, ks row-column-sheet selections from the tensor.
Value parameters
- 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
Attributes
Return the row, column and sheet dimensions of this tensor.
Return the row, column and sheet dimensions of this tensor.
Attributes
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.
Value parameters
- b
-
the other matrix
Attributes
Retrieve the complement of the is row selections from the tensor.
Retrieve the complement of the is row selections from the tensor.
Value parameters
- is
-
1st dimension (row) indices of the tensor
Attributes
Retrieve the complement of the is row selections from the tensor.
Retrieve the complement of the is row selections from the tensor.
Value parameters
- is
-
1st dimension (row) indices of the tensor
- js
-
2nd dimension (column) indices of the tensor
Attributes
Retrieve the complement of the is row selections from the tensor.
Retrieve the complement of the is row selections from the tensor.
Value parameters
- is
-
1st dimension (row) indices of the tensor
- js
-
2nd dimension (column) indices of the tensor
- ks
-
3rd dimension (sheet) indices of the tensor
Attributes
Set all the tensor element values to x.
Set all the tensor element values to x.
Value parameters
- x
-
the value to set all elements to
Attributes
Set the format to the newFormat.
Set the format to the newFormat.
Value parameters
- newFormat
-
the new format string
Attributes
Convert this tensor to a matrix where all the elements have integer values.
Convert this tensor to a matrix where all the elements have integer values.
Attributes
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.
Attributes
- Definition Classes
-
Any
Convert this tensor to a string with a line break after each sheet.
Convert this tensor to a string with a line break after each sheet.
Attributes
Update a single element of the tensor to the given value.
Update a single element of the tensor to the given value.
Value parameters
- 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
Attributes
Update a single vector of the tensor to the given vector.
Update a single vector of the tensor to the given vector.
Value parameters
- 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