def test_rigorous_henon(depth, box, plot=False, fpath="../sandbox/henon_test"):

    # our tree, mapper, enclosure
    tree = Tree(box, full=True)
    m = HenonMapper()
    ce = CombEnc(tree, m)

    for d in range(depth):
        # print 'at depth', d
        ce.tree.subdivide()
        # print 'subdivided:', ce.tree.size, 'boxes'
        ce.update()
        # print 'enclosure updated'
        I = graph_mis(ce.mvm)
        # print 'len(I) = ', len(I)
        # print ''
        # now remove all boxes not in I (the maximal invariant set)
        ce.tree.remove(list(set(range(ce.tree.size)) - set(I)))

    if plot:
        # now display the tree!
        boxes = ce.tree.boxes()
        gfx.show_uboxes(boxes, col="c", ecol="b")
    print "done with rigorous henon @ depth", depth
    print ""

    fname = fpath + dot + "CE" + dot + str(depth)
    utils.write_dot(ce.mvm.graph, fname + ".dot")
    utils.pickle_tree(ce.tree, fname + ".pkl")
示例#2
0
文件: test_ce.py 项目: caosuomo/rads
#!/usr/bin/python

import numpy as np
import numpy.random as nprand
import matplotlib.pylab as plt
from rads.enclosure import CombEnc,Tree
from rads.maps import HenonMapper

box = np.array([[0.0,0],[8,8]])
tree = Tree(box,depth=6,full=True)
m = HenonMapper()
ce = CombEnc(tree,m)

ce.update()
print ce.adj
print ce.mvm