GNU Octave  8.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
fNDArray.cc
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 //
3 // Copyright (C) 1996-2023 The Octave Project Developers
4 //
5 // See the file COPYRIGHT.md in the top-level directory of this
6 // distribution or <https://octave.org/copyright/>.
7 //
8 // This file is part of Octave.
9 //
10 // Octave is free software: you can redistribute it and/or modify it
11 // under the terms of the GNU General Public License as published by
12 // the Free Software Foundation, either version 3 of the License, or
13 // (at your option) any later version.
14 //
15 // Octave is distributed in the hope that it will be useful, but
16 // WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 // GNU General Public License for more details.
19 //
20 // You should have received a copy of the GNU General Public License
21 // along with Octave; see the file COPYING. If not, see
22 // <https://www.gnu.org/licenses/>.
23 //
24 ////////////////////////////////////////////////////////////////////////
25 
26 #if defined (HAVE_CONFIG_H)
27 # include "config.h"
28 #endif
29 
30 #include <istream>
31 #include <limits>
32 #include <ostream>
33 
34 #include "Array-util.h"
35 #include "f77-fcn.h"
36 #include "fNDArray.h"
37 #include "lo-error.h"
38 #include "lo-ieee.h"
39 #include "lo-mappers.h"
40 #include "mx-base.h"
41 #include "mx-op-defs.h"
42 #include "oct-fftw.h"
43 #include "oct-locbuf.h"
44 
45 #include "bsxfun-defs.cc"
46 
48  : MArray<float> (a.dims ())
49 {
50  octave_idx_type n = a.numel ();
51  for (octave_idx_type i = 0; i < n; i++)
52  xelem (i) = static_cast<unsigned char> (a(i));
53 }
54 
55 #if defined (HAVE_FFTW)
56 
58 FloatNDArray::fourier (int dim) const
59 {
60  dim_vector dv = dims ();
61 
62  if (dim > dv.ndims () || dim < 0)
63  return FloatComplexNDArray ();
64 
65  octave_idx_type stride = 1;
66  octave_idx_type n = dv(dim);
67 
68  for (int i = 0; i < dim; i++)
69  stride *= dv(i);
70 
71  octave_idx_type howmany = numel () / dv(dim);
72  howmany = (stride == 1 ? howmany : (howmany > stride ? stride : howmany));
73  octave_idx_type nloop = (stride == 1 ? 1 : numel () / dv(dim) / stride);
74  octave_idx_type dist = (stride == 1 ? n : 1);
75 
76  const float *in (data ());
77  FloatComplexNDArray retval (dv);
78  FloatComplex *out (retval.fortran_vec ());
79 
80  // Need to be careful here about the distance between fft's
81  for (octave_idx_type k = 0; k < nloop; k++)
82  octave::fftw::fft (in + k * stride * n, out + k * stride * n,
83  n, howmany, stride, dist);
84 
85  return retval;
86 }
87 
89 FloatNDArray::ifourier (int dim) const
90 {
91  dim_vector dv = dims ();
92 
93  if (dim > dv.ndims () || dim < 0)
94  return FloatComplexNDArray ();
95 
96  octave_idx_type stride = 1;
97  octave_idx_type n = dv(dim);
98 
99  for (int i = 0; i < dim; i++)
100  stride *= dv(i);
101 
102  octave_idx_type howmany = numel () / dv(dim);
103  howmany = (stride == 1 ? howmany : (howmany > stride ? stride : howmany));
104  octave_idx_type nloop = (stride == 1 ? 1 : numel () / dv(dim) / stride);
105  octave_idx_type dist = (stride == 1 ? n : 1);
106 
107  FloatComplexNDArray retval (*this);
108  FloatComplex *out (retval.fortran_vec ());
109 
110  // Need to be careful here about the distance between fft's
111  for (octave_idx_type k = 0; k < nloop; k++)
112  octave::fftw::ifft (out + k * stride * n, out + k * stride * n,
113  n, howmany, stride, dist);
114 
115  return retval;
116 }
117 
120 {
121  dim_vector dv = dims ();
122  if (dv.ndims () < 2)
123  return FloatComplexNDArray ();
124 
125  dim_vector dv2 (dv(0), dv(1));
126  const float *in = data ();
127  FloatComplexNDArray retval (dv);
128  FloatComplex *out = retval.fortran_vec ();
129  octave_idx_type howmany = numel () / dv(0) / dv(1);
130  octave_idx_type dist = dv(0) * dv(1);
131 
132  for (octave_idx_type i=0; i < howmany; i++)
133  octave::fftw::fftNd (in + i*dist, out + i*dist, 2, dv2);
134 
135  return retval;
136 }
137 
140 {
141  dim_vector dv = dims ();
142  if (dv.ndims () < 2)
143  return FloatComplexNDArray ();
144 
145  dim_vector dv2 (dv(0), dv(1));
146  FloatComplexNDArray retval (*this);
147  FloatComplex *out = retval.fortran_vec ();
148  octave_idx_type howmany = numel () / dv(0) / dv(1);
149  octave_idx_type dist = dv(0) * dv(1);
150 
151  for (octave_idx_type i=0; i < howmany; i++)
152  octave::fftw::ifftNd (out + i*dist, out + i*dist, 2, dv2);
153 
154  return retval;
155 }
156 
159 {
160  dim_vector dv = dims ();
161  int rank = dv.ndims ();
162 
163  const float *in (data ());
164  FloatComplexNDArray retval (dv);
165  FloatComplex *out (retval.fortran_vec ());
166 
167  octave::fftw::fftNd (in, out, rank, dv);
168 
169  return retval;
170 }
171 
174 {
175  dim_vector dv = dims ();
176  int rank = dv.ndims ();
177 
178  FloatComplexNDArray tmp (*this);
179  FloatComplex *in (tmp.fortran_vec ());
180  FloatComplexNDArray retval (dv);
181  FloatComplex *out (retval.fortran_vec ());
182 
183  octave::fftw::ifftNd (in, out, rank, dv);
184 
185  return retval;
186 }
187 
188 #else
189 
191 FloatNDArray::fourier (int dim) const
192 {
193  octave_unused_parameter (dim);
194 
195  (*current_liboctave_error_handler)
196  ("support for FFTW was unavailable or disabled when liboctave was built");
197 
198  return FloatComplexNDArray ();
199 }
200 
202 FloatNDArray::ifourier (int dim) const
203 {
204  octave_unused_parameter (dim);
205 
206  (*current_liboctave_error_handler)
207  ("support for FFTW was unavailable or disabled when liboctave was built");
208  return FloatComplexNDArray ();
209 }
210 
212 FloatNDArray::fourier2d (void) const
213 {
214  (*current_liboctave_error_handler)
215  ("support for FFTW was unavailable or disabled when liboctave was built");
216 
217  return FloatComplexNDArray ();
218 }
219 
221 FloatNDArray::ifourier2d (void) const
222 {
223  (*current_liboctave_error_handler)
224  ("support for FFTW was unavailable or disabled when liboctave was built");
225 
226  return FloatComplexNDArray ();
227 }
228 
230 FloatNDArray::fourierNd (void) const
231 {
232  (*current_liboctave_error_handler)
233  ("support for FFTW was unavailable or disabled when liboctave was built");
234 
235  return FloatComplexNDArray ();
236 }
237 
239 FloatNDArray::ifourierNd (void) const
240 {
241  (*current_liboctave_error_handler)
242  ("support for FFTW was unavailable or disabled when liboctave was built");
243 
244  return FloatComplexNDArray ();
245 }
246 
247 #endif
248 
249 // unary operations
250 
253 {
254  if (any_element_is_nan ())
256 
257  return do_mx_unary_op<bool, float> (*this, mx_inline_not);
258 }
259 
260 bool
262 {
263  return (neg_zero ? test_all (octave::math::negative_sign)
264  : do_mx_check<float> (*this, mx_inline_any_negative));
265 }
266 
267 bool
269 {
270  return (neg_zero ? test_all (octave::math::positive_sign)
271  : do_mx_check<float> (*this, mx_inline_any_positive));
272 }
273 
274 bool
276 {
277  return do_mx_check<float> (*this, mx_inline_any_nan);
278 }
279 
280 bool
282 {
283  return ! do_mx_check<float> (*this, mx_inline_all_finite);
284 }
285 
286 bool
288 {
289  return ! test_all (octave::is_one_or_zero);
290 }
291 
292 bool
294 {
295  return test_all (octave::is_zero);
296 }
297 
298 bool
300 {
302 }
303 
304 // Return nonzero if any element of M is not an integer. Also extract
305 // the largest and smallest values and return them in MAX_VAL and MIN_VAL.
306 
307 bool
308 FloatNDArray::all_integers (float& max_val, float& min_val) const
309 {
310  octave_idx_type nel = numel ();
311 
312  if (nel > 0)
313  {
314  max_val = elem (0);
315  min_val = elem (0);
316  }
317  else
318  return false;
319 
320  for (octave_idx_type i = 0; i < nel; i++)
321  {
322  float val = elem (i);
323 
324  if (val > max_val)
325  max_val = val;
326 
327  if (val < min_val)
328  min_val = val;
329 
330  if (! octave::math::isinteger (val))
331  return false;
332  }
333 
334  return true;
335 }
336 
337 bool
339 {
341 }
342 
343 bool
345 {
346  return false;
347 }
348 
349 // FIXME: this is not quite the right thing.
350 
352 FloatNDArray::all (int dim) const
353 {
354  return do_mx_red_op<bool, float> (*this, dim, mx_inline_all);
355 }
356 
358 FloatNDArray::any (int dim) const
359 {
360  return do_mx_red_op<bool, float> (*this, dim, mx_inline_any);
361 }
362 
364 FloatNDArray::cumprod (int dim) const
365 {
366  return do_mx_cum_op<float, float> (*this, dim, mx_inline_cumprod);
367 }
368 
370 FloatNDArray::cumsum (int dim) const
371 {
372  return do_mx_cum_op<float, float> (*this, dim, mx_inline_cumsum);
373 }
374 
376 FloatNDArray::prod (int dim) const
377 {
378  return do_mx_red_op<float, float> (*this, dim, mx_inline_prod);
379 }
380 
381 NDArray
382 FloatNDArray::dprod (int dim) const
383 {
384  return do_mx_red_op<double, float> (*this, dim, mx_inline_dprod);
385 }
386 
388 FloatNDArray::sum (int dim) const
389 {
390  return do_mx_red_op<float, float> (*this, dim, mx_inline_sum);
391 }
392 
393 NDArray
394 FloatNDArray::dsum (int dim) const
395 {
396  return do_mx_red_op<double, float> (*this, dim, mx_inline_dsum);
397 }
398 
400 FloatNDArray::sumsq (int dim) const
401 {
402  return do_mx_red_op<float, float> (*this, dim, mx_inline_sumsq);
403 }
404 
406 FloatNDArray::max (int dim) const
407 {
408  return do_mx_minmax_op<float> (*this, dim, mx_inline_max);
409 }
410 
412 FloatNDArray::max (Array<octave_idx_type>& idx_arg, int dim) const
413 {
414  return do_mx_minmax_op<float> (*this, idx_arg, dim, mx_inline_max);
415 }
416 
418 FloatNDArray::min (int dim) const
419 {
420  return do_mx_minmax_op<float> (*this, dim, mx_inline_min);
421 }
422 
424 FloatNDArray::min (Array<octave_idx_type>& idx_arg, int dim) const
425 {
426  return do_mx_minmax_op<float> (*this, idx_arg, dim, mx_inline_min);
427 }
428 
430 FloatNDArray::cummax (int dim) const
431 {
432  return do_mx_cumminmax_op<float> (*this, dim, mx_inline_cummax);
433 }
434 
437 {
438  return do_mx_cumminmax_op<float> (*this, idx_arg, dim, mx_inline_cummax);
439 }
440 
442 FloatNDArray::cummin (int dim) const
443 {
444  return do_mx_cumminmax_op<float> (*this, dim, mx_inline_cummin);
445 }
446 
449 {
450  return do_mx_cumminmax_op<float> (*this, idx_arg, dim, mx_inline_cummin);
451 }
452 
454 FloatNDArray::diff (octave_idx_type order, int dim) const
455 {
456  return do_mx_diff_op<float> (*this, dim, order, mx_inline_diff);
457 }
458 
462 {
463  if (rb.numel () > 0)
464  insert (rb, ra_idx);
465  return *this;
466 }
467 
471 {
472  FloatComplexNDArray retval (*this);
473  if (rb.numel () > 0)
474  retval.insert (rb, ra_idx);
475  return retval;
476 }
477 
481 {
482  charNDArray retval (dims ());
483  octave_idx_type nel = numel ();
484 
485  for (octave_idx_type i = 0; i < nel; i++)
486  {
487  float d = elem (i);
488 
489  if (octave::math::isnan (d))
490  (*current_liboctave_error_handler)
491  ("invalid conversion from NaN to character");
492 
494 
495  if (ival < 0 || ival > std::numeric_limits<unsigned char>::max ())
496  // FIXME: is there something better to do? Should we warn the user?
497  ival = 0;
498 
499  retval.elem (i) = static_cast<char> (ival);
500  }
501 
502  if (rb.isempty ())
503  return retval;
504 
505  retval.insert (rb, ra_idx);
506  return retval;
507 }
508 
511 {
512  return do_mx_unary_op<float, FloatComplex> (a, mx_inline_real);
513 }
514 
517 {
518  return do_mx_unary_op<float, FloatComplex> (a, mx_inline_imag);
519 }
520 
524 {
525  Array<float>::insert (a, r, c);
526  return *this;
527 }
528 
532 {
534  return *this;
535 }
536 
538 FloatNDArray::abs (void) const
539 {
540  return do_mx_unary_map<float, float, std::abs> (*this);
541 }
542 
545 {
546  return do_mx_unary_map<bool, float, octave::math::isnan> (*this);
547 }
548 
551 {
552  return do_mx_unary_map<bool, float, octave::math::isinf> (*this);
553 }
554 
557 {
558  return do_mx_unary_map<bool, float, octave::math::isfinite> (*this);
559 }
560 
561 void
563  const dim_vector& dimensions,
564  int start_dimension)
565 {
566  ::increment_index (ra_idx, dimensions, start_dimension);
567 }
568 
571  const dim_vector& dimensions)
572 {
573  return ::compute_index (ra_idx, dimensions);
574 }
575 
578 {
579  return MArray<float>::diag (k);
580 }
581 
584 {
585  return MArray<float>::diag (m, n);
586 }
587 
588 // This contains no information on the array structure !!!
589 std::ostream&
590 operator << (std::ostream& os, const FloatNDArray& a)
591 {
592  octave_idx_type nel = a.numel ();
593 
594  for (octave_idx_type i = 0; i < nel; i++)
595  {
596  os << ' ';
597  octave::write_value<float> (os, a.elem (i));
598  os << "\n";
599  }
600  return os;
601 }
602 
603 std::istream&
604 operator >> (std::istream& is, FloatNDArray& a)
605 {
606  octave_idx_type nel = a.numel ();
607 
608  if (nel > 0)
609  {
610  float tmp;
611  for (octave_idx_type i = 0; i < nel; i++)
612  {
613  tmp = octave::read_value<float> (is);
614  if (is)
615  a.elem (i) = tmp;
616  else
617  return is;
618  }
619  }
620 
621  return is;
622 }
623 
625 
628 
631 
634 
637 
octave_idx_type compute_index(octave_idx_type n, const dim_vector &dims)
Definition: Array-util.cc:177
#define BSXFUN_STDREL_DEFS_MXLOOP(ARRAY)
Definition: bsxfun-defs.cc:244
#define BSXFUN_STDOP_DEFS_MXLOOP(ARRAY)
Definition: bsxfun-defs.cc:236
#define BSXFUN_OP2_DEF_MXLOOP(OP, ARRAY, ARRAY1, ARRAY2, LOOP)
Definition: bsxfun-defs.cc:226
#define BSXFUN_OP_DEF_MXLOOP(OP, ARRAY, LOOP)
Definition: bsxfun-defs.cc:221
OCTARRAY_OVERRIDABLE_FUNC_API const T * data(void) const
Size of the specified dimension.
Definition: Array.h:663
OCTARRAY_OVERRIDABLE_FUNC_API bool isempty(void) const
Size of the specified dimension.
Definition: Array.h:651
bool test_all(F fcn) const
Size of the specified dimension.
Definition: Array.h:928
OCTARRAY_OVERRIDABLE_FUNC_API octave_idx_type numel(void) const
Number of elements in the array.
Definition: Array.h:414
OCTARRAY_OVERRIDABLE_FUNC_API const dim_vector & dims(void) const
Return a const-reference so that dims ()(i) works efficiently.
Definition: Array.h:503
OCTARRAY_API Array< T, Alloc > & insert(const Array< T, Alloc > &a, const Array< octave_idx_type > &idx)
Insert an array into another at a specified position.
Definition: Array-base.cc:1610
OCTARRAY_API T * fortran_vec(void)
Size of the specified dimension.
Definition: Array-base.cc:1766
OCTARRAY_OVERRIDABLE_FUNC_API T & elem(octave_idx_type n)
Size of the specified dimension.
Definition: Array.h:562
OCTARRAY_API Array< T, Alloc > diag(octave_idx_type k=0) const
Get the kth super or subdiagonal.
Definition: Array-base.cc:2543
OCTARRAY_OVERRIDABLE_FUNC_API T & xelem(octave_idx_type n)
Size of the specified dimension.
Definition: Array.h:524
OCTAVE_API FloatComplexNDArray & insert(const NDArray &a, octave_idx_type r, octave_idx_type c)
Definition: fCNDArray.cc:520
OCTAVE_API bool any_element_is_positive(bool=false) const
Definition: fNDArray.cc:268
OCTAVE_API boolNDArray isnan(void) const
Definition: fNDArray.cc:544
OCTAVE_API FloatComplexNDArray fourierNd(void) const
Definition: fNDArray.cc:158
OCTAVE_API FloatComplexNDArray ifourier2d(void) const
Definition: fNDArray.cc:139
OCTAVE_API bool all_elements_are_zero(void) const
Definition: fNDArray.cc:293
static OCTAVE_API octave_idx_type compute_index(Array< octave_idx_type > &ra_idx, const dim_vector &dimensions)
Definition: fNDArray.cc:570
FloatNDArray(void)
Definition: fNDArray.h:43
OCTAVE_API FloatNDArray sum(int dim=-1) const
Definition: fNDArray.cc:388
OCTAVE_API bool any_element_is_inf_or_nan(void) const
Definition: fNDArray.cc:281
OCTAVE_API boolNDArray isfinite(void) const
Definition: fNDArray.cc:556
OCTAVE_API FloatNDArray min(int dim=-1) const
Definition: fNDArray.cc:418
OCTAVE_API FloatComplexNDArray fourier2d(void) const
Definition: fNDArray.cc:119
OCTAVE_API bool all_integers(void) const
Definition: fNDArray.cc:338
OCTAVE_API FloatComplexNDArray ifourier(int dim=1) const
Definition: fNDArray.cc:89
OCTAVE_API FloatNDArray prod(int dim=-1) const
Definition: fNDArray.cc:376
OCTAVE_API bool any_element_is_negative(bool=false) const
Definition: fNDArray.cc:261
OCTAVE_API FloatNDArray cumprod(int dim=-1) const
Definition: fNDArray.cc:364
OCTAVE_API boolNDArray any(int dim=-1) const
Definition: fNDArray.cc:358
OCTAVE_API boolNDArray all(int dim=-1) const
Definition: fNDArray.cc:352
OCTAVE_API NDArray dprod(int dim=-1) const
Definition: fNDArray.cc:382
OCTAVE_API FloatNDArray & insert(const FloatNDArray &a, octave_idx_type r, octave_idx_type c)
Definition: fNDArray.cc:522
OCTAVE_API bool all_elements_are_int_or_inf_or_nan(void) const
Definition: fNDArray.cc:299
OCTAVE_API FloatNDArray cummin(int dim=-1) const
Definition: fNDArray.cc:442
OCTAVE_API bool too_large_for_float(void) const
Definition: fNDArray.cc:344
OCTAVE_API FloatNDArray cumsum(int dim=-1) const
Definition: fNDArray.cc:370
OCTAVE_API NDArray dsum(int dim=-1) const
Definition: fNDArray.cc:394
OCTAVE_API bool any_element_is_nan(void) const
Definition: fNDArray.cc:275
OCTAVE_API FloatNDArray concat(const FloatNDArray &rb, const Array< octave_idx_type > &ra_idx)
Definition: fNDArray.cc:460
OCTAVE_API bool any_element_not_one_or_zero(void) const
Definition: fNDArray.cc:287
static OCTAVE_API void increment_index(Array< octave_idx_type > &ra_idx, const dim_vector &dimensions, int start_dimension=0)
Definition: fNDArray.cc:562
OCTAVE_API FloatNDArray diff(octave_idx_type order=1, int dim=-1) const
Definition: fNDArray.cc:454
OCTAVE_API FloatComplexNDArray ifourierNd(void) const
Definition: fNDArray.cc:173
OCTAVE_API boolNDArray operator!(void) const
Definition: fNDArray.cc:252
OCTAVE_API FloatComplexNDArray fourier(int dim=1) const
Definition: fNDArray.cc:58
OCTAVE_API FloatNDArray cummax(int dim=-1) const
Definition: fNDArray.cc:430
OCTAVE_API FloatNDArray sumsq(int dim=-1) const
Definition: fNDArray.cc:400
OCTAVE_API boolNDArray isinf(void) const
Definition: fNDArray.cc:550
OCTAVE_API FloatNDArray max(int dim=-1) const
Definition: fNDArray.cc:406
OCTAVE_API FloatNDArray abs(void) const
Definition: fNDArray.cc:538
OCTAVE_API FloatNDArray diag(octave_idx_type k=0) const
Definition: fNDArray.cc:577
friend class FloatComplexNDArray
Definition: fNDArray.h:141
Template for N-dimensional array classes with like-type math operators.
Definition: MArray.h:63
OCTAVE_API charNDArray & insert(const charNDArray &a, octave_idx_type r, octave_idx_type c)
Definition: chNDArray.cc:166
Vector representing the dimensions (size) of an Array.
Definition: dim-vector.h:94
octave_idx_type ndims(void) const
Number of dimensions.
Definition: dim-vector.h:257
std::istream & operator>>(std::istream &is, FloatNDArray &a)
Definition: fNDArray.cc:604
FloatNDArray max(float d, const FloatNDArray &m)
Definition: fNDArray.cc:624
FloatNDArray imag(const FloatComplexNDArray &a)
Definition: fNDArray.cc:516
FloatNDArray real(const FloatComplexNDArray &a)
Definition: fNDArray.cc:510
std::ostream & operator<<(std::ostream &os, const FloatNDArray &a)
Definition: fNDArray.cc:590
void err_nan_to_logical_conversion(void)
octave_idx_type nint_big(double x)
Definition: lo-mappers.cc:184
bool negative_sign(double x)
Definition: lo-mappers.cc:178
bool isinteger(double x)
Definition: lo-mappers.h:225
bool positive_sign(double x)
Definition: lo-mappers.h:62
bool isnan(bool)
Definition: lo-mappers.h:178
F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE * d
bool is_int_or_inf_or_nan(double x)
Definition: lo-utils.cc:50
bool is_one_or_zero(const T &x)
Definition: lo-utils.h:72
bool is_zero(const T &x)
Definition: lo-utils.h:78
void mx_inline_any(const T *v, bool *r, octave_idx_type l, octave_idx_type n, octave_idx_type u)
Definition: mx-inlines.cc:851
void mx_inline_cummin(const T *v, T *r, octave_idx_type n)
Definition: mx-inlines.cc:1193
void mx_inline_cumprod(const T *v, T *r, octave_idx_type n)
Definition: mx-inlines.cc:868
void mx_inline_cumsum(const T *v, T *r, octave_idx_type n)
Definition: mx-inlines.cc:867
bool mx_inline_any_nan(std::size_t n, const T *x)
Definition: mx-inlines.cc:257
void mx_inline_max(const T *v, T *r, octave_idx_type n)
Definition: mx-inlines.cc:972
void mx_inline_not(std::size_t n, bool *r, const X *x)
Definition: mx-inlines.cc:181
void mx_inline_all(const T *v, bool *r, octave_idx_type m, octave_idx_type n)
Definition: mx-inlines.cc:817
void mx_inline_prod(const T *v, T *r, octave_idx_type l, octave_idx_type n, octave_idx_type u)
Definition: mx-inlines.cc:847
void mx_inline_cummax(const T *v, T *r, octave_idx_type n)
Definition: mx-inlines.cc:1194
void mx_inline_dprod(const T *v, typename subst_template_param< std::complex, T, double >::type *r, octave_idx_type l, octave_idx_type n, octave_idx_type u)
Definition: mx-inlines.cc:848
void mx_inline_real(std::size_t n, T *r, const std::complex< T > *x)
Definition: mx-inlines.cc:321
T mx_inline_sumsq(const T *v, octave_idx_type n)
Definition: mx-inlines.cc:755
bool mx_inline_any_positive(std::size_t n, const T *x)
Definition: mx-inlines.cc:296
void mx_inline_imag(std::size_t n, T *r, const std::complex< T > *x)
Definition: mx-inlines.cc:328
T mx_inline_sum(const T *v, octave_idx_type n)
Definition: mx-inlines.cc:752
void mx_inline_min(const T *v, T *r, octave_idx_type n)
Definition: mx-inlines.cc:971
T octave_idx_type m
Definition: mx-inlines.cc:773
void mx_inline_dsum(const T *v, typename subst_template_param< std::complex, T, double >::type *r, octave_idx_type l, octave_idx_type n, octave_idx_type u)
Definition: mx-inlines.cc:845
void mx_inline_diff(const T *v, T *r, octave_idx_type n, octave_idx_type order)
Definition: mx-inlines.cc:1390
bool mx_inline_all_finite(std::size_t n, const T *x)
Definition: mx-inlines.cc:270
bool mx_inline_any_negative(std::size_t n, const T *x)
Definition: mx-inlines.cc:283
octave_idx_type n
Definition: mx-inlines.cc:753
T * r
Definition: mx-inlines.cc:773
void mx_inline_pow(std::size_t n, R *r, const X *x, const Y *y)
Definition: mx-inlines.cc:414
#define NDND_BOOL_OPS(ND1, ND2)
Definition: mx-op-defs.h:350
#define NDS_BOOL_OPS(ND, S)
Definition: mx-op-defs.h:256
#define NDND_CMP_OPS(ND1, ND2)
Definition: mx-op-defs.h:333
#define SND_BOOL_OPS(S, ND)
Definition: mx-op-defs.h:303
#define NDS_CMP_OPS(ND, S)
Definition: mx-op-defs.h:239
#define SND_CMP_OPS(S, ND)
Definition: mx-op-defs.h:286
#define MINMAX_FCNS(T, S)
Definition: mx-op-defs.h:589
std::complex< float > FloatComplex
Definition: oct-cmplx.h:34
octave_int< T > pow(const octave_int< T > &a, const octave_int< T > &b)
const octave_base_value const Array< octave_idx_type > & ra_idx