bugGNU Octave - Bugs: bug #43780, Single-precision diagonal matrix...

 
 

bug #43780: Single-precision diagonal matrix expanded when multiplying logical vector

Submitter:  Nir Krakauer <nir_krakauer>
Submitted:  Mon 08 Dec 2014 05:38:09 PM UTC
   
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Confirmed Assigned to:  None
Originator Name:  Nir Krakauer Open/Closed:  * Open
Release:  * dev Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sun 18 Dec 2016 08:08:13 PM UTC, comment #3: 

This issue is still present in Octave 4.2.0.

Hartmut <hardy>
Mon 12 Oct 2015 10:35:44 PM UTC, comment #2: 

Just had time to test this.  Unfortunately it fails to compile


libinterp/operators/op-bm-bm.cc: In function 'void install_bm_bm_ops()':
libinterp/operators/op-bm-bm.cc:168:2: error: 'oct_conv_float_matrix_to_bool_matrix' was not declared in this scope
libinterp/operators/op-bm-bm.cc:169:49: error: 'octave_float_scalar' has not been declared
libinterp/operators/op-bm-bm.cc:170:2: error: 'oct_conv_float_scalar_to_bool_matrix' was not declared in this scope


Looking to code by example, I used the DEFCONVFN macro as was done earlier in op-bm-bm.cc.


DEFCONVFN (matrix_to_bool_matrix, matrix, bool)
DEFCONVFN (scalar_to_bool_matrix, scalar, bool)
// Added to match declaration for doubles
DEFCONVFN (float_matrix_to_bool_matrix, float_matrix, bool)
DEFCONVFN (float_scalar_to_bool_matrix, float_scalar, bool)


This leads to



libinterp/operators/op-bm-bm.cc: In function 'octave_base_value* oct_conv_float_scalar_to_bool_matrix(const octave_base_value&)':
libinterp/operators/op-bm-bm.cc:131:102: error: 'octave_float_scalar' does not name a type
libinterp/operators/op-bm-bm.cc:131:204: error: 'v' was not declared in this scope
libinterp/operators/op-bm-bm.cc: At global scope:
libinterp/operators/op-bm-bm.cc:131:28: warning: unused parameter 'a' [-Wunused-parameter]
libinterp/operators/op-bm-bm.cc: In function 'void install_bm_bm_ops()':
libinterp/operators/op-bm-bm.cc:169:49: error: 'octave_float_scalar' has not been declared


so I commented out the scalar instance of DEFCONVFN and INSTALL_CONVOP.  Now it compiles.  But I get the same error as before


x0 = diag(ones(1E6, 1, "single")) * ones(1E6, 1, "logical");
error: out of memory or dimension too large for Octave's index type


Just guessing, but maybe the conversions need to be somewhere in the fdm files for float_diagonal_matrix in the operator directory.

Rik <rik5>
Group administrator
Thu 01 Oct 2015 12:07:20 PM UTC, comment #1: 


This should be trivially fixed by adding the lines



  INSTALL_CONVOP (octave_float_matrix, octave_bool_matrix, float_matrix_to_bool_matrix);
  INSTALL_CONVOP (octave_float_scalar, octave_bool_matrix, float_scalar_to_bool_matrix);


to libinterp/operators/op-bm-bm.cc though I can't test it

D.

Anonymous
Mon 08 Dec 2014 05:38:09 PM UTC, original submission:  


x0 = diag(ones(1E6, 1, "single")) * ones(1E6, 1, "logical");
  error: out of memory or dimension too large for Octave's index type



On the other hand,


x1 = diag(ones(1E6, 1, "double")) * ones(1E6, 1, "logical");
x2 = diag(ones(1E6, 1, "single")) * ones(1E6, 1, "single");


both work fine.



Nir Krakauer <nir_krakauer>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by hardy (Posted a comment)
  • -email is unavailable- added by rik5 (Updated the item)
  • -email is unavailable- added by nir_krakauer (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-12-18 rik5 Release3.8.2 dev
    2014-12-29 rik5 StatusNone Confirmed

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code