Skip to content

quadtree_children

quadtree_children(CH)

"Leaf nodes of a quadtree

Builds a list of indeces to the child cells of the quadtree

Parameters:

Name Type Description Default
CH numpy int array

Matrix of child indeces (-1 if leaf node)

required

Returns:

Name Type Description
child_indeces list

Indeces into CH and A of leaf node cells

See Also

initialize_quadtree, quadtree_boundary.

Examples:

TODO

Source code in src/gpytoolbox/quadtree_children.py
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
def quadtree_children(CH):
    """"Leaf nodes of a quadtree

    Builds a list of indeces to the child cells of the quadtree

    Parameters
    ----------
    CH : numpy int array
        Matrix of child indeces (-1 if leaf node)

    Returns
    -------
    child_indeces : list
        Indeces into CH and A of leaf node cells

    See Also
    --------
    initialize_quadtree, quadtree_boundary.

    Examples
    --------
    TODO 
    """
    # Builds a list of indeces to the child cells of the quadtree
    #
    # Inputs:
    #   CH #nodes by 4 matrix of child indeces (-1 if leaf node)
    #
    # Outputs:
    #   child_indeces list of child indeces

    return (CH[:,0]<0).nonzero()[0]