public void RandomTest() { var expected = new[] { 5, 8, 21, 37, 46, 6, 8 }; var data = _combination.GetIndexOf(expected, Comparer <int> .Default); var actual = _combination.Element(data); Assert.IsTrue(expected.SequenceEqual(actual)); }
private long CombIndex(int[] ballsArray) { var comparer = Comparer <int> .Default; if (_choice == Choice.Main) { return((long)_model.GetIndexOf(ballsArray.Take(_model.ChosenElements).ToArray(), comparer)); } return((long)_model.GetIndexOf(ballsArray.Skip(ballsArray.Length - _model.ChosenElements).ToArray(), comparer)); }
public int VortexDegree(int[] balls, ICombination <int> model) { long index = (long)model.GetIndexOf(balls, Comparer <int> .Default); long circle = model.TotalCombinations < 360 ? index / 9 : index / 360; return((int)(index - (circle * GetMax(model.TotalCombinations)))); }
public int VortexCircleLevel(int[] balls, ICombination <int> model) { long index = (long)model.GetIndexOf(balls, Comparer <int> .Default); long circle = index / GetMax(model.TotalCombinations); return((int)circle); }
public List <IData> ToPatternMatches(BaseData <int>[] toArray, ICombination <int> model) { decimal index = model.GetIndexOf(toArray.Select(x => x.Data).ToArray(), Comparer <int> .Default); int[] actual = model.Element(index); Dictionary <string, string> patterns = new Dictionary <string, string> { { FeatureNames.FiboPattern, GetFiboPattern(actual) }, { FeatureNames.PrimePattern, GetPrimePattern(actual) }, { FeatureNames.PrimeCount, GetCount(GetPrimePattern(actual), model) }, { FeatureNames.FiboCount, GetCount(GetFiboPattern(actual), model) } }; return(patterns.Select(x => new FeatureData <string>(x.Key, x.Value) as IData).ToList()); }
public List <IData> ToFibIndexs(BaseData <int>[] toArray, ICombination <int> model) { long index = (long)model.GetIndexOf(toArray.Select(x => x.Data).ToArray(), Comparer <int> .Default); return(FibIndexs(index)); }
public long CombIndex(int[] ballsArray, ICombination <int> model) { return((long)model.GetIndexOf(ballsArray, Comparer <int> .Default)); }