23 #if defined (HAVE_CONFIG_H) 42 return dv.
ndims () == 2 && (
dv(0) == 1 ||
dv(1) == 1);
56 if (
y >
x[n-1] ||
y <
x[0])
59 #if defined (EXHAUSTIF) 60 for (j = 0; j < n - 1; j++)
62 if (
x[j] <=
y &&
y <=
x[j+1])
91 if (
y >
x[0] ||
y <
x[n-1])
94 #if defined (EXHAUSTIF) 95 for (j = 0; j < n - 1; j++)
97 if (
x[j+1] <=
y &&
y <=
x[j])
125 template <
typename T>
129 const T *v,
const T **
y, T *vi)
141 for (
int i = 0;
i < n;
i++)
144 out = index[
i] == -1;
151 coef[2*
i+1] = (
y[
i][m] -
x[
i][j])/(
x[
i][j+1] -
x[
i][j]);
152 coef[2*
i] = 1 - coef[2*
i+1];
163 for (
int i = 0;
i < (1 << n);
i++)
169 for (
int j = 0; j < n; j++)
173 l +=
scale[j] * (index[j] + bit);
183 template <
typename T,
typename M>
194 for (
int i = 0;
i < n;
i++)
197 size[
i] =
V.dims ()(
i);
203 const T *v =
V.data ();
204 T *vi = Vi.fortran_vec ();
213 for (
int i = 1;
i < n;
i++)
221 for (
int i = 0;
i < n;
i++)
223 if (X[
i].
dims () !=
V.dims ())
224 error (
"interpn: incompatible size of argument number %d",
i+1);
235 for (
int i = 0;
i < n;
i++)
238 error (
"interpn: incompatible size of argument number %d",
i+1);
261 DEFUN (__lin_interpn__, args, ,
267 int nargin = args.length ();
277 if (args(n).is_single_type ())
284 for (
int i = 0;
i < n;
i++)
286 X[
i] = args(
i).float_array_value ();
287 Y[
i] = args(n+
i+1).float_array_value ();
290 error (
"interpn: incompatible size of argument number %d", n+
i+2);
293 retval = lin_interpn<float, FloatNDArray> (n, X,
V, Y);
300 const NDArray V = args(n).array_value ();
302 for (
int i = 0;
i < n;
i++)
304 X[
i] = args(
i).array_value ();
305 Y[
i] = args(n+
i+1).array_value ();
308 error (
"interpn: incompatible size of argument number %d", n+
i+2);
311 retval = lin_interpn<double, NDArray> (n, X,
V, Y);
F77_RET_T const F77_INT const F77_INT const F77_INT const F77_DBLE const F77_DBLE F77_INT F77_DBLE * V
OCTINTERP_API void print_usage(void)
#define DEFUN(name, args_name, nargout_name, doc)
Macro to define a builtin function.
void error(const char *fmt,...)
octave_idx_type lookup(const T *x, octave_idx_type n, T y)
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 isvector(const T &array)
then the function must return scalars which will be concatenated into the return array(s). If code
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
F77_RET_T const F77_INT const F77_INT const F77_INT const F77_DBLE const F77_DBLE F77_INT & M
the element is set to zero In other the statement xample y
void scale(Matrix &m, double x, double y, double z)
#define OCTAVE_LOCAL_BUFFER(T, buf, size)
octave_idx_type ndims(void) const
Number of dimensions.
Vector representing the dimensions (size) of an Array.
void lin_interpn(int n, const octave_idx_type *size, const octave_idx_type *scale, octave_idx_type Ni, T extrapval, const T **x, const T *v, const T **y, T *vi)
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 * x