Package org.flag4j.arrays.sparse
Class CooCTensor
java.lang.Object
org.flag4j.core.TensorBase<CooCTensor,CTensor,CooCTensor,CTensor,CooTensor,CNumber[],CNumber>
org.flag4j.core.sparse_base.SparseTensorBase<CooCTensor,CTensor,CooCTensor,CTensor,CooTensor,CNumber[],CNumber>
org.flag4j.core.sparse_base.ComplexSparseTensorBase<CooCTensor,CTensor,CooTensor>
org.flag4j.arrays.sparse.CooCTensor
- All Implemented Interfaces:
Serializable
,ComplexTensorExclusiveMixin<CooCTensor>
,ComplexTensorMixin<CooCTensor,
,CooTensor> SparseTensorMixin
,TensorComparisonsMixin
,TensorExclusiveMixin<CooCTensor,
,CTensor, CooCTensor, CooCTensor> TensorManipulationsMixin<CooCTensor>
,TensorOperationsMixin<CooCTensor,
,CTensor, CooCTensor, CTensor, CooTensor, CNumber> TensorPropertiesMixin
public class CooCTensor
extends ComplexSparseTensorBase<CooCTensor,CTensor,CooTensor>
implements ComplexTensorExclusiveMixin<CooCTensor>
Complex sparse tensor. Stored in coordinate (COO) format.
- See Also:
-
Field Summary
Fields inherited from class org.flag4j.core.sparse_base.SparseTensorBase
indices, nnz
Fields inherited from class org.flag4j.core.TensorBase
DEFAULT_ROUND_TO_ZERO_THRESHOLD, entries, shape
-
Constructor Summary
ConstructorDescriptionConstructs a sparse complex tensor whose non-zero values, indices, and shape are specified by another sparse complex tensor.CooCTensor
(Shape shape) Creates a sparse tensor with specified shape filled with zeros.CooCTensor
(Shape shape, double[] nonZeroEntries, int[][] indices) Creates a sparse tensor with specified shape filled with zeros.CooCTensor
(Shape shape, int[] nonZeroEntries, int[][] indices) Creates a sparse tensor with specified shape filled with zeros.CooCTensor
(Shape shape, List<CNumber> nonZeroEntries, List<int[]> indices) Creates a sparse tensor with specified shape and non-zero values/indices.CooCTensor
(Shape shape, CNumber[] nonZeroEntries, int[][] indices) Creates a sparse tensor with specified shape filled with zeros. -
Method Summary
Modifier and TypeMethodDescriptionadd
(double a) Adds specified value to all entries of this tensor.Computes the element-wise addition between two tensors of the same rank.Computes the element-wise addition between two tensors of the same rank.add
(CooCTensor B) Computes the element-wise addition between two tensors of the same rank.Computes the element-wise addition between two tensors of the same rank.Adds specified value to all entries of this tensor.void
Computes the element-wise addition of two tensors of the same rank and stores the result in this tensor.void
addEq
(CooCTensor B) Computes the element-wise addition of two tensors of the same rank and stores the result in this tensor.boolean
allClose
(CooCTensor tensor, double relTol, double absTol) Checks if all entries of this tensor are close to the entries of the argumenttensor
.copy()
Creates a copy of this tensor.Computes the element-wise division between two tensors.Computes the element-wise division between two tensors.Computes the element-wise multiplication between two tensors.Computes the element-wise multiplication between two tensors.Computes the element-wise multiplication between two tensors.Computes the element-wise multiplication between two tensors.boolean
Checks if an object is equal to this sparse COO tensor.flatten()
Flattens tensor to single dimension.flatten
(int axis) Flattens a tensor along the specified axis.static CooCTensor
Converts a sparseCooCTensor
from a denseTensor
.get
(int... indices) Gets the element in this tensor at the specified indices.protected CooCTensor
getSelf()
Simply returns a reference of this tensor.H()
Computes the conjugate transpose of this tensor.H
(int... axes) Computes the conjugate transpose of this tensor.H
(int axis1, int axis2) Computes the transpose of a tensor.Computes the conjugate transpose of this tensor.protected CooTensor
makeRealTensor
(Shape shape, double[] entries, int[][] indices) A factory for creating a real sparse tensor.protected CooCTensor
makeTensor
(Shape shape, CNumber[] entries, int[][] indices) A factory for creating a complex sparse tensor.Copies and reshapes tensor if possible.set
(double value, int... indices) Sets an index of this tensor to a specified value.Sets an index of this tensor to a specified value.void
Sorts the indices of this tensor in lexicographical order while maintaining the associated value for each index.sub
(double a) Adds specified value to all entries of this tensor.Computes the element-wise subtraction between two tensors of the same rank.Computes the element-wise addition between two tensors of the same rank.sub
(CooCTensor B) Computes the element-wise subtraction between two tensors of the same rank.Computes the element-wise subtraction between two tensors of the same rank.Subtracts a specified value from all entries of this tensor.void
Computes the element-wise subtraction of two tensors of the same rank and stores the result in this tensor.void
subEq
(CooCTensor B) Computes the element-wise subtraction of two tensors of the same rank and stores the result in this tensor.T()
Computes the transpose of a tensor.T
(int... axes) Computes the transpose of this tensor.T
(int axis1, int axis2) Computes the transpose of a tensor.tensorDot
(CooCTensor src2, int[] aAxes, int[] bAxes) Computes the tensor contraction of this tensor with a specified tensor over the specified set of axes.tensorInv
(int numIndices) Computes the 'inverse' of this tensor.toDense()
Converts this sparse tensor to an equivalent dense tensor.Converts this tensor to a matrix with the specified shape.Computes the transpose of a tensor.Methods inherited from class org.flag4j.core.sparse_base.ComplexSparseTensorBase
abs, argMax, argMin, conj, div, div, isComplex, isOnes, isReal, isZeros, max, maxAbs, min, minAbs, mult, mult, nonZeroEntries, recip, reshape, round, round, roundToZero, roundToZero, sqrt, sum, toReal, toRealSafe
Methods inherited from class org.flag4j.core.sparse_base.SparseTensorBase
density, sparsity
Methods inherited from class org.flag4j.core.TensorBase
allClose, getEntries, getRank, getShape, sameLength, sameShape, tensorEquals, totalEntries
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.flag4j.core.ComplexTensorExclusiveMixin
hermTranspose, hermTranspose
-
Constructor Details
-
CooCTensor
Creates a sparse tensor with specified shape filled with zeros.- Parameters:
shape
- Shape of the tensor.
-
CooCTensor
Creates a sparse tensor with specified shape filled with zeros.- Parameters:
shape
- Shape of the tensor.nonZeroEntries
- Non-zero entries of the tensor.indices
- Indices of the non-zero entries of the tensor.
-
CooCTensor
Creates a sparse tensor with specified shape filled with zeros.- Parameters:
shape
- Shape of the tensor.nonZeroEntries
- Non-zero entries of the tensor.indices
- Indices of the non-zero entries of the tensor.
-
CooCTensor
-
CooCTensor
Creates a sparse tensor with specified shape and non-zero values/indices.- Parameters:
shape
- Shape of the tensor.nonZeroEntries
- Non-zero entries of the tensor.indices
- Indices of the non-zero entries of the tensor.
-
CooCTensor
Constructs a sparse complex tensor whose non-zero values, indices, and shape are specified by another sparse complex tensor.- Parameters:
A
- The sparse complex tensor to construct a copy of.
-
-
Method Details
-
equals
Checks if an object is equal to this sparse COO tensor.- Specified by:
equals
in interfaceTensorComparisonsMixin
- Overrides:
equals
in classObject
- Parameters:
object
- Object to compare this sparse COO tensor to.- Returns:
- True if the object is a
CooCTensor
, has the same shape as this tensor, and is element-wise equal to this tensor.
-
getSelf
Simply returns a reference of this tensor.- Specified by:
getSelf
in classTensorBase<CooCTensor,
CTensor, CooCTensor, CTensor, CooTensor, CNumber[], CNumber> - Returns:
- A reference to this tensor.
-
allClose
Description copied from class:TensorBase
Checks if all entries of this tensor are close to the entries of the argumenttensor
.- Specified by:
allClose
in classTensorBase<CooCTensor,
CTensor, CooCTensor, CTensor, CooTensor, CNumber[], CNumber> - Parameters:
tensor
- Tensor to compare this tensor to.relTol
- Relative tolerance.absTol
- Absolute tolerance.- Returns:
- True if the argument
tensor
is the same shape as this tensor and all entries are 'close', i.e. elementsa
andb
at the same positions in the two tensors respectively satisfy|a-b| <= (atol + rtol*|b|)
. Otherwise, returns false. - See Also:
-
hermTranspose
Computes the conjugate transpose of this tensor. In the context of a tensor, this swaps the first and last axes and takes the complex conjugate of the elements along these axes. Same asH()
.- Specified by:
hermTranspose
in interfaceComplexTensorMixin<CooCTensor,
CooTensor> - Returns:
- The complex transpose of this tensor.
-
H
Computes the conjugate transpose of this tensor. In the context of a tensor, this swaps the first and last axes and takes the complex conjugate of the elements along these axes. Same ashermTranspose()
.- Specified by:
H
in interfaceComplexTensorMixin<CooCTensor,
CooTensor> - Returns:
- The complex transpose of this tensor.
-
set
Sets an index of this tensor to a specified value.- Specified by:
set
in interfaceComplexTensorMixin<CooCTensor,
CooTensor> - Parameters:
value
- Value to set.indices
- The indices of this matrix for which to set the value.- Returns:
- A reference to this tensor.
- Throws:
IllegalArgumentException
- If the number of indices is not equal to the rank of this tensor.IndexOutOfBoundsException
- If any of the indices are not within this tensor.
-
set
Sets an index of this tensor to a specified value.- Specified by:
set
in interfaceTensorManipulationsMixin<CooCTensor>
- Parameters:
value
- Value to set.indices
- The indices of this tensor for which to set the value.- Returns:
- A reference to this tensor.
-
reshape
Copies and reshapes tensor if possible. The total number of entries in this tensor must match the total number of entries in the reshaped tensor.- Specified by:
reshape
in interfaceTensorManipulationsMixin<CooCTensor>
- Parameters:
newShape
- Shape of the new tensor.- Returns:
- A tensor which is equivalent to this tensor but with the specified shape.
- Throws:
IllegalArgumentException
- If this tensor cannot be reshaped to the specified dimensions.
-
flatten
Flattens tensor to single dimension. To flatten tensor along a single axis.- Specified by:
flatten
in interfaceTensorManipulationsMixin<CooCTensor>
- Returns:
- The flattened tensor.
-
tensorDot
Computes the tensor contraction of this tensor with a specified tensor over the specified set of axes. That is, computes the sum of products between the two tensors along the specified set of axes.- Specified by:
tensorDot
in interfaceTensorExclusiveMixin<CooCTensor,
CTensor, CooCTensor, CooCTensor> - Parameters:
src2
- Tensor to contract with this tensor.aAxes
- Axes along which to compute products for this tensor.bAxes
- Axes along which to compute products forsrc2
tensor.- Returns:
- The tensor dot product over the specified axes.
- Throws:
IllegalArgumentException
- If the two tensors shapes do not match along the specified axes pairwise inaAxes
andbAxes
.IllegalArgumentException
- IfaAxes
andbAxes
do not match in length, or if any of the axes are out of bounds for the corresponding tensor.
-
T
Computes the transpose of a tensor. Same asTensorExclusiveMixin.transpose(int, int)
. In the context of a tensor, this exchanges the specified axes. Also seetranspose()
andT()
to exchange first and last axes.- Specified by:
T
in interfaceTensorExclusiveMixin<CooCTensor,
CTensor, CooCTensor, CooCTensor> - Parameters:
axis1
- First axis to exchange.axis2
- Second axis to exchange.- Returns:
- The transpose of this tensor.
-
T
Computes the transpose of this tensor. That is, interchanges the axes of this tensor so that it matches the specified axes permutation. Same asTensorExclusiveMixin.transpose(int[])
.- Specified by:
T
in interfaceTensorExclusiveMixin<CooCTensor,
CTensor, CooCTensor, CooCTensor> - Parameters:
axes
- Permutation of tensor axis. If the tensor has rankN
, then this must be an array of lengthN
which is a permutation of{0, 1, 2, ..., N-1}
.- Returns:
- The transpose of this tensor with its axes permuted by the
axes
array. - Throws:
IllegalArgumentException
- Ifaxes
is not a permutation of{1, 2, 3, ... N-1}
.
-
add
Computes the element-wise addition between two tensors of the same rank.- Specified by:
add
in interfaceTensorExclusiveMixin<CooCTensor,
CTensor, CooCTensor, CooCTensor> - Parameters:
B
- Second tensor in the addition.- Returns:
- The result of adding the tensor B to this tensor element-wise.
- Throws:
IllegalArgumentException
- If this tensor and B have different shapes.
-
add
Computes the element-wise addition between two tensors of the same rank.- Specified by:
add
in interfaceTensorExclusiveMixin<CooCTensor,
CTensor, CooCTensor, CooCTensor> - Parameters:
B
- Second tensor in the addition.- Returns:
- The result of adding the tensor B to this tensor element-wise.
- Throws:
IllegalArgumentException
- If this tensor and B have different shapes.
-
sub
Computes the element-wise addition between two tensors of the same rank.- Specified by:
sub
in interfaceTensorExclusiveMixin<CooCTensor,
CTensor, CooCTensor, CooCTensor> - Parameters:
B
- Second tensor in the addition.- Returns:
- The result of adding the tensor B to this tensor element-wise.
- Throws:
IllegalArgumentException
- If this tensor and B have different shapes.
-
add
Computes the element-wise addition between two tensors of the same rank.- Specified by:
add
in interfaceTensorExclusiveMixin<CooCTensor,
CTensor, CooCTensor, CooCTensor> - Parameters:
B
- Second tensor in the addition.- Returns:
- The result of adding the tensor B to this tensor element-wise.
- Throws:
IllegalArgumentException
- If this tensor and B have different shapes.
-
add
Computes the element-wise addition between two tensors of the same rank.- Specified by:
add
in interfaceTensorExclusiveMixin<CooCTensor,
CTensor, CooCTensor, CooCTensor> - Specified by:
add
in interfaceTensorOperationsMixin<CooCTensor,
CTensor, CooCTensor, CTensor, CooTensor, CNumber> - Parameters:
B
- Second tensor in the addition.- Returns:
- The result of adding the tensor B to this tensor element-wise.
- Throws:
IllegalArgumentException
- If this tensor and B have different shapes.
-
sub
Computes the element-wise subtraction between two tensors of the same rank.- Specified by:
sub
in interfaceTensorExclusiveMixin<CooCTensor,
CTensor, CooCTensor, CooCTensor> - Parameters:
B
- Second tensor in element-wise subtraction.- Returns:
- The result of subtracting the tensor B from this tensor element-wise.
- Throws:
IllegalArgumentException
- If this tensor and B have different shapes.
-
sub
Computes the element-wise subtraction between two tensors of the same rank.- Specified by:
sub
in interfaceTensorExclusiveMixin<CooCTensor,
CTensor, CooCTensor, CooCTensor> - Parameters:
B
- Second tensor in element-wise subtraction.- Returns:
- The result of subtracting the tensor B from this tensor element-wise.
- Throws:
IllegalArgumentException
- If this tensor and B have different shapes.
-
add
Adds specified value to all entries of this tensor.- Specified by:
add
in interfaceTensorOperationsMixin<CooCTensor,
CTensor, CooCTensor, CTensor, CooTensor, CNumber> - Parameters:
a
- Value to add to all entries of this tensor.- Returns:
- The result of adding the specified value to each entry of this tensor.
-
add
Adds specified value to all entries of this tensor.- Specified by:
add
in interfaceTensorOperationsMixin<CooCTensor,
CTensor, CooCTensor, CTensor, CooTensor, CNumber> - Parameters:
a
- Value to add to all entries of this tensor.- Returns:
- The result of adding the specified value to each entry of this tensor.
-
sub
Computes the element-wise subtraction between two tensors of the same rank.- Specified by:
sub
in interfaceTensorExclusiveMixin<CooCTensor,
CTensor, CooCTensor, CooCTensor> - Specified by:
sub
in interfaceTensorOperationsMixin<CooCTensor,
CTensor, CooCTensor, CTensor, CooTensor, CNumber> - Parameters:
B
- Second tensor in element-wise subtraction.- Returns:
- The result of subtracting the tensor B from this tensor element-wise.
- Throws:
IllegalArgumentException
- If this tensor and B have different shapes.
-
elemMult
Computes the element-wise multiplication between two tensors.- Specified by:
elemMult
in interfaceTensorExclusiveMixin<CooCTensor,
CTensor, CooCTensor, CooCTensor> - Parameters:
B
- Tensor to element-wise multiply to this tensor.- Returns:
- The result of the element-wise tensor multiplication.
- Throws:
IllegalArgumentException
- If the tensors do not have the same shape.
-
elemMult
Computes the element-wise multiplication between two tensors.- Specified by:
elemMult
in interfaceTensorExclusiveMixin<CooCTensor,
CTensor, CooCTensor, CooCTensor> - Parameters:
B
- Tensor to element-wise multiply to this tensor.- Returns:
- The result of the element-wise tensor multiplication.
- Throws:
IllegalArgumentException
- If the tensors do not have the same shape.
-
elemMult
Computes the element-wise multiplication between two tensors.- Specified by:
elemMult
in interfaceTensorExclusiveMixin<CooCTensor,
CTensor, CooCTensor, CooCTensor> - Parameters:
B
- Tensor to element-wise multiply to this tensor.- Returns:
- The result of the element-wise tensor multiplication.
- Throws:
IllegalArgumentException
- If the tensors do not have the same shape.
-
sub
Adds specified value to all entries of this tensor.- Specified by:
sub
in interfaceTensorOperationsMixin<CooCTensor,
CTensor, CooCTensor, CTensor, CooTensor, CNumber> - Parameters:
a
- Value to add to all entries of this tensor.- Returns:
- The result of adding the specified value to each entry of this tensor.
-
sub
Subtracts a specified value from all entries of this tensor.- Specified by:
sub
in interfaceTensorOperationsMixin<CooCTensor,
CTensor, CooCTensor, CTensor, CooTensor, CNumber> - Parameters:
a
- Value to subtract from all entries of this tensor.- Returns:
- The result of subtracting the specified value from each entry of this tensor.
-
transpose
Computes the transpose of a tensor. Same asT()
.- Specified by:
transpose
in interfaceTensorOperationsMixin<CooCTensor,
CTensor, CooCTensor, CTensor, CooTensor, CNumber> - Returns:
- The transpose of this tensor.
-
T
Computes the transpose of a tensor. Same astranspose()
.- Specified by:
T
in interfaceTensorOperationsMixin<CooCTensor,
CTensor, CooCTensor, CTensor, CooTensor, CNumber> - Returns:
- The transpose of this tensor.
-
get
Gets the element in this tensor at the specified indices.- Specified by:
get
in interfaceTensorOperationsMixin<CooCTensor,
CTensor, CooCTensor, CTensor, CooTensor, CNumber> - Parameters:
indices
- Indices of element.- Returns:
- The element at the specified indices.
- Throws:
IllegalArgumentException
- If the number of indices does not match the rank of this tensor.
-
copy
Creates a copy of this tensor.- Specified by:
copy
in interfaceTensorOperationsMixin<CooCTensor,
CTensor, CooCTensor, CTensor, CooTensor, CNumber> - Returns:
- A copy of this tensor.
-
elemMult
Computes the element-wise multiplication between two tensors.- Specified by:
elemMult
in interfaceTensorExclusiveMixin<CooCTensor,
CTensor, CooCTensor, CooCTensor> - Specified by:
elemMult
in interfaceTensorOperationsMixin<CooCTensor,
CTensor, CooCTensor, CTensor, CooTensor, CNumber> - Parameters:
B
- Tensor to element-wise multiply to this tensor.- Returns:
- The result of the element-wise tensor multiplication.
- Throws:
IllegalArgumentException
- If this tensor andB
do not have the same shape.
-
elemDiv
Computes the element-wise division between two tensors.- Specified by:
elemDiv
in interfaceTensorExclusiveMixin<CooCTensor,
CTensor, CooCTensor, CooCTensor> - Specified by:
elemDiv
in interfaceTensorOperationsMixin<CooCTensor,
CTensor, CooCTensor, CTensor, CooTensor, CNumber> - Parameters:
B
- Tensor to element-wise divide with this tensor.- Returns:
- The result of the element-wise tensor multiplication.
- Throws:
IllegalArgumentException
- If this tensor andB
do not have the same shape.
-
elemDiv
Computes the element-wise division between two tensors.- Specified by:
elemDiv
in interfaceTensorExclusiveMixin<CooCTensor,
CTensor, CooCTensor, CooCTensor> - Parameters:
B
- Tensor to element-wise divide from this tensor.- Returns:
- The result of the element-wise tensor division.
- Throws:
IllegalArgumentException
- If the tensors do not have the same shape.
-
tensorInv
Computes the 'inverse' of this tensor. That is, computes the tensor
X=this.tensorInv()
such thatthis.tensorDot(X, numIndices)
is the 'identity' tensor for the tensor dot product operation. A tensorI
is the identity for a tensor dot product ifthis.tensorDot(I, numIndices).equals(this)
.WARNING: This method will convert this tensor to a dense tensor.
- Specified by:
tensorInv
in interfaceTensorExclusiveMixin<CooCTensor,
CTensor, CooCTensor, CooCTensor> - Parameters:
numIndices
- The number of first numIndices which are involved in the inverse sum.- Returns:
- The 'inverse' of this tensor as defined in the above sense.
- See Also:
-
flatten
Flattens a tensor along the specified axis.- Specified by:
flatten
in interfaceTensorManipulationsMixin<CooCTensor>
- Parameters:
axis
- Axis along which to flatten tensor.- Throws:
IllegalArgumentException
- If the axis is not positive or larger thanthis.
.TensorBase.getRank()
-1
-
makeTensor
A factory for creating a complex sparse tensor.- Specified by:
makeTensor
in classComplexSparseTensorBase<CooCTensor,
CTensor, CooTensor> - Parameters:
shape
- Shape of the sparse tensor to make.entries
- Non-zero entries of the sparse tensor to make.indices
- Non-zero indices of the sparse tensor to make.- Returns:
- A tensor created from the specified parameters.
-
makeRealTensor
A factory for creating a real sparse tensor.- Specified by:
makeRealTensor
in classComplexSparseTensorBase<CooCTensor,
CTensor, CooTensor> - Parameters:
shape
- Shape of the sparse tensor to make.entries
- Non-zero entries of the sparse tensor to make.indices
- Non-zero indices of the sparse tensor to make.- Returns:
- A tensor created from the specified parameters.
-
sortIndices
public void sortIndices()Sorts the indices of this tensor in lexicographical order while maintaining the associated value for each index.- Specified by:
sortIndices
in interfaceSparseTensorMixin
- Overrides:
sortIndices
in classComplexSparseTensorBase<CooCTensor,
CTensor, CooTensor>
-
fromDense
Converts a sparseCooCTensor
from a denseTensor
. This is likely only worthwhile for very sparse tensors.- Parameters:
src
- Dense tensor to convert to sparse COO tensor.- Returns:
- A COO tensor which is equivalent to the
src
dense tensor.
-
toMatrix
Converts this tensor to a matrix with the specified shape.- Parameters:
matShape
- Shape of the resulting matrix. Must be broadcastable with the shape of this tensor.- Returns:
- A matrix of shape
matShape
with the values of this tensor.
-
toDense
Converts this sparse tensor to an equivalent dense tensor.- Specified by:
toDense
in classSparseTensorBase<CooCTensor,
CTensor, CooCTensor, CTensor, CooTensor, CNumber[], CNumber> - Returns:
- A dense tensor which is equivalent to this sparse tensor.
-
H
Computes the transpose of a tensor. Same asComplexTensorExclusiveMixin.hermTranspose(int, int)
. In the context of a tensor, this exchanges the specified axes and takes the complex conjugate of elements along those axes. Also seehermTranspose()
andH()
to conjugate transpose first and last axes.- Specified by:
H
in interfaceComplexTensorExclusiveMixin<CooCTensor>
- Parameters:
axis1
- First axis to exchange and apply complex conjugate.axis2
- Second axis to exchange and apply complex conjugate.- Returns:
- The conjugate transpose of this tensor.
-
H
Computes the conjugate transpose of this tensor. That is, interchanges the axes of this tensor so that it matches the specified axes permutation and takes the complex conjugate of the elements of these axes. Same asComplexTensorExclusiveMixin.hermTranspose(int[])
.- Specified by:
H
in interfaceComplexTensorExclusiveMixin<CooCTensor>
- Parameters:
axes
- Permutation of tensor axis. If the tensor has rankN
, then this must be an array of lengthN
which is a permutation of{0, 1, 2, ..., N-1}
.- Returns:
- The conjugate transpose of this tensor with its axes permuted by the
axes
array. - Throws:
IllegalArgumentException
- Ifaxes
is not a permutation of{1, 2, 3, ... N-1}
.
-
addEq
Computes the element-wise addition of two tensors of the same rank and stores the result in this tensor.- Specified by:
addEq
in interfaceComplexTensorExclusiveMixin<CooCTensor>
- Parameters:
B
- Second tensor in the addition.- Throws:
IllegalArgumentException
- If this tensor andB
have different shapes.
-
addEq
Computes the element-wise addition of two tensors of the same rank and stores the result in this tensor.- Specified by:
addEq
in interfaceComplexTensorExclusiveMixin<CooCTensor>
- Parameters:
B
- Second tensor in the addition.- Throws:
IllegalArgumentException
- If this tensor andB
have different shapes.
-
subEq
Computes the element-wise subtraction of two tensors of the same rank and stores the result in this tensor.- Specified by:
subEq
in interfaceComplexTensorExclusiveMixin<CooCTensor>
- Parameters:
B
- Second tensor in the subtraction.- Throws:
IllegalArgumentException
- If this tensor andB
have different shapes.
-
subEq
Computes the element-wise subtraction of two tensors of the same rank and stores the result in this tensor.- Specified by:
subEq
in interfaceComplexTensorExclusiveMixin<CooCTensor>
- Parameters:
B
- Second tensor in the subtraction.- Throws:
IllegalArgumentException
- If this tensor andB
have different shapes.
-