def from_coefs(cls, getcoefs, nm, points_target, points_source=None, **params):
        """Construct an instance of the class from a evaluation function.

        Parameters
        ----------
        getcoefs: Callable
            A function evaluating an array of matrices at given coordinates.
        points_target: np.ndarray of shape (N, 3)
            The coordinates of the target points. If points_source=None, also the coordinates of the target points
        points_source: np.ndarray of shape (N, 3)
            If not None; the coordinates of the source points.
        epsilon: float, keyword-only, optional
            Tolerance of the Adaptive Cross Approximation
        eta: float, keyword-only, optional
            Criterion to choose the blocks to compress
        minclustersize: int, keyword-only, optional
            Minimum shape of a block
        maxblocksize: int, keyword-only, optional
            Maximum number of coefficients in a block

        Returns
        -------
        MultiHMatrix or ComplexMultiHMatrix
        """
        # Set params.
        cls._set_building_params(**params)