On 2/1/07, Robert Kern <[EMAIL PROTECTED]> wrote:
Keith Goodman wrote:
> A port to Octave of the test script works fine on the same system.

Are you sure that your Octave port uses ATLAS to do the matrix product? Could
you post your port?

Here's the port. Yes, Octave uses atlas for matrix multiplication.
Maybe the problem is a race condition and due to timing the outcome is
always the same in Octave...
function repeat()    
    nsim = 100;
    [x, y] = load();
    z0 = calc(x, y);
    for i = 1:nsim
        disp(i)
        [x, y] = load();
        z = calc(x, y);
        if any(z ~= z0)
            printf("%d Max difference = %f", i, max(abs((z - z0)/z0)))     
        end
    end     

function z = calc(x, y) 
    z = x * (x' * y);
    
function [x, y] = load()

    # x data
    x = zeros(3,3);
    x(1,1) =  0.00301404794991108;
    x(1,2) =  0.00264742266711118;
    x(1,3) = -0.00112705028731085;
    x(2,1) =  0.0228605377994491;
    x(2,2) =  0.00337153112741583;
    x(2,3) = -0.00823674912992519;
    x(3,1) =  0.00447839875836716;
    x(3,2) =  0.00274880280576514;
    x(3,3) = -0.00161133933606597;
         
    # y data
    y = zeros(3,1);
    y(1,1) = 0.000885398;
    y(2,1) = 0.00667193;
    y(3,1) = 0.000324727;
_______________________________________________
Numpy-discussion mailing list
[email protected]
http://projects.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to