TermMatrix class.