create varX = new Variable.Local<Rational>("x");

Discussion in 'Java' started by Mohamad Khaleghy, May 23, 2014.

  1. Hi
    I have sample code downloaded for using jscience.

    But when I use it, it gives this message:

    E/AndroidRuntime(1296): java.lang.NoClassDefFoundError:eek:rg.jscience.mathematics.function.Variable$Local

    Am i I missing something? Of course I imported the jscience jar lib to my project. But still can't figure this out.

    Variable.Local<Rational> varX = new Variable.Local<Rational>("x");
    Variable.Local<Rational> varY = new Variable.Local<Rational>("y");

    // f(x, y) = x² + x·y + 1;
    Polynomial<Rational> x = Polynomial.valueOf(Rational.ONE, varX);
    Polynomial<Rational> y = Polynomial.valueOf(Rational.ONE, varY);
    Polynomial<Rational> fx_y = x.pow(2).plus(x.times(y)).plus(Rational.ONE);
    System.out.println("f(x,y) = " + fx_y);

    // Evaluates f(1,0)
    System.out.println("f(1,0) = " + fx_y.evaluate(Rational.ONE, Rational..ZERO));

    // Calculates df(x,y)/dx
    System.out.println("df(x,y)/dx = " + fx_y.differentiate(varX));
     
    Mohamad Khaleghy, May 23, 2014
    #1
    1. Advertisements

  2. Mohamad Khaleghy

    Joerg Meier Guest

    On Fri, 23 May 2014 07:09:05 -0700 (PDT), Mohamad Khaleghy wrote:

    > Am i I missing something? Of course I imported the jscience jar lib to my project. But still can't figure this out.


    Importing it lets you compile. Are you also making sure that they get
    exported into the final apk ?

    Liebe Gruesse,
    Joerg

    --
    Ich lese meine Emails nicht, replies to Email bleiben also leider
    ungelesen.
     
    Joerg Meier, May 23, 2014
    #2
    1. Advertisements

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Similar Threads
  1. Paul Carey

    Instance Variable vs Local Variable

    Paul Carey, Dec 3, 2003, in forum: Java
    Replies:
    3
    Views:
    1,161
    Chris Uppal
    Dec 3, 2003
  2. Jerry
    Replies:
    5
    Views:
    35,250
    Roedy Green
    Aug 6, 2005
  3. Patrick Hoffmann
    Replies:
    3
    Views:
    3,330
    Christian Janßen
    Aug 8, 2003
  4. Kench
    Replies:
    2
    Views:
    5,748
    Victor Bazarov
    Jun 28, 2004
  5. Mohanasundaram
    Replies:
    44
    Views:
    1,668
    Keith Thompson
    Aug 24, 2004
  6. sairam
    Replies:
    2
    Views:
    580
    Steve Holden
    Apr 5, 2007
  7. Richard A. DeVenezia

    Nested function X vs. nested varX = function

    Richard A. DeVenezia, Sep 8, 2003, in forum: Javascript
    Replies:
    1
    Views:
    337
    Code Ronin
    Sep 9, 2003
  8. Replies:
    2
    Views:
    915
    Thomas 'PointedEars' Lahn
    Mar 11, 2008
Loading...