Examples of countUnsetBits()


Examples of org.uncommons.maths.binary.BitString.countUnsetBits()

        population = mutation.apply(population, FrameworkTestUtils.getRNG());
        BitString mutated = population.get(0);
        assert !mutated.equals(original) : "Mutation should be different from original.";
        assert mutated.getLength() == 9 : "Mutated bit string changed length.";
        int set = mutated.countSetBits();
        int unset = mutated.countUnsetBits();
        assert set == 5 || set == 7 : "Mutated bit string has wrong number of 1s: " + set;
        assert unset == 2 || unset == 4 : "Mutated bit string has wrong number of 0s: " + unset;
    }
}
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.