/// <summary>Computations that depend on the observed value of vVector__337</summary> private void Changed_vVector__337() { if (this.Changed_vVector__337_iterationsDone == 1) { return; } this.vVector__337_marginal = new PointMass <Vector[]>(this.VVector__337); // The constant 'vVectorGaussian337' VectorGaussian vVectorGaussian337 = VectorGaussian.FromNatural(DenseVector.FromArray(new double[3] { 1547829870.0, 525077980.0, 200270.0 }), new PositiveDefiniteMatrix(new double[3, 3] { { 4254590363351.0, 1127383488860.0, 433199230.0 }, { 1127383488860.0, 482723521821.0, 146764360.0 }, { 433199230.0, 146764360.0, 56221.0 } })); this.vVector1011_marginal_F = ArrayHelper.MakeUniform <VectorGaussian>(vVectorGaussian337); // Buffer for ReplicateOp_Divide.Marginal<VectorGaussian> VectorGaussian vVector1011_rep_B_toDef = default(VectorGaussian); // Message to 'vVector1011_rep' from Replicate factor vVector1011_rep_B_toDef = ReplicateOp_Divide.ToDefInit <VectorGaussian>(vVectorGaussian337); // Message to 'vVector1011_marginal' from Variable factor this.vVector1011_marginal_F = VariableOp.MarginalAverageConditional <VectorGaussian>(vVector1011_rep_B_toDef, vVectorGaussian337, this.vVector1011_marginal_F); DistributionStructArray <Gaussian, double> vdouble__1011_F = default(DistributionStructArray <Gaussian, double>); // Create array for 'vdouble__1011' Forwards messages. vdouble__1011_F = new DistributionStructArray <Gaussian, double>(1); for (int index337 = 0; index337 < 1; index337++) { vdouble__1011_F[index337] = Gaussian.Uniform(); } DistributionStructArray <Gaussian, double> vdouble__1012_F = default(DistributionStructArray <Gaussian, double>); // Create array for 'vdouble__1012' Forwards messages. vdouble__1012_F = new DistributionStructArray <Gaussian, double>(1); for (int index337 = 0; index337 < 1; index337++) { vdouble__1012_F[index337] = Gaussian.Uniform(); } DistributionRefArray <VectorGaussian, Vector> vVector1011_rep_F = default(DistributionRefArray <VectorGaussian, Vector>); DistributionRefArray <VectorGaussian, Vector> vVector1011_rep_B = default(DistributionRefArray <VectorGaussian, Vector>); // Create array for 'vVector1011_rep' Forwards messages. vVector1011_rep_F = new DistributionRefArray <VectorGaussian, Vector>(1); // Create array for 'vVector1011_rep' Backwards messages. vVector1011_rep_B = new DistributionRefArray <VectorGaussian, Vector>(1); for (int index337 = 0; index337 < 1; index337++) { vVector1011_rep_B[index337] = ArrayHelper.MakeUniform <VectorGaussian>(vVectorGaussian337); vVector1011_rep_F[index337] = ArrayHelper.MakeUniform <VectorGaussian>(vVectorGaussian337); } // Buffer for ReplicateOp_Divide.UsesAverageConditional<VectorGaussian> VectorGaussian vVector1011_rep_F_marginal = default(VectorGaussian); // Message to 'vVector1011_rep' from Replicate factor vVector1011_rep_F_marginal = ReplicateOp_Divide.MarginalInit <VectorGaussian>(vVectorGaussian337); // Message to 'vVector1011_rep' from Replicate factor vVector1011_rep_F_marginal = ReplicateOp_Divide.Marginal <VectorGaussian>(vVector1011_rep_B_toDef, vVectorGaussian337, vVector1011_rep_F_marginal); // Buffer for InnerProductOp.InnerProductAverageConditional // Create array for replicates of 'vVector1011_rep_F_index337__AMean' Vector[] vVector1011_rep_F_index337__AMean = new Vector[1]; for (int index337 = 0; index337 < 1; index337++) { // Message to 'vdouble__1012' from InnerProduct factor vVector1011_rep_F_index337__AMean[index337] = InnerProductOp.AMeanInit(vVector1011_rep_F[index337]); } // Buffer for InnerProductOp.AMean // Create array for replicates of 'vVector1011_rep_F_index337__AVariance' PositiveDefiniteMatrix[] vVector1011_rep_F_index337__AVariance = new PositiveDefiniteMatrix[1]; for (int index337 = 0; index337 < 1; index337++) { // Message to 'vdouble__1012' from InnerProduct factor vVector1011_rep_F_index337__AVariance[index337] = InnerProductOp.AVarianceInit(vVector1011_rep_F[index337]); // Message to 'vVector1011_rep' from Replicate factor vVector1011_rep_F[index337] = ReplicateOp_Divide.UsesAverageConditional <VectorGaussian>(vVector1011_rep_B[index337], vVector1011_rep_F_marginal, index337, vVector1011_rep_F[index337]); } // Create array for 'vdouble__1012_marginal' Forwards messages. this.vdouble__1012_marginal_F = new DistributionStructArray <Gaussian, double>(1); for (int index337 = 0; index337 < 1; index337++) { this.vdouble__1012_marginal_F[index337] = Gaussian.Uniform(); } // Message from use of 'vdouble__1012' DistributionStructArray <Gaussian, double> vdouble__1012_use_B = default(DistributionStructArray <Gaussian, double>); // Create array for 'vdouble__1012_use' Backwards messages. vdouble__1012_use_B = new DistributionStructArray <Gaussian, double>(1); for (int index337 = 0; index337 < 1; index337++) { vdouble__1012_use_B[index337] = Gaussian.Uniform(); // Message to 'vdouble__1012' from InnerProduct factor vVector1011_rep_F_index337__AVariance[index337] = InnerProductOp.AVariance(vVector1011_rep_F[index337], vVector1011_rep_F_index337__AVariance[index337]); // Message to 'vdouble__1012' from InnerProduct factor vVector1011_rep_F_index337__AMean[index337] = InnerProductOp.AMean(vVector1011_rep_F[index337], vVector1011_rep_F_index337__AVariance[index337], vVector1011_rep_F_index337__AMean[index337]); // Message to 'vdouble__1012' from InnerProduct factor vdouble__1012_F[index337] = InnerProductOp.InnerProductAverageConditional(vVector1011_rep_F_index337__AMean[index337], vVector1011_rep_F_index337__AVariance[index337], this.VVector__337[index337]); // Message to 'vdouble__1012_marginal' from DerivedVariable factor this.vdouble__1012_marginal_F[index337] = DerivedVariableOp.MarginalAverageConditional <Gaussian>(vdouble__1012_use_B[index337], vdouble__1012_F[index337], this.vdouble__1012_marginal_F[index337]); } // Create array for 'vdouble__1011_marginal' Forwards messages. this.vdouble__1011_marginal_F = new DistributionStructArray <Gaussian, double>(1); for (int index337 = 0; index337 < 1; index337++) { this.vdouble__1011_marginal_F[index337] = Gaussian.Uniform(); } // Message from use of 'vdouble__1011' DistributionStructArray <Gaussian, double> vdouble__1011_use_B = default(DistributionStructArray <Gaussian, double>); // Create array for 'vdouble__1011_use' Backwards messages. vdouble__1011_use_B = new DistributionStructArray <Gaussian, double>(1); for (int index337 = 0; index337 < 1; index337++) { vdouble__1011_use_B[index337] = Gaussian.Uniform(); // Message to 'vdouble__1011' from GaussianFromMeanAndVariance factor vdouble__1011_F[index337] = GaussianFromMeanAndVarianceOp.SampleAverageConditional(vdouble__1012_F[index337], 0.1); // Message to 'vdouble__1011_marginal' from Variable factor this.vdouble__1011_marginal_F[index337] = VariableOp.MarginalAverageConditional <Gaussian>(vdouble__1011_use_B[index337], vdouble__1011_F[index337], this.vdouble__1011_marginal_F[index337]); } this.Changed_vVector__337_iterationsDone = 1; }
/// <summary>Computations that depend on the observed value of vVector__232 and vdouble__696</summary> private void Changed_vVector__232_vdouble__696() { if (this.Changed_vVector__232_vdouble__696_iterationsDone == 1) { return; } this.vVector__232_marginal = new PointMass <Vector[]>(this.VVector__232); this.vdouble__696_marginal = new DistributionStructArray <Gaussian, double>(5622, delegate(int index232) { return(Gaussian.Uniform()); }); this.vdouble__696_marginal = Distribution.SetPoint <DistributionStructArray <Gaussian, double>, double[]>(this.vdouble__696_marginal, this.Vdouble__696); // The constant 'vVectorGaussian232' VectorGaussian vVectorGaussian232 = VectorGaussian.FromNatural(DenseVector.FromArray(new double[3] { 0.0, 0.0, 0.0 }), new PositiveDefiniteMatrix(new double[3, 3] { { 1.0, 0.0, 0.0 }, { 0.0, 1.0, 0.0 }, { 0.0, 0.0, 1.0 } })); this.vVector697_marginal_F = ArrayHelper.MakeUniform <VectorGaussian>(vVectorGaussian232); // Message from use of 'vdouble__697' DistributionStructArray <Gaussian, double> vdouble__697_use_B = default(DistributionStructArray <Gaussian, double>); // Create array for 'vdouble__697_use' Backwards messages. vdouble__697_use_B = new DistributionStructArray <Gaussian, double>(5622); for (int index232 = 0; index232 < 5622; index232++) { vdouble__697_use_B[index232] = Gaussian.Uniform(); // Message to 'vdouble__697_use' from GaussianFromMeanAndVariance factor vdouble__697_use_B[index232] = GaussianFromMeanAndVarianceOp.MeanAverageConditional(this.Vdouble__696[index232], 0.1); } DistributionRefArray <VectorGaussian, Vector> vVector697_rep_B = default(DistributionRefArray <VectorGaussian, Vector>); // Create array for 'vVector697_rep' Backwards messages. vVector697_rep_B = new DistributionRefArray <VectorGaussian, Vector>(5622); for (int index232 = 0; index232 < 5622; index232++) { vVector697_rep_B[index232] = ArrayHelper.MakeUniform <VectorGaussian>(vVectorGaussian232); // Message to 'vVector697_rep' from InnerProduct factor vVector697_rep_B[index232] = InnerProductOp.AAverageConditional(vdouble__697_use_B[index232], this.VVector__232[index232], vVector697_rep_B[index232]); } // Buffer for ReplicateOp_Divide.Marginal<VectorGaussian> VectorGaussian vVector697_rep_B_toDef = default(VectorGaussian); // Message to 'vVector697_rep' from Replicate factor vVector697_rep_B_toDef = ReplicateOp_Divide.ToDefInit <VectorGaussian>(vVectorGaussian232); // Message to 'vVector697_rep' from Replicate factor vVector697_rep_B_toDef = ReplicateOp_Divide.ToDef <VectorGaussian>(vVector697_rep_B, vVector697_rep_B_toDef); // Message to 'vVector697_marginal' from Variable factor this.vVector697_marginal_F = VariableOp.MarginalAverageConditional <VectorGaussian>(vVector697_rep_B_toDef, vVectorGaussian232, this.vVector697_marginal_F); DistributionStructArray <Gaussian, double> vdouble__697_F = default(DistributionStructArray <Gaussian, double>); // Create array for 'vdouble__697' Forwards messages. vdouble__697_F = new DistributionStructArray <Gaussian, double>(5622); for (int index232 = 0; index232 < 5622; index232++) { vdouble__697_F[index232] = Gaussian.Uniform(); } DistributionRefArray <VectorGaussian, Vector> vVector697_rep_F = default(DistributionRefArray <VectorGaussian, Vector>); // Create array for 'vVector697_rep' Forwards messages. vVector697_rep_F = new DistributionRefArray <VectorGaussian, Vector>(5622); for (int index232 = 0; index232 < 5622; index232++) { vVector697_rep_F[index232] = ArrayHelper.MakeUniform <VectorGaussian>(vVectorGaussian232); } // Buffer for ReplicateOp_Divide.UsesAverageConditional<VectorGaussian> VectorGaussian vVector697_rep_F_marginal = default(VectorGaussian); // Message to 'vVector697_rep' from Replicate factor vVector697_rep_F_marginal = ReplicateOp_Divide.MarginalInit <VectorGaussian>(vVectorGaussian232); // Message to 'vVector697_rep' from Replicate factor vVector697_rep_F_marginal = ReplicateOp_Divide.Marginal <VectorGaussian>(vVector697_rep_B_toDef, vVectorGaussian232, vVector697_rep_F_marginal); // Buffer for InnerProductOp.InnerProductAverageConditional // Create array for replicates of 'vVector697_rep_F_index232__AMean' Vector[] vVector697_rep_F_index232__AMean = new Vector[5622]; for (int index232 = 0; index232 < 5622; index232++) { // Message to 'vdouble__697' from InnerProduct factor vVector697_rep_F_index232__AMean[index232] = InnerProductOp.AMeanInit(vVector697_rep_F[index232]); } // Buffer for InnerProductOp.AMean // Create array for replicates of 'vVector697_rep_F_index232__AVariance' PositiveDefiniteMatrix[] vVector697_rep_F_index232__AVariance = new PositiveDefiniteMatrix[5622]; for (int index232 = 0; index232 < 5622; index232++) { // Message to 'vdouble__697' from InnerProduct factor vVector697_rep_F_index232__AVariance[index232] = InnerProductOp.AVarianceInit(vVector697_rep_F[index232]); // Message to 'vVector697_rep' from Replicate factor vVector697_rep_F[index232] = ReplicateOp_Divide.UsesAverageConditional <VectorGaussian>(vVector697_rep_B[index232], vVector697_rep_F_marginal, index232, vVector697_rep_F[index232]); } // Create array for 'vdouble__697_marginal' Forwards messages. this.vdouble__697_marginal_F = new DistributionStructArray <Gaussian, double>(5622); for (int index232 = 0; index232 < 5622; index232++) { this.vdouble__697_marginal_F[index232] = Gaussian.Uniform(); // Message to 'vdouble__697' from InnerProduct factor vVector697_rep_F_index232__AVariance[index232] = InnerProductOp.AVariance(vVector697_rep_F[index232], vVector697_rep_F_index232__AVariance[index232]); // Message to 'vdouble__697' from InnerProduct factor vVector697_rep_F_index232__AMean[index232] = InnerProductOp.AMean(vVector697_rep_F[index232], vVector697_rep_F_index232__AVariance[index232], vVector697_rep_F_index232__AMean[index232]); // Message to 'vdouble__697' from InnerProduct factor vdouble__697_F[index232] = InnerProductOp.InnerProductAverageConditional(vVector697_rep_F_index232__AMean[index232], vVector697_rep_F_index232__AVariance[index232], this.VVector__232[index232]); // Message to 'vdouble__697_marginal' from DerivedVariable factor this.vdouble__697_marginal_F[index232] = DerivedVariableOp.MarginalAverageConditional <Gaussian>(vdouble__697_use_B[index232], vdouble__697_F[index232], this.vdouble__697_marginal_F[index232]); } this.Changed_vVector__232_vdouble__696_iterationsDone = 1; }