(problem)
return contrast
Generates the raw sample from the problem file

    Parameters
    ----------
    problem : dict
        The problem definition
Generates the raw sample from the problem file
Generates the raw sample from the problem file
def generate_contrast(problem):
    """Generates the raw sample from the problem file

    Parameters
    ----------
    problem : dict
        The problem definition
    """

    num_vars = problem['num_vars']

    # Find the smallest n, such that num_vars < k
    k = [2 ** n for n in range(16)]
    k_chosen = 2 ** find_smallest(num_vars)

    # Generate the fractional factorial contrast
    contrast = np.vstack([hadamard(k_chosen), -hadamard(k_chosen)])

    return contrast
def generate_contrast ( problem ) : num_vars = problem [ 'num_vars' ] # Find the smallest n, such that num_vars < k k = [ 2 ** n for n in range ( 16 ) ] k_chosen = 2 ** find_smallest ( num_vars ) # Generate the fractional factorial contrast contrast = np . vstack ( [ hadamard ( k_chosen ) , - hadamard ( k_chosen ) ] ) return contrast