Implementing TableFactor and TruncGaussianFactor