26 #if defined (HAVE_CONFIG_H)
44 DEFUN (__pchip_deriv__, args, ,
51 int nargin = args.
length ();
53 bool rows = (nargin == 3 && args(2).uint_value () == 2);
57 if (args(0).is_single_type () || args(1).is_single_type ())
62 error (
"__pchip_deriv__: X must be at least of length 2");
64 if (args(1).iscomplex ())
71 if (nx != (rows ? nyc : nyr))
72 error (
"__pchip_deriv__: X and Y dimension mismatch");
84 reinterpret_cast<float const *
> (ymat.
data ()) + k * inc,
85 reinterpret_cast<float *
> (dmat.
fortran_vec ()) + k * inc,
89 error (
"__pchip_deriv__: PCHIM failed for real part with ierr = %"
90 OCTAVE_F77_INT_TYPE_FORMAT,
ierr);
93 reinterpret_cast<float const *
> (ymat.
data ()) + 1 + k * inc,
94 reinterpret_cast<float *
> (dmat.
fortran_vec ()) + 1 + k * inc,
98 error (
"__pchip_deriv__: PCHIM failed for imaginary part with ierr = %"
99 OCTAVE_F77_INT_TYPE_FORMAT,
ierr);
113 if (nx != (rows ? nyc : nyr))
114 error (
"__pchip_deriv__: X and Y dimension mismatch");
126 ymat.
data () + k * inc,
133 error (
"__pchip_deriv__: PCHIM failed with ierr = %"
134 OCTAVE_F77_INT_TYPE_FORMAT,
ierr);
145 error (
"__pchip_deriv__: X must be at least of length 2");
147 if (args(1).iscomplex ())
154 if (nx != (rows ? nyc : nyr))
155 error (
"__pchip_deriv__: X and Y dimension mismatch");
167 reinterpret_cast<double const *
> (ymat.
data ()) + k * inc,
168 reinterpret_cast<double *
> (dmat.
fortran_vec ()) + k * inc,
172 error (
"__pchip_deriv__: DPCHIM failed for real part with ierr = %"
173 OCTAVE_F77_INT_TYPE_FORMAT,
ierr);
176 reinterpret_cast<double const *
> (ymat.
data ()) + 1 + k * inc,
177 reinterpret_cast<double *
> (dmat.
fortran_vec ()) + 1 + k * inc,
181 error (
"__pchip_deriv__: DPCHIM failed for imaginary part with ierr = %"
182 OCTAVE_F77_INT_TYPE_FORMAT,
ierr);
191 Matrix ymat (args(1).matrix_value ());
196 if (nx != (rows ? nyc : nyr))
197 error (
"__pchip_deriv__: X and Y dimension mismatch");
209 ymat.
data () + k * inc,
215 error (
"__pchip_deriv__: DPCHIM failed with ierr = %"
216 OCTAVE_F77_INT_TYPE_FORMAT,
ierr);
261 OCTAVE_END_NAMESPACE(
octave)
T * fortran_vec()
Size of the specified dimension.
octave_idx_type rows() const
const T * data() const
Size of the specified dimension.
octave_idx_type columns() const
octave_idx_type numel() const
Number of elements in the array.
octave_idx_type length() const
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
#define DEFUN(name, args_name, nargout_name, doc)
Macro to define a builtin function.
subroutine dpchim(N, X, F, D, INCFD, IERR)
void() error(const char *fmt,...)
#define F77_XFCN(f, F, args)
octave_f77_int_type F77_INT
F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE const F77_INT F77_INT & ierr
F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE const F77_INT & incfd
subroutine pchim(N, X, F, D, INCFD, IERR)