Beispiel #1
0
 array constant(cfloat val, const dim4 &dims)
 {
     af_array res;
     AF_THROW(af_constant_complex(&res, real(val), imag(val),
                                  dims.ndims(), dims.get(), c32));
     return array(res);
 }
Beispiel #2
0
 AFAPI array constant(cdouble val, const dim4 &dims, const af::dtype type)
 {
     if (type != c32 && type != c64) {
         return constant(real(val), dims, type);
     }
     af_array res;
     AF_THROW(af_constant_complex(&res,
                                  real(val),
                                  imag(val),
                                  dims.ndims(),
                                  dims.get(), type));
     return array(res);
 }