def choose_max(self, axis, target=None):
    """
    Find the maximum value along the given dimension, where 0 represents the
    leading dimension and 1 represents the non-leading dimension. If a target
    is not prvided, a new vector is created for storing the result.
    """

    m, n = self.shape

    assert axis == 0, 'Axis = 1 not implemented.'
    if not target:
     target = self

    err_code = _eigenmat.choose_max_by_axis(self.p_mat, target.p_mat, ct.c_int(axis))
    if err_code:
      raise generate_exception(err_code)

    return target

    Find the maximum value along the given dimension, where 0 represents the
    leading dimension and 1 represents the non-leading dimension. If a target
    is not prvided, a new vector is created for storing the result.
    
eigenmat/eigenmat.py