Exemplo n.º 1
0
  /**
   * {@inheritDoc}
   *
   * <p>All {@code variables} must be of type {@link Discrete}. The domain of the returned variable
   * will be a {@link JointDiscreteDomain} with the subdomains in the same order as {@code
   * variables}.
   */
  @Internal
  @Override
  public Variable createJointNoFactors(Variable... variables) {
    final boolean thisIsFirst = (variables[0] == this);
    final int dimensions = thisIsFirst ? variables.length : variables.length + 1;
    final DiscreteDomain[] domains = new DiscreteDomain[dimensions];
    final IDatum[] subdomainPriors = new IDatum[dimensions];
    domains[0] = getDomain();
    subdomainPriors[0] = getPrior();

    for (int i = thisIsFirst ? 1 : 0; i < dimensions; ++i) {
      final Discrete var = variables[i].asDiscreteVariable();
      domains[i] = var.getDomain();
      subdomainPriors[i] = var.getPrior();
    }

    final JointDiscreteDomain<?> jointDomain = DiscreteDomain.joint(domains);
    final Discrete jointVar = new Discrete(jointDomain);
    jointVar.setPrior(joinPriors(jointDomain, subdomainPriors));
    return jointVar;
  }
Exemplo n.º 2
0
 @Deprecated
 @Override
 public void setFixedValueObject(@Nullable Object value) {
   setPrior(value != null ? Value.createWithIndex(getDomain(), (Integer) value) : null);
 }
Exemplo n.º 3
0
 /** @deprecated use {@link #setPrior} instead. */
 @Deprecated
 public void setFixedValue(Object fixedValue) {
   setPrior(Value.create(getDomain(), fixedValue));
 }
Exemplo n.º 4
0
 /** @deprecated use {@link #setPriorIndex(int)} instead. */
 @Deprecated
 public void setFixedValueIndex(int fixedValueIndex) {
   setPrior(Value.createWithIndex(getDomain(), fixedValueIndex));
 }
Exemplo n.º 5
0
 /** @deprecated use {@link #setPrior(double...)} instead */
 @Deprecated
 public void setInput(@Nullable double... value) {
   setPrior(value);
 }