added a LineOptimizerMatrix for DBNs math