MCPcopy Create free account
hub / github.com/arrayfire/arrayfire / af_constant_complex

Function af_constant_complex

src/api/c/data.cpp:84–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82}
83
84af_err af_constant_complex(af_array *result, const double real,
85 const double imag, const unsigned ndims,
86 const dim_t *const dims, af_dtype type) {
87 try {
88 af_array out;
89 AF_CHECK(af_init());
90
91 if (ndims <= 0) { return af_create_handle(result, 0, nullptr, type); }
92 dim4 d = verifyDims(ndims, dims);
93
94 switch (type) {
95 case c32: out = createCplx<cfloat, float>(d, real, imag); break;
96 case c64: out = createCplx<cdouble, double>(d, real, imag); break;
97 default: TYPE_ERROR(5, type);
98 }
99
100 std::swap(*result, out);
101 }
102 CATCHALL
103 return AF_SUCCESS;
104}
105
106af_err af_constant_long(af_array *result, const intl val, const unsigned ndims,
107 const dim_t *const dims) {

Callers 2

initMethod · 0.50
constantFunction · 0.50

Calls 4

verifyDimsFunction · 0.85
swapFunction · 0.85
af_initFunction · 0.70
af_create_handleFunction · 0.70

Tested by 1

initMethod · 0.40