Package org.flag4j.core.dense_base
Class ComplexDenseTensorBase<T extends ComplexDenseTensorBase<T,Y>,Y extends RealDenseTensorBase<Y,T>>
java.lang.Object
org.flag4j.core.TensorBase<T,T,T,T,Y,CNumber[],CNumber>
org.flag4j.core.dense_base.DenseTensorBase<T,T,Y,CNumber[],CNumber>
org.flag4j.core.dense_base.ComplexDenseTensorBase<T,Y>
- Type Parameters:
T
- Type of this tensor.Y
- Real Tensor type.
- All Implemented Interfaces:
Serializable
,ComplexTensorMixin<T,
,Y> DenseMixin<CNumber>
,TensorComparisonsMixin
,TensorManipulationsMixin<T>
,TensorOperationsMixin<T,
,T, T, T, Y, CNumber> TensorPropertiesMixin
public abstract class ComplexDenseTensorBase<T extends ComplexDenseTensorBase<T,Y>,Y extends RealDenseTensorBase<Y,T>>
extends DenseTensorBase<T,T,Y,CNumber[],CNumber>
implements ComplexTensorMixin<T,Y>
The base class for all complex dense tensors. This includes complex dense matrices and vectors.
- See Also:
-
Field Summary
Fields inherited from class org.flag4j.core.TensorBase
DEFAULT_ROUND_TO_ZERO_THRESHOLD, entries, shape
-
Constructor Summary
ModifierConstructorDescriptionprotected
ComplexDenseTensorBase
(Shape shape, CNumber[] entries) Creates a complex dense tensor with specified entries and shape. -
Method Summary
Modifier and TypeMethodDescriptionabs()
Computes the element-wise absolute value/magnitude of a tensor.add
(double a) Adds specified value to all entries of this tensor.Adds specified value to all entries of this tensor.Computes the element-wise addition between two tensors of the same rank.void
Subtracts a specified value from all entries of this tensor and stores the result in this tensor.void
Subtracts a specified value from all entries of this tensor and stores the result in this tensor.void
Computes the element-wise subtraction of two tensors of the same rank and stores the result in this tensor.boolean
Checks if all entries of this tensor are close to the entries of the argumenttensor
.int[]
argMax()
Finds the indices of the maximum value in this tensor.int[]
argMin()
Finds the indices of the minimum value in this tensor.conj()
Computes the complex conjugate of a tensor.copy()
Creates a deep copy of this tensor.div
(double divisor) Computes the scalar division of a tensor.Computes the scalar division of a tensor.Computes the element-wise division between two tensors.Computes the element-wise multiplication between two tensors.get
(int... indices) Gets the element in this tensor at the specified indices.int
hashCode()
Creates a hashcode for this matrix.boolean
Checks if this tensor contains at least one complex entry.boolean
isOnes()
Checks if this tensor only contains ones.boolean
isReal()
Checks if this tensor has only real valued entries.boolean
isZeros()
Checks if this tensor only contains zeros.protected abstract Y
makeRealTensor
(Shape shape, double[] entries) Factory to create a real tensor with the specified shape and size.double
max()
Finds the maximum value in this tensor.double
maxAbs()
Finds the maximum value, in absolute value, in this tensor.double
min()
Finds the minimum value in this tensor.double
minAbs()
Finds the minimum value, in absolute value, in this tensor.mult
(double factor) Computes scalar multiplication of a tensor.Computes scalar multiplication of a tensor.recip()
Computes the reciprocals, element-wise, of a tensor.reshape
(int... shape) Copies and reshapes tensor if possible.Copies and reshapes tensor if possible.round()
Rounds each entry of this tensor to the nearest whole number.round
(int precision) Rounds each entry in this tensor to the nearest whole number.Rounds values in this tensor which are close to zero in absolute value to zero.roundToZero
(double threshold) Rounds values which are close to zero in absolute value to zero.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.sqrt()
Computes the element-wise square root of a tensor.sub
(double a) Adds specified value to all entries of this tensor.Subtracts a specified value from all entries of this tensor.Computes the element-wise subtraction between two tensors of the same rank.void
Subtracts a specified value from all entries of this tensor and stores the result in this tensor.void
Subtracts a specified value from all entries of this tensor and stores the result in this tensor.void
Computes the element-wise subtraction of two tensors of the same rank and stores the result in this tensor.sum()
Sums together all entries in the tensor.toReal()
Converts a complex tensor to a real matrix.Converts a complex tensor to a real matrix safely.Methods inherited from class org.flag4j.core.dense_base.DenseTensorBase
makeTensor, toCoo
Methods inherited from class org.flag4j.core.TensorBase
allClose, getEntries, getRank, getSelf, getShape, sameLength, sameShape, tensorEquals, totalEntries
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.flag4j.core.ComplexTensorMixin
H, hermTranspose
Methods inherited from interface org.flag4j.core.TensorComparisonsMixin
equals
Methods inherited from interface org.flag4j.core.TensorManipulationsMixin
flatten, flatten
Methods inherited from interface org.flag4j.core.TensorOperationsMixin
T, transpose
-
Constructor Details
-
ComplexDenseTensorBase
Creates a complex dense tensor with specified entries and shape.- Parameters:
shape
- Shape of this tensor.entries
- Entries of this tensor. The number of entries must match the product of allshape
dimensions.- Throws:
IllegalArgumentException
- If the number of entries does not equal the product of dimensions in theshape
.
-
-
Method Details
-
makeRealTensor
-
min
public double min()Description copied from interface:TensorPropertiesMixin
Finds the minimum value in this tensor. If this tensor is complex, then this method finds the smallest value in magnitude.- Specified by:
min
in interfaceTensorPropertiesMixin
- Returns:
- The minimum value (smallest in magnitude for a complex valued tensor) in this tensor.
-
max
public double max()Description copied from interface:TensorPropertiesMixin
Finds the maximum value in this tensor. If this tensor is complex, then this method finds the largest value in magnitude.- Specified by:
max
in interfaceTensorPropertiesMixin
- Returns:
- The maximum value (largest in magnitude for a complex valued tensor) in this tensor.
-
minAbs
public double minAbs()Description copied from interface:TensorPropertiesMixin
Finds the minimum value, in absolute value, in this tensor. If this tensor is complex, then this method is equivalent toTensorPropertiesMixin.min()
.- Specified by:
minAbs
in interfaceTensorPropertiesMixin
- Returns:
- The minimum value, in absolute value, in this tensor.
-
maxAbs
public double maxAbs()Description copied from interface:TensorPropertiesMixin
Finds the maximum value, in absolute value, in this tensor. If this tensor is complex, then this method is equivalent toTensorPropertiesMixin.max()
.- Specified by:
maxAbs
in interfaceTensorPropertiesMixin
- Returns:
- The maximum value, in absolute value, in this tensor.
-
argMin
public int[] argMin()Finds the indices of the minimum value in this tensor.- Specified by:
argMin
in interfaceTensorPropertiesMixin
- Returns:
- The indices of the minimum value in this tensor. If this value occurs multiple times, the indices of the first entry (in row-major ordering) are returned.
-
argMax
public int[] argMax()Finds the indices of the maximum value in this tensor.- Specified by:
argMax
in interfaceTensorPropertiesMixin
- Returns:
- The indices of the maximum value in this tensor. If this value occurs multiple times, the indices of the first entry (in row-major ordering) are returned.
-
isZeros
public boolean isZeros()Description copied from interface:TensorComparisonsMixin
Checks if this tensor only contains zeros.- Specified by:
isZeros
in interfaceTensorComparisonsMixin
- Returns:
- True if this tensor only contains zeros. Otherwise, returns false.
-
isOnes
public boolean isOnes()Description copied from interface:TensorComparisonsMixin
Checks if this tensor only contains ones.- Specified by:
isOnes
in interfaceTensorComparisonsMixin
- Returns:
- True if this tensor only contains ones. Otherwise, returns false.
-
hashCode
public int hashCode()Creates a hashcode for this matrix. Note, method addsArrays.hashCode(double[])
applied on the underlying data array and the underlying shape array. -
isReal
public boolean isReal()Checks if this tensor has only real valued entries.- Specified by:
isReal
in interfaceComplexTensorMixin<T extends ComplexDenseTensorBase<T,
Y>, Y extends RealDenseTensorBase<Y, T>> - Returns:
- True if this tensor contains NO complex entries. Otherwise, returns false.
-
isComplex
public boolean isComplex()Checks if this tensor contains at least one complex entry.- Specified by:
isComplex
in interfaceComplexTensorMixin<T extends ComplexDenseTensorBase<T,
Y>, Y extends RealDenseTensorBase<Y, T>> - Returns:
- True if this tensor contains at least one complex entry. Otherwise, returns false.
-
set
Sets an index of this tensor to a specified value.- Specified by:
set
in interfaceTensorManipulationsMixin<T extends ComplexDenseTensorBase<T,
Y>> - Parameters:
value
- Value to set.indices
- The indices of this tensor for which to set the value.- Returns:
- A reference to this tensor.
-
set
Sets an index of this tensor to a specified value.- Specified by:
set
in interfaceComplexTensorMixin<T extends ComplexDenseTensorBase<T,
Y>, Y extends RealDenseTensorBase<Y, T>> - Parameters:
value
- Value to set.indices
- The indices of this tensor for which to set the value.- Returns:
- A reference to this tensor.
-
get
Gets the element in this tensor at the specified indices.- Specified by:
get
in interfaceTensorOperationsMixin<T extends ComplexDenseTensorBase<T,
Y>, T extends ComplexDenseTensorBase<T, Y>, T extends ComplexDenseTensorBase<T, Y>, T extends ComplexDenseTensorBase<T, Y>, Y extends RealDenseTensorBase<Y, T>, 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.
-
toReal
Converts a complex tensor to a real matrix. The imaginary component of any complex value will be ignored.- Specified by:
toReal
in interfaceComplexTensorMixin<T extends ComplexDenseTensorBase<T,
Y>, Y extends RealDenseTensorBase<Y, T>> - Returns:
- A tensor of the same size containing only the real components of this tensor.
- See Also:
-
toRealSafe
Converts a complex tensor to a real matrix safely. That is, first checks if the tensor only contains real values and then converts to a real tensor. However, if non-real value exist, then an error is thrown.- Specified by:
toRealSafe
in interfaceComplexTensorMixin<T extends ComplexDenseTensorBase<T,
Y>, Y extends RealDenseTensorBase<Y, T>> - Returns:
- A tensor of the same size containing only the real components of this tensor.
- Throws:
RuntimeException
- If this tensor contains at least one non-real value.- See Also:
-
copy
Creates a deep copy of this tensor.- Specified by:
copy
in interfaceTensorOperationsMixin<T extends ComplexDenseTensorBase<T,
Y>, T extends ComplexDenseTensorBase<T, Y>, T extends ComplexDenseTensorBase<T, Y>, T extends ComplexDenseTensorBase<T, Y>, Y extends RealDenseTensorBase<Y, T>, CNumber> - Returns:
- A deep copy of this tensor.
-
recip
Computes the reciprocals, element-wise, of a tensor.- Specified by:
recip
in interfaceTensorOperationsMixin<T extends ComplexDenseTensorBase<T,
Y>, T extends ComplexDenseTensorBase<T, Y>, T extends ComplexDenseTensorBase<T, Y>, T extends ComplexDenseTensorBase<T, Y>, Y extends RealDenseTensorBase<Y, T>, CNumber> - Returns:
- A tensor containing the reciprocal elements of this tensor.
- Throws:
ArithmeticException
- If this tensor contains any zeros.
-
sum
Sums together all entries in the tensor.- Specified by:
sum
in interfaceTensorOperationsMixin<T extends ComplexDenseTensorBase<T,
Y>, T extends ComplexDenseTensorBase<T, Y>, T extends ComplexDenseTensorBase<T, Y>, T extends ComplexDenseTensorBase<T, Y>, Y extends RealDenseTensorBase<Y, T>, CNumber> - Returns:
- The sum of all entries in this tensor.
-
sqrt
Computes the element-wise square root of a tensor.- Specified by:
sqrt
in interfaceTensorOperationsMixin<T extends ComplexDenseTensorBase<T,
Y>, T extends ComplexDenseTensorBase<T, Y>, T extends ComplexDenseTensorBase<T, Y>, T extends ComplexDenseTensorBase<T, Y>, Y extends RealDenseTensorBase<Y, T>, CNumber> - Returns:
- The result of applying an element-wise square root to this tensor. Note, this method will compute the principle square root i.e. the square root with positive real part.
-
abs
Computes the element-wise absolute value/magnitude of a tensor. If the tensor contains complex values, the magnitude will be computed.- Specified by:
abs
in interfaceTensorOperationsMixin<T extends ComplexDenseTensorBase<T,
Y>, T extends ComplexDenseTensorBase<T, Y>, T extends ComplexDenseTensorBase<T, Y>, T extends ComplexDenseTensorBase<T, Y>, Y extends RealDenseTensorBase<Y, T>, CNumber> - Returns:
- The result of applying an element-wise absolute value/magnitude to this tensor.
-
conj
Computes the complex conjugate of a tensor.- Specified by:
conj
in interfaceComplexTensorMixin<T extends ComplexDenseTensorBase<T,
Y>, Y extends RealDenseTensorBase<Y, T>> - Returns:
- The complex conjugate of this tensor.
-
add
Computes the element-wise addition between two tensors of the same rank.- Specified by:
add
in interfaceTensorOperationsMixin<T extends ComplexDenseTensorBase<T,
Y>, T extends ComplexDenseTensorBase<T, Y>, T extends ComplexDenseTensorBase<T, Y>, T extends ComplexDenseTensorBase<T, Y>, Y extends RealDenseTensorBase<Y, T>, 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.
-
add
Adds specified value to all entries of this tensor.- Specified by:
add
in interfaceTensorOperationsMixin<T extends ComplexDenseTensorBase<T,
Y>, T extends ComplexDenseTensorBase<T, Y>, T extends ComplexDenseTensorBase<T, Y>, T extends ComplexDenseTensorBase<T, Y>, Y extends RealDenseTensorBase<Y, T>, 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<T extends ComplexDenseTensorBase<T,
Y>, T extends ComplexDenseTensorBase<T, Y>, T extends ComplexDenseTensorBase<T, Y>, T extends ComplexDenseTensorBase<T, Y>, Y extends RealDenseTensorBase<Y, T>, 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 interfaceTensorOperationsMixin<T extends ComplexDenseTensorBase<T,
Y>, T extends ComplexDenseTensorBase<T, Y>, T extends ComplexDenseTensorBase<T, Y>, T extends ComplexDenseTensorBase<T, Y>, Y extends RealDenseTensorBase<Y, T>, 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.
-
sub
Adds specified value to all entries of this tensor.- Specified by:
sub
in interfaceTensorOperationsMixin<T extends ComplexDenseTensorBase<T,
Y>, T extends ComplexDenseTensorBase<T, Y>, T extends ComplexDenseTensorBase<T, Y>, T extends ComplexDenseTensorBase<T, Y>, Y extends RealDenseTensorBase<Y, T>, 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<T extends ComplexDenseTensorBase<T,
Y>, T extends ComplexDenseTensorBase<T, Y>, T extends ComplexDenseTensorBase<T, Y>, T extends ComplexDenseTensorBase<T, Y>, Y extends RealDenseTensorBase<Y, T>, 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.
-
mult
Computes scalar multiplication of a tensor.- Specified by:
mult
in interfaceTensorOperationsMixin<T extends ComplexDenseTensorBase<T,
Y>, T extends ComplexDenseTensorBase<T, Y>, T extends ComplexDenseTensorBase<T, Y>, T extends ComplexDenseTensorBase<T, Y>, Y extends RealDenseTensorBase<Y, T>, CNumber> - Parameters:
factor
- Scalar value to multiply with tensor.- Returns:
- The result of multiplying this tensor by the specified scalar.
-
mult
Computes scalar multiplication of a tensor.- Specified by:
mult
in interfaceTensorOperationsMixin<T extends ComplexDenseTensorBase<T,
Y>, T extends ComplexDenseTensorBase<T, Y>, T extends ComplexDenseTensorBase<T, Y>, T extends ComplexDenseTensorBase<T, Y>, Y extends RealDenseTensorBase<Y, T>, CNumber> - Parameters:
factor
- Scalar value to multiply with tensor.- Returns:
- The result of multiplying this tensor by the specified scalar.
-
div
Computes the scalar division of a tensor.- Specified by:
div
in interfaceTensorOperationsMixin<T extends ComplexDenseTensorBase<T,
Y>, T extends ComplexDenseTensorBase<T, Y>, T extends ComplexDenseTensorBase<T, Y>, T extends ComplexDenseTensorBase<T, Y>, Y extends RealDenseTensorBase<Y, T>, CNumber> - Parameters:
divisor
- The scalar value to divide tensor by.- Returns:
- The result of dividing this tensor by the specified scalar.
- Throws:
ArithmeticException
- If divisor is zero.
-
div
Computes the scalar division of a tensor.- Specified by:
div
in interfaceTensorOperationsMixin<T extends ComplexDenseTensorBase<T,
Y>, T extends ComplexDenseTensorBase<T, Y>, T extends ComplexDenseTensorBase<T, Y>, T extends ComplexDenseTensorBase<T, Y>, Y extends RealDenseTensorBase<Y, T>, CNumber> - Parameters:
divisor
- The scalar value to divide tensor by.- Returns:
- The result of dividing this tensor by the specified scalar.
- Throws:
ArithmeticException
- If divisor is zero.
-
elemMult
Computes the element-wise multiplication between two tensors.- Specified by:
elemMult
in interfaceTensorOperationsMixin<T extends ComplexDenseTensorBase<T,
Y>, T extends ComplexDenseTensorBase<T, Y>, T extends ComplexDenseTensorBase<T, Y>, T extends ComplexDenseTensorBase<T, Y>, Y extends RealDenseTensorBase<Y, T>, CNumber> - 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.
-
elemDiv
Computes the element-wise division between two tensors.- Specified by:
elemDiv
in interfaceTensorOperationsMixin<T extends ComplexDenseTensorBase<T,
Y>, T extends ComplexDenseTensorBase<T, Y>, T extends ComplexDenseTensorBase<T, Y>, T extends ComplexDenseTensorBase<T, Y>, Y extends RealDenseTensorBase<Y, T>, CNumber> - Parameters:
B
- Tensor to element-wise divide with this tensor.- Returns:
- The result of the element-wise tensor division.
- Throws:
IllegalArgumentException
- If the tensors do not have the same shape.
-
addEq
Computes the element-wise subtraction of two tensors of the same rank and stores the result in this tensor.- Specified by:
addEq
in classDenseTensorBase<T extends ComplexDenseTensorBase<T,
Y>, T extends ComplexDenseTensorBase<T, Y>, Y extends RealDenseTensorBase<Y, T>, CNumber[], CNumber> - Parameters:
B
- Second tensor in the subtraction.- Throws:
IllegalArgumentException
- If this tensor and B have different shapes.
-
addEq
Subtracts a specified value from all entries of this tensor and stores the result in this tensor.- Specified by:
addEq
in interfaceDenseMixin<T extends ComplexDenseTensorBase<T,
Y>> - Parameters:
b
- Value to subtract from all entries of this tensor.
-
addEq
Subtracts a specified value from all entries of this tensor and stores the result in this tensor.- Specified by:
addEq
in interfaceDenseMixin<T extends ComplexDenseTensorBase<T,
Y>> - Parameters:
b
- Value to subtract from all entries of this tensor.
-
subEq
Computes the element-wise subtraction of two tensors of the same rank and stores the result in this tensor.- Specified by:
subEq
in classDenseTensorBase<T extends ComplexDenseTensorBase<T,
Y>, T extends ComplexDenseTensorBase<T, Y>, Y extends RealDenseTensorBase<Y, T>, CNumber[], CNumber> - Parameters:
B
- Second tensor in the subtraction.- Throws:
IllegalArgumentException
- If this tensor and B have different shapes.
-
subEq
Subtracts a specified value from all entries of this tensor and stores the result in this tensor.- Specified by:
subEq
in interfaceDenseMixin<T extends ComplexDenseTensorBase<T,
Y>> - Parameters:
b
- Value to subtract from all entries of this tensor.
-
subEq
Subtracts a specified value from all entries of this tensor and stores the result in this tensor.- Specified by:
subEq
in interfaceDenseMixin<T extends ComplexDenseTensorBase<T,
Y>> - Parameters:
b
- Value to subtract from all entries of 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<T extends ComplexDenseTensorBase<T,
Y>> - Parameters:
shape
- 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.
-
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<T extends ComplexDenseTensorBase<T,
Y>> - Parameters:
shape
- 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.
-
round
Description copied from interface:TensorManipulationsMixin
Rounds each entry of this tensor to the nearest whole number.- Specified by:
round
in interfaceTensorManipulationsMixin<T extends ComplexDenseTensorBase<T,
Y>> - Returns:
- A copy of this tensor with each entry rounded to the nearest whole number.
- See Also:
-
round
Description copied from interface:TensorManipulationsMixin
Rounds each entry in this tensor to the nearest whole number.- Specified by:
round
in interfaceTensorManipulationsMixin<T extends ComplexDenseTensorBase<T,
Y>> - Parameters:
precision
- The number of decimal places to round to. This value must be non-negative.- Returns:
- A copy of this matrix with rounded values.
- See Also:
-
roundToZero
Description copied from interface:TensorManipulationsMixin
Rounds values in this tensor which are close to zero in absolute value to zero. If the matrix is complex, both the real and imaginary components will be rounded independently. By default, the values must be within 1.0*E^-12 of zero. To specify a threshold value seeTensorManipulationsMixin.roundToZero(double)
.- Specified by:
roundToZero
in interfaceTensorManipulationsMixin<T extends ComplexDenseTensorBase<T,
Y>> - Returns:
- A copy of this matrix with rounded values.
- See Also:
-
roundToZero
Description copied from interface:TensorManipulationsMixin
Rounds values which are close to zero in absolute value to zero. If the matrix is complex, both the real and imaginary components will be rounded independently.- Specified by:
roundToZero
in interfaceTensorManipulationsMixin<T extends ComplexDenseTensorBase<T,
Y>> - Parameters:
threshold
- Threshold for rounding values to zero. That is, if a value in this matrix is less than the threshold in absolute value then it will be rounded to zero. This value must be non-negative.- Returns:
- A copy of this matrix with rounded values.
- See Also:
-
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<T extends ComplexDenseTensorBase<T,
Y>, T extends ComplexDenseTensorBase<T, Y>, T extends ComplexDenseTensorBase<T, Y>, T extends ComplexDenseTensorBase<T, Y>, Y extends RealDenseTensorBase<Y, T>, 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:
-