Code Monkey home page Code Monkey logo

Comments (5)

chmorgan avatar chmorgan commented on May 31, 2024 1

Hi @sgreben I opened a PR and commented about the implementation. I wasn't sure there was a clean way to figure out if the value was out of range so went the route of extending the existing At() function. I would appreciate feedback and can adjust if necessary.

from piecewiselinear.

sgreben avatar sgreben commented on May 31, 2024

Hey, thanks for getting in touch! Personally I'd prefer keeping the signature for At as-is. Open to discussion though :) Would something like func (f Function) IsInterpolatedAt(x float64) bool perhaps also cover your use-case? So you could then do

if !f.IsInterpolatedAt(x) {
   // x is not within domain X, f.At(x) is guaranteed to be zero
   return
}
//  x is within domain X, f.At(x) might be non-zero

I actually find it useful that the function is well-defined outside the X domain - this way it can be used wherever a func (float)float is expected.

from piecewiselinear.

chmorgan avatar chmorgan commented on May 31, 2024

from piecewiselinear.

sgreben avatar sgreben commented on May 31, 2024

Yes, please! And if you have a better idea for the name than I did (IsInterpolatedAt doesn't exactly roll off the tongue...) please feel free to choose that :) Many thanks!

Sergey

from piecewiselinear.

sgreben avatar sgreben commented on May 31, 2024

Addressed in #3 Thanks!

from piecewiselinear.

Related Issues (2)

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.