static void FunctionalSequence(int limit) { var q = new FNSeq<int>(Enumerable.Range(0, limit)); while (q.Length() > 0) q = q.remove(0); }
static void FunctionalSequence(int limit) { var q = new FNSeq <int>(Enumerable.Range(0, limit)); while (q.Length() > 0) { q = q.remove(0); } }
public CollectionTest(int contLength, UInt32 nOperations, IEnumerable <T> contents) { this.nContLength = contLength; this.nOperations = nOperations; theContainer = contents; foreach (T t in contents) { theContainer2.Add(t); } theFContainer = new FNSeq <T>(contents); theFContainer2 = new FNSeq <T>(contents); }
public double fseqReverse() { Double milliSeconds = 0D; T myT = default(T); DateTime start = DateTime.Now; for (UInt32 i = 0; i < nOperations; i++) { { FNSeq <T> fsReversed = theFContainer.reverse(); myT = fsReversed.itemAt(nContLength - 1); } } DateTime end = DateTime.Now; milliSeconds += (end - start).TotalMilliseconds; return(milliSeconds); }
public double fseqConcat() { Double milliSeconds = 0D; T myT = default(T); DateTime start = DateTime.Now; for (UInt32 i = 0; i < nOperations; i++) { { FNSeq <T> theResult = theFContainer.Merge(theFContainer2); myT = theResult.itemAt(nContLength + nContLength - 1); } } DateTime end = DateTime.Now; milliSeconds += (end - start).TotalMilliseconds; return(milliSeconds); }
public double fseqTake() { Double milliSeconds = 0D; T myT = default(T); int halfLength = nContLength / 2; DateTime start = DateTime.Now; for (UInt32 i = 0; i < nOperations; i++) { { FNSeq <T> skippedFSeq = theFContainer.take(halfLength); myT = skippedFSeq.itemAt(halfLength - 1); } } DateTime end = DateTime.Now; milliSeconds += (end - start).TotalMilliseconds; return(milliSeconds); }