fix computing the optimization cost (the gradients are usually more expensive to compute)
fix computing the optimization cost (the gradients are usually more expensive to compute)

accosmin/nanocv,accosmin/nanocv,accosmin/nanocv