comparison src/ov-base-diag.h @ 15428:fd5c0159b588 stable

Fix diag handling of diagvectors (bug #37411) * DiagArray2.h (extract_diag): New function * DiagArray2.cc (extract_diag): Ditto * ov.h (octave_value): New constructors for DiagArray2<T> types. * ov.cc (octave_value): Ditto * ov-base-diag.h (octave_base_diag<DMT,MT>::diag): Remove definition. * ov-base-diag.cc (octave_base_diag<DMT,MT>::diag) Rewrite to check for special diagvector case. * data.cc: Add test for this bug
author Jordi Gutiérrez Hermoso <jordigh@octave.org>
date Fri, 21 Sep 2012 16:42:33 -0400
parents 72c96de7a403
children
comparison
equal deleted inserted replaced
15382:197774b411ec 15428:fd5c0159b588
95 95
96 MatrixType matrix_type (void) const { return MatrixType::Diagonal; } 96 MatrixType matrix_type (void) const { return MatrixType::Diagonal; }
97 MatrixType matrix_type (const MatrixType&) const 97 MatrixType matrix_type (const MatrixType&) const
98 { return matrix_type (); } 98 { return matrix_type (); }
99 99
100 octave_value diag (octave_idx_type k = 0) const 100 octave_value diag (octave_idx_type k = 0) const;
101 { return octave_value (matrix.diag (k)); }
102 101
103 octave_value sort (octave_idx_type dim = 0, sortmode mode = ASCENDING) const 102 octave_value sort (octave_idx_type dim = 0, sortmode mode = ASCENDING) const
104 { return to_dense ().sort (dim, mode); } 103 { return to_dense ().sort (dim, mode); }
105 octave_value sort (Array<octave_idx_type> &sidx, octave_idx_type dim = 0, 104 octave_value sort (Array<octave_idx_type> &sidx, octave_idx_type dim = 0,
106 sortmode mode = ASCENDING) const 105 sortmode mode = ASCENDING) const