Coder Social home page Coder Social logo

Match arbitrary function about matchpy HOT 4 OPEN

hpac avatar hpac commented on June 6, 2024
Match arbitrary function

from matchpy.

Comments (4)

hbarthels avatar hbarthels commented on June 6, 2024

You mean a pattern where f is a variable that matches a function symbol, like f_[a_, b_] in Mathematica? Unfortunately, MatchPy doesn't support that yet.

If the functions you are considering are not actually arbitrary, that is, if you have a finite number of them that is known by the time you construct your patterns, you could achieve something similar by constructing one pattern for each function. With many-to-one matching, the performance should still be ok.

from matchpy.

sidmani avatar sidmani commented on June 6, 2024

Unfortunately the functions are completely arbitrary. Do you know how I could implement that in MatchPy? How difficult would it be?

from matchpy.

hbarthels avatar hbarthels commented on June 6, 2024

@wheerd should be able to give you a better answer than me. From the algorithmic point of view, right now I don't see a reason why it should be impossible. I just don't have a good feeling for how much work it would be, and if it would integrate nicely into what we already have.

from matchpy.

wheerd avatar wheerd commented on June 6, 2024

Integrating it into the one-to-one matching would be relatively easy, but I don't know about the many-to-one case. My gut feeling is that would be complicated if you want to cover all the and iterate over all possible matches. I can't give much more pointers as I haven't worked on this in three years and my knowledge got a bit rusty.

from matchpy.

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.