25 #if defined (HAVE_CONFIG_H) 37 inline double max (
double a,
double b,
double c)
40 return (
b <
c ?
c :
b);
42 return (
a <
c ?
c :
a);
45 inline double min (
double a,
double b,
double c)
48 return (
b >
c ?
c :
b);
50 return (
a >
c ?
c :
a);
53 #define REF(x,k,i) x(static_cast<octave_idx_type>(elem((k), (i))) - 1) 63 DEFUN (tsearch, args, ,
74 if (args.length () != 5)
77 const double eps = 1.0e-12;
102 double x0, y0, a11, a12, a21, a22, det;
104 a11 = a12 = a21 = a22 = 0.0;
110 const double xt =
xi(kp);
111 const double yt = yi(kp);
116 const double dx1 = xt - x0;
117 const double dx2 = yt - y0;
118 const double c1 = (a22 * dx1 - a21 * dx2) / det;
119 const double c2 = (-a12 * dx1 + a11 * dx2) / det;
120 if (c1 >= -
eps && c2 >= -
eps && (c1 + c2) <= (1 +
eps))
128 for (
k = 0;
k < nelem;
k++)
132 if (xt >= minx(
k) && xt <= maxx(
k) && yt >= miny(
k) && yt <= maxy(
k))
137 a11 =
REF (
x,
k, 1) - x0;
138 a12 =
REF (
y,
k, 1) - y0;
139 a21 =
REF (
x,
k, 2) - x0;
140 a22 =
REF (
y,
k, 2) - y0;
141 det = a11 * a22 - a21 * a12;
144 const double dx1 = xt - x0;
145 const double dx2 = yt - y0;
146 const double c1 = (a22 * dx1 - a21 * dx2) / det;
147 const double c2 = (-a12 * dx1 + a11 * dx2) / det;
148 if ((c1 >= -
eps) && (c2 >= -
eps) && ((c1 + c2) <= (1 +
eps)))
OCTINTERP_API void print_usage(void)
#define DEFUN(name, args_name, nargout_name, doc)
Macro to define a builtin function.
double lo_ieee_nan_value(void)
double max(double a, double b, double c)
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
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)
OCTAVE_EXPORT octave_value_list isa nd deftypefn *return ovl(args(0).isinteger())
the element is set to zero In other the statement xample y
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