25 #if defined (HAVE_CONFIG_H)
36 inline double max (
double a,
double b,
double c)
39 return (b < c ? c : b);
41 return (a < c ? c : a);
44 inline double min (
double a,
double b,
double c)
47 return (b > c ? c : b);
49 return (a > c ? c : a);
52 #define REF(x,k,i) x(static_cast<octave_idx_type>(elem((k), (i))) - 1)
73 if (
args.length () != 5)
76 const double eps = 1.0e-12;
101 double x0, y0, a11, a12, a21, a22, det;
103 a11 = a12 = a21 = a22 = 0.0;
109 const double xt =
xi(kp);
110 const double yt = yi(kp);
115 const double dx1 = xt - x0;
116 const double dx2 = yt - y0;
117 const double c1 = (a22 * dx1 - a21 * dx2) / det;
118 const double c2 = (-a12 * dx1 + a11 * dx2) / det;
119 if (c1 >= -eps && c2 >= -eps && (c1 + c2) <= (1 +
eps))
127 for (k = 0; k < nelem; k++)
130 if (xt >= minx(k) && xt <= maxx(k) && yt >= miny(k) && yt <= maxy(k))
135 a11 =
REF (x, k, 1) - x0;
136 a12 =
REF (y, k, 1) - y0;
137 a21 =
REF (x, k, 2) - x0;
138 a22 =
REF (y, k, 2) - y0;
139 det = a11 * a22 - a21 * a12;
142 const double dx1 = xt - x0;
143 const double dx2 = yt - y0;
144 const double c1 = (a22 * dx1 - a21 * dx2) / det;
145 const double c2 = (-a12 * dx1 + a11 * dx2) / det;
146 if ((c1 >= -eps) && (c2 >= -
eps) && ((c1 + c2) <= (1 +
eps)))
OCTAVE_EXPORT octave_value_list isa nd deftypefn *return ovl(args(0).is_integer_type())
OCTINTERP_API void print_usage(void)
octave_idx_type numel(void) const
Number of elements in the array.
#define DEFUN(name, args_name, nargout_name, doc)
double lo_ieee_nan_value(void)
double max(double a, double b, double c)
octave_idx_type rows(void) const
cell array If invoked with two or more scalar integer or a vector of integer values
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
double min(double a, double b, double c)
the sparsity preserving column transformation such that that defines the pivoting threshold can be given in which case it defines the c
issues an error eealso double
the element is set to zero In other the statement xample y
static const double xi[33]
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