Giter Club home page Giter Club logo

Comments (5)

saona-raimundo avatar saona-raimundo commented on May 29, 2024 1

Thanks to you!!

from argmin.

stefan-k avatar stefan-k commented on May 29, 2024

Hi!

Error and ArgminError should be public. I just tried the following, which works for me:

use argmin::prelude::*;

impl ArgminOp for MyProblem {
    type Param = f64;
    type Output = f64;
    type Hessian = ();
    type Jacobian = ();
    type Float = f64;

    fn apply(&self, p: &Self::Param) -> Result<Self::Output, Error> {
        Err(ArgminError::InvalidParameter {
            text: String::from("bla"),
        }
        .into())
    }
}

However, the ergonomics are far from ideal, I agree. I will think about this.
Alternatively, you should be able to implement your own errors if you want to.

Could you show me the compile error, please?

from argmin.

stefan-k avatar stefan-k commented on May 29, 2024

Which version are you using? The current master branch or 0.2.6? Your snippet suggests the master branch, but your problem suggests 0.2.6 ;)

I would suggest to use the current master branch, as the current release is quite old and outdated. I plan to publish a new release soon.

from argmin.

saona-raimundo avatar saona-raimundo commented on May 29, 2024

Perfect!!
I am so sorry, I got mixed the two versions (working on 0.2.6). Working on the master branch works as you say :)

So, case solved.
Happy to hear about the new release! :D

By the way, did you notice that the documentation is "broken"? I mean, from crates.io, the documentation link is broken. Is it a problem with docs.rs?

(I can open other issue for this if you want)

from argmin.

stefan-k avatar stefan-k commented on May 29, 2024

Glad I could help! I'm very sorry about the confusion!

Thanks for informing me about the broken documentation, I will investigate it :)

from argmin.

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.