クラス BitPatternUtils

java.lang.Object
org.nkjmlab.util.java.math.BitPatternUtils

public class BitPatternUtils extends Object
  • コンストラクタの詳細

    • BitPatternUtils

      public BitPatternUtils()
  • メソッドの詳細

    • getBitPatternsAsInt

      public static List<List<Integer>> getBitPatternsAsInt(int n)
      Gets bit patterns.
      
       getBitpatterns(3) returns
       [
        [0, 0, 0], [0, 0, 1], [0, 1, 0], [0, 1, 1],
        [1, 0, 0], [1, 0, 1], [1, 1, 0], [1, 1, 1]
       ]
       
      パラメータ:
      n - length of bit.
      戻り値:
      order by ascendant
    • getBitPatterns

      public static List<List<Boolean>> getBitPatterns(int n)
      Gets bit patterns.
      
       getBitpatterns(3) returns
       
       [
        [false, false, false], [false, false, true], [false, true, false], [false, true, true],
        [true, false, false], [true, false, true], [true, true, false], [true, true, true]
       ]
       
       
      パラメータ:
      n - length of bit.
      戻り値:
      order by ascendant