Combination function for factors.
Combination function for factors. By default, this is product, but other operations (such as divide that is a valid operation for some semirings) can use this
Creates a new Factor of the same class with a different type and semiring
Creates a new factor of the same type
Returns a new Factor with duplicate variable(s) removed
Fill the contents of this factor by applying a rule to every combination of values.
Get the value associated with a row.
Get the value associated with a row. The row is identified by an list of indices into the ranges of the variables over which the factor is defined.
Fill the contents of the target by applying the given function to all elements of this factor.
Returns the marginalization of the factor to a variable according to the given addition function.
Returns the marginalization of the factor to a variable according to the given addition function. This involves summing out all other variables.
Returns the product of this factor with another factor according to a given multiplication function.
Returns the product of this factor with another factor according to a given multiplication function. The product is associated with all variables in the two inputs, and the value associated with an assignment is the product of the values in the two inputs.
Returns a factor that maps values of the other variables to the value of the given variable that maximizes the entry associated with that value, according to some maximization function.
Returns a factor that maps values of the other variables to the value of the given variable that maximizes the entry associated with that value, according to some maximization function. comparator defines the maximization. It returns true iff its second argument is greater than its first.
The type of element whose value is being recorded. The resulting factor maps values of other variables in this factor to this type.
Returns the summation of the factor over a variable according to an addition function.
Returns the summation of the factor over a variable according to an addition function. The result is associated with all the variables in the input except for the summed over variable and the value for a set of assignments is the sum of the values of the corresponding assignments in the input.
Produce a readable string representation of the factor
Fold the given function through the contents of the factor, beginning with the given initial values
Indicates if any of this Factor's variables has Star
Indicates if this Factor is condition/constrained
Indicates if this Factor has any variables
Set the value associated with a row.
Set the value associated with a row. The row is identified by an list of indices into the ranges of the variables over which the factor is defined.
Description that includes the variable list and conditional probabilities
Description that includes the variable list and conditional probabilities
Definition of Factor
A factor is associated with a set of variables and specifies a value for every combination of assignments to those variables.
Factors are parameterized by the type of the Variables they contain and contain a semiring that defines the mathematical operation to be performed on the values Parent variables are distinguished from the output variable.
Refactored by