26 #if defined (HAVE_CONFIG_H)
64 double *dif2,
double *dif3)
80 double y =
x - root[j];
82 dif3[i] = y * dif3[i] + 3.0 * dif2[i];
83 dif2[i] = y * dif2[i] + 2.0 * dif1[i];
84 dif1[i] = y * dif1[i];
152 double alpha,
double beta,
double *dif1,
double *dif2,
153 double *dif3,
double *root)
155 assert (n0 == 0 || n0 == 1);
156 assert (n1 == 0 || n1 == 1);
165 double ab = alpha + beta;
166 double ad = beta - alpha;
167 double ap = beta * alpha;
169 dif1[0] = (ad / (ab + 2.0) + 1.0) / 2.0;
177 double z = ab + 2 * z1;
179 dif1[i] = (ab * ad / z / (z + 2.0) + 1.0) / 2.0;
182 dif2[i] = (ab + ap + z1) / z / z / (z + 1.0);
186 double y = z1 * (ab + z1);
188 dif2[i] = y / z / (z - 1.0);
213 double xp = (dif1[j] -
x) * xn - dif2[j] * xd;
214 double xp1 = (dif1[j] -
x) * xn1 - dif2[j] * xd1 - xn;
228 zc -= z / (
x - root[j-1]);
240 if (std::abs (z) <= 100 * std::numeric_limits<double>::epsilon ())
245 x += std::sqrt (std::numeric_limits<double>::epsilon ());
261 dif (nt, root, dif1, dif2, dif3);
315 double *dif2,
double *dif3,
double *root,
double *vect)
317 assert (n0 == 0 || n0 == 1);
318 assert (n1 == 0 || n1 == 1);
324 assert (
id == 1 ||
id == 2 ||
id == 3);
327 assert (i >= 0 && i < nt);
339 vect[i] = dif2[i] / dif1[i] / 2.0;
341 vect[i] = dif3[i] / dif1[i] / 3.0;
345 double y = root[i] - root[j];
347 vect[j] = dif1[i] / dif1[j] / y;
350 vect[j] = vect[j] * (dif2[i] / dif1[i] - 2.0 / y);
362 double ax =
x * (1.0 -
x);
368 ax = ax / (1.0 -
x) / (1.0 -
x);
370 vect[j] = ax / (dif1[j] * dif1[j]);
376 vect[j] = vect[j] / y;
385 (*current_liboctave_error_handler) (
"CollocWt: fatal error '%s'", msg);
392 error (
"CollocWt: left bound greater than right bound");
403 error (
"CollocWt: right bound less than left bound");
418 error (
"CollocWt: width less than or equal to zero");
424 error (
"CollocWt: total number of collocation points less than zero");
451 error (
"jcobi: newton iteration failed");
492 os <<
"left boundary is included\n";
494 os <<
"left boundary is not included\n";
497 os <<
"right boundary is included\n";
499 os <<
"right boundary is not included\n";
512 OCTAVE_END_NAMESPACE(
octave)
std::ostream & operator<<(std::ostream &os, const CollocWt &a)
T * fortran_vec()
Size of the specified dimension.
octave_idx_type left_included() const
octave_idx_type m_inc_left
void error(const char *msg)
octave_idx_type m_inc_right
octave_idx_type right_included() const
CollocWt & set_left(double val)
CollocWt & set_right(double val)
void resize(octave_idx_type n, const double &rfv=0)
void resize(octave_idx_type nr, octave_idx_type nc, double rfv=0)
Vector representing the dimensions (size) of an Array.
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
F77_RET_T const F77_DBLE * x