Basic triangular matrix calculator