Adapt the code to the latest sparse/dense matrix support of roboptim-core.