code: public static boolean isPositiveSemidefinite( DMatrixRMaj A ) {
          if( !isSquare(A))
             return false;
  
          EigenDecomposition_F64<DMatrixRMaj> eig = DecompositionFactory_DDRM.eig(A.numCols,false);
          if( eig.inputModified() )
              A = A.copy();
          eig.decompose(A);
  
          for( int i = 0; i < A.numRows; i++ ) {
              Complex_F64 v = eig.getEigenvalue(i);
  
              if( v.getReal() < 0 )
                  return false;
          }
  
          return true;
      }
docs: <p>
  Checks to see if the matrix is positive semidefinite:
  </p>
  <p>
  x<sup>T</sup> A x &ge; 0<br>
  for all x where x is a non-zero vector and A is a symmetric matrix.
  </p>
  
  @param A square symmetric matrix. Not modified.
  
  @return True if it is positive semidefinite and false if it is not.