         cusp::array1d<float, Space> x(2, -1.0);
         cusp::relaxation::jacobi<float, Space> relax(A, 1.0);
         relax(A, b, x, 0.5);
-        ASSERT_EQUAL(x[0], 1.0);
-        ASSERT_EQUAL(x[1], 0.5);
+        ASSERT_ALMOST_EQUAL(x[0], 1.0);
+        ASSERT_ALMOST_EQUAL(x[1], 0.5);
     }
-}
-
-template <class SparseMatrix>
-void TestJacobiRelaxationWithWeighting(void)
-{
-    _TestJacobiRelaxationWithWeighting<SparseMatrix>();
 }
 DECLARE_SPARSE_MATRIX_UNITTEST(TestJacobiRelaxationWithWeighting);
 

#include <cusp/array2d.h>
#include <cusp/multiply.h>

template <class MatrixType>
void _TestJacobiRelaxation(void)
{
    typedef typename MatrixType::memory_space Space;

    cusp::array2d<float, Space> M(5,5);
    M(0,0) = 1.0;  M(0,1) = 1.0;  M(0,2) = 2.0;  M(0,3) = 0.0;  M(0,4) = 0.0; 

        cusp::array1d<float, Space> x(2, -1.0);
        cusp::relaxation::jacobi<float, Space> relax(A, 0.5);
        relax(A, b, x);
        ASSERT_ALMOST_EQUAL(x[0], 1.0);
        ASSERT_ALMOST_EQUAL(x[1], 0.5);
    }
    
    // override default omega
