def import_wisdom_from_file(filename):
    """Imports wisdom from the file given by the filename"""
    fp = open(filename, 'r')
    c_fp = PyFile_AsFile(fp)
    if lib.fftw_import_wisdom_from_file(c_fp):
        pass
    else:
        raise IOError, "Could not read wisdom from file %s" % filename
Exemple #2
0
def import_wisdom_from_file(filename):
    """Imports wisdom from the file given by the filename"""
    fp = open(filename,'r')
    c_fp = PyFile_AsFile(fp)
    if lib.$libname$_import_wisdom_from_file(c_fp):
        pass
def export_wisdom_to_file(filename):
    """Export accumulated wisdom to file given by the filename"""
    fp = open(filename, 'a')
    c_fp = PyFile_AsFile(fp)
    lib.fftw_export_wisdom_to_file(c_fp)
    fp.close()
def fprint_plan(plan, filename):
    """Print a nerd-readable version of the plan to the given filename"""
    fp = open(filename, 'w')
    c_fp = PyFile_AsFile(fp)
    lib.fftw_fprint_plan(plan, c_fp)
    fp.close()