**julia posted on 08-13-2009 5:13 AM**

Hi

I am trying to add a factor to infer.net but it seems that I am missing something.

1) In Factor.cs I have added

public static double MyFactor (double a, double b, double c) { return (a-b)*(a+b-c) ; }

2) I created a file MyFactorVmpOp.cs containing

namespace MicrosoftResearch.Infer.Factors {

[ FactorMethod ( typeof(Factor), "MyFactor", typeof(double), typeof(double), typeof(double) ) ]

public static class MyFactorVmpOp {

public static Gaussian MyFactorAverageLogarithm( Gaussian A, Gaussian B, Gaussian C ){ };

public static Gaussian AAverageLogarithm( Gaussian MyFactor, Gaussian B, Gaussian C ){ };

public static Gaussian BAverageLogarithm( Gaussian MyFactor, Gaussian A, Gaussian C ){ };

public static Gaussian CAverageLogarithm( Gaussian MyFactor, Gaussian A, Gaussian B ){ };

}

}

3) In the file containing the main script, I have added the line

[assembly: MicrosoftResearch.Infer.Factors.HasMessageFunctions]

4) I call the factor using

Variable<double> x = Variable<double>.Factor(Factor.MyFactor, x,y,w);

but at compilation it says 'MicrosoftResearch.Factors.Factor' does not contain a definition for 'MyFactor'

It seems that it doesn't take into account the change in Factor.cs. I have read the help on that subject but there doesn't seem to be anything else to do... any idea?

Thanks, Julia