add DiscreteFactor
Merge pull request #278 from wlbksy/devel

add DiscreteFactor