C# Class SIMDPrototyping.Trees.SingleArray.Tree

Afficher le fichier Open project: RossNordby/scratchpad Class Usage Examples

Méthodes publiques

Méthode Description
Add ( int leafId, BoundingBox &box ) : void
AddGlobal ( int leafId, BoundingBox &leafBounds ) : void

Tests every possible insertion path to find the one which minimizes the tree's heuristic cost.

AgglomerativeRefine ( int nodeIndex, QuickList &spareNodes, bool &nodesInvalidated ) : void

Collects a limited set of subtrees hanging from the specified node and performs a local treelet rebuild using a bottom-up agglomerative approach.

BinnedRefine ( int nodeIndex, QuickList &subtreeReferences, int maximumSubtrees, QuickList &treeletInternalNodes, QuickList &spareNodes, BinnedResources &resources, bool &nodesInvalidated ) : void
BottomUpAgglomerativeRefine ( ) : void

Executes one pass of bottom-up refinement.

BottomUpBinnedRefine ( int maximumSubtrees ) : void

Executes one pass of bottom-up refinement.

BuildVolumeHeuristic ( int leafIds, BoundingBox leafBounds, int start, int length = -1 ) : void
CollectSubtrees ( int nodeIndex, int maximumSubtrees, SubtreeHeapEntry entries, QuickList &subtrees, QuickList &internalNodes, float &treeletCost ) : void
CollectSubtreesDirect ( int nodeIndex, int maximumSubtrees, QuickList &subtrees, QuickQueue &internalNodes, float &treeletCost ) : void
ComputeMaximumDepth ( ) : int
CreateBinnedResources ( BufferPool bufferPool, int maximumSubtreeCount, int &buffer, MemoryRegion &region, BinnedResources &resources ) : void
CreateOptimized ( ) : Tree

Creates a cache optimized copy of the tree that uses the minimum amount of memory possible.

CreateOptimized ( Leaf optimizedLeavesArray, Node optimizedNodesArray ) : void

Creates a cache optimized version of the tree in the given leaves and nodes arrays.

GetCacheOptimizeTuning ( int maximumSubtrees, float costChange, float cacheOptimizeAggressivenessScale ) : int
GetRefineTuning ( int frameIndex, int refinementCandidatesCount, float refineAggressivenessScale, float costChange, int threadCount, int &targetRefinementCount, int &refinementPeriod, int &refinementOffset ) : void
GetRefitAndMarkTuning ( int &maximumSubtrees, int &estimatedRefinementCandidateCount, int &leafCountThreshold ) : void
MeasureCacheQuality ( ) : float
MeasureCacheQuality ( int nodeIndex ) : float
MeasureCostMetric ( ) : float
MeasureNodeOccupancy ( int &nodeCount, int &childCount ) : void
PartialRefine ( int offset, int skip, QuickList &spareNodes, int maximumSubtrees, QuickList &treeletInternalNodes, BinnedResources &binnedResources, bool &nodesInvalidated ) : void
RecursiveRefine ( int maximumSubtrees, int treeSizeSeed, QuickList &treeletInternalNodes, QuickList &spareNodes, BinnedResources &binnedResources, bool &nodesInvalidated ) : void
Refit ( ) : void
RefitAndRefine ( int frameIndex, IParallelLooper looper, RefitAndRefineMultithreadedContext context, float refineAggressivenessScale = 1, float cacheOptimizeAggressivenessScale = 1 ) : int
RefitAndRefine ( int frameIndex, float refineAggressivenessScale = 1, float cacheOptimizeAggressivenessScale = 1 ) : int
RefitNonrecursive2 ( ) : void
RefitNonrecursive22 ( ) : void
RemoveAt ( int leafIndex ) : LeafMove
RemoveUnusedInternalNodes ( QuickList &spareNodes ) : void
SweepBuild ( int leafIds, BoundingBox leafBounds, int start, int length = -1, BufferPool intPool = null, BufferPool floatPool = null ) : void
TopDownAgglomerativeRefine ( ) : void
TopDownBinnedRefine ( int maximumSubtrees ) : void
Validate ( ) : void

Private Methods

Méthode Description
BuildStagingChild ( int parent, int indexInParent, TempNode tempNodes, int tempNodeIndex, int collapseCount, Node stagingNodes, int &stagingNodeCount, float &treeletCost ) : int
CheckForRefinementOverlaps ( int nodeIndex, QuickList &refinementTargets ) : void
CollapseTree ( int depthRemaining, TempNode tempNodes, int tempNodeIndex, int nodeChildren, int &childCount, BoundingBox nodeBounds, int leafCounts ) : void
CollectNodesForMultithreadedRefit ( int threadCount, QuickList &refitAndMarkTargets, int refinementLeafCountThreshold, QuickList &refinementCandidates ) : void
CollectNodesForMultithreadedRefit ( int nodeIndex, int multithreadingLeafCountThreshold, QuickList &refitAndMarkTargets, int refinementLeafCountThreshold, QuickList &refinementCandidates ) : void
CollectSubtreesForNodeDirect ( int nodeIndex, int remainingDepth, QuickList &subtrees, QuickQueue &internalNodes, float &treeletCost ) : void
ComputeBestCostChange ( int nodeIndex, BoundingBox &newLeafBounds, Path &candidate, Path &best ) : void
ComputeBoundsMetric ( BoundingBox &boundingBox ) : float
ComputeMaximumDepth ( Node node, int currentDepth ) : int
CreateStagingNodeBinned ( BinnedResources &resources, int start, int count, int &stagingNodeCount, float &childTreeletsCost ) : int
CreateSweepBuilderNode ( int parentIndex, int indexInParent, SweepResources &leaves, int start, int count ) : int
FindPartition ( SweepResources &leaves, int start, int count, int &splitIndex, BoundingBox &a, BoundingBox &b, int &leafCountA, int &leafCountB ) : void
FindPartitionBinned ( BinnedResources &resources, int start, int count, int &splitIndex, BoundingBox &a, BoundingBox &b, int &leafCountA, int &leafCountB ) : void
FindPartitionForAxis ( BoundingBox boundingBoxes, BoundingBox aMerged, float centroids, int indexMap, int count, int &splitIndex, float &cost, BoundingBox &a, BoundingBox &b, int &leafCountA, int &leafCountB ) : void
GetChoiceList ( List choices ) : string
GetLeafBoundingBox ( int leafIndex, BoundingBox &boundingBox ) : void
GetVolumeSplitIndex ( int leafIds, BoundingBox leafBounds, int start, int length ) : int
InsertLeafIntoEmptySlot ( int leafId, BoundingBox &leafBox, int nodeIndex, int childIndex, Node node, bool &leavesInvalidated ) : void
MeasureCacheQuality ( int nodeIndex, int &foundNodes, float &nodeScore, int &scorableNodeCount ) : void
MeasureNodeOccupancy ( Node node, int &nodeCount, int &childCount ) : void
MergeLeafNodes ( int newLeafId, BoundingBox &newLeafBounds, int parentIndex, int indexInParent, BoundingBox &merged, bool &nodesInvalidated, bool &leavesInvalidated ) : void
OptimizeBFS ( Node optimizedNodes, Leaf optimizedLeaves, int &optimizedNodeCount, int &optimizedLeafCount ) : void
OptimizeDFS ( int optimizedParentIndex, int nodeIndex, Node optimizedNodes, Leaf optimizedLeaves, int &optimizedNodeCount, int &optimizedLeafCount ) : int
OptimizeGroupDFS ( Node optimizedNodes, Leaf optimizedLeaves, int &optimizedNodeCount, int &optimizedLeafCount ) : void
OptimizeGroupDFS ( int optimizedNodeIndex, int optimizedParentNodeIndex, int nodeIndex, Node optimizedNodes, Leaf optimizedLeaves, int &optimizedNodeCount, int &optimizedLeafCount ) : void
PartialRefine ( int index, int depth, int offset, int skip, QuickList &subtreeReferences, QuickList &treeletInternalNodes, QuickList &spareNodes, int maximumSubtrees, BinnedResources &binnedResources, bool &nodesInvalidated ) : void
RecursiveRefine ( int nodeIndex, int maximumSubtrees, int &treeSizeSeed, QuickList &treeletInternalNodes, QuickList &spareNodes, BinnedResources &binnedResources, bool &nodesInvalidated ) : void
Refit ( int nodeIndex, BoundingBox &boundingBox ) : void
Refit2 ( int nodeIndex, BoundingBox &boundingBox ) : void
Refit4 ( int nodeIndex, BoundingBox &boundingBox ) : void
RefitAndMark ( int leafCountThreshold, QuickList &refinementCandidates ) : float
RefitAndMark ( int index, int leafCountThreshold, QuickList &refinementCandidates, BoundingBox &boundingBox ) : float
RefitAndMeasure ( int nodeIndex, BoundingBox &boundingBox ) : float
RefitCached ( int nodeIndex, BoundingBox &boundingBox ) : void
RefitForRemoval ( Node node ) : void
RefitSwitch4 ( int nodeIndex, BoundingBox &boundingBox ) : void
ReifyChildren ( int internalNodeIndex, Node stagingNodes, QuickList &subtrees, QuickList &treeletInternalNodes, int &nextInternalNodeIndexToUse, QuickList &spareNodes, bool &nodesInvalidated ) : void
ReifyStagingNode ( int parent, int indexInParent, Node stagingNodes, int stagingNodeIndex, QuickList &subtrees, QuickList &treeletInternalNodes, int &nextInternalNodeIndexToUse, QuickList &spareNodes, bool &nodesInvalidated ) : int
ReifyStagingNodes ( int treeletRootIndex, Node stagingNodes, QuickList &subtrees, QuickList &treeletInternalNodes, int &nextInternalNodeIndexToUse, QuickList &spareNodes, bool &nodesInvalidated ) : void
RemoveNodeAt ( int nodeIndex ) : void
SetLeafBoundingBox ( int leafIndex, BoundingBox &boundingBox ) : void
Split ( int leafIds, BoundingBox leafBounds, int start, int length, int recursionRemaining, Queue subnodes ) : void
Split ( int leafIds, BoundingBox leafBounds, int start, int length, int recursionRemaining, int starts, int min, int max ) : void
SplitLeavesIntoChildren ( int depthRemaining, SweepResources &leaves, int start, int count, int nodeIndex ) : void
SplitSubtreesIntoChildrenBinned ( int depthRemaining, BinnedResources &resources, int start, int count, int stagingNodeIndex, int &stagingNodesCount, float &childrenTreeletsCost ) : void
SwapPaths ( Path &candidate, Path &best, float newCostIncrease, int childIndex ) : void
TopDownAgglomerativeRefine ( int nodeIndex, QuickList &spareNodes ) : void
TopDownBinnedRefine ( int nodeIndex, int maximumSubtrees, QuickList &subtreeReferences, QuickList &treeletInternalNodes, QuickList &spareNodes, BinnedResources &resources ) : void
TryToBottomUpAgglomerativeRefine ( int refinementFlags, int nodeIndex, QuickList &spareInternalNodes ) : void
TryToBottomUpBinnedRefine ( int refinementFlags, int nodeIndex, int maximumSubtrees, QuickList &subtreeReferences, QuickList &treeletInternalNodes, BinnedResources &resources, QuickList &spareInternalNodes ) : void
UpdateLeafBoundingBox ( int leafIndex, BoundingBox &boundingBox ) : void
Validate ( int nodeIndex, int expectedParentIndex, int expectedIndexInParent, BoundingBox &expectedBoundingBox, int &foundLeafCount ) : void
ValidateLeafNodeIndices ( ) : void
ValidateLeaves ( ) : void
ValidateRefineFlags ( int index ) : void
ValidateStaging ( Node stagingNodes, QuickList &subtreeNodePointers, int treeletParent, int treeletIndexInParent ) : void
ValidateStaging ( Node stagingNodes, int stagingNodeIndex, QuickList &subtreeNodePointers, QuickList &collectedSubtreeReferences, QuickList &internalReferences, int &foundSubtrees, int &foundLeafCount ) : void
VolumeHeuristicAddNode ( int parentNodeIndex, int indexInParent, int leafIds, BoundingBox leafBounds, int start, int length, BoundingBox &mergedBoundingBox, int &nodeIndex ) : void

Method Details

Add() public méthode

public Add ( int leafId, BoundingBox &box ) : void
leafId int
box BoundingBox
Résultat void

AddGlobal() public méthode

Tests every possible insertion path to find the one which minimizes the tree's heuristic cost.
public AddGlobal ( int leafId, BoundingBox &leafBounds ) : void
leafId int
leafBounds BoundingBox
Résultat void

AgglomerativeRefine() public méthode

Collects a limited set of subtrees hanging from the specified node and performs a local treelet rebuild using a bottom-up agglomerative approach.
public AgglomerativeRefine ( int nodeIndex, QuickList &spareNodes, bool &nodesInvalidated ) : void
nodeIndex int Root of the refinement treelet.
spareNodes QuickList
nodesInvalidated bool True if the refinement process invalidated node pointers, false otherwise.
Résultat void

BinnedRefine() public méthode

public BinnedRefine ( int nodeIndex, QuickList &subtreeReferences, int maximumSubtrees, QuickList &treeletInternalNodes, QuickList &spareNodes, BinnedResources &resources, bool &nodesInvalidated ) : void
nodeIndex int
subtreeReferences QuickList
maximumSubtrees int
treeletInternalNodes QuickList
spareNodes QuickList
resources BinnedResources
nodesInvalidated bool
Résultat void

BottomUpAgglomerativeRefine() public méthode

Executes one pass of bottom-up refinement.
public BottomUpAgglomerativeRefine ( ) : void
Résultat void

BottomUpBinnedRefine() public méthode

Executes one pass of bottom-up refinement.
public BottomUpBinnedRefine ( int maximumSubtrees ) : void
maximumSubtrees int
Résultat void

BuildVolumeHeuristic() public méthode

public BuildVolumeHeuristic ( int leafIds, BoundingBox leafBounds, int start, int length = -1 ) : void
leafIds int
leafBounds BoundingBox
start int
length int
Résultat void

CollectSubtrees() public méthode

public CollectSubtrees ( int nodeIndex, int maximumSubtrees, SubtreeHeapEntry entries, QuickList &subtrees, QuickList &internalNodes, float &treeletCost ) : void
nodeIndex int
maximumSubtrees int
entries SubtreeHeapEntry
subtrees QuickList
internalNodes QuickList
treeletCost float
Résultat void

CollectSubtreesDirect() public méthode

public CollectSubtreesDirect ( int nodeIndex, int maximumSubtrees, QuickList &subtrees, QuickQueue &internalNodes, float &treeletCost ) : void
nodeIndex int
maximumSubtrees int
subtrees QuickList
internalNodes QuickQueue
treeletCost float
Résultat void

ComputeMaximumDepth() public méthode

public ComputeMaximumDepth ( ) : int
Résultat int

CreateBinnedResources() public static méthode

public static CreateBinnedResources ( BufferPool bufferPool, int maximumSubtreeCount, int &buffer, MemoryRegion &region, BinnedResources &resources ) : void
bufferPool BufferPool
maximumSubtreeCount int
buffer int
region MemoryRegion
resources BinnedResources
Résultat void

CreateOptimized() public méthode

Creates a cache optimized copy of the tree that uses the minimum amount of memory possible.
public CreateOptimized ( ) : Tree
Résultat Tree

CreateOptimized() public méthode

Creates a cache optimized version of the tree in the given leaves and nodes arrays.
public CreateOptimized ( Leaf optimizedLeavesArray, Node optimizedNodesArray ) : void
optimizedLeavesArray Leaf Array to fill with optimized leaves.
optimizedNodesArray Node Array to fill with optimized nodes.
Résultat void

GetCacheOptimizeTuning() public méthode

public GetCacheOptimizeTuning ( int maximumSubtrees, float costChange, float cacheOptimizeAggressivenessScale ) : int
maximumSubtrees int
costChange float
cacheOptimizeAggressivenessScale float
Résultat int

GetRefineTuning() public méthode

public GetRefineTuning ( int frameIndex, int refinementCandidatesCount, float refineAggressivenessScale, float costChange, int threadCount, int &targetRefinementCount, int &refinementPeriod, int &refinementOffset ) : void
frameIndex int
refinementCandidatesCount int
refineAggressivenessScale float
costChange float
threadCount int
targetRefinementCount int
refinementPeriod int
refinementOffset int
Résultat void

GetRefitAndMarkTuning() public méthode

public GetRefitAndMarkTuning ( int &maximumSubtrees, int &estimatedRefinementCandidateCount, int &leafCountThreshold ) : void
maximumSubtrees int
estimatedRefinementCandidateCount int
leafCountThreshold int
Résultat void

MeasureCacheQuality() public méthode

public MeasureCacheQuality ( ) : float
Résultat float

MeasureCacheQuality() public méthode

public MeasureCacheQuality ( int nodeIndex ) : float
nodeIndex int
Résultat float

MeasureCostMetric() public méthode

public MeasureCostMetric ( ) : float
Résultat float

MeasureNodeOccupancy() public méthode

public MeasureNodeOccupancy ( int &nodeCount, int &childCount ) : void
nodeCount int
childCount int
Résultat void

PartialRefine() public méthode

public PartialRefine ( int offset, int skip, QuickList &spareNodes, int maximumSubtrees, QuickList &treeletInternalNodes, BinnedResources &binnedResources, bool &nodesInvalidated ) : void
offset int
skip int
spareNodes QuickList
maximumSubtrees int
treeletInternalNodes QuickList
binnedResources BinnedResources
nodesInvalidated bool
Résultat void

RecursiveRefine() public méthode

public RecursiveRefine ( int maximumSubtrees, int treeSizeSeed, QuickList &treeletInternalNodes, QuickList &spareNodes, BinnedResources &binnedResources, bool &nodesInvalidated ) : void
maximumSubtrees int
treeSizeSeed int
treeletInternalNodes QuickList
spareNodes QuickList
binnedResources BinnedResources
nodesInvalidated bool
Résultat void

Refit() public méthode

public Refit ( ) : void
Résultat void

RefitAndRefine() public méthode

public RefitAndRefine ( int frameIndex, IParallelLooper looper, RefitAndRefineMultithreadedContext context, float refineAggressivenessScale = 1, float cacheOptimizeAggressivenessScale = 1 ) : int
frameIndex int
looper IParallelLooper
context RefitAndRefineMultithreadedContext
refineAggressivenessScale float
cacheOptimizeAggressivenessScale float
Résultat int

RefitAndRefine() public méthode

public RefitAndRefine ( int frameIndex, float refineAggressivenessScale = 1, float cacheOptimizeAggressivenessScale = 1 ) : int
frameIndex int
refineAggressivenessScale float
cacheOptimizeAggressivenessScale float
Résultat int

RefitNonrecursive2() public méthode

public RefitNonrecursive2 ( ) : void
Résultat void

RefitNonrecursive22() public méthode

public RefitNonrecursive22 ( ) : void
Résultat void

RemoveAt() public méthode

public RemoveAt ( int leafIndex ) : LeafMove
leafIndex int
Résultat LeafMove

RemoveUnusedInternalNodes() public méthode

public RemoveUnusedInternalNodes ( QuickList &spareNodes ) : void
spareNodes QuickList
Résultat void

SweepBuild() public méthode

public SweepBuild ( int leafIds, BoundingBox leafBounds, int start, int length = -1, BufferPool intPool = null, BufferPool floatPool = null ) : void
leafIds int
leafBounds BoundingBox
start int
length int
intPool BufferPool
floatPool BufferPool
Résultat void

TopDownAgglomerativeRefine() public méthode

public TopDownAgglomerativeRefine ( ) : void
Résultat void

TopDownBinnedRefine() public méthode

public TopDownBinnedRefine ( int maximumSubtrees ) : void
maximumSubtrees int
Résultat void

Validate() public méthode

public Validate ( ) : void
Résultat void