added ternary multiplication, with some basic inference of positive semi-definiteness, using cholesky decomposition to solve posdef linear systems