jsci.physics.relativity
Class Rank2Tensor
- java.lang.Object
-
- jsci.physics.relativity.Tensor
-
- jsci.physics.relativity.Rank2Tensor
-
- All Implemented Interfaces:
- java.io.Serializable, Member
- Direct Known Subclasses:
- EMFieldTensor, KroneckerDelta, LorentzBoost, MinkowskiMetric
public class Rank2Tensor extends Tensor
The Rank2Tensor class encapsulates 2nd rank tensors.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description Rank2Tensor()Constructs a 2nd rank tensor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description Rank2Tensoradd(Rank2Tensor t)Returns the addition of this tensor and another.booleanequals(java.lang.Object a)Compares two tensors for equality.doublegetComponent(int i, int j)Returns a component of this tensor.Rank1Tensormultiply(Rank1Tensor t)Returns the multiplication of this tensor by another.voidsetComponent(int i, int j, double x)Sets the value of a component of this tensor.Rank2Tensorsubtract(Rank2Tensor t)Returns the subtraction of this tensor by another.Rank3TensortensorProduct(Rank1Tensor t)Returns the tensor product of this tensor and another.Rank4TensortensorProduct(Rank2Tensor t)Returns the tensor product of this tensor and another.
-
-
-
Method Detail
-
equals
public boolean equals(java.lang.Object a)
Compares two tensors for equality.- Overrides:
equalsin classjava.lang.Object- Parameters:
a- a 2nd rank tensor
-
getComponent
public double getComponent(int i, int j)Returns a component of this tensor.- Parameters:
i- 1st indexj- 2nd index- Throws:
DimensionException- If attempting to access an invalid component.
-
setComponent
public void setComponent(int i, int j, double x)Sets the value of a component of this tensor.- Parameters:
i- 1st indexj- 2nd indexx- value- Throws:
DimensionException- If attempting to access an invalid component.
-
add
public Rank2Tensor add(Rank2Tensor t)
Returns the addition of this tensor and another.- Parameters:
t- a 2nd rank tensor
-
subtract
public Rank2Tensor subtract(Rank2Tensor t)
Returns the subtraction of this tensor by another.- Parameters:
t- a 2nd rank tensor
-
multiply
public Rank1Tensor multiply(Rank1Tensor t)
Returns the multiplication of this tensor by another.- Parameters:
t- a 1st rank tensor
-
tensorProduct
public Rank3Tensor tensorProduct(Rank1Tensor t)
Returns the tensor product of this tensor and another.- Parameters:
t- a 1st rank tensor
-
tensorProduct
public Rank4Tensor tensorProduct(Rank2Tensor t)
Returns the tensor product of this tensor and another.- Parameters:
t- a 2nd rank tensor
-
-
DMelt 3.0 © DataMelt by jWork.ORG