Get finite support

@lileicc @cberzan Here I add the methods getFiniteSupport() to each distribution. This will be used for implementing Gibbs Sampling.
I see, it makes sense.

So when you setParams, you just make it null?


On Fri, Aug 15, 2014 at 10:12 AM, Da Tang <notifications@github.com> wrote:

> In src/main/java/blog/distrib/Beta.java:
>
> > @@ -184,6 +185,12 @@ public String toString() {
> >      return "Beta(" + a + "," + b + ")";
> >    }
> >
> > +  @Override
> > +  public Object[] getFiniteSupport() {
> > +    checkHasParams();
>
> @lileicc <https://github.com/lileicc> Last time you told me to move the
> calculation outside setParams... Also, I don't think it is a good idea to
> calculate finiteSupport inside setParams, especially for distributions who
> have a huge finiteSupport, like Multinomial. Sometimes we don't need
> finiteSupport. So it is better to calculate it when never we use it, and
> then cache the finiteSupport so that we could directly return it the next
> time.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/BayesianLogic/blog/pull/295/files#r16303303>.
>