(name)
return loadmat(os.path.join(example_dir, name + '.mat'), struct_as_record=True)
Load an example problem by name.

    Parameters
    ----------
    name : string (e.g. 'airfoil')
        Name of the example to load

    Notes
    -----
    Each example is stored in a dictionary with the following keys:
        - 'A'        : sparse matrix
        - 'B'        : near-nullspace candidates
        - 'vertices' : dense array of nodal coordinates
        - 'elements' : dense array of element indices

    Current example names are:%s

    Examples
    --------
    >>> from pyamg.gallery import load_example
    >>> ex = load_example('knot')
Load an example problem by name.
Load an example problem by name .
def load_example(name):
    """Load an example problem by name.

    Parameters
    ----------
    name : string (e.g. 'airfoil')
        Name of the example to load

    Notes
    -----
    Each example is stored in a dictionary with the following keys:
        - 'A'        : sparse matrix
        - 'B'        : near-nullspace candidates
        - 'vertices' : dense array of nodal coordinates
        - 'elements' : dense array of element indices

    Current example names are:%s

    Examples
    --------
    >>> from pyamg.gallery import load_example
    >>> ex = load_example('knot')

    """
    if name not in example_names:
        raise ValueError(f'No example with name {name}')

    return loadmat(os.path.join(example_dir, name + '.mat'), struct_as_record=True)
def load_example ( name ) : if name not in example_names : raise ValueError ( f'No example with name {name}' ) return loadmat ( os . path . join ( example_dir , name + '.mat' ) , struct_as_record = True )