public void Filter1() { var list = FList.New(1, 2, 3); var actual = FList.Filter(i => i > 1, list); var expected = FList.New(2, 3); Assert.AreEqual(expected, actual); }
public void Filter2() { var list = FList.New(1, 2, 3); var actual = FList.Filter(i => i > 3, list); var expected = FList.Empty <int>(); Assert.AreEqual(expected, actual); }
public void Filter2String() { var list = "123"; var actual = FList.Filter(i => i > '3', list); var expected = FList.Empty <char>(); Assert.AreEqual(expected, actual); }
public void Filter3String() { var list = "123"; var actual = FList.Filter(i => i > '0', list); var expected = "123"; Assert.AreEqual(expected, actual.ToString()); }
//Velocity Selector //v=E/B //E = Electric field strength //B = Magnetic Field strength //Need to stress this fucntion as it has a lot going for it public static FList <Particles.Particle> VelocitySelector <T>(T Particle, int NumberOfparticles, double E, double B, FRandom Rand) where T : Particle { return(FList.Filter((x) => x.Velocity >= Devide(E, B) - Devide(E, B) * 0.1 && x.Velocity <= Devide(E, B) + Devide(E, B) * 0.1, GenerateListOfParticlesWithRandomVelocity(Particle, NumberOfparticles, Rand))); }