Add new solve method with algpats.