Implement decomposition based solve functions for solving Ax = b

Thanks Ondrej, I could get it work.