File Coverage

lib/PDL/Math-pp-catanh.c
Criterion Covered Total %
statement 0 49 0.0
branch 0 190 0.0
condition n/a
subroutine n/a
pod n/a
total 0 239 0.0


line stmt bran cond sub pod time code
1              
2             #line 453 "lib/PDL/PP.pm"
3             /*
4             * THIS FILE WAS GENERATED BY PDL::PP from lib/PDL/Math.pd! Do not modify!
5             */
6              
7             #define PDL_FREE_CODE(trans, destroy, comp_free_code, ntpriv_free_code) \
8             if (destroy) { \
9             comp_free_code \
10             } \
11             if ((trans)->dims_redone) { \
12             ntpriv_free_code \
13             }
14              
15             #include "EXTERN.h"
16             #include "perl.h"
17             #include "XSUB.h"
18             #include "pdl.h"
19             #include "pdlcore.h"
20             #define PDL PDL_Math
21             extern Core* PDL; /* Structure hold core C functions */
22             #line 23 "lib/PDL/Math-pp-catanh.c"
23              
24             #include
25             #include "protos.h"
26             #include "cpoly.h"
27              
28             #line 1857 "lib/PDL/PP.pm"
29             pdl_error pdl_catanh_readdata(pdl_trans *__privtrans) {
30             pdl_error PDL_err = {0, NULL, 0};
31             #line 32 "lib/PDL/Math-pp-catanh.c"
32 0 0         if (!__privtrans->broadcast.incs) return PDL->make_error(PDL_EUSERERROR, "Error in catanh:" "broadcast.incs NULL");
33             /* broadcastloop declarations */
34             int __brcloopval;
35             register PDL_Indx __tind0,__tind1; /* counters along dim */
36 0           register PDL_Indx __tnpdls = __privtrans->broadcast.npdls;
37             /* dims here are how many steps along those dims */
38 0           register PDL_Indx __tinc0_i = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,0,0);
39 0           register PDL_Indx __tinc0_o = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,1,0);
40 0           register PDL_Indx __tinc1_i = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,0,1);
41 0           register PDL_Indx __tinc1_o = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,1,1);
42             #define PDL_BROADCASTLOOP_START_catanh_readdata PDL_BROADCASTLOOP_START( \
43             readdata, \
44             __privtrans->broadcast, \
45             __privtrans->vtable, \
46             i_datap += __offsp[0]; \
47             o_datap += __offsp[1]; \
48             , \
49             ( ,i_datap += __tinc1_i - __tinc0_i * __tdims0 \
50             ,o_datap += __tinc1_o - __tinc0_o * __tdims0 \
51             ), \
52             ( ,i_datap += __tinc0_i \
53             ,o_datap += __tinc0_o \
54             ) \
55             )
56             #define PDL_BROADCASTLOOP_END_catanh_readdata PDL_BROADCASTLOOP_END( \
57             __privtrans->broadcast, \
58             i_datap -= __tinc1_i * __tdims1 + __offsp[0]; \
59             o_datap -= __tinc1_o * __tdims1 + __offsp[1]; \
60             )
61             #ifndef PDL_DECLARE_PARAMS_catanh_1
62             #define PDL_DECLARE_PARAMS_catanh_1(PDL_TYPE_OP,PDL_PPSYM_OP,PDL_TYPE_PARAM_o,PDL_PPSYM_PARAM_o) \
63             PDL_DECLARE_PARAMETER(PDL_TYPE_OP, i, (__privtrans->pdls[0]), 1, PDL_PPSYM_OP) \
64             PDL_DECLARE_PARAMETER(PDL_TYPE_PARAM_o, o, (__privtrans->pdls[1]), 1, PDL_PPSYM_PARAM_o)
65             #endif
66             #define PDL_IF_BAD(t,f) f
67 0           switch (__privtrans->__datatype) { /* Start generic switch */
68 0           case PDL_F: {
69 0 0         PDL_DECLARE_PARAMS_catanh_1(PDL_Float,F,PDL_CFloat,G)
    0          
    0          
    0          
    0          
    0          
70 0 0         PDL_BROADCASTLOOP_START_catanh_readdata {
    0          
    0          
    0          
    0          
    0          
    0          
71             #line 504 "lib/PDL/Math.pd"
72             PDL_CFloat tmp = (i_datap)[0];
73             tmp = catanh(tmp);
74             (o_datap)[0] = tmp;
75             #line 76 "lib/PDL/Math-pp-catanh.c"
76 0 0         }PDL_BROADCASTLOOP_END_catanh_readdata
    0          
77 0           } break;
78 0           case PDL_D: {
79 0 0         PDL_DECLARE_PARAMS_catanh_1(PDL_Double,D,PDL_CDouble,C)
    0          
    0          
    0          
    0          
    0          
80 0 0         PDL_BROADCASTLOOP_START_catanh_readdata {
    0          
    0          
    0          
    0          
    0          
    0          
81             #line 504 "lib/PDL/Math.pd"
82             PDL_CDouble tmp = (i_datap)[0];
83             tmp = catanh(tmp);
84             (o_datap)[0] = tmp;
85             #line 86 "lib/PDL/Math-pp-catanh.c"
86 0 0         }PDL_BROADCASTLOOP_END_catanh_readdata
    0          
87 0           } break;
88 0           case PDL_LD: {
89 0 0         PDL_DECLARE_PARAMS_catanh_1(PDL_LDouble,E,PDL_CLDouble,H)
    0          
    0          
    0          
    0          
    0          
90 0 0         PDL_BROADCASTLOOP_START_catanh_readdata {
    0          
    0          
    0          
    0          
    0          
    0          
91             #line 504 "lib/PDL/Math.pd"
92             PDL_CLDouble tmp = (i_datap)[0];
93             tmp = catanh(tmp);
94             (o_datap)[0] = tmp;
95             #line 96 "lib/PDL/Math-pp-catanh.c"
96 0 0         }PDL_BROADCASTLOOP_END_catanh_readdata
    0          
97 0           } break;
98 0           case PDL_CF: {
99 0 0         PDL_DECLARE_PARAMS_catanh_1(PDL_CFloat,G,PDL_CFloat,G)
    0          
    0          
    0          
    0          
    0          
100 0 0         PDL_BROADCASTLOOP_START_catanh_readdata {
    0          
    0          
    0          
    0          
    0          
    0          
101             #line 504 "lib/PDL/Math.pd"
102             PDL_CFloat tmp = (i_datap)[0];
103             tmp = catanh(tmp);
104             (o_datap)[0] = tmp;
105             #line 106 "lib/PDL/Math-pp-catanh.c"
106 0 0         }PDL_BROADCASTLOOP_END_catanh_readdata
    0          
107 0           } break;
108 0           case PDL_CD: {
109 0 0         PDL_DECLARE_PARAMS_catanh_1(PDL_CDouble,C,PDL_CDouble,C)
    0          
    0          
    0          
    0          
    0          
110 0 0         PDL_BROADCASTLOOP_START_catanh_readdata {
    0          
    0          
    0          
    0          
    0          
    0          
111             #line 504 "lib/PDL/Math.pd"
112             PDL_CDouble tmp = (i_datap)[0];
113             tmp = catanh(tmp);
114             (o_datap)[0] = tmp;
115             #line 116 "lib/PDL/Math-pp-catanh.c"
116 0 0         }PDL_BROADCASTLOOP_END_catanh_readdata
    0          
117 0           } break;
118 0           case PDL_CLD: {
119 0 0         PDL_DECLARE_PARAMS_catanh_1(PDL_CLDouble,H,PDL_CLDouble,H)
    0          
    0          
    0          
    0          
    0          
120 0 0         PDL_BROADCASTLOOP_START_catanh_readdata {
    0          
    0          
    0          
    0          
    0          
    0          
121             #line 504 "lib/PDL/Math.pd"
122             PDL_CLDouble tmp = (i_datap)[0];
123             tmp = catanh(tmp);
124             (o_datap)[0] = tmp;
125             #line 126 "lib/PDL/Math-pp-catanh.c"
126 0 0         }PDL_BROADCASTLOOP_END_catanh_readdata
    0          
127 0           } break;
128 0           default: return PDL->make_error(PDL_EUSERERROR, "PP INTERNAL ERROR in catanh: unhandled datatype(%d), only handles (FDEGCH)! PLEASE MAKE A BUG REPORT\n", __privtrans->__datatype);
129             }
130             #undef PDL_IF_BAD
131 0           return PDL_err;
132             }
133              
134             static pdl_datatypes pdl_catanh_vtable_gentypes[] = { PDL_F, PDL_LD, PDL_CF, PDL_CD, PDL_CLD, PDL_D, -1 };
135             static PDL_Indx pdl_catanh_vtable_realdims[] = { 0, 0 };
136             static char *pdl_catanh_vtable_parnames[] = { "i","o" };
137             static short pdl_catanh_vtable_parflags[] = {
138             0,
139             PDL_PARAM_ISCOMPLEX|PDL_PARAM_ISCREAT|PDL_PARAM_ISOUT|PDL_PARAM_ISWRITE
140             };
141             static pdl_datatypes pdl_catanh_vtable_partypes[] = { -1, -1 };
142             static PDL_Indx pdl_catanh_vtable_realdims_starts[] = { 0, 0 };
143             static PDL_Indx pdl_catanh_vtable_realdims_ind_ids[] = { 0 };
144             static char *pdl_catanh_vtable_indnames[] = { "" };
145             pdl_transvtable pdl_catanh_vtable = {
146             PDL_TRANS_DO_BROADCAST, 0, pdl_catanh_vtable_gentypes, 1, 2, NULL /*CORE21*/,
147             pdl_catanh_vtable_realdims, pdl_catanh_vtable_parnames,
148             pdl_catanh_vtable_parflags, pdl_catanh_vtable_partypes,
149             pdl_catanh_vtable_realdims_starts, pdl_catanh_vtable_realdims_ind_ids, 0,
150             0, pdl_catanh_vtable_indnames,
151             NULL, pdl_catanh_readdata, NULL,
152             NULL,
153             0,"PDL::Math::catanh"
154             };
155              
156              
157 0           pdl_error pdl_run_catanh(pdl *i,pdl *o) {
158 0           pdl_error PDL_err = {0, NULL, 0};
159 0 0         if (!PDL) return (pdl_error){PDL_EFATAL, "PDL core struct is NULL, can't continue",0};
160 0           pdl_trans *__privtrans = PDL->create_trans(&pdl_catanh_vtable);
161 0 0         if (!__privtrans) return PDL->make_error_simple(PDL_EFATAL, "Couldn't create trans");
162 0           __privtrans->pdls[0] = i;
163 0           __privtrans->pdls[1] = o;
164 0 0         PDL_RETERROR(PDL_err, PDL->type_coerce(__privtrans));
165 0 0         PDL_RETERROR(PDL_err, PDL->make_trans_mutual(__privtrans));
166 0           return PDL_err;
167             }