typename std::enable_if<real_to_complex, ndt::type>::type
    resolve_dst_type_(const ndt::type &DYND_UNUSED(dst_tp), intptr_t DYND_UNUSED(nsrc), const ndt::type *src_tp,
                      intptr_t DYND_UNUSED(nkwd), const nd::array *kwds,
                      const std::map<std::string, ndt::type> &DYND_UNUSED(tp_vars)) {
      nd::array shape = kwds[0];

      intptr_t ndim = src_tp[0].get_ndim();
      dimvector src_shape(ndim);
      src_tp[0].extended()->get_shape(ndim, 0, src_shape.get(), NULL, NULL);
      src_shape[ndim - 1] = (shape.is_null() ? src_shape[ndim - 1] : shape(ndim - 1).as<intptr_t>()) / 2 + 1;
      return ndt::make_type(ndim, src_shape.get(), ndt::make_type<complex<double>>());
    }
示例#2
0
    static typename std::enable_if<real_to_complex, void>::type
    resolve_dst_type_(char *DYND_UNUSED(static_data), size_t DYND_UNUSED(data_size), char *DYND_UNUSED(data),
                      ndt::type &dst_tp, intptr_t DYND_UNUSED(nsrc), const ndt::type *src_tp,
                      intptr_t DYND_UNUSED(nkwd), const nd::array *kwds,
                      const std::map<std::string, ndt::type> &DYND_UNUSED(tp_vars))
    {
        nd::array shape = kwds[0];

        intptr_t ndim = src_tp[0].get_ndim();
        dimvector src_shape(ndim);
        src_tp[0].extended()->get_shape(ndim, 0, src_shape.get(), NULL, NULL);
        src_shape[ndim - 1] = (shape.is_null() ? src_shape[ndim - 1] : shape(ndim - 1).as<intptr_t>()) / 2 + 1;
        dst_tp = ndt::make_fixed_dim(ndim, src_shape.get(), ndt::type::make<complex<double>>());
    }