octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #53242] tests: 'test subspace.m' fails randoml


From: Dan Sebald
Subject: [Octave-bug-tracker] [bug #53242] tests: 'test subspace.m' fails randomly
Date: Thu, 1 Mar 2018 17:54:45 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.0

Follow-up Comment #16, bug #53242 (project octave):

Here's a new changeset with the test I suggested.  It removes both of the
random tests, the second of which will be covered by M.L.'s more comprehensive
examples.  Mike can add a new changeset, combine them into one, propose some
other type of small-angle test, etc.

Instead of the 3*e length for the rotated vector, I set the length to rand(1)
and saw no fails for 100000 tries.  I don't think it is worth randomizing
anything here.

To illustrate that the test is checking what it's supposed to, here is the
computation with and without the use of asin():


octave:2> theta = pi/200;
octave:3> Ry = [cos(theta) 0 sin(theta);0 1 0;-sin(theta) 0 cos(theta)];
octave:4> a = Ry*[3*e 0 0]';
octave:5> b = [1 1 0;1 -1 0]';
octave:6> theta - subspace (a, b)
ans =   -3.4694e-18
octave:7> eps
ans =    2.2204e-16
octave:8> A = a;
octave:9> B = b;
octave:10>   A = orth (A);
octave:11>   B = orth (B);
octave:12>   c = A'*B;
octave:13>   scos = min (svd (c));
octave:14>   ang = acos (scos);
octave:15> theta - ang
ans =    2.0511e-14


(file #43429)
    _______________________________________________________

Additional Item Attachment:

File name: octave-subspace_angle_test_bug_53242-djs2018mar01.patch Size:1 KB


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?53242>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]