[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #51650] left-division operator not implemented
From: |
Rik |
Subject: |
[Octave-bug-tracker] [bug #51650] left-division operator not implemented for integer data types |
Date: |
Fri, 4 Aug 2017 19:38:26 -0400 (EDT) |
User-agent: |
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:54.0) Gecko/20100101 Firefox/54.0 |
Update of bug #51650 (project octave):
Status: None => Confirmed
Summary: b\int64(1) vs b/int64(1) => left-division operator
not implemented for integer data types
_______________________________________________________
Follow-up Comment #3:
It's not just int64 matrices. The left-division operator isn't implemented
for any of the integer types. For example,
octave:8> c = int8 ([1 0; 1 1]);
octave:9> c \ 1
error: binary operator '\' not implemented for 'int8 matrix' by 'scalar'
operations
octave:9> c \ c
error: binary operator '\' not implemented for 'int8 matrix' by 'int8 matrix'
operations
You can see that the error messages are reasonably precise about what is going
on. Of course, for a scalar Octave could actually do this one piece of linear
algebra. But is it worth it? Most likely not. In order to implement the
operator Octave needs to generate functions and prototypes of each function
for the C++ compiler that connect a known data type to every other data type.
So there would be a routine for int8 \ int64, one for uint32 \ int16, another
for uint8 \ int16, etc. This quickly gets out of control.
But there certainly is an issue with this particular operation
scalar_integer_type \ matrix_data_type
Instead of issuing a warning, as above, for "binary operator '\' not
implemented", Octave issues the very unhelpful "octave_base_value:: wrong type
argument".
The second issue, is that if the initial value is a floating point type such
as a single or double then the operation proceeds, but gets the wrong answer
(scalar vs. matrix). Using the matrix c defined above.
octave:23> 2 \ c
ans = 0.50000
octave:24> 2 \ double (c)
ans =
0.50000 0.00000
0.50000 0.50000
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?51650>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/