/// <summary>
        /// Creates a sparse GP point mass - i.e. all the mass is at a given function
        /// </summary>
        /// <param name="sgpf"></param>
        /// <param name="value"></param>
        /// <returns></returns>
        public static SparseGP PointMass(SparseGPFixed sgpf, IFunction value)
        {
            SparseGP sgp = new SparseGP(sgpf, false);

            sgp.Point = value;
            return(sgp);
        }
 public SparseGP(SparseGPFixed spgf, bool includePrior, VectorGaussian InducingDist, IFunction pointFunc)
 {
     fixedParameters   = spgf;
     IncludePrior      = includePrior;
     this.InducingDist = VectorGaussian.Copy(InducingDist);
     this.pointFunc    = pointFunc;
 }
        /// <summary>
        /// Sets one sparse GP to another. Everything is copied
        /// except the FixedParameters and the lsit of rank 1 potentials
        /// which are referenced.
        /// </summary>
        /// <param name="that">The sparse GP to copy</param>
        public void SetTo(SparseGP that)
        {
            fixedParameters = that.FixedParameters;
            InducingDist.SetTo(that.InducingDist);
            IncludePrior = that.IncludePrior;
            pointFunc    = that.pointFunc;

            if (that.alpha != null)
            {
                alpha = Vector.Copy(that.alpha);
            }
            else
            {
                alpha = null;
            }

            if (that.beta != null)
            {
                beta = new PositiveDefiniteMatrix(that.beta as Matrix);
            }
            else
            {
                beta = null;
            }

            if (that.meanB != null)
            {
                meanB = Vector.Copy(that.meanB);
            }
            else
            {
                meanB = null;
            }

            if (that.varBB != null)
            {
                varBB = new PositiveDefiniteMatrix(that.varBB as Matrix);
            }
            else
            {
                varBB = null;
            }
        }
 /// <summary>
 /// Creates a uniform sparse GP
 /// </summary>
 /// <param name="sgpf"></param>
 /// <returns></returns>
 public static SparseGP Uniform(SparseGPFixed sgpf)
 {
     return(new SparseGP(sgpf, false));
 }
 /// <summary>
 ///
 /// </summary>
 /// <param name="spgf">Fixed parameters</param>
 /// <param name="includePrior">Whether this instance includes the prior</param>
 public SparseGP(SparseGPFixed spgf, bool includePrior)
 {
     fixedParameters = spgf;
     InducingDist    = new VectorGaussian(spgf.NumberBasisPoints);
     IncludePrior    = includePrior;
 }
 /// <summary>
 /// Constructs sparse GP, given basis etc
 /// </summary>
 /// <param name="spgf">The fixed parameters</param>
 public SparseGP(SparseGPFixed spgf) : this(spgf, true)
 {
 }