コード例 #1
0
        /// <summary>
        /// Returns an <see cref="IEnumerable{Int64}"/> representation of the <paramref name="iterator"/>.
        /// This is a one way trip purely for host language convenience.
        /// </summary>
        /// <param name="iterator"></param>
        /// <returns></returns>
        private static IEnumerable <long> ToEnumerable(this IntVarIterator iterator)
        {
            iterator.Init();

            while (iterator.Ok())
            {
                yield return(iterator.Value());

                iterator.Next();
            }
        }
コード例 #2
0
 /// <summary>
 /// Returns an <see cref="IList{Int64}"/> representation of the <paramref name="iterator"/>.
 /// This is a one way trip purely for host language convenience.
 /// </summary>
 /// <param name="iterator"></param>
 /// <returns></returns>
 /// <see cref="ToEnumerable(IntVarIterator)"/>
 public static IList <long> ToList(this IntVarIterator iterator)
 {
     return(iterator.ToEnumerable().ToList());
 }