public class Channel
extends java.lang.Object
Constructor and Description |
---|
Channel()
Constructs the empty channel.
|
Channel(int kind,
java.lang.String[] inputNames,
java.lang.String[] outputNames,
double[][] matrix)
Constructs a channel with initial values.
|
Channel(java.lang.String[] inputNames,
java.lang.String[] outputNames,
double[][] matrix)
Constructs a (basic) channel with initial values.
|
Modifier and Type | Method and Description |
---|---|
static void |
addspaces(int i)
Prints i+1 spaces.
|
static Channel |
cascade(Channel[] channels)
Returns the cascade channel (sequential composition) of given channels.
|
java.lang.String[] |
getInputNames() |
Channel |
getJointDist(ProbDist prior)
Return the joint distribution on inputs and outputs
generated by a given prior and this channel.
|
static Channel |
getJointDist(ProbDist prior,
Channel channel)
Return the joint distribution on inputs and outputs generated by prior and channel.
|
double[][] |
getMatrix()
Returns the channel matrix.
|
java.lang.String[] |
getOutputNames() |
ProbDist |
getPosteriorProbDist(ProbDist prior) |
boolean |
isWellFormed(double accuracy)
Checks whether this channel is well-formed or not.
|
int |
noOfInputs()
Returns the number of inputs.
|
int |
noOfOutputs()
Returns the number of outputs.
|
static Channel |
parallelComposition(Channel[] channels)
Calculate the channel composed in parallel.
|
static Channel |
parallelComposition(Channel[] channels,
boolean removeBrackets1,
boolean removeBrackets2)
Calculate the channel composed in parallel.
|
static java.lang.String[] |
parallelComposition(java.lang.String[] names1,
java.lang.String[] names2,
int size1,
int size2,
int size) |
static java.lang.String[] |
parallelComposition(java.lang.String[] names1,
java.lang.String[] names2,
int size1,
int size2,
int size,
boolean removeBrackets,
java.lang.String separator) |
void |
printChannel()
Prints the channel to standard out.
|
void |
printJointMatrix(ProbDist pd)
Prints the joint probability distribution obtained by a given
(prior) input probability distribution and this channel to standard out.
|
void |
setGroupForRow(int[] arg)
Sets groupForRow.
|
void |
setGroupNames(java.lang.String[] arg)
Sets the array of group names.
|
void |
setInputNames(java.lang.String[] arg)
Sets the array of input names.
|
void |
setInputsPerRow(java.util.Vector[] arg)
Sets inputsPerRow.
|
void |
setMatrix(double[][] arg)
Sets the channel matrix.
|
void |
setOutputNames(java.lang.String[] arg)
Sets the array of output names.
|
void |
setRowsForGroup(java.util.Vector[] arg)
Sets rowsForGroup.
|
public Channel()
public Channel(int kind, java.lang.String[] inputNames, java.lang.String[] outputNames, double[][] matrix)
kind
- kind of channels.inputNames
- input namesoutputNames
- output namesmatrix
- channel matrixpublic Channel(java.lang.String[] inputNames, java.lang.String[] outputNames, double[][] matrix)
inputNames
- input namesoutputNames
- output namesmatrix
- channel matrixpublic static void addspaces(int i)
i
- the number of spaces printedpublic static Channel cascade(Channel[] channels)
channels
- array of channelspublic java.lang.String[] getInputNames()
public Channel getJointDist(ProbDist prior)
prior
- prior distributionpublic static Channel getJointDist(ProbDist prior, Channel channel)
prior
- prior distributionchannel
- channelpublic double[][] getMatrix()
public java.lang.String[] getOutputNames()
public boolean isWellFormed(double accuracy)
accuracy
- possible error of the summation of each rowpublic int noOfInputs()
public int noOfOutputs()
public static Channel parallelComposition(Channel[] channels)
channels
- array of channelspublic static Channel parallelComposition(Channel[] channels, boolean removeBrackets1, boolean removeBrackets2)
channels
- array of channelspublic static java.lang.String[] parallelComposition(java.lang.String[] names1, java.lang.String[] names2, int size1, int size2, int size)
public static java.lang.String[] parallelComposition(java.lang.String[] names1, java.lang.String[] names2, int size1, int size2, int size, boolean removeBrackets, java.lang.String separator)
public void printChannel()
public void printJointMatrix(ProbDist pd)
pd
- (prior) input probability distributionpublic void setGroupForRow(int[] arg)
arg
- vector of groupForRow's.public void setGroupNames(java.lang.String[] arg)
arg
- array of group namespublic void setInputNames(java.lang.String[] arg)
arg
- array of input namespublic void setInputsPerRow(java.util.Vector[] arg)
arg
- vector of inputsPerRow's.public void setMatrix(double[][] arg)
arg
- channel matrixpublic void setOutputNames(java.lang.String[] arg)
arg
- array of output namespublic void setRowsForGroup(java.util.Vector[] arg)
arg
- vector of rowsForGroup's.