Exemplo n.º 1
0
 public void Add(SimpleRow newRow)
 {
     if (isLeafNode)
     {
         if (CanAddElementToPage())
         {
             elements.Add(newRow);
         }
         else
         {
             SplitPage(newRow);
         }
         return;
     }
     var hash = CalculateHashForElement(newRow);
     children[hash].Add(newRow);
 }
Exemplo n.º 2
0
        protected override bool CheckIfAnySubsetIsGenerator(SimpleRow row)
        {
            var subsets = GetSubsets(row.Transaction);
            foreach (var subset in subsets)
            {
                var support = 0;
                var description = GetDescription(subset);
                if (eachResults.ContainsKey(description))
                {
                    var value = eachResults[description];
                    support = value.RelationComplied + value.RelationNotComplied;
                }

                if (support == row.RelationComplied + row.RelationNotComplied)
                    return true;
            }

            return false;
        }
Exemplo n.º 3
0
 private int CalculateHashForElement(SimpleRow newRow)
 {
     return newRow.Transaction[depth]%firstNumber;
 }
Exemplo n.º 4
0
 private void SplitPage(SimpleRow newRow)
 {
     isLeafNode = false;
     InitializeChildren();
     elements.Add(newRow);
     foreach (var simpleRow in elements)
     {
         int hash = CalculateHashForElement(simpleRow);
         children[hash].Add(simpleRow);
     }
     elements = null;
 }
Exemplo n.º 5
0
 protected virtual void OnAddNode(SimpleRow row)
 {
 }
Exemplo n.º 6
0
 protected virtual bool CheckIfAnySubsetIsGenerator(SimpleRow row)
 {
     return false;
 }
Exemplo n.º 7
0
 private void IncrementCounters(SimpleRow row, Row transaction)
 {
     if (transaction.Value == Relation.Complied)
     {
         row.RelationComplied += 1;
     }
     else
     {
         row.RelationNotComplied += 1;
     }
 }
Exemplo n.º 8
0
 protected override void OnAddNode(SimpleRow row)
 {
     var description = GetDescription(row.Transaction);
     eachResults.Add(description, row);
 }