# HG changeset patch # User John W. Eaton # Date 1583704495 14400 # Node ID 27c0b26e5a9f7716c7a21450012ea389fd72797a # Parent 908bdd05398a714b0d70e9b23af2f82d701f8d94# Parent 9e983eb1749d984ed587ad32d4de18a868f3c991 maint: merge stable to default. diff -r 908bdd05398a -r 27c0b26e5a9f NEWS diff -r 908bdd05398a -r 27c0b26e5a9f etc/NEWS.6 --- 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 diff -r 908bdd05398a -r 27c0b26e5a9f libinterp/corefcn/sparse-xpow.cc --- 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 (b) != b) + if (! xisint (b)) error ("use full(a) ^ full(b)"); int btmp = static_cast (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 (b) != b) + if (! xisint (b)) error ("use full(a) ^ full(b)"); int btmp = static_cast (b); @@ -329,7 +329,7 @@ octave_idx_type nr = a.rows (); octave_idx_type nc = a.cols (); - if (static_cast (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 (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 (btmp) != btmp) + if (! xisint (btmp)) { convert_to_complex = 1; goto done; diff -r 908bdd05398a -r 27c0b26e5a9f libinterp/parse-tree/oct-parse.yy --- 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 ()) {