def quad_potential(C, is_cov, as_cov):
 if issparse(C):
  if (not chol_available):
   raise ImportError('Sparse mass matrices require scikits.sparse')
  if (is_cov != as_cov):
   return QuadPotential_Sparse(C)
  else:
   raise ValueError('Sparse precission matrices are not supported')
 partial_check_positive_definite(C)
 if (C.ndim == 1):
  if (is_cov != as_cov):
   return ElemWiseQuadPotential(C)
  else:
   return ElemWiseQuadPotential((1.0 / C))
 elif (is_cov != as_cov):
  return QuadPotential(C)
 else:
  return QuadPotential_Inv(C)

def quad_potential ( C , is_cov , as_cov ) : if issparse ( C ) : if ( not chol_available ) : raise ImportError ( 'Sparse mass matrices require scikits.sparse' ) if ( is_cov != as_cov ) : return QuadPotential_Sparse ( C ) else : raise ValueError ( 'Sparse precission matrices are not supported' ) partial_check_positive_definite ( C ) if ( C . ndim == 1 ) : if ( is_cov != as_cov ) : return ElemWiseQuadPotential ( C ) else : return ElemWiseQuadPotential ( ( 1.0 / C ) ) elif ( is_cov != as_cov ) : return QuadPotential ( C ) else : return QuadPotential_Inv ( C )
parameters c : arraylike .