Search the web
Sign In
New User? Sign Up
jsci
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Real people. Real stories. See how Yahoo! Groups impacts members worldwide.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Sum computation   Message List  
Reply | Forward Message #318 of 369 |
Re: [jsci] Sum computation

Pavan (Akkisetty Venkata Sai Pavan Kumar) wrote:
> I am not sure if evaluate( )-mathod will do non-numeric evaluations. I
> see that your mathml is non-numeric in nature (I mean symbolic).
> This is the output I get if I use Mathematica to interpret your mathml.

Ok, that was a confusing example. The following should be possible to compute:

<math xmlns="http://www.w3.org/1998/Math/MathML">
<apply>
<sum/>
<bvar><ci>i</ci></bvar>
<lowlimit><cn>0</cn></lowlimit>
<uplimit><cn>100</cn></uplimit>
<apply>
<power/>
<cn>2</cn>
<ci>i</ci>
</apply>
</apply>
</math>

Now there's an exception: "Exception in thread "main"
java.lang.ClassCastException: java.lang.String"

> I am also trying to use JSci to convert mathml to Jsci objects. Can you
> send me an example code if you have any?? I couldn't understand how to
> use MathMLDOMimpl library.

Yes, it's really difficult to see how the library works.

import JSci.mathml.MathMLApplyElementImpl;
import JSci.io.MathMLExpression;

public class TestJSci {

/**
* @param args
*/
public static void main(String[] args) {
JSci.io.MathMLParser parser = new JSci.io.MathMLParser();

try {

parser.parse("test.mml");
} catch (Exception e) {
System.out.println(e.getMessage());
}

Object parseList[] = parser.translateToJSciObjects();

for (int i = 0; i < parseList.length; i++) {
JSci.io.MathMLExpression test = (JSci.io.MathMLExpression) parseList[i];
System.out.println(test.evaluate());
System.out.println(test.getOperation());
}
}

}

Regards, Herbert


___________________________________________________________
Telefonate ohne weitere Kosten vom PC zum PC: http://messenger.yahoo.de



Thu Dec 7, 2006 9:37 am

herbertkluge
Offline Offline
Send Email Send Email

Forward
Message #318 of 369 |
Expand Messages Author Sort by Date

Hello! Why is the computation of a sum not working? <math xmlns="http://www.w3.org/1998/Math/MathML"> <apply> <sum/> <bvar><ci>i</ci></bvar>...
Herbert Kluge
herbertkluge
Offline Send Email
Dec 5, 2006
6:59 pm

Hi Herbert: As far as I understand, this(mathml) is just the representation of the (math)information. There is no solver attached to it. You have to send this...
Pavan (Akkisetty Venk...
avspavan
Offline Send Email
Dec 5, 2006
7:35 pm

Pavan (Akkisetty Venkata Sai Pavan Kumar) wrote: > As far as I understand, this(mathml) is just the representation of the > (math)information. There is no...
Herbert Kluge
herbertkluge
Offline Send Email
Dec 6, 2006
7:05 pm

Hi: I am not sure if evaluate( )-mathod will do non-numeric evaluations. I see that your mathml is non-numeric in nature (I mean symbolic). This is the output...
Pavan (Akkisetty Venk...
avspavan
Offline Send Email
Dec 6, 2006
7:32 pm

Pavan (Akkisetty Venkata Sai Pavan Kumar) wrote: > I am not sure if evaluate( )-mathod will do non-numeric evaluations. I > see that your mathml is non-numeric...
Herbert Kluge
herbertkluge
Offline Send Email
Dec 7, 2006
9:39 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help