src/Kingdom.OrTools.ConstraintSolver.Core/OrProblemSolverBase.cs
/// <summary>
/// Intersects the <paramref name="first"/> with the <paramref name="second"/>, excluding
/// the one that appeared in the <paramref name="first"/>.
/// </summary>
/// <typeparam name="TResult"></typeparam>
/// <param name="first"></param>
/// <param name="second"></param>
/// <param name="intersect"></param>
/// <returns></returns>
Intersects the  with the , excluding
the one that appeared in the .
Intersects the with the excluding the one that appeared in the .
private static IEnumerable<TResult> Intersect<TResult>(IEnumerable<TAspect> first, IEnumerable<TAspect> second,
            Func<TAspect, TAspect, IEnumerable<TResult>> intersect)
        {
            return (from a in first.ToArray()
                from b in second.Where(s => !ReferenceEquals(s, a)).ToArray()
                select intersect(a, b)).SelectMany(x => x);
        }
private static IEnumerable < TResult > Intersect < TResult > ( IEnumerable < TAspect > first , IEnumerable < TAspect > second , Func < TAspect , TAspect , IEnumerable < TResult > > intersect ) { return ( from a in first . ToArray ( ) from b in second . Where ( s => ! ReferenceEquals ( s , a ) ) . ToArray ( ) select intersect ( a , b ) ) . SelectMany ( x => x ) ; }
Intersects the  with the , excluding
the one that appeared in the .
Intersects the with the excluding the one that appeared in the .
// Get all the B's that are not A and Intersect their Variables.
None
first
IEnumerable<TAspect>
None
second
IEnumerable<TAspect>
None
intersect
Func<TAspect, TAspect, IEnumerable<TResult>>
None
typeparam
None