mathlib-develop Mailing List for JMathLib - Octave, Matlab clone in java (Page 6)
Status: Beta
Brought to you by:
st_mueller
You can subscribe to this list here.
2003 |
Jan
|
Feb
(18) |
Mar
(8) |
Apr
|
May
|
Jun
|
Jul
(15) |
Aug
(3) |
Sep
(1) |
Oct
(1) |
Nov
(1) |
Dec
(1) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(3) |
Feb
(4) |
Mar
|
Apr
(4) |
May
(4) |
Jun
(9) |
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(2) |
Dec
|
2005 |
Jan
(1) |
Feb
(1) |
Mar
|
Apr
(2) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2006 |
Jan
(1) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
(4) |
Sep
(3) |
Oct
(3) |
Nov
(2) |
Dec
(3) |
2007 |
Jan
(4) |
Feb
(2) |
Mar
|
Apr
|
May
(3) |
Jun
(2) |
Jul
(2) |
Aug
(2) |
Sep
|
Oct
|
Nov
(3) |
Dec
|
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
(21) |
Aug
|
Sep
(1) |
Oct
(1) |
Nov
|
Dec
(1) |
2009 |
Jan
|
Feb
(1) |
Mar
|
Apr
(3) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
(2) |
2010 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
(1) |
2012 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2014 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
(1) |
Oct
|
Nov
|
Dec
|
2016 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Stefan M. <st...@he...> - 2003-02-22 19:23:25
|
mark wrote: > On Thursday 20 Feb 2003 7:40 pm, Stefan Mueller wrote: > >>>While testing it I notived a problem with function calls >>> >>>entering >>> >>> >>>>path >>> >>>runs the path function and sets the ans variable but doesn't display >>>anything >>> >>>while entering >>> >>> >>>>path() >>> >>>displays the result of the function call. >> >>I'll have a look into it. >> >>Kind regards, >> Stefan. > > > > This seems to be connected to the function being treated as a variable rather > than a function when the brackets are ommitted. > > There is a similar problem if there is a space between the function name and > the brackets. If you enter > >>sin (5) > > > then you get a null pointer error. > > After checking it seems that MathLib treats VariableTokens and FunctionTokens > in the same way. It first checks for a variable with that name then for a > function. > > Therefore it might be an idea to combine VariableTokens and FunctionTokens > into one class (Say ReferenceToken) since this would ensure consistent > behaviour regardless of how the function or variable is entered. > > One difficulty is the fact that VariableToken descends from OperandToken while > FunctionToken descends from OperatorToken. RefereenceToken would have to be a > subclass of OperandToken which would mean that it would have to store any > parameters being passed to the variable or function. > > Though this would have the advantage of making functions more consistent with > keyword functions such as IF and WHILE. You're right, the mentioned approach looks very nice. There is also another advantage. To move functions into a descendent of OperandToken would clean up the handling of Expression-Tokens. In the future expression-tokens should only handle operands like +,*/^ this will simplify handling of priorities and evaluation of expressions. I'll start working on it right away. I propose to call the new token FunctionVariable-token since it cannot be determined during parsing if a token is a variable or a function. Kind regards, Stefan. |
From: mark <msp...@ya...> - 2003-02-21 21:30:28
|
On Thursday 20 Feb 2003 7:40 pm, Stefan Mueller wrote: > > While testing it I notived a problem with function calls > > > > entering > > > >>path > > > > runs the path function and sets the ans variable but doesn't display > > anything > > > > while entering > > > >>path() > > > > displays the result of the function call. > > I'll have a look into it. > > Kind regards, > Stefan. This seems to be connected to the function being treated as a variable ra= ther=20 than a function when the brackets are ommitted. There is a similar problem if there is a space between the function name = and=20 the brackets. If you enter >sin (5) then you get a null pointer error. After checking it seems that MathLib treats VariableTokens and FunctionTo= kens=20 in the same way. It first checks for a variable with that name then for a= =20 function. Therefore it might be an idea to combine VariableTokens and FunctionToken= s=20 into one class (Say ReferenceToken) since this would ensure consistent=20 behaviour regardless of how the function or variable is entered. One difficulty is the fact that VariableToken descends from OperandToken = while =20 FunctionToken descends from OperatorToken. RefereenceToken would have to = be a=20 subclass of OperandToken which would mean that it would have to store any= =20 parameters being passed to the variable or function. Though this would have the advantage of making functions more consistent = with=20 keyword functions such as IF and WHILE. Best Regards Mark |
From: Stefan M. <st...@he...> - 2003-02-21 17:32:54
|
Hi Mark, there are a couple of files missing. Please see below, kind regards, Stefan. .\MathLib\Tokens\SymbolicToken.java:300: cannot resolve symbol symbol : class GeometricSymbolicExpression location: class MathLib.Tokens.SymbolicToken result = new GeometricSymbolicExpression(this); ^ .\MathLib\Tokens\SymbolicToken.java:337: cannot resolve symbol symbol : class GeometricSymbolicExpression location: class MathLib.Tokens.SymbolicToken result = new GeometricSymbolicExpression(this); ^ .\MathLib\Tokens\SymbolicToken.java:343: cannot resolve symbol symbol : class GeometricSymbolicExpression location: class MathLib.Tokens.SymbolicToken result = new GeometricSymbolicExpression(this); ^ .\MathLib\Tokens\SymbolicToken.java:372: cannot resolve symbol symbol : class ExponentialSymbolicExpression location: class MathLib.Tokens.SymbolicToken result = new ExponentialSymbolicExpression(this, arg); ^ 17 errors C:\CVSWork\mathlib\Source>javac -classpath ;. -d ..\Classes MathLib\Tokens\*.jav a MathLib\Tokens\FunctionToken.java:78: cannot resolve symbol symbol : class SymbolicExpression location: class MathLib.Tokens.FunctionToken if(result == null && ((operands[0] instanceof SymbolicToken) ||(oper ands[0] instanceof SymbolicExpression))) ^ MathLib\Tokens\FunctionToken.java:80: cannot resolve symbol symbol : class FunctionSymbolicExpression location: class MathLib.Tokens.FunctionToken result = new FunctionSymbolicExpression(this, operands); ^ MathLib\Tokens\NumberToken.java:498: cannot resolve symbol symbol : class SymbolicExpression location: class MathLib.Tokens.NumberToken else if((arg instanceof SymbolicToken) || (arg instanceof SymbolicExpres |
From: Stefan M. <st...@he...> - 2003-02-20 19:34:02
|
> While testing it I notived a problem with function calls > > entering > >>path > > runs the path function and sets the ans variable but doesn't display anything > > while entering > >>path() > > displays the result of the function call. I'll have a look into it. Kind regards, Stefan. -- ------------------------------------ Dr.-Ing. Stefan Mueller email: St...@he... ------------------------------------ |
From: mark <msp...@ya...> - 2003-02-20 13:25:08
|
On Wednesday 12 Feb 2003 1:13 pm, mark wrote: > At the moment when executing num1 <op> num2 the system sometimes modifi= es > num1 and sometimes creates a new NumberToken. > > I've been thinking that it might be better if NumberTokens were immutab= le > so that all operations returned a new object without changing either > operand. > I've made the changes to NumberToken so that all operations should create= a=20 new instance. If an operation ever modifies one of it parameters then that should be=20 considered to be a bug. Best Regards Mark |
From: mark <msp...@ya...> - 2003-02-20 13:25:08
|
On Monday 10 Feb 2003 4:58 pm, mark wrote: > Hi Stefan and Alejandro > > I've noticed an error with the swing interface. It's stripping off the = last > character of any expression so that 12 + 34 becomes just 12 + 3 > That's working correctly now. Though I'm not getting any icon. The smalllogo.gif file is in the Swing=20 directory but it isn't appearing. Best Regards Mark |
From: mark <msp...@ya...> - 2003-02-18 22:36:07
|
I've changed the path function so that it's an internal function defined = in=20 the StandardFunction.java file. I've done this so that if the search path is corrupted it is still possib= le to=20 use the path function in order to check what state the search path is in. While testing it I notived a problem with function calls entering >path=20 runs the path function and sets the ans variable but doesn't display anyt= hing while entering >path() displays the result of the function call. Best Regards Mark |
From: mark <msp...@ya...> - 2003-02-17 08:50:21
|
On Saturday 15 Feb 2003 10:04 pm, Alejandro Torras wrote: > Hi Mark and Stefan!! > > > > Actually I meant finding factors of polynomials > > > i.e. x^2 + 2*x + 1 =3D> (x+1)^2 > > > > > > Though I'll check the link out since the the current implementation= of > > > numerical factorization is pretty slow. > > > > Sorry, I've no clue at all. I've never done anything with symbolic > > stuff. > > Me too, but I think we can give us hints to a proper sollution, as we h= ave > done before ;-) > > Finding the roots of polynomials, I have read something about the > Tartaglia's triangle, Pascal's or Newton's one, but I don't remeber now= =2E > > You can see a plenty tutorial about it at > http://www.krysstal.com/binomial.html > > But this works only for binomial power of expressions like (x + y)^z wh= ere > x,y are integers and z is a natural number. > > If we want general root finding, including complex roots, we should sea= rch > a bit more. > > Regards, > Alejandro. > Well I'm not sure that we need to worry about complex roots to begin with= but=20 it does need to be more general than just binomial expansions. Things lik= e x^3 + 6x^2 + 11x + 6 =3D (x+1)(x+2)(x+3) I wasn't able to find anything on google but there is a section on it in=20 volume 2 of The Art Of Computer Programming. I'll read through that toda= y. Best Regards Mark |
From: Alejandro T. <ate...@ho...> - 2003-02-16 21:43:26
|
Hi Stefan! I'm sorry I haven't reply you before. This field is available since jdk 1.4.0. I ported the swing gui to this version because I had some problems mixing light and heavy weight components (popups) with 1.3.1. You can take a look at Source/MathLib/UI/Swing/releasenotes.txt . I think the upload was successful... Almost every choice I do is explained here. Best regards, Alejandro. ----- Original Message ----- From: "Stefan Mueller" <st...@he...> To: "MathLib Devel" <mat...@li...>; "Alejandro Torras" <ate...@ho...> Sent: Thursday, February 13, 2003 5:24 PM Subject: [Mathlib-develop] Bug in SwingGui > Hi Alejandro, > > 1. did you also subscribe to the developer list? I also sent this email > to you standard address. > > 2. there's a bug in the Swing GUI > > MathLib\UI\Swing\Console.java:35: cannot resolve symbol > symbol : variable BUTTON2 > location: class java.awt.event.MouseEvent > if ((b & me.BUTTON2) == me.BUTTON2) > ^ > MathLib\UI\Swing\Console.java:35: cannot resolve symbol > symbol : variable BUTTON2 > location: class java.awt.event.MouseEvent > if ((b & me.BUTTON2) == me.BUTTON2) > ^ > MathLib\UI\Swing\Console.java:39: cannot resolve symbol > symbol : variable BUTTON1 > location: class java.awt.event.MouseEvent > else if ((b & me.BUTTON1) == me.BUTTON1) > ^ > MathLib\UI\Swing\Console.java:39: cannot resolve symbol > symbol : variable BUTTON1 > location: class java.awt.event.MouseEvent > else if ((b & me.BUTTON1) == me.BUTTON1) > ^ > 5 errors |
From: Alejandro T. <ate...@ho...> - 2003-02-15 21:01:03
|
Hi Mark and Stefan!! > > Actually I meant finding factors of polynomials > > i.e. x^2 + 2*x + 1 => (x+1)^2 > > > > Though I'll check the link out since the the current implementation of > > numerical factorization is pretty slow. > Sorry, I've no clue at all. I've never done anything with symbolic > stuff. Me too, but I think we can give us hints to a proper sollution, as we have done before ;-) Finding the roots of polynomials, I have read something about the Tartaglia's triangle, Pascal's or Newton's one, but I don't remeber now. You can see a plenty tutorial about it at http://www.krysstal.com/binomial.html But this works only for binomial power of expressions like (x + y)^z where x,y are integers and z is a natural number. If we want general root finding, including complex roots, we should search a bit more. Regards, Alejandro. |
From: mark <msp...@ya...> - 2003-02-13 20:45:07
|
On Wednesday 12 Feb 2003 6:55 pm, Stefan Mueller wrote: > >>Hi Mark and Stefan! > >> > >>1) Why don't we put it on a new class on Functions/Calculus package? = I > >> have free access to some "numerical methods" books at the university= , so > >> if you need it I'll pass you some hints. > > > > What I meant was how to handle cases like derivative( sin(x), x) =3D> > > cos(x) or even derivative( UserFunction(x), x) =3D> OtherFunction(x) > > > > My idea was that the implementation of sin and UserFunction would con= tain > > a method called derivative which would return the correct value. > > I aggree to add the two methods to the individual functions. > But what about complex integration/derivative rules, like the chain > rule? > e.g.: d/dx of sin(cos(x)) > IIRC d/dx f(u) =3D d/dx u * d/du f(u)=20 so d/dx sin(cos(x)) =3D -sin(x) * cos(cos(x)) So differentiating chained functions shouldn't be too hard. Though we should probably limit derivatives to functions that take 1=20 parameter. Best Regards Mark |
From: Stefan M. <st...@he...> - 2003-02-13 16:18:12
|
Hi Alejandro, 1. did you also subscribe to the developer list? I also sent this email to you standard address. 2. there's a bug in the Swing GUI MathLib\UI\Swing\Console.java:35: cannot resolve symbol symbol : variable BUTTON2 location: class java.awt.event.MouseEvent if ((b & me.BUTTON2) == me.BUTTON2) ^ MathLib\UI\Swing\Console.java:35: cannot resolve symbol symbol : variable BUTTON2 location: class java.awt.event.MouseEvent if ((b & me.BUTTON2) == me.BUTTON2) ^ MathLib\UI\Swing\Console.java:39: cannot resolve symbol symbol : variable BUTTON1 location: class java.awt.event.MouseEvent else if ((b & me.BUTTON1) == me.BUTTON1) ^ MathLib\UI\Swing\Console.java:39: cannot resolve symbol symbol : variable BUTTON1 location: class java.awt.event.MouseEvent else if ((b & me.BUTTON1) == me.BUTTON1) ^ 5 errors -- ------------------------------------ Dr.-Ing. Stefan Mueller email: St...@he... ------------------------------------ |
From: Stefan M. <st...@he...> - 2003-02-12 19:08:59
|
mark wrote: > Hi Stefan and Alejandro > Also now that the mailing list is set up what do you think to using that for > all discussion? It'll mean that all our insightful comments will be stored > for prosterity. I aggree. It's a good idea. Kind regards, Stefan. ------------------------------------ Dr.-Ing. Stefan Mueller email: St...@he... ------------------------------------ |
From: Stefan M. <st...@he...> - 2003-02-12 18:49:28
|
>>Hi Mark and Stefan! >> >>1) Why don't we put it on a new class on Functions/Calculus package? I have >>free access to some "numerical methods" books at the university, so if you >>need it I'll pass you some hints. > > > What I meant was how to handle cases like derivative( sin(x), x) => cos(x) > or even derivative( UserFunction(x), x) => OtherFunction(x) > > My idea was that the implementation of sin and UserFunction would contain a > method called derivative which would return the correct value. I aggree to add the two methods to the individual functions. But what about complex integration/derivative rules, like the chain rule? e.g.: d/dx of sin(cos(x)) >>2) Do you mean find the factors of a number (15= 3*5) >>If true, this page can help you http://www.alpertron.com.ar/ECM.HTM >>I have tried it with 128 digits on 16 segons!!! > > > Actually I meant finding factors of polynomials > i.e. x^2 + 2*x + 1 => (x+1)^2 > > Though I'll check the link out since the the current implementation of > numerical factorization is pretty slow. Sorry, I've no clue at all. I've never done anything with symbolic stuff. Kind regards, Stefan. -- ------------------------------------ Dr.-Ing. Stefan Mueller email: St...@he... ------------------------------------ |
From: mark <msp...@ya...> - 2003-02-12 17:39:20
|
At the moment when executing num1 <op> num2 the system sometimes modifies= num1=20 and sometimes creates a new NumberToken. I've been thinking that it might be better if NumberTokens were immutable= so=20 that all operations returned a new object without changing either operand= =2E The advantages are 1: constants can be used in place of common numbers (-1,0,1,i) 2: this will reduce the need for functions to clone there parameters befo= re=20 operating on them=20 3: it'll reduce the chance of bugs becuase of having two references to a=20 number that suddenly changes The disadvantages are 1: It might slow some operations down So what does everyone think about this? Best Regards Mark |
From: Alejandro T. <ate...@ho...> - 2003-02-11 23:16:00
|
Hi! You can check out the new swing gui release. There's two things to comment: a) The swing gui has been developed and tested under the jdk 1.4.x, so = it won't work properly on older versions (See releasenotes.txt - GN0004) b) The context menu is still buggy (See GN0005) Regards, Alejandro. |
From: mark <msp...@ya...> - 2003-02-11 12:12:51
|
Hi Stefan and Alejandro I've noticed an error with the swing interface. It's stripping off the la= st=20 character of any expression so that 12 + 34 becomes just 12 + 3 Also now that the mailing list is set up what do you think to using that = for=20 all discussion? It'll mean that all our insightful comments will be store= d=20 for prosterity.=20 Best Regards Mark |