All Downloads are FREE. Search and download functionalities are using the official Maven repository.

axle.pgm.DTree.scala Maven / Gradle / Ivy

The newest version!
package axle.pgm

import axle.stats.Distribution
import spire.algebra.Eq
import spire.algebra.Field

class DTreeEdge {}

class DTreeNode {}

class DTree[T: Eq, N: Field] {

  def cluster(n: DTreeNode): Set[Distribution[T, N]] = ???

  def context(n: DTreeNode): Set[Distribution[T, N]] = ???

  def isLeaf(n: DTreeNode): Boolean = ???

  // returns an order pi with width(pi,G) no greater than the width
  // of dtree rooted at t

  def toEliminationOrder(t: DTreeNode): List[Distribution[T, N]] =
    if (isLeaf(t)) {
      val ct = context(t) // Set
      cluster(t).filter(v => !ct.contains(v)).toList
    } else {
      val leftPi: List[Distribution[T, N]] = ???
      val rightPi: List[Distribution[T, N]] = ???
      // TODO merge them
      // TODO add cluster(t) - context(t) in any order to result
      Nil
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy