/// <include file='FactorDocs.xml' path='factor_docs/message_op_class[@name="IsGreaterThanOp"]/message_doc[@name="LogAverageFactor(Bernoulli, int, int)"]/*'/>
 public static double LogAverageFactor(Bernoulli isGreaterThan, int a, int b)
 {
     return(isGreaterThan.GetLogProb(Factor.IsGreaterThan(a, b)));
 }
Exemple #2
0
 /// <include file='FactorDocs.xml' path='factor_docs/message_op_class[@name="BooleanNotOp"]/message_doc[@name="LogAverageFactor(bool, bool)"]/*'/>
 public static double LogAverageFactor(bool not, bool b)
 {
     return((not == Factor.Not(b)) ? 0.0 : Double.NegativeInfinity);
 }
Exemple #3
0
 /// <include file='FactorDocs.xml' path='factor_docs/message_op_class[@name="AllTrueOp"]/message_doc[@name="LogAverageFactor(bool, IList{bool})"]/*'/>
 public static double LogAverageFactor(bool allTrue, IList <bool> array)
 {
     return((allTrue == Factor.AllTrue(array)) ? 0.0 : Double.NegativeInfinity);
 }
 /// <include file='FactorDocs.xml' path='factor_docs/message_op_class[@name="IsGreaterThanOp"]/message_doc[@name="LogAverageFactor(bool, int, int)"]/*'/>
 public static double LogAverageFactor(bool isGreaterThan, int a, int b)
 {
     return((isGreaterThan == Factor.IsGreaterThan(a, b)) ? 0.0 : Double.NegativeInfinity);
 }
Exemple #5
0
 /// <include file='FactorDocs.xml' path='factor_docs/message_op_class[@name="FastSumOp"]/message_doc[@name="LogAverageFactor(double, IList{double})"]/*'/>
 public static double LogAverageFactor(double sum, IList <double> array)
 {
     return((sum == Factor.Sum(array)) ? 0.0 : Double.NegativeInfinity);
 }
Exemple #6
0
 public static double[][] GaussianArrayArray(int sampleCount, double[] precisions, out int[][] indices)
 {
     indices = Util.ArrayInit(sampleCount, i => Util.ArrayInit(precisions.Length, j => j));
     return(Util.ArrayInit(sampleCount, i => Util.ArrayInit(precisions.Length, j => Factor.Gaussian(0, precisions[j]))));
 }
Exemple #7
0
 /// <include file='FactorDocs.xml' path='factor_docs/message_op_class[@name="BooleanAndOp"]/message_doc[@name="LogAverageFactor(Bernoulli, bool, bool)"]/*'/>
 public static double LogAverageFactor(Bernoulli and, bool a, bool b)
 {
     return(and.GetLogProb(Factor.And(a, b)));
 }
Exemple #8
0
 /// <include file='FactorDocs.xml' path='factor_docs/message_op_class[@name="BooleanAndOp"]/message_doc[@name="LogAverageFactor(bool, bool, bool)"]/*'/>
 public static double LogAverageFactor(bool and, bool a, bool b)
 {
     return((and == Factor.And(a, b)) ? 0.0 : Double.NegativeInfinity);
 }
 /// <include file='FactorDocs.xml' path='factor_docs/message_op_class[@name="IsPositiveOp"]/message_doc[@name="LogAverageFactor(bool, double)"]/*'/>
 public static double LogAverageFactor(bool isPositive, double x)
 {
     return((isPositive == Factor.IsPositive(x)) ? 0.0 : Double.NegativeInfinity);
 }