MCPcopy Create free account
hub / github.com/numpy/numpy / CLONGDOUBLE_vdot

Function CLONGDOUBLE_vdot

numpy/core/src/multiarray/vdot.c:117–136  ·  view source on GitHub ↗

* All data is assumed aligned. */

Source from the content-addressed store, hash-verified

115 * All data is assumed aligned.
116 */
117NPY_NO_EXPORT void
118CLONGDOUBLE_vdot(char *ip1, npy_intp is1, char *ip2, npy_intp is2,
119 char *op, npy_intp n, void *NPY_UNUSED(ignore))
120{
121 npy_longdouble tmpr = 0.0L;
122 npy_longdouble tmpi = 0.0L;
123 npy_intp i;
124
125 for (i = 0; i < n; i++, ip1 += is1, ip2 += is2) {
126 const npy_longdouble ip1r = ((npy_longdouble *)ip1)[0];
127 const npy_longdouble ip1i = ((npy_longdouble *)ip1)[1];
128 const npy_longdouble ip2r = ((npy_longdouble *)ip2)[0];
129 const npy_longdouble ip2i = ((npy_longdouble *)ip2)[1];
130
131 tmpr += ip1r * ip2r + ip1i * ip2i;
132 tmpi += ip1r * ip2i - ip1i * ip2r;
133 }
134 ((npy_longdouble *)op)[0] = tmpr;
135 ((npy_longdouble *)op)[1] = tmpi;
136}
137
138/*
139 * All data is assumed aligned.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected