24 #if defined (HAVE_CONFIG_H) 58 double val =
static_cast<double> 68 double val =
static_cast<double> (pa[
i]);
79 ptmp[
i] = static_cast<double>
80 (pa[
i] + static_cast<octave_idx_type> (1));
83 ptmp[
i] = static_cast<double> (pa[
i]);
92 xelem (
i) =
static_cast<unsigned char> (
a(
i));
95 #if defined (HAVE_FFTW) 102 if (dim >
dv.
ndims () || dim < 0)
108 for (
int i = 0;
i < dim;
i++)
112 howmany = (stride == 1 ? howmany : (howmany > stride ? stride : howmany));
123 n, howmany, stride, dist);
133 if (dim >
dv.
ndims () || dim < 0)
139 for (
int i = 0;
i < dim;
i++)
143 howmany = (stride == 1 ? howmany : (howmany > stride ? stride : howmany));
153 n, howmany, stride, dist);
237 if (dim >
dv.
ndims () || dim < 0)
244 Complex *pwsave = wsave.fortran_vec ();
250 for (
int i = 0;
i < dim;
i++)
254 howmany = (stride == 1 ? howmany : (howmany > stride ? stride : howmany));
285 if (dim >
dv.
ndims () || dim < 0)
292 Complex *pwsave = wsave.fortran_vec ();
298 for (
int i = 0;
i < dim;
i++)
302 howmany = (stride == 1 ? howmany : (howmany > stride ? stride : howmany));
322 static_cast<double> (npts);
338 for (
int i = 0;
i < rank;
i++)
343 Complex *pwsave = wsave.fortran_vec ();
348 howmany = (stride == 1 ? howmany
349 : (howmany > stride ? stride : howmany));
362 prow[l] =
retval((l +
k*npts)*stride + j*dist);
368 retval((l +
k*npts)*stride + j*dist) = prow[l];
387 for (
int i = 0;
i < rank;
i++)
392 Complex *pwsave = wsave.fortran_vec ();
397 howmany = (stride == 1 ? howmany
398 : (howmany > stride ? stride : howmany));
411 prow[l] =
retval((l +
k*npts)*stride + j*dist);
417 retval((l +
k*npts)*stride + j*dist) =
418 prow[l] / static_cast<double> (npts);
436 for (
int i = 0;
i < rank;
i++)
441 Complex *pwsave = wsave.fortran_vec ();
446 howmany = (stride == 1 ? howmany
447 : (howmany > stride ? stride : howmany));
460 prow[l] =
retval((l +
k*npts)*stride + j*dist);
466 retval((l +
k*npts)*stride + j*dist) = prow[l];
484 for (
int i = 0;
i < rank;
i++)
489 Complex *pwsave = wsave.fortran_vec ();
494 howmany = (stride == 1 ? howmany
495 : (howmany > stride ? stride : howmany));
508 prow[l] =
retval((l +
k*npts)*stride + j*dist);
514 retval((l +
k*npts)*stride + j*dist) =
515 prow[l] / static_cast<double> (npts);
632 return do_mx_red_op<bool, double> (*
this, dim,
mx_inline_all);
638 return do_mx_red_op<bool, double> (*
this, dim,
mx_inline_any);
662 return do_mx_red_op<double, double> (*
this, dim,
mx_inline_sum);
686 return do_mx_minmax_op<double> (*
this, idx_arg, dim,
mx_inline_max);
698 return do_mx_minmax_op<double> (*
this, idx_arg, dim,
mx_inline_min);
759 (*current_liboctave_error_handler)
760 (
"invalid conversion from NaN to character");
768 retval.elem (
i) =
static_cast<char>(ival);
807 return do_mx_unary_map<double, double, std::abs> (*this);
813 return do_mx_unary_map<bool, double, octave::math::isnan> (*this);
819 return do_mx_unary_map<bool, double, octave::math::isinf> (*this);
825 return do_mx_unary_map<bool, double, octave::math::isfinite> (*this);
880 tmp = octave_read_value<double> (
is);
T mx_inline_xsum(const T *v, octave_idx_type n)
void octave_write_double(std::ostream &os, double d)
octave_idx_type compute_index(octave_idx_type n, const dim_vector &dims)
bool test_any(F fcn) const
Simpler calls.
#define NDS_BOOL_OPS(ND, S)
#define NDS_CMP_OPS(ND, S)
ComplexNDArray fourier(int dim=1) const
ComplexNDArray ifourier(int dim=1) const
Template for N-dimensional array classes with like-type math operators.
void mx_inline_cummax(const T *v, T *r, octave_idx_type n)
std::istream & operator>>(std::istream &is, NDArray &a)
const octave_base_value const Array< octave_idx_type > & ra_idx
#define SND_CMP_OPS(S, ND)
bool any_element_is_negative(bool=false) const
#define BSXFUN_OP_DEF_MXLOOP(OP, ARRAY, LOOP)
NDArray cummin(int dim=-1) const
subroutine zffti(n, wsave)
identity matrix If supplied two scalar respectively For allows like xample val
NDArray max(double d, const NDArray &m)
#define F77_DBLE_CMPLX_ARG(x)
void mx_inline_real(size_t n, T *r, const std::complex< T > *x)
bool mx_inline_all_finite(size_t n, const T *x)
const double * fortran_vec(void) const
#define MINMAX_FCNS(T, S)
NDArray min(int dim=-1) const
ComplexNDArray ifourier2d(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 &)
NDArray cumsum(int dim=-1) const
double & elem(octave_idx_type n)
double lo_ieee_nan_value(void)
T mx_inline_sumsq(const T *v, octave_idx_type n)
std::ostream & operator<<(std::ostream &os, const NDArray &a)
bool mx_inline_any_negative(size_t n, const T *x)
bool positive_sign(double x)
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
bool too_large_for_float(void) const
NDArray sumsq(int dim=-1) const
void err_nan_to_logical_conversion(void)
NDArray diff(octave_idx_type order=1, int dim=-1) const
bool all_integers(void) const
bool mx_inline_any(const T *v, octave_idx_type n)
NDArray imag(const ComplexNDArray &a)
F77_RET_T const F77_REAL const F77_REAL F77_REAL &F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE &F77_RET_T const F77_DBLE F77_DBLE &F77_RET_T const F77_REAL F77_REAL &F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE * d
subroutine zfftb(n, c, wsave)
NDArray concat(const NDArray &rb, const Array< octave_idx_type > &ra_idx)
void mx_inline_imag(size_t n, T *r, const std::complex< T > *x)
Array< T > & insert(const Array< T > &a, const Array< octave_idx_type > &idx)
Insert an array into another at a specified position.
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
boolNDArray all(int dim=-1) const
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)
NDArray diag(octave_idx_type k=0) const
NDArray xsum(int dim=-1) const
#define NDND_CMP_OPS(ND1, ND2)
NDArray real(const ComplexNDArray &a)
bool all_elements_are_zero(void) const
bool all_elements_are_int_or_inf_or_nan(void) const
#define NDND_BOOL_OPS(ND1, ND2)
NDArray & insert(const NDArray &a, octave_idx_type r, octave_idx_type c)
NDArray cummax(int dim=-1) const
void resize(const dim_vector &dv, const double &rfv)
static octave_idx_type compute_index(Array< octave_idx_type > &ra_idx, const dim_vector &dimensions)
octave_int< T > pow(const octave_int< T > &a, const octave_int< T > &b)
ComplexNDArray ifourierNd(void) const
boolNDArray isfinite(void) const
#define SND_BOOL_OPS(S, ND)
bool mx_inline_any_positive(size_t n, const T *x)
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)
boolNDArray operator!(void) const
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)
NDArray cumprod(int dim=-1) const
double & xelem(octave_idx_type n)
bool test_all(F fcn) const
T mx_inline_sum(const T *v, octave_idx_type n)
bool any_element_is_inf_or_nan(void) const
static void increment_index(Array< octave_idx_type > &ra_idx, const dim_vector &dimensions, int start_dimension=0)
void mx_inline_cumprod(const T *v, T *r, octave_idx_type n)
void mx_inline_cumsum(const T *v, T *r, octave_idx_type n)
ComplexNDArray fourier2d(void) const
octave_idx_type nint_big(double x)
bool negative_sign(double x)
bool any_element_not_one_or_zero(void) const
Array< T > diag(octave_idx_type k=0) const
Get the kth super or subdiagonal.
boolNDArray isinf(void) const
static int ifftNd(const Complex *, Complex *, const int, const dim_vector &)
NDArray sum(int dim=-1) const
#define OCTAVE_LOCAL_BUFFER(T, buf, size)
#define BSXFUN_OP2_DEF_MXLOOP(OP, ARRAY, ARRAY1, ARRAY2, LOOP)
boolNDArray isnan(void) const
bool any_element_is_positive(bool=false) const
NDArray prod(int dim=-1) const
bool xtoo_large_for_float(double x)
boolNDArray any(int dim=-1) const
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_not(size_t n, bool *r, const X *x)
octave_idx_type numel(void) const
Number of elements in the array.
write the output to stdout if nargout is
ComplexNDArray fourierNd(void) const
Vector representing the dimensions (size) of an Array.
NDArray max(int dim=-1) const
T mx_inline_prod(const T *v, octave_idx_type n)
bool xis_one_or_zero(double x)
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)
bool any_element_is_nan(void) const
bool xis_int_or_inf_or_nan(double x)
void mx_inline_min(const T *v, T *r, octave_idx_type n)