Example #1
0
 def test_lin_constraint_jac(self):
     dummy_array = np.array([1.0])
     res = lin_constraint_jac(dummy_array,
                              flat_idxr=[0, 2],
                              coeffs=np.array([1.0, -2.0]),
                              n=3)
     self.assertTrue(all(np.equal(res, np.array([1.0, 0.0, -2.0]))))
 def test_lin_constraint_jac(self):
     dummy_array = np.array([1.0])
     res = lin_constraint_jac(
         dummy_array, flat_idxr=[0, 2], coeffs=np.array([1.0, -2.0]), n=3
     )
     self.assertTrue(all(np.equal(res, np.array([1.0, 0.0, -2.0]))))