Skip to content

allmatch

AllMatch()

self.match is a matching function that matches all inputs.

Source code in berbl/match/allmatch.py
def __init__(self):
    pass

match(X)

Since this matching function matches all inputs, this always returns an all-ones matrix of shape (N, 1) (with each entry corresponding to one of the rows of the input matrix).

Parameters:

Name Type Description Default
X array of shape

Input matrix.

required

Returns:

Type Description
array

Matching vector (N) of this matching function

Source code in berbl/match/allmatch.py
def match(self, X: np.ndarray):
    """
    Since this matching function matches all inputs, this always returns an
    all-ones matrix of shape `(N, 1)` (with each entry corresponding to one
    of the rows of the input matrix).

    Parameters
    ----------
    X : array of shape `(N, DX)`
        Input matrix.

    Returns
    -------
    array
        Matching vector ``(N)`` of this matching function
    """
    return np.ones((len(X), 1))