MCPcopy Create free account
hub / github.com/pydata/numexpr / nc_abs

Function nc_abs

numexpr3/complex_functions.hpp:591–605  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

589
590
591static void
592nc_abs( npy_intp n, npy_complex64 *x, npy_intp sb1, npy_float32 *r )
593{
594 if( sb1 == sizeof(npy_complex64) ) { // Aligned
595 for( npy_intp I = 0; I < n; I++ ) {
596 r[I] = sqrtf( x[I].real*x[I].real + x[I].imag*x[I].imag);
597 }
598 }
599 else {
600 sb1 /= sizeof(npy_complex64);
601 for( npy_intp I = 0; I < n; I++ ) {
602 r[I] = sqrtf( x[I*sb1].real*x[I*sb1].real + x[I*sb1].imag*x[I*sb1].imag);
603 }
604 }
605}
606
607static void
608nc_abs( npy_intp n, npy_complex128 *x, npy_intp sb1, npy_float64 *r )

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…