viewgit/index.php:465 Only variables should be passed by reference [2048]
viewgit/index.php:466 Non-static method GeSHi::get_language_name_from_extension() should not be called statically [2048]
#!/usr/bin/env python # -*- coding: utf-8 -*- # # # Consideriamo \phi_{0}(x) = box function # e iteriamo per cercare di ottenere la funzione # associata ad un filtro. print " => Carico le librerie necessarie...", from pylab import * import time, numpy, Filtering print "ok" # Si comincia ad iterare h = numpy.array([0.125 , 0.25, 0.25, 0.25, 0.125]) h = Filtering.DaubechiesFilterBank.lowPassFilter.GetResponse() h = Filtering.StrangFilterBank.lowPassFilter.GetResponse() # h = Filtering.StrangFilterBank.lowPassFilter.GetResponse() t = numpy.linspace(-0.5,len(h) + 0.05,100) def box(x): """box function""" if(x >= 0 and x<=1): return 1 return 0 phi = map(box, t) def refinement(x): """Refinement function""" i = t.tolist().index(x) newphi = 0 counter = 0 for value in h: newphi += value * phi_func(2*x - counter) counter += 1 return max(min(2 * newphi, 10), -10) def phi_func(x): for item in t: if item > x: break return phi[t.tolist().index(item)] ion () hold(False) diff = 1 try: while True: plot(t,phi) draw () print "diff = %f" % diff time.sleep (1) newphi = map(refinement, t) diff = numpy.linalg.norm(numpy.array(newphi) - numpy.array(phi)) phi = newphi except KeyboardInterrupt: plot(t,phi) draw() raw_input() f = open("phi.txt", "w") for value in phi: f.write("%s\n" % value) f.close ()