write, compile triangular deomcosition solution