23 #if defined (HAVE_CONFIG_H) 37 DEFUN (__dsearchn__, args, ,
43 if (args.length () != 2)
46 Matrix x = args(0).matrix_value ().transpose ();
47 Matrix xi = args(1).matrix_value ().transpose ();
49 if (
x.rows () !=
xi.rows () ||
x.columns () < 1)
50 error (
"__dsearch__: number of rows of X and XI must match");
61 #define DIST(dd, y, yi, m) \ 63 for (octave_idx_type k = 0; k < m; k++) \ 65 double yd = y[k] - yi[k]; \ 70 const double *pxi =
xi.fortran_vec ();
74 const double *px =
x.fortran_vec ();
85 *pidx =
static_cast<double>(j + 1);
95 return ovl (idx, dist);
OCTINTERP_API void print_usage(void)
const T * fortran_vec(void) const
#define DEFUN(name, args_name, nargout_name, doc)
Macro to define a builtin function.
void error(const char *fmt,...)
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
#define DIST(dd, y, yi, m)
OCTAVE_EXPORT octave_value_list isa nd deftypefn *return ovl(args(0).isinteger())
static const double xi[33]
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