[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #63293] assert skips sparseness comparison if
From: |
Nicholas Jankowski |
Subject: |
[Octave-bug-tracker] [bug #63293] assert skips sparseness comparison if a tolerance is specified |
Date: |
Sun, 30 Oct 2022 07:54:31 -0400 (EDT) |
Follow-up Comment #1, bug #63293 (project octave):
looking at this more closely, it seems that only the assert codepath without
tol performs the sparseness check (around line 247), just after a comment: ##
Without explicit tolerance, be more strict."
other conditions get ignored as well:
>> assert([1 2 3],complex([1 2 3]))
error: ASSERT errors for: assert ([1, 2, 3],complex ([1, 2, 3]))
Location | Observed | Expected | Reason
() O E real != complex
>> assert([1 2 3],complex([1 2 3]),eps)
>> assert([1 2 3],single([1 2 3]))
error: ASSERT errors for: assert ([1, 2, 3],single ([1, 2, 3]))
Location | Observed | Expected | Reason
() O E Class double != single
>> assert([1 2 3],single([1 2 3]),eps)
>> assert([1 0 1],logical([1 0 1]))
error: ASSERT errors for: assert ([1, 0, 1],logical ([1, 0, 1]))
Location | Observed | Expected | Reason
() O E Class double != logical
>> assert([1 0 1],logical([1 0 1]),eps)
so, this is by design? is it really problematic to have these cases do type
checking when a numerical tolerance is given?
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?63293>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/