Tup.Mahout4Net.Fpm.PfpGrowth.FPGrowth.FPTree.CreateNode C# (CSharp) Method

CreateNode() public method

public CreateNode ( int parentNodeId, int attributeValue, long count ) : int
parentNodeId int
attributeValue int
count long
return int
        public int CreateNode(int parentNodeId, int attributeValue, long count)
        {
            if (nodes >= this.attribute.Length)
            {
                Resize();
            }

            childCount[nodes] = 0;
            next[nodes] = -1;
            parent[nodes] = parentNodeId;
            this.attribute[nodes] = attributeValue;
            nodeCount[nodes] = count;

            conditional[nodes] = 0;
            if (nodeChildren[nodes] == null)
            {
                nodeChildren[nodes] = new int[DEFAULT_CHILDREN_INITIAL_SIZE];
            }

            int childNodeId = nodes++;
            AddChild(parentNodeId, childNodeId);
            AddHeaderNext(attributeValue, childNodeId);
            return childNodeId;
        }