def testHamiltonian(self):
     from continuous_vortex_system import scaled_gradient_hamiltonian
     scaled_grad = scaled_gradient_hamiltonian(self.gamma, self.x0, 
                                               self.sigma)
     
     grad2 = row_product(self.gamma, scaled_grad) 
     self.assertTrue(is_float_equal(grad2, self.grad, tol=1e-14))
    def testResidueDirect(self):
        from vortex_integrator import iteration_direct, VortexSystem

        v = VortexSystem()
        v.h = self.h 
        v.gamma = self.gamma
        v.sigma = self.sigma

        r = iteration_direct(self.b, self.x0, v)
        r = 2*row_product(self.gamma, self.b - r)
        self.assertTrue(is_float_equal(r, self.res_direct, tol=1e-14))