src/estimagic/optimization/pounders_auxiliary.py
def _get_monomial_basis(x):
    """Get the monomial basis (basis for quadratic functions) of x.

    Monomial basis = .5*[x(1)^2  sqrt(2)*x(1)*x(2) ... sqrt(2)*x(1)*x(n) ...
        ... x(2)^2 sqrt(2)*x(2)*x(3) .. x(n)^2]

    Args:
        x (np.ndarray): Parameter vector of shape (n,).

    Returns:
        (np.ndarray): Monomial basis of x wof shape (n * (n + 1) / 2,).
    """
    n = x.shape[0]
    monomial_basis = np.zeros(int(n * (n + 1) / 2))

    j = 0
    for i in range(n):
        monomial_basis[j] = 0.5 * x[i] ** 2
        j += 1

        for k in range(i + 1, n):
            monomial_basis[j] = x[i] * x[k] / np.sqrt(2)
            j += 1

    return monomial_basis
Get the monomial basis (basis for quadratic functions) of x.

    Monomial basis = .5*[x(1)^2  sqrt(2)*x(1)*x(2) ... sqrt(2)*x(1)*x(n) ...
        ... x(2)^2 sqrt(2)*x(2)*x(3) .. x(n)^2]

    Args:
        x (np.ndarray): Parameter vector of shape (n,).

    Returns:
        (np.ndarray): Monomial basis of x wof shape (n * (n + 1) / 2,).
    
Get the monomial basis (basis for quadratic functions) of x.
Get the monomial basis ( basis for quadratic functions ) of x .
def _get_monomial_basis(x):
    n = x.shape[0]
    monomial_basis = np.zeros(int(n * (n + 1) / 2))
    j = 0
    for i in range(n):
        monomial_basis[j] = 0.5 * x[i] ** 2
        j += 1
        for k in range(i + 1, n):
            monomial_basis[j] = x[i] * x[k] / np.sqrt(2)
            j += 1
    return monomial_basis
def _get_monomial_basis ( x ) : n = x . shape [ 0 ] monomial_basis = np . zeros ( int ( n * ( n + 1 ) / 2 ) ) j = 0 for i in range ( n ) : monomial_basis [ j ] = 0.5 * x [ i ] ** 2 j += 1 for k in range ( i + 1 , n ) : monomial_basis [ j ] = x [ i ] * x [ k ] / np . sqrt ( 2 ) j += 1 return monomial_basis
Get the monomial basis (basis for quadratic functions) of x.
Monomial basis = .5*[x(1)^2  sqrt(2)*x(1)*x(2) ... sqrt(2)*x(1)*x(n) ...
... x(2)^2 sqrt(2)*x(2)*x(3) .. x(n)^2]
Get the monomial basis ( basis for quadratic functions ) of x . Monomial basis = . 5 * [ x ( 1 ) ^2 sqrt ( 2 ) * x ( 1 ) * x ( 2 ) ... sqrt ( 2 ) * x ( 1 ) * x ( n ) ... ... x ( 2 ) ^2 sqrt ( 2 ) * x ( 2 ) * x ( 3 ) .. x ( n ) ^2 ]
"""Get the monomial basis (basis for quadratic functions) of x.

    Monomial basis = .5*[x(1)^2  sqrt(2)*x(1)*x(2) ... sqrt(2)*x(1)*x(n) ...
        ... x(2)^2 sqrt(2)*x(2)*x(3) .. x(n)^2]

    Args:
        x (np.ndarray): Parameter vector of shape (n,).

    Returns:
        (np.ndarray): Monomial basis of x wof shape (n * (n + 1) / 2,).
    """
Monomial basis of x wof shape (n * (n + 1) / 2,).
Monomial basis of x wof shape ( n * ( n + 1 ) / 2 ) .
(np.ndarray)
x
Parameter vector of shape (n,).
Parameter vector of shape ( n ) .