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++)
143 index[
i] =
lookup (x[
i], size[i], y[i][
m]);
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++)
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);
269 if (nargin < 2 || nargin % 2 == 0)
275 int n = (nargin-1)/2;
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);
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)
void error(const char *fmt,...)
octave_idx_type lookup(const T *x, octave_idx_type n, T y)
F77_RET_T const F77_INT const F77_INT const F77_INT const F77_DBLE const F77_DBLE F77_INT & M
OCTAVE_EXPORT octave_value_list return the value of the option it must match the dimension of the state and the relative tolerance must also be a vector of the same length tem it must match the dimension of the state and the absolute tolerance must also be a vector of the same length The local error test applied at each integration step is xample roup calculate Y_a and Y _d item Given Y
bool isvector(const T &array)
nd deftypefn *octave_map m
then the function must return scalars which will be concatenated into the return array(s).If code
the sparsity preserving column transformation such that that defines the pivoting threshold can be given in which case it defines the c
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
=val(i)}if ode{val(i)}occurs in table i
octave_idx_type ndims(void) const
Number of dimensions.
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)
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 F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &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 F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T const F77_DBLE F77_DBLE &F77_RET_T const F77_REAL F77_REAL &F77_RET_T F77_REAL F77_REAL &F77_RET_T F77_DBLE F77_DBLE &F77_RET_T const F77_DBLE * x