tri.sol function

Solve the linear equation (-Q-zI)w=v.