def _minimize_trust_ncg(fun, x0, args=(), jac=None, hess=None, hessp=None,
                        **trust_region_options):
    if jac is None:
        raise ValueError('Jacobian is required for Newton-CG trust-region '
                         'minimization')
    if hess is None and hessp is None:
        raise ValueError('Either the Hessian or the Hessian-vector product '
                         'is required for Newton-CG trust-region minimization')
    return _minimize_trust_region(fun, x0, args=args, jac=jac, hess=hess,
                                  hessp=hessp, subproblem=CGSteihaugSubproblem,
                                  **trust_region_options)
Diagonals are not connected, so feature is removed
dataset/ETHPy150Open scipy/scipy/scipy/optimize/_trustregion_ncg.py/_minimize_trust_ncg--crossover with--dataset/ETHPy150Open mapbox/rasterio/tests/test_features.py/test_sieve_connectivity_rook