GithubHelp home page GithubHelp logo

Comments (5)

timholy avatar timholy commented on May 18, 2024 1

Can you get away with Linear? The reason I ask is that Linear does not require prefiltering; if you don't need to do prefiltering, then it does not destroy the input.

If you do need Quadratic, and can use InPlace, then you can copy to a reusable buffer as you say. I don't think there's an alternative to copying if you want to use the current infrastructure: interpolate! uses the input to store the interpolation coefficients, and those are not equal to the input data for anything higher than Linear.

from interpolations.jl.

sglyon avatar sglyon commented on May 18, 2024

Would it work to call copy on your input matrix before passing it to interpolate!?

from interpolations.jl.

jianghaizhu avatar jianghaizhu commented on May 18, 2024

Yes, I can make a copy of the input matrix before interpolate!, which would allocate the same amount of memory as interpolate. However, since I have tens of thousands of volumes whose size are fixed, I can pre-allocate a volume with the right size and use copy!() to copy the input matrix to the pre-allocated volume before interpolate! to limit the memory allocation, which is an improvement. But that is still tens of thousands additional copies of large 3d matrices, e.g. 250x250x250.

from interpolations.jl.

jianghaizhu avatar jianghaizhu commented on May 18, 2024

Thanks! I did find out that when using Linear the output was not destroyed and was puzzled. Now I know why. Yes, right now I can go with Linear, but eventually I need to move to Quadratic and even Cubic. I didn't find an InPlace for Cubic though. Will this be implemented? Also when using BSpline(Quadratic(InPlace())), the GT has to be OnCell()?

from interpolations.jl.

timholy avatar timholy commented on May 18, 2024

Somebody probably needs to work out the mathematics. If you're interested in tackling that, there was once some PDF documentation on InPlace but it seems to have been removed. Perhaps you could try checking out older versions of this package to find it.

from interpolations.jl.

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.