public class Rank1Tensor extends Tensor
Modifier and Type | Field and Description |
---|---|
protected double[] |
rank1 |
Constructor and Description |
---|
Rank1Tensor()
Constructs a 1st rank tensor.
|
Rank1Tensor(double s,
double v1,
double v2,
double v3)
Constructs a 1st rank tensor.
|
Rank1Tensor(double s,
DoubleVector v)
Constructs a 1st rank tensor.
|
Modifier and Type | Method and Description |
---|---|
Rank1Tensor |
add(Rank1Tensor t)
Returns the addition of this tensor and another.
|
boolean |
equals(java.lang.Object a)
Compares two tensors for equality.
|
double |
getComponent(int i)
Returns a component of this tensor.
|
int |
hashCode()
Returns a hashcode for this tensor.
|
double |
norm()
Returns the norm (invariant).
|
void |
setComponent(int i,
double x)
Sets the value of a component of this tensor.
|
Rank1Tensor |
subtract(Rank1Tensor t)
Returns the subtraction of this tensor by another.
|
Rank2Tensor |
tensorProduct(Rank1Tensor t)
Returns the tensor product of this tensor and another.
|
Rank3Tensor |
tensorProduct(Rank2Tensor t)
Returns the tensor product of this tensor and another.
|
Rank4Tensor |
tensorProduct(Rank3Tensor t)
Returns the tensor product of this tensor and another.
|
java.lang.String |
toString()
Returns a comma delimited string representing the value of this tensor.
|
public Rank1Tensor()
public Rank1Tensor(double s, DoubleVector v)
s
- a scalarv
- a 3-vectorpublic Rank1Tensor(double s, double v1, double v2, double v3)
s
- a scalarv1
- 1st 3-vector componentv2
- 2nd 3-vector componentv3
- 3rd 3-vector componentpublic boolean equals(java.lang.Object a)
equals
in class java.lang.Object
a
- a 1st rank tensorpublic java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public double getComponent(int i)
i
- 1st indexDimensionException
- If attempting to access an invalid component.public void setComponent(int i, double x)
i
- 1st indexx
- valueDimensionException
- If attempting to access an invalid component.public double norm()
public Rank1Tensor add(Rank1Tensor t)
t
- a 1st rank tensorpublic Rank1Tensor subtract(Rank1Tensor t)
t
- a 1st rank tensorpublic Rank2Tensor tensorProduct(Rank1Tensor t)
t
- a 1st rank tensorpublic Rank3Tensor tensorProduct(Rank2Tensor t)
t
- a 2nd rank tensorpublic Rank4Tensor tensorProduct(Rank3Tensor t)
t
- a 3rd rank tensor