本文整理汇总了C++中F_FUNC函数的典型用法代码示例。如果您正苦于以下问题:C++ F_FUNC函数的具体用法?C++ F_FUNC怎么用?C++ F_FUNC使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了F_FUNC函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: pbvv_wrap
int pbvv_wrap(double v, double x, double *pvf, double *pvd) {
double *vv;
double *vp;
int num;
/* NB. Indexing of DV/DP in specfun.f:PBVV starts from 0, hence +2 */
num = ABS((int)v) + 2;
vv = (double *)PyMem_Malloc(sizeof(double)*2*num);
if (vv==NULL) {
sf_error("pbvv", SF_ERROR_OTHER, "memory allocation error");
*pvf = NPY_NAN;
*pvd = NPY_NAN;
return -1;
}
vp = vv + num;
F_FUNC(pbvv,PBVV)(&v, &x, vv, vp, pvf, pvd);
PyMem_Free(vv);
return 0;
}
示例2: kelvin_wrap
int kelvin_wrap(double x, npy_cdouble *Be, npy_cdouble *Ke, npy_cdouble *Bep, npy_cdouble *Kep) {
int flag = 0;
if (x<0) {x=-x; flag=1;}
F_FUNC(klvna,KLVNA)(&x, F2C_CST(Be), F2C_CST(Ke), F2C_CST(Bep), F2C_CST(Kep));
ZCONVINF("klvna", *Be);
ZCONVINF("klvna", *Ke);
ZCONVINF("klvna", *Bep);
ZCONVINF("klvna", *Kep);
if (flag) {
REAL(*Bep) = -REAL(*Bep);
IMAG(*Bep) = -IMAG(*Bep);
REAL(*Ke) = NPY_NAN;
IMAG(*Ke) = NPY_NAN;
REAL(*Kep) = NPY_NAN;
IMAG(*Kep) = NPY_NAN;
}
return 0;
}
示例3: itairy_wrap
int itairy_wrap(double x, double *apt, double *bpt, double *ant, double *bnt) {
double tmp;
int flag = 0;
if (x < 0) {
x = -x;
flag = 1;
}
F_FUNC(itairy,ITAIRY)(&x, apt, bpt, ant, bnt);
if (flag) { /* negative limit -- switch signs and roles */
tmp = *apt;
*apt = -*ant;
*ant = -tmp;
tmp = *bpt;
*bpt = -*bnt;
*bnt = -tmp;
}
return 0;
}
示例4: hypU_wrap
double hypU_wrap(double a, double b, double x) {
double out;
int md; /* method code --- not returned */
int isfer = 0;
F_FUNC(chgu,CHGU)(&a, &b, &x, &out, &md, &isfer);
if (out == 1e300) {
sf_error("hypU", SF_ERROR_OVERFLOW, NULL);
out = NPY_INFINITY;
}
if (isfer == 6) {
sf_error("hypU", SF_ERROR_NO_RESULT, NULL);
out = NPY_NAN;
} else if (isfer != 0) {
sf_error("hypU", isfer, NULL);
out = NPY_NAN;
}
return out;
}
示例5: cbesh_wrap2_e
Py_complex cbesh_wrap2_e( double v, Py_complex z) {
int n = 1;
int kode = 2;
int m = 2;
int nz, ierr;
int sign = 1;
Py_complex cy;
if (v < 0) {
v = -v;
sign = -1;
}
F_FUNC(zbesh,ZBESH)(CADDR(z), &v, &kode, &m, &n, CADDR(cy), &nz, &ierr);
DO_MTHERR("hankel2e:", &cy);
if (sign == -1) {
cy = rotate(cy, -v);
}
return cy;
}
示例6: pbdv_wrap
int pbdv_wrap(double v, double x, double *pdf, double *pdd) {
double *dv;
double *dp;
int num;
/* NB. Indexing of DV/DP in specfun.f:PBDV starts from 0, hence +2 */
num = ABS((int)v) + 2;
dv = (double *)PyMem_Malloc(sizeof(double)*2*num);
if (dv==NULL) {
sf_error("pbdv", SF_ERROR_OTHER, "memory allocation error");
*pdf = NPY_NAN;
*pdd = NPY_NAN;
return -1;
}
dp = dv + num;
F_FUNC(pbdv,PBDV)(&v, &x, dv, dp, pdf, pdd);
PyMem_Free(dv);
return 0;
}
示例7: prolate_segv_wrap
double prolate_segv_wrap(double m, double n, double c)
{
int kd=1;
int int_m, int_n;
double cv, *eg;
if ((m<0) || (n<m) || (m!=floor(m)) || (n!=floor(n)) || ((n-m)>198)) {
return NPY_NAN;
}
int_m = (int) m;
int_n = (int) n;
eg = (double *)PyMem_Malloc(sizeof(double)*(n-m+2));
if (eg==NULL) {
printf("Warning: Memory allocation error.\n");
return NPY_NAN;
}
F_FUNC(segv,SEGV)(&int_m,&int_n,&c,&kd,&cv,eg);
PyMem_Free(eg);
return cv;
}
示例8: oblate_segv_wrap
double oblate_segv_wrap(double m, double n, double c)
{
int kd=-1;
int int_m, int_n;
double cv, *eg;
if ((m<0) || (n<m) || (m!=floor(m)) || (n!=floor(n)) || ((n-m)>198)) {
return NPY_NAN;
}
int_m = (int) m;
int_n = (int) n;
eg = (double *)PyMem_Malloc(sizeof(double)*(n-m+2));
if (eg==NULL) {
sf_error("oblate_segv", SF_ERROR_OTHER, "memory allocation error");
return NPY_NAN;
}
F_FUNC(segv,SEGV)(&int_m,&int_n,&c,&kd,&cv,eg);
PyMem_Free(eg);
return cv;
}
示例9: cbesh_wrap2_e
npy_cdouble cbesh_wrap2_e( double v, npy_cdouble z) {
int n = 1;
int kode = 2;
int m = 2;
int nz, ierr;
int sign = 1;
npy_cdouble cy;
cy.real = NPY_NAN;
cy.imag = NPY_NAN;
if (v < 0) {
v = -v;
sign = -1;
}
F_FUNC(zbesh,ZBESH)(CADDR(z), &v, &kode, &m, &n, CADDR(cy), &nz, &ierr);
DO_SFERR("hankel2e:", &cy);
if (sign == -1) {
cy = rotate(cy, -v);
}
return cy;
}
示例10: cbesk_wrap_e
Py_complex cbesk_wrap_e( double v, Py_complex z) {
int n = 1;
int kode = 2;
int nz, ierr;
Py_complex cy;
if (v < 0) {
/* K_v == K_{-v} even for non-integer v */
v = -v;
}
F_FUNC(zbesk,ZBESK)(CADDR(z), &v, &kode, &n, CADDR(cy), &nz, &ierr);
DO_MTHERR("kve:", &cy);
if (ierr == 2) {
if (z.real >= 0 && z.imag == 0) {
/* overflow */
cy.real = NPY_INFINITY;
cy.imag = 0;
}
}
return cy;
}
示例11: sem_cva_wrap
double sem_cva_wrap(double m, double q) {
int int_m, kd=4;
double out;
if ((m <= 0) || (m != floor(m))) {
sf_error("cem_cva", SF_ERROR_DOMAIN, NULL);
return NPY_NAN;
}
int_m = (int)m;
if (q < 0) {
/* http://dlmf.nist.gov/28.2#E26 */
if (int_m % 2 == 0) {
return sem_cva_wrap(m, -q);
}
else {
return cem_cva_wrap(m, -q);
}
}
if (int_m % 2) kd=3;
F_FUNC(cva2,CVA2)(&kd, &int_m, &q, &out);
return out;
}
示例12: sem_wrap
int sem_wrap(double m, double q, double x, double *csf, double *csd)
{
int int_m, kf=2, sgn;
double f, d;
if ((m < 0) || (m != floor(m))) {
*csf = NPY_NAN;
*csd = NPY_NAN;
sf_error("sem", SF_ERROR_DOMAIN, NULL);
return -1;
}
int_m = (int)m;
if (int_m == 0) {
*csf = 0;
*csd = 0;
return 0;
}
if (q < 0) {
/* http://dlmf.nist.gov/28.2#E34 */
if (int_m % 2 == 0) {
sgn = ((int_m/2) % 2 == 0) ? -1 : 1;
sem_wrap(m, -q, 90 - x, &f, &d);
*csf = sgn * f;
*csd = -sgn * d;
return 0;
}
else {
sgn = ((int_m/2) % 2 == 0) ? 1 : -1;
cem_wrap(m, -q, 90 - x, &f, &d);
*csf = sgn * f;
*csd = -sgn * d;
return 0;
}
}
F_FUNC(mtu0,MTU0)(&kf,&int_m, &q, &x, csf, csd);
return 0;
}
示例13:
/******************************* end of sbesjy *******************************/
/*eof body*/
/******************* See f2py2e/f90mod_rules.py: buildhooks *******************/
/*need_f90modhooks*/
/************** See f2py2e/rules.py: module_rules['modulebody'] **************/
/******************* See f2py2e/common_rules.py: buildhooks *******************/
/*need_commonhooks*/
/**************************** See f2py2e/rules.py ****************************/
static FortranDataDef f2py_routine_defs[] = {
{"rotcoef",-1,{{-1}},0,(char *)F_FUNC(rotcoef,ROTCOEF),(f2py_init_func)f2py_rout_uts_scsmfo_rotcoef,doc_f2py_rout_uts_scsmfo_rotcoef},
{"asmfr",-1,{{-1}},0,(char *)F_FUNC(asmfr,ASMFR),(f2py_init_func)f2py_rout_uts_scsmfo_asmfr,doc_f2py_rout_uts_scsmfo_asmfr},
{"ms_radial_fields",-1,{{-1}},0,(char *)F_FUNC_US(ms_radial_fields,MS_RADIAL_FIELDS),(f2py_init_func)f2py_rout_uts_scsmfo_ms_radial_fields,doc_f2py_rout_uts_scsmfo_ms_radial_fields},
{"asm",-1,{{-1}},0,(char *)F_FUNC(asm,ASM),(f2py_init_func)f2py_rout_uts_scsmfo_asm,doc_f2py_rout_uts_scsmfo_asm},
{"sbesjy",-1,{{-1}},0,(char *)F_FUNC(sbesjy,SBESJY),(f2py_init_func)f2py_rout_uts_scsmfo_sbesjy,doc_f2py_rout_uts_scsmfo_sbesjy},
/*eof routine_defs*/
{NULL}
};
static PyMethodDef f2py_module_methods[] = {
{NULL,NULL}
};
#if PY_VERSION_HEX >= 0x03000000
示例14:
/******************************** end of nnls ********************************/
/*eof body*/
/******************* See f2py2e/f90mod_rules.py: buildhooks *******************/
/*need_f90modhooks*/
/************** See f2py2e/rules.py: module_rules['modulebody'] **************/
/******************* See f2py2e/common_rules.py: buildhooks *******************/
/*need_commonhooks*/
/**************************** See f2py2e/rules.py ****************************/
static FortranDataDef f2py_routine_defs[] = {
{"nnls",-1,{{-1}},0,(char *)F_FUNC(nnls,NNLS),(f2py_init_func)f2py_rout__nnls_nnls,doc_f2py_rout__nnls_nnls},
/*eof routine_defs*/
{NULL}
};
static PyMethodDef f2py_module_methods[] = {
{NULL,NULL}
};
#if PY_VERSION_HEX >= 0x03000000
static struct PyModuleDef moduledef = {
PyModuleDef_HEAD_INIT,
"_nnls",
NULL,
示例15: PYERR
//.........这里部分代码省略.........
if ((ifixx =
(PyArrayObject *) PyArray_CopyFromObject(pifixx, NPY_INT, 1,
2)) == NULL)
{
PYERR(PyExc_ValueError,
"could not convert ifixx to a suitable array");
}
if (ifixx->nd == 1 && ifixx->dimensions[0] == m)
{
ldifx = 1;
}
else if (ifixx->nd == 1 && ifixx->dimensions[0] == n && m == 1)
{
ldifx = n;
}
else if (ifixx->nd == 2 && ifixx->dimensions[0] == m
&& ifixx->dimensions[1] == n)
{
ldifx = n;
}
else
{
PYERR(PyExc_ValueError,
"could not convert ifixx to a suitable array");
}
} /* ifixx */
if (errfile != NULL)
{
/* call FORTRAN's OPEN to open the file with a logical unit of 18 */
lunerr = 18;
F_FUNC(dluno,DLUNO)(&lunerr, errfile, lerrfile);
}
if (rptfile != NULL)
{
/* call FORTRAN's OPEN to open the file with a logical unit of 19 */
lunrpt = 19;
F_FUNC(dluno,DLUNO)(&lunrpt, rptfile, lrptfile);
}
if (pstpb == NULL)
{
dim1[0] = np;
stpb = (PyArrayObject *) PyArray_SimpleNew(1, dim1, NPY_DOUBLE);
*(double *)(stpb->data) = 0.0;
}
else /* pstpb is a sequence */
{
if ((stpb =
(PyArrayObject *) PyArray_CopyFromObject(pstpb, NPY_DOUBLE, 1,
1)) == NULL
|| stpb->dimensions[0] != np)
{
PYERR(PyExc_ValueError,
"could not convert stpb to a suitable array");
}
} /* stpb */
if (pstpd == NULL)
{
dim2[0] = 1;
dim2[1] = m;
stpd = (PyArrayObject *) PyArray_SimpleNew(2, dim2, NPY_DOUBLE);