from pytest import approx
import numpy as np


def is_positive_definite(X):
    eig_vals = np.linalg.eigvals(X)
    return np.all(eig_vals > 0.0)


def is_symmetric(X):
    symmetric_mat = np.swapaxes(X, -2, -1)
    return X == approx(symmetric_mat)


def is_symmetric_positive_definite(X):
    return is_symmetric(X) and is_positive_definite(X)

b6516c289d56002a580c6d214a668fb5f22302a9
<mask token>

<mask token>


def is_symmetric(X):
    symmetric_mat = np.swapaxes(X, -2, -1)
    return X == approx(symmetric_mat)


<mask token>

<mask token>


def is_positive_definite(X):
    eig_vals = np.linalg.eigvals(X)
    return np.all(eig_vals > 0.0)


def is_symmetric(X):
    symmetric_mat = np.swapaxes(X, -2, -1)
    return X == approx(symmetric_mat)


<mask token>

<mask token>


def is_positive_definite(X):
    eig_vals = np.linalg.eigvals(X)
    return np.all(eig_vals > 0.0)


def is_symmetric(X):
    symmetric_mat = np.swapaxes(X, -2, -1)
    return X == approx(symmetric_mat)


def is_symmetric_positive_definite(X):
    return is_symmetric(X) and is_positive_definite(X)

from pytest import approx
import numpy as np


def is_positive_definite(X):
    eig_vals = np.linalg.eigvals(X)
    return np.all(eig_vals > 0.0)


def is_symmetric(X):
    symmetric_mat = np.swapaxes(X, -2, -1)
    return X == approx(symmetric_mat)


def is_symmetric_positive_definite(X):
    return is_symmetric(X) and is_positive_definite(X)
