24 #if defined (HAVE_CONFIG_H) 38 #include "mx-cnda-s.h" 50 xelem (
i) =
static_cast<unsigned char> (
a(
i));
53 #if defined (HAVE_FFTW) 60 if (dim >
dv.
ndims () || dim < 0)
66 for (
int i = 0;
i < dim;
i++)
70 howmany = (stride == 1 ? howmany : (howmany > stride ? stride : howmany));
81 n, howmany, stride, dist);
91 if (dim >
dv.
ndims () || dim < 0)
97 for (
int i = 0;
i < dim;
i++)
101 howmany = (stride == 1 ? howmany : (howmany > stride ? stride : howmany));
112 n, howmany, stride, dist);
196 if (dim >
dv.
ndims () || dim < 0)
203 Complex *pwsave = wsave.fortran_vec ();
209 for (
int i = 0;
i < dim;
i++)
213 howmany = (stride == 1 ? howmany : (howmany > stride ? stride : howmany));
244 if (dim >
dv.
ndims () || dim < 0)
251 Complex *pwsave = wsave.fortran_vec ();
257 for (
int i = 0;
i < dim;
i++)
261 howmany = (stride == 1 ? howmany : (howmany > stride ? stride : howmany));
281 static_cast<double> (npts);
297 for (
int i = 0;
i < rank;
i++)
302 Complex *pwsave = wsave.fortran_vec ();
307 howmany = (stride == 1 ? howmany
308 : (howmany > stride ? stride : howmany));
321 prow[l] =
retval((l +
k*npts)*stride + j*dist);
327 retval((l +
k*npts)*stride + j*dist) = prow[l];
346 for (
int i = 0;
i < rank;
i++)
351 Complex *pwsave = wsave.fortran_vec ();
356 howmany = (stride == 1 ? howmany
357 : (howmany > stride ? stride : howmany));
370 prow[l] =
retval((l +
k*npts)*stride + j*dist);
376 retval((l +
k*npts)*stride + j*dist) =
377 prow[l] / static_cast<double> (npts);
395 for (
int i = 0;
i < rank;
i++)
400 Complex *pwsave = wsave.fortran_vec ();
405 howmany = (stride == 1 ? howmany
406 : (howmany > stride ? stride : howmany));
419 prow[l] =
retval((l +
k*npts)*stride + j*dist);
425 retval((l +
k*npts)*stride + j*dist) = prow[l];
443 for (
int i = 0;
i < rank;
i++)
448 Complex *pwsave = wsave.fortran_vec ();
453 howmany = (stride == 1 ? howmany
454 : (howmany > stride ? stride : howmany));
467 prow[l] =
retval((l +
k*npts)*stride + j*dist);
473 retval((l +
k*npts)*stride + j*dist) =
474 prow[l] / static_cast<double> (npts);
532 double r_val =
val.real ();
533 double i_val =
val.imag ();
551 double r_val =
val.real ();
552 double i_val =
val.imag ();
583 return do_mx_red_op<bool, Complex> (*
this, dim,
mx_inline_all);
589 return do_mx_red_op<bool, Complex> (*
this, dim,
mx_inline_any);
607 return do_mx_red_op<Complex, Complex> (*
this, dim,
mx_inline_prod);
613 return do_mx_red_op<Complex, Complex> (*
this, dim,
mx_inline_sum);
619 return do_mx_red_op<Complex, Complex> (*
this, dim,
mx_inline_xsum);
631 return do_mx_diff_op<Complex> (*
this, dim, order,
mx_inline_diff);
673 return do_mx_minmax_op<Complex> (*
this, idx_arg, dim,
mx_inline_max);
685 return do_mx_minmax_op<Complex> (*
this, idx_arg, dim,
mx_inline_min);
715 return do_mx_unary_map<double, Complex, std::abs> (*this);
721 return do_mx_unary_map<bool, Complex, octave::math::isnan> (*this);
727 return do_mx_unary_map<bool, Complex, octave::math::isinf> (*this);
733 return do_mx_unary_map<bool, Complex, octave::math::isfinite> (*this);
739 return do_mx_unary_map<Complex, Complex, std::conj<double>> (
a);
747 int n = a_dv.
ndims ();
751 (
"Array<T>::insert: invalid indexing operation");
755 a_ra_idx.
elem (0) = r;
756 a_ra_idx.
elem (1) =
c;
758 for (
int i = 0;
i < n;
i++)
761 (*current_liboctave_error_handler)
762 (
"Array<T>::insert: range error for insert");
765 a_ra_idx.
elem (0) = 0;
766 a_ra_idx.
elem (1) = 0;
776 ra_idx.elem (0) = a_ra_idx(0) + r;
777 ra_idx.elem (1) = a_ra_idx(1) +
c;
855 tmp = octave_read_value<Complex> (
is);
ComplexNDArray cumprod(int dim=-1) const
T mx_inline_xsum(const T *v, octave_idx_type n)
octave_idx_type compute_index(octave_idx_type n, const dim_vector &dims)
void mx_inline_mul2(size_t n, R *r, const X *x)
ComplexNDArray fourierNd(void) const
ComplexNDArray concat(const ComplexNDArray &rb, const Array< octave_idx_type > &ra_idx)
std::istream & operator>>(std::istream &is, ComplexNDArray &a)
bool test_any(F fcn) const
Simpler calls.
#define NDS_BOOL_OPS(ND, S)
#define NDS_CMP_OPS(ND, S)
ComplexNDArray ifourierNd(void) const
Template for N-dimensional array classes with like-type math operators.
ComplexNDArray conj(const ComplexNDArray &a)
boolNDArray operator!(void) const
void mx_inline_cummax(const T *v, T *r, octave_idx_type n)
const octave_base_value const Array< octave_idx_type > & ra_idx
#define SND_CMP_OPS(S, ND)
#define BSXFUN_OP_DEF_MXLOOP(OP, ARRAY, LOOP)
ComplexNDArray xsum(int dim=-1) const
subroutine zffti(n, wsave)
identity matrix If supplied two scalar respectively For allows like xample val
OCTAVE_NORETURN liboctave_error_handler current_liboctave_error_handler
#define F77_DBLE_CMPLX_ARG(x)
ComplexNDArray sumsq(int dim=-1) const
ComplexNDArray & operator/=(ComplexNDArray &a, double s)
bool mx_inline_all_finite(size_t n, const T *x)
const Complex * fortran_vec(void) const
#define MINMAX_FCNS(T, S)
boolNDArray isfinite(void) const
void octave_write_complex(std::ostream &os, const Complex &c)
ComplexNDArray diag(octave_idx_type k=0) const
ComplexNDArray concat(NDArray &ra, ComplexNDArray &rb, const Array< octave_idx_type > &ra_idx)
ComplexNDArray diff(octave_idx_type order=1, int dim=-1) const
boolNDArray isnan(void) const
const dim_vector & dims(void) const
Return a const-reference so that dims ()(i) works efficiently.
static int ifft(const Complex *in, Complex *out, size_t npts, size_t nsamples=1, octave_idx_type stride=1, octave_idx_type dist=-1)
static int fftNd(const double *, Complex *, const int, const dim_vector &)
ComplexNDArray sum(int dim=-1) const
Complex & elem(octave_idx_type n)
T mx_inline_sumsq(const T *v, octave_idx_type n)
ComplexNDArray cummin(int dim=-1) const
void mx_inline_max(const T *v, T *r, octave_idx_type n)
nd example oindent opens the file binary numeric values will be read assuming they are stored in IEEE format with the least significant bit and then converted to the native representation Opening a file that is already open simply opens it again and returns a separate file id It is not an error to open a file several though writing to the same file through several different file ids may produce unexpected results The possible values of text mode reading and writing automatically converts linefeeds to the appropriate line end character for the you may append a you must also open the file in binary mode The parameter conversions are currently only supported for and permissions will be set to and then everything is written in a single operation This is very efficient and improves performance c
void err_nan_to_logical_conversion(void)
bool too_large_for_float(void) const
bool mx_inline_any(const T *v, octave_idx_type n)
ComplexNDArray prod(int dim=-1) const
subroutine zfftb(n, c, wsave)
static void increment_index(Array< octave_idx_type > &ra_idx, const dim_vector &dimensions, int start_dimension=0)
Array< T > & insert(const Array< T > &a, const Array< octave_idx_type > &idx)
Insert an array into another at a specified position.
ComplexNDArray fourier(int dim=1) const
calling an anonymous function involves an overhead quite comparable to the overhead of an m file function Passing a handle to a built in function is because the interpreter is not involved in the internal loop For a
bool mx_inline_all_real(size_t n, const std::complex< T > *x)
static int fft(const double *in, Complex *out, size_t npts, size_t nsamples=1, octave_idx_type stride=1, octave_idx_type dist=-1)
ComplexNDArray cummax(int dim=-1) const
#define NDND_CMP_OPS(ND1, ND2)
ComplexNDArray & insert(const NDArray &a, octave_idx_type r, octave_idx_type c)
#define NDND_BOOL_OPS(ND1, ND2)
boolNDArray any(int dim=-1) const
ComplexNDArray min(int dim=-1) const
octave_int< T > pow(const octave_int< T > &a, const octave_int< T > &b)
#define SND_BOOL_OPS(S, ND)
ComplexNDArray ifourier2d(void) const
bool any_element_is_inf_or_nan(void) const
void mx_inline_cummin(const T *v, T *r, octave_idx_type n)
void mx_inline_pow(size_t n, R *r, const X *x, const Y *y)
the exceeded dimensions are set to if fewer subscripts than dimensions are the exceeding dimensions are merged into the final requested dimension For consider the following dims
bool mx_inline_any_nan(size_t n, const T *x)
F77_RET_T F77_FUNC(xerbla, XERBLA)
#define BSXFUN_STDREL_DEFS_MXLOOP(ARRAY)
bool any_element_is_nan(void) const
Complex & xelem(octave_idx_type n)
T mx_inline_sum(const T *v, octave_idx_type n)
ComplexNDArray cumsum(int dim=-1) const
bool all_integers(double &max_val, double &min_val) const
void mx_inline_cumprod(const T *v, T *r, octave_idx_type n)
static octave_idx_type compute_index(Array< octave_idx_type > &ra_idx, const dim_vector &dimensions)
boolNDArray isinf(void) const
void mx_inline_cumsum(const T *v, T *r, octave_idx_type n)
std::ostream & operator<<(std::ostream &os, const ComplexNDArray &a)
OCTAVE_EXPORT octave_value_list or N dimensional array whose elements are all equal to the IEEE symbol NaN(Not a Number). NaN is the result of operations which do not produce a well defined 0 result. Common operations which produce a NaN are arithmetic with infinity ex($\infty - \infty$)
Array< T > diag(octave_idx_type k=0) const
Get the kth super or subdiagonal.
static int ifftNd(const Complex *, Complex *, const int, const dim_vector &)
ComplexNDArray max(int dim=-1) const
#define OCTAVE_LOCAL_BUFFER(T, buf, size)
bool xtoo_large_for_float(double x)
bool all_elements_are_real(void) const
static const Complex Complex_NaN_result(octave::numeric_limits< double >::NaN(), octave::numeric_limits< double >::NaN())
octave_idx_type ndims(void) const
Number of dimensions.
bool mx_inline_all(const T *v, octave_idx_type n)
#define BSXFUN_STDOP_DEFS_MXLOOP(ARRAY)
std::complex< double > Complex
void mx_inline_div2(size_t n, R *r, const X *x)
void mx_inline_not(size_t n, bool *r, const X *x)
ComplexNDArray ifourier(int dim=1) const
octave_idx_type numel(void) const
Number of elements in the array.
write the output to stdout if nargout is
boolNDArray all(int dim=-1) const
Vector representing the dimensions (size) of an Array.
T mx_inline_prod(const T *v, octave_idx_type n)
ComplexNDArray fourier2d(void) const
where the brackets indicate optional arguments and and character or cell array For character arrays the conversion is repeated for every row
subroutine zfftf(n, c, wsave)
void mx_inline_diff(const T *v, T *r, octave_idx_type n, octave_idx_type order)
void mx_inline_min(const T *v, T *r, octave_idx_type n)