jsci.physics.relativity
Class Rank1Tensor
- java.lang.Object
-
- jsci.physics.relativity.Tensor
-
- jsci.physics.relativity.Rank1Tensor
-
- All Implemented Interfaces:
- java.io.Serializable, Member
public class Rank1Tensor extends Tensor
The Rank1Tensor class encapsulates 1st rank tensors.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description Rank1Tensor()Constructs a 1st rank tensor.Rank1Tensor(double s, Double3Vector v)Constructs a 1st rank tensor.Rank1Tensor(double s, double v1, double v2, double v3)Constructs a 1st rank tensor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description Rank1Tensoradd(Rank1Tensor t)Returns the addition of this tensor and another.booleanequals(java.lang.Object a)Compares two tensors for equality.doublegetComponent(int i)Returns a component of this tensor.inthashCode()Returns a hashcode for this tensor.doublenorm()Returns the norm (invariant).voidsetComponent(int i, double x)Sets the value of a component of this tensor.Rank1Tensorsubtract(Rank1Tensor t)Returns the subtraction of this tensor by another.Rank2TensortensorProduct(Rank1Tensor t)Returns the tensor product of this tensor and another.Rank3TensortensorProduct(Rank2Tensor t)Returns the tensor product of this tensor and another.Rank4TensortensorProduct(Rank3Tensor t)Returns the tensor product of this tensor and another.java.lang.StringtoString()Returns a comma delimited string representing the value of this tensor.
-
-
-
Constructor Detail
-
Rank1Tensor
public Rank1Tensor()
Constructs a 1st rank tensor.
-
Rank1Tensor
public Rank1Tensor(double s, Double3Vector v)Constructs a 1st rank tensor.- Parameters:
s- a scalarv- a 3-vector
-
Rank1Tensor
public Rank1Tensor(double s, double v1, double v2, double v3)Constructs a 1st rank tensor.- Parameters:
s- a scalarv1- 1st 3-vector componentv2- 2nd 3-vector componentv3- 3rd 3-vector component
-
-
Method Detail
-
equals
public boolean equals(java.lang.Object a)
Compares two tensors for equality.- Overrides:
equalsin classjava.lang.Object- Parameters:
a- a 1st rank tensor
-
toString
public java.lang.String toString()
Returns a comma delimited string representing the value of this tensor.- Overrides:
toStringin classjava.lang.Object
-
hashCode
public int hashCode()
Returns a hashcode for this tensor.- Overrides:
hashCodein classjava.lang.Object
-
getComponent
public double getComponent(int i)
Returns a component of this tensor.- Parameters:
i- 1st index- Throws:
DimensionException- If attempting to access an invalid component.
-
setComponent
public void setComponent(int i, double x)Sets the value of a component of this tensor.- Parameters:
i- 1st indexx- value- Throws:
DimensionException- If attempting to access an invalid component.
-
norm
public double norm()
Returns the norm (invariant).
-
add
public Rank1Tensor add(Rank1Tensor t)
Returns the addition of this tensor and another.- Parameters:
t- a 1st rank tensor
-
subtract
public Rank1Tensor subtract(Rank1Tensor t)
Returns the subtraction of this tensor by another.- Parameters:
t- a 1st rank tensor
-
tensorProduct
public Rank2Tensor tensorProduct(Rank1Tensor t)
Returns the tensor product of this tensor and another.- Parameters:
t- a 1st rank tensor
-
tensorProduct
public Rank3Tensor tensorProduct(Rank2Tensor t)
Returns the tensor product of this tensor and another.- Parameters:
t- a 2nd rank tensor
-
tensorProduct
public Rank4Tensor tensorProduct(Rank3Tensor t)
Returns the tensor product of this tensor and another.- Parameters:
t- a 3rd rank tensor
-
-
DMelt 3.0 © DataMelt by jWork.ORG