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: Michael Leitner
Subject: [Octave-bug-tracker] [bug #53242] tests: 'test subspace.m' fails randomly
Date: Thu, 1 Mar 2018 03:39:11 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0

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

No, you misunderstood: The dimensionality of the subspaces can well be
different, but this means that the *number of columns* would be different.
However, they still have to be subspaces of a common vector space,
specifically \mathbb{R}^n, thus they always need to have the same number of
rows, in this case n. This is exactly what is checked in the input validation,
and it also works:


subspace([1 1 0;1 -1 0]',[1 0 1]')


By the way, I think that this is something that is more worth being tested,
i.e. to construct some such examples as above, with different column numbers
of A and B, and row numbers larger than 2, and to compare with the exact
results (of course pi/4 in the case above), rather than to test just the
angles between two two-dimensional vectors, which is about the simplest
conceivable task this very potent function can do. And also include degenerate
test cases like 


subspace([1,1)


I just took a few minutes and wrote the following tests


assert(subspace(1,1),0);
assert(subspace([1 0]',[1 1;0 1]'),0,3*eps);
assert(subspace([1 0 1]',[1 1 0;1 -1 0]'),pi/4,3*eps)
assert(subspace([1 5 0 0;-3 2 0 0]',[0 0 4 2;0 0 4 3]'),pi/2) 
assert(subspace([1 1 1 1;1 2 3 4]',[1 -1 -1 1;]'),pi/2) 


They should test also the more general behaviour and should not fail.

    _______________________________________________________

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]