Exemple #1
0
 public static int Distance(BooleanVector BooleanVector1, BooleanVector BooleanVector2)
 {
     int count = 0;
     for (int i = 0; i < BooleanVector1.Length; i++)
         if (BooleanVector1[i] != BooleanVector2[i])
             count++;
     return count;
 }
 public BooleanFunction(int variableCount, bool keepsZero, bool keepsOne)
 {
     this.variableCount = variableCount;
     formulas           = new BooleanFormulaSet();
     do
     {
         this.vector = BooleanVector.RandomBooleanVector(1 << variableCount);
     }while ((!keepsZero && KeepsConstantZero()) || (keepsZero && !KeepsConstantZero()) ||
             (!keepsOne && KeepsConstantOne()) || (keepsOne && !KeepsConstantOne()));
 }
 public BooleanFunction(int variableCount, bool notSelfAdjoint, bool notLinear, bool notMonotone)
 {
     this.variableCount = variableCount;
     formulas           = new BooleanFormulaSet();
     do
     {
         this.vector = BooleanVector.RandomBooleanVector(1 << variableCount);
     }while ((notSelfAdjoint && IsSelfAdjoint()) || (notLinear && IsLinear()) ||
             (notMonotone && IsMonotone()));
 }
 public BooleanFunction(int variableCount, bool selfAdjoint, bool linear, bool monotone, bool balanced)
 {
     this.variableCount = variableCount;
     formulas           = new BooleanFormulaSet();
     do
     {
         this.vector = BooleanVector.RandomBooleanVector(1 << variableCount);
     }while ((selfAdjoint && !IsSelfAdjoint()) || (linear && !IsLinear()) ||
             (monotone && !IsMonotone()) || (balanced && !IsBalanced()));
 }
Exemple #5
0
        public static int Distance(BooleanVector BooleanVector1, BooleanVector BooleanVector2)
        {
            int count = 0;

            for (int i = 0; i < BooleanVector1.Length; i++)
            {
                if (BooleanVector1[i] != BooleanVector2[i])
                {
                    count++;
                }
            }
            return(count);
        }
 public static bool Incomparable(BooleanVector vector1, BooleanVector vector2)
 {
     return !((vector1 <= vector2) || (vector2 <= vector1));
 }
 public BooleanFunction(int variableCount)
 {
     this.variableCount = variableCount;
     formulas           = new BooleanFormulaSet();
     this.vector        = BooleanVector.RandomBooleanVector(1 << variableCount);
 }
Exemple #8
0
 public static bool Incomparable(BooleanVector vector1, BooleanVector vector2)
 {
     return(!((vector1 <= vector2) || (vector2 <= vector1)));
 }