comparison libinterp/corefcn/tril.cc @ 29931:7faff48840eb

prefer data over fortran_vec for read-only access to data See also the discussion here: https://octave.discourse.group/t/rename-uses-of-fortran-vec-to-data-for-clarity/1439 * Array.h (const T * Array<T>::fortran_vec (void) const): Deprecate. Change all uses to call data instead.
author John W. Eaton <jwe@octave.org>
date Fri, 30 Jul 2021 11:46:05 -0400
parents 270ffe1e7647
children 32c3a5805893
comparison
equal deleted inserted replaced
29930:aa98b5fdfbbb 29931:7faff48840eb
44 static Array<T> 44 static Array<T>
45 do_tril (const Array<T>& a, octave_idx_type k, bool pack) 45 do_tril (const Array<T>& a, octave_idx_type k, bool pack)
46 { 46 {
47 octave_idx_type nr = a.rows (); 47 octave_idx_type nr = a.rows ();
48 octave_idx_type nc = a.columns (); 48 octave_idx_type nc = a.columns ();
49 const T *avec = a.fortran_vec (); 49 const T *avec = a.data ();
50 octave_idx_type zero = 0; 50 octave_idx_type zero = 0;
51 51
52 if (pack) 52 if (pack)
53 { 53 {
54 octave_idx_type j1 = std::min (std::max (zero, k), nc); 54 octave_idx_type j1 = std::min (std::max (zero, k), nc);
86 static Array<T> 86 static Array<T>
87 do_triu (const Array<T>& a, octave_idx_type k, bool pack) 87 do_triu (const Array<T>& a, octave_idx_type k, bool pack)
88 { 88 {
89 octave_idx_type nr = a.rows (); 89 octave_idx_type nr = a.rows ();
90 octave_idx_type nc = a.columns (); 90 octave_idx_type nc = a.columns ();
91 const T *avec = a.fortran_vec (); 91 const T *avec = a.data ();
92 octave_idx_type zero = 0; 92 octave_idx_type zero = 0;
93 93
94 if (pack) 94 if (pack)
95 { 95 {
96 octave_idx_type j1 = std::min (std::max (zero, k), nc); 96 octave_idx_type j1 = std::min (std::max (zero, k), nc);