GithubHelp home page GithubHelp logo

Comments (6)

wjakob avatar wjakob commented on June 22, 2024

Complex<DynamicArray> is the way to go. Dynamic arrays always come at the deepest level of the hierarchy. What is the problem with the map function? (I assume you mean vectorize?)

from enoki.

gergol avatar gergol commented on June 22, 2024

Thanks for the quick reply! Sorry for being unclear. I mean the the DynamicArray::map function. My goal is to be able to use the output of an FFT with enoki.

from enoki.

wjakob avatar wjakob commented on June 22, 2024

Enoki assumes that the data is arranged in SoA format. In that case, you should be able to map the two components of your complex vector without problems (with two map calls). If the data is interleaved, you will need to gather each component.

from enoki.

gergol avatar gergol commented on June 22, 2024

So here is how I try to do it:

using namespace enoki;
{
  using FloatP   = Packet<float, 8>;
  using FloatX  = DynamicArray<FloatP>;
  using ComplexX = Complex<FloatX>;

  std::vector<float> interleaved;

  auto cplx = ComplexX::map(interleaved.data(), 10);

}

However, the last line fails to compile with error: no member named 'map' in enoki::Complex<enoki::DynamicArray<enoki::Packet<float, 8, true, enoki::RoundingMode::Default> >, true>'; did you mean 'max' , because Complex inherits from StaticArray.

from enoki.

wjakob avatar wjakob commented on June 22, 2024

As I said -- you need a map per component (FloatX::map) or two FloatX gathers in the interleaved case.

from enoki.

gergol avatar gergol commented on June 22, 2024

OK, I see. I was thinking there was a way to do something similar to a reinterpret_cast<complex<float>>. Thanks for your help!

from enoki.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.