|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.jstacs.algorithms.graphs.tensor.Tensor
de.jstacs.algorithms.graphs.tensor.AsymmetricTensor
public class AsymmetricTensor
This class can be used for Tensor
s which are not symmetric, as
opposed to the symmetry defined in SymmetricTensor
.
Tensor
,
SymmetricTensor
Field Summary | |
---|---|
protected double[][][] |
tensor
The internal tensor. |
Fields inherited from class de.jstacs.algorithms.graphs.tensor.Tensor |
---|
L, order, powers |
Constructor Summary | |
---|---|
AsymmetricTensor(double[][][] asym_tensor,
int n,
byte k)
This constructor creates and checks a filled asymmetric tensor with given dimension. |
|
AsymmetricTensor(int n,
byte k)
This constructor creates an empty asymmetric tensor with given dimension. |
Method Summary | |
---|---|
int[] |
getMaximalEdgeFor(byte k,
int child,
int... parents)
Returns the edge permute(parents[0],... |
double |
getRootValue(int child)
Returns the value for child as root. |
double |
getValue(byte k,
int child,
int... parents)
Returns the value for the edge parents[0],... |
void |
resetValue(byte k,
int child,
int... parents)
Sets the value for the edge parents[0],... |
void |
setRootValue(int child,
double val)
Sets the value val for the root node child . |
void |
setValue(byte k,
double val,
int child,
int... parents)
Sets the value for the edge parents[0],... |
Methods inherited from class de.jstacs.algorithms.graphs.tensor.Tensor |
---|
getAsymIndex, getNumberOfNodes, getOrder, readTensorFromFile, toDouble3DArray, writeTensorToFile |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected double[][][] tensor
Constructor Detail |
---|
public AsymmetricTensor(int n, byte k)
n
- the number of nodesk
- the orderTensor.Tensor(int, byte)
public AsymmetricTensor(double[][][] asym_tensor, int n, byte k) throws IllegalArgumentException
asym_tensor
- the tensor weightsn
- the number of nodesk
- the order
IllegalArgumentException
- if n
< 0 or k
< 1 or the
given tensor has a wrong dimensionTensor.Tensor(int, byte)
Method Detail |
---|
public int[] getMaximalEdgeFor(byte k, int child, int... parents)
Tensor
permute(parents[0],...,parents[k-1]) -> child
that maximizes
the score.
getMaximalEdgeFor
in class Tensor
k
- the number of parents to be usedchild
- the child nodeparents
- the parent nodes (only the first k
will be used)
permute(parents[0],...,parents[k-1]) -> child
that
maximizes the scorepublic double getRootValue(int child)
Tensor
child
as root.
getRootValue
in class Tensor
child
- the name of the node
public double getValue(byte k, int child, int... parents)
Tensor
parents[0],...,parents[k-1] -> child
.
getValue
in class Tensor
k
- the number of parents to be usedchild
- the child nodeparents
- the parent nodes (only the first k
will be used)
parents[0],...,parents[k-1] -> child
public void setRootValue(int child, double val)
Tensor
val
for the root node child
.
setRootValue
in class Tensor
child
- the name of the nodeval
- the value for the nodepublic void setValue(byte k, double val, int child, int... parents)
Tensor
parents[0],...,parents[k-1] -> child
.
setValue
in class Tensor
k
- the number of parents to be usedval
- the new valuechild
- the child nodeparents
- the parent nodes (only the first k
will be used)public void resetValue(byte k, int child, int... parents)
Tensor
parents[0],...,parents[k-1] -> child
to
Double.NEGATIVE_INFINITY
.
resetValue
in class Tensor
k
- the number of parents to be usedchild
- the child nodeparents
- the parent nodes (only the first k
will be used)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |