Mercurial > octave
changeset 28146:27c0b26e5a9f
maint: merge stable to default.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Sun, 08 Mar 2020 17:54:55 -0400 |
parents | 908bdd05398a (current diff) 9e983eb1749d (diff) |
children | a04cb1364af4 |
files | NEWS etc/NEWS.6 libinterp/parse-tree/oct-parse.yy |
diffstat | 3 files changed, 18 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/etc/NEWS.6 Fri Feb 28 07:08:14 2020 +0100 +++ b/etc/NEWS.6 Sun Mar 08 17:54:55 2020 -0400 @@ -158,6 +158,12 @@ outputs) as well as the orientation of all outputs to match Matlab releases prior to R2012b. +- The function `streamtube` is Matlab compatible and plots tubes along + streamlines which are scaled by the vector field divergence. The + Octave-only extension `ostreamtube` can be used to visualize the flow + expansion and contraction of the vector field due to the local + crossflow divergence. + - The interpreter now supports handles to nested functions. - The graphics properties `"LineWidth"` and `"MarkerSize"` are now
--- a/libinterp/corefcn/sparse-xpow.cc Fri Feb 28 07:08:14 2020 +0100 +++ b/libinterp/corefcn/sparse-xpow.cc Sun Mar 08 17:54:55 2020 -0400 @@ -67,7 +67,7 @@ if (nr == 0 || nc == 0 || nr != nc) error ("for A^b, A must be a square matrix. Use .^ for elementwise power."); - if (static_cast<int> (b) != b) + if (! xisint (b)) error ("use full(a) ^ full(b)"); int btmp = static_cast<int> (b); @@ -135,7 +135,7 @@ if (nr == 0 || nc == 0 || nr != nc) error ("for A^b, A must be a square matrix. Use .^ for elementwise power."); - if (static_cast<int> (b) != b) + if (! xisint (b)) error ("use full(a) ^ full(b)"); int btmp = static_cast<int> (b); @@ -329,7 +329,7 @@ octave_idx_type nr = a.rows (); octave_idx_type nc = a.cols (); - if (static_cast<int> (b) != b && a.any_element_is_negative ()) + if (! xisint (b) && a.any_element_is_negative ()) { ComplexMatrix result (nr, nc, Complex (std::pow (0.0, b))); @@ -363,7 +363,7 @@ retval = octave_value (result); } } - else if (static_cast<int> (b) != b && a.any_element_is_negative ()) + else if (! xisint (b) && a.any_element_is_negative ()) { SparseComplexMatrix result (a); @@ -427,7 +427,7 @@ if (a.data(i) < 0.0) { double btmp = b (a.ridx (i), j); - if (static_cast<int> (btmp) != btmp) + if (! xisint (btmp)) { convert_to_complex = 1; goto done;
--- a/libinterp/parse-tree/oct-parse.yy Fri Feb 28 07:08:14 2020 +0100 +++ b/libinterp/parse-tree/oct-parse.yy Sun Mar 08 17:54:55 2020 -0400 @@ -4561,6 +4561,13 @@ if (m_lexer.m_reading_fcn_file || m_lexer.m_reading_script_file || m_lexer.m_reading_classdef_file) curr_line = get_file_line (m_lexer.m_fcn_file_full_name, err_line); + else + curr_line = m_lexer.m_current_input_line; + + // Adjust the error column for display because it is 1-based in the + // lexer for easier reporting and it has already been advanced to + // one past the end of the most recently read token. + err_col -= 2; if (! curr_line.empty ()) {