view +noname/printSolutions.m @ 87:0a29a60e0b21

In Curve: Rearranged for speed. arc_length_fun is now a property of Curve. If it is not supplied, it is computed via the derivative and spline fitting. Switching to the arc length parameterization is much faster now. The new stuff can be tested with testArcLength.m (which should be deleted after that).
author Martin Almquist <martin.almquist@it.uu.se>
date Sun, 29 Nov 2015 22:23:09 +0100
parents c7efff913935
children 484b48e95c83
line wrap: on
line source

function printSolutions(filename)
    sf = SolutionFile(filename);

    method  = {};
    order   = [];
    m       = [];
    T       = [];
    t       = [];
    runtime = [];
    k       = [];

    for i = 1:length(sf.keys)
        key = sf.keys{i};
        entry = sf.get(key);


        method  = [method  key.method];
        order   = [order   key.order];
        m       = [m       key.m];
        T       = [T       key.T];
        t       = [t       entry.repr.t];
        runtime = [runtime entry.runtime];
        k       = [k       entry.k];
    end

    methodW  = findFieldWidth('%s',method);
    orderW   = findFieldWidth('%d',order);
    mW       = findFieldWidth('%d',m);
    TW       = findFieldWidth('%d',T);
    tW       = findFieldWidth('%.3e',t);
    runtimeW = findFieldWidth('%.3f',runtime);
    kW       = findFieldWidth('%.4f',k);

    for i = 1:length(sf.keys)
        fprintf('[%*s: o=%-*d, m=%-*d, T=%-*d]: t=%-*.3e, runtime=%*.3f, k=%*.4f\n',methodW, method{i}, orderW,order(i),mW,m(i),TW,T(i), tW, t(i), runtimeW,runtime(i), kW, k(i));
    end

end