metrics

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 22, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LeafSize

func LeafSize(n node.N) float64

func NNodes

func NNodes(n node.N) int

func SAH

func SAH(n node.N) float64

Types

type C

type C struct {
	Internal float64
	Leaf     float64
	Object   float64
}
var (
	AilaC C = C{
		Internal: 1.2,
		Leaf:     1,
		Object:   0,
	}

	// The internally cached node heuristic may differ from the heuristic as
	// strictly defined by the MacDonald and Booth paper. We are making the
	// tree heuristic here independent of the cached heuristic in order to
	// have comparable tree costs across different node heuristic
	// strategies.
	SA = hyperrectangle.SA
)

func (C) SAH

func (c C) SAH(n node.N) float64

SAH returns the surface area heuristic as defined in MacDonald and Booth 1990.

The total heuristic is comprised of three separate components -- the cost of the internal nodes, the cost of the leaves, and the cost of testing for intersections. We use track these via ci, cl, and co respectively.

Per Aila et al., a "normal" SAH value is around 100.

N.B.: SAH assumes the local subtree has up-to-date AABB bounding boxes and heuristic caches.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL