Check if ``A`` is a symmetric matrix.

    Args:
        A (array_like): Matrix.

    Returns:
        bool: ``True`` if ``A`` is symmetric; ``False`` otherwise.
172027
def check_symmetry(A):
    
    A = asanyarray(A)
    if A.ndim != 2:
        raise ValueError("Checks symmetry only for bi-dimensional arrays.")

    if A.shape[0] != A.shape[1]:
        return False

    return abs(A - A.T).max() < sqrt(finfo(float).eps)
246255
public static DoubleMatrix[] symmetricEigenvectors(DoubleMatrix A) {
        A.assertSquare();
        DoubleMatrix eigenvalues = new DoubleMatrix(A.rows);
        DoubleMatrix eigenvectors = A.dup();
        int isuppz[] = new int[2 * A.rows];
        SimpleBlas.syevr('V', 'A', 'U', A.dup(), 0, 0, 0, 0, 0, eigenvalues, eigenvectors, isuppz);
        return new DoubleMatrix[]{eigenvectors, DoubleMatrix.diag(eigenvalues)};
    }
390126
def is_unitary(matrix: np.ndarray) -> bool:
    
    rows, cols = matrix.shape
    if rows != cols:
        return False
    return np.allclose(np.eye(rows), matrix.dot(matrix.T.conj()))
1335003
public static INDArray symmetricGeneralizedEigenvalues(INDArray A, INDArray B) {
        Preconditions.checkArgument(A.isMatrix() && A.isSquare(), "Argument A must be a square matrix: has shape %s", A.shape());
        Preconditions.checkArgument(B.isMatrix() && B.isSquare(), "Argument B must be a square matrix: has shape %s", B.shape());
        INDArray W = Nd4j.create(A.rows());

        A = InvertMatrix.invert(B, false).mmuli(A);
        Nd4j.getBlasWrapper().syev('V', 'L', A, W);
        return W;
    }
287064
protected boolean process(DMatrixRMaj A, DMatrixRMaj F ) {
		if( !solverNull.process(A,1,F) )
			return true;

		F.numRows = 3;
		F.numCols = 3;

		return false;
	}
756032
def symmetrize(A):
    
    assert type(A) is spmatrix, "argument must be a sparse matrix"
    assert A.size[0] == A.size[1], "argument must me a square matrix"
    idx = [i for i,ij in enumerate(zip(A.I,A.J)) if ij[0] > ij[1]]
    return tril(A) + spmatrix(A.V[idx], A.J[idx], A.I[idx], A.size)
951934
def s2a(s):
    
    a = np.zeros((3, 3,), 'f')  # make the a matrix
    for i in range(3):
        a[i][i] = s[i]
    a[0][1], a[1][0] = s[3], s[3]
    a[1][2], a[2][1] = s[4], s[4]
    a[0][2], a[2][0] = s[5], s[5]
    return a
671325
def perm(A, p):
    
    assert isinstance(A,spmatrix), "argument must be a sparse matrix"
    assert A.size[0] == A.size[1], "A must be a square matrix"
    assert A.size[0] == len(p), "length of p must be equal to the order of A"
    return A[p,p]
336563
private static boolean identityEquals(Object[] a, Object[] a2) {
        if (a == a2) {
            return true;
        }
        if (a == null || a2 == null) {
            return false;
        }

        int length = a.length;
        if (a2.length != length) {
            return false;
        }

        for (int i=0; i<length; i++) {
            if (a[i] != a2[i]) {
                return false;
            }
        }

        return true;
    }
614557
def is_equal(self, other):
        
        other = self.coerce(other)
        return len(self.get_values().symmetric_difference(other.get_values())) == 0
616053
def _align_ast(self, a):
        

        try:
            if isinstance(a, BV):
                return self._align_bv(a)
            elif isinstance(a, Bool) and len(a.args) == 2 and a.args[1].cardinality > a.args[0].cardinality:
                return self._reverse_comparison(a)
            else:
                return a
        except ClaripyBalancerError:
            return a
887347
def is_bool_matrix(l):
    

    """
    if isinstance(l, np.ndarray):
        if l.ndim == 2 and (l.dtype == bool):
            return True
    return False
550875
def chol(A):
    
    A = np.array(A)
    assert A.shape[0] == A.shape[1], "Input matrix must be square"

    L = [[0.0] * len(A) for _ in range(len(A))]
    for i in range(len(A)):
        for j in range(i + 1):
            s = sum(L[i][k] * L[j][k] for k in range(j))
            L[i][j] = (
                (A[i][i] - s) ** 0.5 if (i == j) else (1.0 / L[j][j] * (A[i][j] - s))
            )

    return np.array(L)
770904
def symmetric_difference(self, other):
        
        other = self._cast_to_frameset(other)
        if other is NotImplemented:
            return NotImplemented
        from_frozenset = self.items.symmetric_difference(other.items)
        return self.from_iterable(from_frozenset, sort=True)
735697
def make_symmetric(dict):
    """"""
    for key, value in list(dict.items()):
        dict[value] = key
    return dict
624393
public static boolean checkIndicesSorted( DMatrixSparseCSC A ) {
        for (int j = 0; j < A.numCols; j++) {
            int idx0 = A.col_idx[j];
            int idx1 = A.col_idx[j+1];

            if( idx0 != idx1 && A.nz_rows[idx0] >= A.numRows )
                return false;

            for (int i = idx0+1; i < idx1; i++) {
                int row = A.nz_rows[i];
                if( A.nz_rows[i-1] >= row)
                    return false;
                if( row >= A.numRows )
                    return false;
            }
        }
        return true;
    }
685224
def matrix_at_check(self, original, loc, tokens):
        """"""
        return self.check_py("35", "matrix multiplication", original, loc, tokens)