def test_form(self):
        m = [[0, 2, 3, 4], [2, 0, 6, 7], [3, 6, 0, 8], [4, 7, 8, 0]]

        m = numpy.array(m)
        dist = hierarchical.condensedform(m, mode="lower")
        numpy.testing.assert_equal(dist, numpy.array([2, 3, 6, 4, 7, 8]))
        numpy.testing.assert_equal(hierarchical.squareform(dist, mode="lower"),
                                   m)
        dist = hierarchical.condensedform(m, mode="upper")
        numpy.testing.assert_equal(dist, numpy.array([2, 3, 4, 6, 7, 8]))
        numpy.testing.assert_equal(hierarchical.squareform(dist, mode="upper"),
                                   m)
    def test_form(self):
        m = [[0, 2, 3, 4],
             [2, 0, 6, 7],
             [3, 6, 0, 8],
             [4, 7, 8, 0]]

        m = numpy.array(m)
        dist = hierarchical.condensedform(m, mode="lower")
        numpy.testing.assert_equal(dist, numpy.array([2, 3, 6, 4, 7, 8]))
        numpy.testing.assert_equal(
            hierarchical.squareform(dist, mode="lower"), m)
        dist = hierarchical.condensedform(m, mode="upper")
        numpy.testing.assert_equal(dist, numpy.array([2, 3, 4, 6, 7, 8]))
        numpy.testing.assert_equal(
            hierarchical.squareform(dist, mode="upper"), m)