mathlib-commitlog Mailing List for JMathLib - Octave, Matlab clone in java (Page 14)
Status: Beta
Brought to you by:
st_mueller
You can subscribe to this list here.
| 2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(2) |
Jul
(4) |
Aug
(150) |
Sep
|
Oct
|
Nov
|
Dec
(2) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2007 |
Jan
(233) |
Feb
(86) |
Mar
(32) |
Apr
(26) |
May
(73) |
Jun
(45) |
Jul
(23) |
Aug
(23) |
Sep
(5) |
Oct
(80) |
Nov
(11) |
Dec
(11) |
| 2008 |
Jan
|
Feb
|
Mar
(13) |
Apr
(3) |
May
(7) |
Jun
(30) |
Jul
(12) |
Aug
(12) |
Sep
|
Oct
|
Nov
(78) |
Dec
(78) |
| 2009 |
Jan
(214) |
Feb
(79) |
Mar
(20) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <st_...@us...> - 2008-12-30 22:02:35
|
Revision: 584
http://mathlib.svn.sourceforge.net/mathlib/?rev=584&view=rev
Author: st_mueller
Date: 2008-12-30 22:02:27 +0000 (Tue, 30 Dec 2008)
Log Message:
-----------
first beta versin of text user interface
Modified Paths:
--------------
JMathLib/trunk/src/jmathlib/ui/text/TextUI.java
Modified: JMathLib/trunk/src/jmathlib/ui/text/TextUI.java
===================================================================
--- JMathLib/trunk/src/jmathlib/ui/text/TextUI.java 2008-12-30 21:36:17 UTC (rev 583)
+++ JMathLib/trunk/src/jmathlib/ui/text/TextUI.java 2008-12-30 22:02:27 UTC (rev 584)
@@ -1,16 +1,12 @@
package jmathlib.ui.text;
import jmathlib.core.interpreter.*;
-import jmathlib.core.interfaces.RemoteAccesible;
+import jmathlib.core.interfaces.*;
import jmathlib.ui.common.Console;
-import java.awt.*;
-import java.awt.event.*;
-import java.applet.*;
import java.io.*;
-import java.util.Vector;
-public class textUI implements RemoteAccesible, MathLibOutput
+public class TextUI implements RemoteAccesible, MathLibOutput
{
/**store whether executing lines or entering a function def*/
private boolean interactiveMode;
@@ -27,14 +23,13 @@
/**stores the input stream*/
private DataInputStream input;
- public textUI()
+ public TextUI()
{
interactiveMode = true;
functionCode = "";
exiting = false;
interpreter = new Interpreter(true, null);
- interpreter.setOutputPanel((MathLibOutput)this);
- interpreter.setDebug(false);
+ interpreter.setOutputPanel(this);
input = new DataInputStream(System.in);
}
@@ -50,7 +45,7 @@
public static void main(String[] args)
{
- MathLibTUI tui = new MathLibTUI();
+ TextUI tui = new TextUI();
if(args.length == 0)
{
tui.run();
@@ -101,7 +96,7 @@
String answerString = "";
//process the function
- answerString = interpreter.readFunction(functionCode, true, false);
+ //answerString = interpreter.readFunction(functionCode, true, false);
interactiveMode = true;
@@ -114,6 +109,9 @@
}
}
+ /**
+ * method for the interpreter to display its outpout
+ */
public void displayText(String text)
{
System.out.println(text);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2008-12-30 22:00:46
|
Revision: 583
http://mathlib.svn.sourceforge.net/mathlib/?rev=583&view=rev
Author: st_mueller
Date: 2008-12-30 21:36:17 +0000 (Tue, 30 Dec 2008)
Log Message:
-----------
buggy
Added Paths:
-----------
JMathLib/trunk/src/jmathlib/ui/text/
JMathLib/trunk/src/jmathlib/ui/text/TextUI.java
Added: JMathLib/trunk/src/jmathlib/ui/text/TextUI.java
===================================================================
--- JMathLib/trunk/src/jmathlib/ui/text/TextUI.java (rev 0)
+++ JMathLib/trunk/src/jmathlib/ui/text/TextUI.java 2008-12-30 21:36:17 UTC (rev 583)
@@ -0,0 +1,139 @@
+package jmathlib.ui.text;
+
+import jmathlib.core.interpreter.*;
+import jmathlib.core.interfaces.RemoteAccesible;
+import jmathlib.ui.common.Console;
+
+import java.awt.*;
+import java.awt.event.*;
+import java.applet.*;
+import java.io.*;
+import java.util.Vector;
+
+public class textUI implements RemoteAccesible, MathLibOutput
+{
+ /**store whether executing lines or entering a function def*/
+ private boolean interactiveMode;
+
+ /**store the current function definition*/
+ private String functionCode;
+
+ /**stores whether the program is closing*/
+ private boolean exiting;
+
+ /**store a reference to the interpreter object*/
+ private Interpreter interpreter;
+
+ /**stores the input stream*/
+ private DataInputStream input;
+
+ public textUI()
+ {
+ interactiveMode = true;
+ functionCode = "";
+ exiting = false;
+ interpreter = new Interpreter(true, null);
+ interpreter.setOutputPanel((MathLibOutput)this);
+ interpreter.setDebug(false);
+ input = new DataInputStream(System.in);
+ }
+
+ public void run()
+ {
+ displayPrompt();
+ while(!exiting)
+ {
+ String command = readLine();
+ interpretLine(command);
+ }
+ }
+
+ public static void main(String[] args)
+ {
+ MathLibTUI tui = new MathLibTUI();
+ if(args.length == 0)
+ {
+ tui.run();
+ }
+ else
+ {
+ String filename = args[0];
+ tui.interpretLine(filename);
+ }
+ }
+
+ public void close()
+ {
+ exiting = true;
+ }
+
+ public void interpretLine(String line)
+ {
+ if(interactiveMode)
+ {
+ //check to see if this is the beginning of a user function
+ if(line.length() > 7 && line.substring(0, 8).equalsIgnoreCase("FUNCTION"))
+ {
+ functionCode = line;
+ interactiveMode = false;
+
+ displayPrompt();
+ }
+ else
+ {
+ if(line.equalsIgnoreCase("exit") || line.equalsIgnoreCase("quit"))
+ {
+ close();
+ }
+ else
+ {
+ String answerString = interpreter.executeExpression(line);
+
+ displayText(answerString);
+ displayPrompt();
+ }
+ }
+ }
+ else
+ {
+ if(line.equalsIgnoreCase("END"))
+ {
+ String answerString = "";
+
+ //process the function
+ answerString = interpreter.readFunction(functionCode, true, false);
+
+ interactiveMode = true;
+
+ displayText(answerString);
+ }
+ else
+ functionCode += line;
+
+ displayPrompt();
+ }
+ }
+
+ public void displayText(String text)
+ {
+ System.out.println(text);
+ }
+
+ public void displayPrompt()
+ {
+ System.out.print("> ");
+ }
+
+ private String readLine()
+ {
+ try
+ {
+ return input.readLine();
+ }
+ catch(IOException error)
+ {
+ System.out.println("IO Exception");
+ }
+ return "";
+ }
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2008-12-30 09:03:07
|
Revision: 582
http://mathlib.svn.sourceforge.net/mathlib/?rev=582&view=rev
Author: st_mueller
Date: 2008-12-30 09:02:58 +0000 (Tue, 30 Dec 2008)
Log Message:
-----------
added tests for the (1:5)' bug
Modified Paths:
--------------
JMathLib/trunk/src/jmathlibtests/toolbox/jmathlib/matrix/testTranspose.java
Modified: JMathLib/trunk/src/jmathlibtests/toolbox/jmathlib/matrix/testTranspose.java
===================================================================
--- JMathLib/trunk/src/jmathlibtests/toolbox/jmathlib/matrix/testTranspose.java 2008-12-29 21:01:24 UTC (rev 581)
+++ JMathLib/trunk/src/jmathlibtests/toolbox/jmathlib/matrix/testTranspose.java 2008-12-30 09:02:58 UTC (rev 582)
@@ -56,5 +56,35 @@
assertTrue(Compare.ArrayEquals(im, ml.getArrayValueIm("a")));
}
+ public void testTranspose06() {
+ ml.executeExpression("a=2:5");
+ double[][] b = {{2.0, 3.0, 4.0, 5.0}};
+ assertTrue(Compare.ArrayEquals(b, ml.getArrayValueRe("a")));
+ }
+ public void testTranspose07() {
+ ml.executeExpression("a=(2:6)");
+ double[][] b = {{2.0, 3.0, 4.0, 5.0, 6.0}};
+ assertTrue(Compare.ArrayEquals(b, ml.getArrayValueRe("a")));
+ }
+
+ public void testTranspose08() {
+ ml.executeExpression("a=(2:4)'");
+ double[][] b = {{2.0}, {3.0}, {4.0}};
+ assertTrue(Compare.ArrayEquals(b, ml.getArrayValueRe("a")));
+ }
+
+ public void testTranspose09() {
+ ml.executeExpression("a=([1:4])'");
+ double[][] b = {{1.0}, {2.0}, {3.0}, {4.0}};
+ assertTrue(Compare.ArrayEquals(b, ml.getArrayValueRe("a")));
+ }
+
+ public void testTranspose10() {
+ ml.executeExpression("a=[1:5]'");
+ double[][] b = {{1.0}, {2.0}, {3.0}, {4.0}, {5.0}};
+ assertTrue(Compare.ArrayEquals(b, ml.getArrayValueRe("a")));
+ }
+
+
}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2008-12-29 21:01:33
|
Revision: 581
http://mathlib.svn.sourceforge.net/mathlib/?rev=581&view=rev
Author: st_mueller
Date: 2008-12-29 21:01:24 +0000 (Mon, 29 Dec 2008)
Log Message:
-----------
Modified Paths:
--------------
JMathLib/trunk/ChangeLog.txt
Modified: JMathLib/trunk/ChangeLog.txt
===================================================================
--- JMathLib/trunk/ChangeLog.txt 2008-12-29 21:00:45 UTC (rev 580)
+++ JMathLib/trunk/ChangeLog.txt 2008-12-29 21:01:24 UTC (rev 581)
@@ -16,6 +16,9 @@
2008/12/xx
stefan *
+2008/12/28
+stefan * jmathlib/ui/applet/JMathLibGUI.java code cleanup and bugfixing
+
2008/12/27
stefan + moved code from MFileWebLoader.java to WebFunctionLoader.java
stefan - removed MFileWebLoader.java
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2008-12-29 21:00:55
|
Revision: 580
http://mathlib.svn.sourceforge.net/mathlib/?rev=580&view=rev
Author: st_mueller
Date: 2008-12-29 21:00:45 +0000 (Mon, 29 Dec 2008)
Log Message:
-----------
added more bugfixing and code cleanup
Modified Paths:
--------------
JMathLib/trunk/src/jmathlib/ui/applet/JMathLibGUI.java
Modified: JMathLib/trunk/src/jmathlib/ui/applet/JMathLibGUI.java
===================================================================
--- JMathLib/trunk/src/jmathlib/ui/applet/JMathLibGUI.java 2008-12-29 20:58:12 UTC (rev 579)
+++ JMathLib/trunk/src/jmathlib/ui/applet/JMathLibGUI.java 2008-12-29 21:00:45 UTC (rev 580)
@@ -37,17 +37,17 @@
/**Temporary store for function code*/
String functionCode;
-
+
/**Construct the applet*/
public JMathLibGUI()
{
- container = this;
- runningStandalone = false;
+ container = this;
}
/**Initialize the applet*/
public void init()
{
+
container.setSize(700,400);
layout = new BorderLayout();
@@ -58,26 +58,25 @@
container.add("Center", answer);
- interpreter = new Interpreter(runningStandalone, this);
+ interpreter = new Interpreter(false, this);
interpreter.setOutputPanel(answer);
interpreter.executeExpression("startup");
- // check if there is an initial command to send to the interpreter
- String startWithS = getParameter("startup");
- if (startWithS!=null)
- interpreter.executeExpression(startWithS);
-
// get parameter for background color (e.g. ff00cc)
try {
Color color = new Color(Integer.parseInt(this.getParameter("bgcolor"),16));
- if (color!=null) answer.setBackground(color);}
+ if (color!=null)
+ answer.setBackground(color);
+ }
catch (NumberFormatException e){ }
// get parameter for foreground color (e.g. ffddff)
try {
Color color = new Color(Integer.parseInt(this.getParameter("fgcolor"),16));
- if (color!=null) answer.setForeground(color);}
+ if (color!=null)
+ answer.setForeground(color);
+ }
catch (NumberFormatException e){ }
}
@@ -88,48 +87,17 @@
answer.displayPrompt();
answer.requestFocus();
- }
+ // check if there is an initial command to send to the interpreter
+ String startWithS = getParameter("startup");
+ if (startWithS!=null)
+ interpreter.executeExpression(startWithS);
- /**Main method - allow the class to be used as an applicatoin*/
- public static void main(String[] args)
- {
- final JMathLibGUI applet = new JMathLibGUI();
+ answer.displayPrompt();
+ answer.requestFocus();
- Frame frame = new Frame();
- frame.setTitle("JMathLib");
+ }
- // add image to window
- Toolkit tk = Toolkit.getDefaultToolkit();
- Image icon = tk.getImage("MathLib/GUI/smalllogo.gif");
- if (icon != null)
- frame.setIconImage(icon);
-
-
- //create an anomynous inner class to handle window closing
- frame.addWindowListener(new WindowAdapter()
- {
- public void windowClosing(WindowEvent e)
- {
- applet.close();
- }
- });
-
- applet.runningStandalone = true;
- applet.container = frame;
- applet.init();
-
- //Get the size of the screen
- Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
-
- //position the frame in the centre of the screen
- frame.setLocation((d.width - frame.getSize().width) / 2, (d.height - frame.getSize().height) / 2);
-
- frame.setVisible(true);
-
- //start the applet
- applet.start();
- }
-
+
/**Interpret the last command line entered*/
public void interpretLine(String line)
{
@@ -141,8 +109,8 @@
/**Function called when the gui is being close*/
public void close()
{
- interpreter.save();
+ //interpreter.save();
- System.exit(0);
+ //System.exit(0);
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2008-12-29 20:58:15
|
Revision: 579
http://mathlib.svn.sourceforge.net/mathlib/?rev=579&view=rev
Author: st_mueller
Date: 2008-12-29 20:58:12 +0000 (Mon, 29 Dec 2008)
Log Message:
-----------
new structure/file for loading m-files/class-files from an applet
Modified Paths:
--------------
JMathLib/trunk/src/jmathlib/core/functions/WebFunctionLoader.java
Modified: JMathLib/trunk/src/jmathlib/core/functions/WebFunctionLoader.java
===================================================================
--- JMathLib/trunk/src/jmathlib/core/functions/WebFunctionLoader.java 2008-12-29 20:51:39 UTC (rev 578)
+++ JMathLib/trunk/src/jmathlib/core/functions/WebFunctionLoader.java 2008-12-29 20:58:12 UTC (rev 579)
@@ -16,7 +16,7 @@
boolean pFileCachingEnabledB = false;
private URL codeBase;
private String directory;
- private Vector pathV = new Vector(30); // paths to external function for applet usage
+ private Vector functionListV = new Vector(30); // paths to external function for applet usage
/**Default constructor*/
@@ -36,7 +36,7 @@
while ((line = br.readLine()) != null) {
System.out.println("read =" + line);
if (!line.startsWith("#")) {
- pathV.addElement(line);
+ functionListV.addElement(line);
//functionLoaders.add(new MFileWebLoader(applet.getCodeBase(), line));
}
}
@@ -77,11 +77,11 @@
String functionPath = null;
// Search filelist for wanted function
- for (int i=0; i<pathV.size(); i++)
+ for (int i=0; i<functionListV.size(); i++)
{
// The searchstring is set to "/foo.class" to avoid matches
// of substring of some other function like "barfoo.class"
- functionPath = ((String)pathV.elementAt(i));
+ functionPath = ((String)functionListV.elementAt(i));
// !! Remark: the command toLowerCase() is necessary, because some filenames have upper case letters (e.g. Disp.class)
if ( functionPath.toLowerCase().endsWith("/"+functionName+".class") )
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2008-12-29 20:51:57
|
Revision: 578
http://mathlib.svn.sourceforge.net/mathlib/?rev=578&view=rev
Author: st_mueller
Date: 2008-12-29 20:51:39 +0000 (Mon, 29 Dec 2008)
Log Message:
-----------
added basic skeleton for detailed description of each toolbox
Added Paths:
-----------
JMathLib/trunk/doc/src/toolbox_introduction_control.xml
JMathLib/trunk/doc/src/toolbox_introduction_cryto.xml
JMathLib/trunk/doc/src/toolbox_introduction_engine.xml
JMathLib/trunk/doc/src/toolbox_introduction_finance.xml
JMathLib/trunk/doc/src/toolbox_introduction_ftp.xml
JMathLib/trunk/doc/src/toolbox_introduction_funfun.xml
JMathLib/trunk/doc/src/toolbox_introduction_general.xml
JMathLib/trunk/doc/src/toolbox_introduction_image.xml
JMathLib/trunk/doc/src/toolbox_introduction_integration.xml
JMathLib/trunk/doc/src/toolbox_introduction_io.xml
JMathLib/trunk/doc/src/toolbox_introduction_jmathlib.xml
JMathLib/trunk/doc/src/toolbox_introduction_linearalgebra.xml
JMathLib/trunk/doc/src/toolbox_introduction_miscellaneous.xml
JMathLib/trunk/doc/src/toolbox_introduction_net.xml
JMathLib/trunk/doc/src/toolbox_introduction_ode.xml
JMathLib/trunk/doc/src/toolbox_introduction_optimization.xml
JMathLib/trunk/doc/src/toolbox_introduction_physicalconstants.xml
JMathLib/trunk/doc/src/toolbox_introduction_polynomial.xml
JMathLib/trunk/doc/src/toolbox_introduction_quaternion.xml
JMathLib/trunk/doc/src/toolbox_introduction_set.xml
JMathLib/trunk/doc/src/toolbox_introduction_signal.xml
JMathLib/trunk/doc/src/toolbox_introduction_sparse.xml
JMathLib/trunk/doc/src/toolbox_introduction_specfun.xml
JMathLib/trunk/doc/src/toolbox_introduction_specialmatrix.xml
JMathLib/trunk/doc/src/toolbox_introduction_statistics.xml
JMathLib/trunk/doc/src/toolbox_introduction_string.xml
JMathLib/trunk/doc/src/toolbox_introduction_time.xml
JMathLib/trunk/doc/src/toolbox_introduction_toolbox_skeleton.xml
Added: JMathLib/trunk/doc/src/toolbox_introduction_control.xml
===================================================================
--- JMathLib/trunk/doc/src/toolbox_introduction_control.xml (rev 0)
+++ JMathLib/trunk/doc/src/toolbox_introduction_control.xml 2008-12-29 20:51:39 UTC (rev 578)
@@ -0,0 +1,10 @@
+<sect1 id="toolbox_introduction_control">
+<title>Introduction to the control toolbox</title>
+<indexterm><primary>control toolbox</primary></indexterm>
+<simpara>
+
+There will be some great features for control systems analysis
+in the future.
+
+</simpara>
+</sect1>
\ No newline at end of file
Added: JMathLib/trunk/doc/src/toolbox_introduction_cryto.xml
===================================================================
--- JMathLib/trunk/doc/src/toolbox_introduction_cryto.xml (rev 0)
+++ JMathLib/trunk/doc/src/toolbox_introduction_cryto.xml 2008-12-29 20:51:39 UTC (rev 578)
@@ -0,0 +1,10 @@
+<sect1 id="toolbox_introduction_crypto">
+<title>Introduction to the toolbox crypto</title>
+<indexterm><primary>toolbox crypto</primary></indexterm>
+<simpara>
+
+There will be some great features for crypto systems
+in the future.
+
+</simpara>
+</sect1>
\ No newline at end of file
Added: JMathLib/trunk/doc/src/toolbox_introduction_engine.xml
===================================================================
--- JMathLib/trunk/doc/src/toolbox_introduction_engine.xml (rev 0)
+++ JMathLib/trunk/doc/src/toolbox_introduction_engine.xml 2008-12-29 20:51:39 UTC (rev 578)
@@ -0,0 +1,10 @@
+<sect1 id="toolbox_introduction_engine">
+<title>Introduction to the toolbox audio</title>
+<indexterm><primary>toolbox audio</primary></indexterm>
+<simpara>
+
+There will be some great features for audio manipulations
+in the future.
+
+</simpara>
+</sect1>
\ No newline at end of file
Added: JMathLib/trunk/doc/src/toolbox_introduction_finance.xml
===================================================================
--- JMathLib/trunk/doc/src/toolbox_introduction_finance.xml (rev 0)
+++ JMathLib/trunk/doc/src/toolbox_introduction_finance.xml 2008-12-29 20:51:39 UTC (rev 578)
@@ -0,0 +1,10 @@
+<sect1 id="toolbox_introduction_finance">
+<title>Introduction to the toolbox audio</title>
+<indexterm><primary>toolbox audio</primary></indexterm>
+<simpara>
+
+There will be some great features for audio manipulations
+in the future.
+
+</simpara>
+</sect1>
\ No newline at end of file
Added: JMathLib/trunk/doc/src/toolbox_introduction_ftp.xml
===================================================================
--- JMathLib/trunk/doc/src/toolbox_introduction_ftp.xml (rev 0)
+++ JMathLib/trunk/doc/src/toolbox_introduction_ftp.xml 2008-12-29 20:51:39 UTC (rev 578)
@@ -0,0 +1,10 @@
+<sect1 id="toolbox_introduction_ftp">
+<title>Introduction to the toolbox audio</title>
+<indexterm><primary>toolbox audio</primary></indexterm>
+<simpara>
+
+There will be some great features for audio manipulations
+in the future.
+
+</simpara>
+</sect1>
\ No newline at end of file
Added: JMathLib/trunk/doc/src/toolbox_introduction_funfun.xml
===================================================================
--- JMathLib/trunk/doc/src/toolbox_introduction_funfun.xml (rev 0)
+++ JMathLib/trunk/doc/src/toolbox_introduction_funfun.xml 2008-12-29 20:51:39 UTC (rev 578)
@@ -0,0 +1,10 @@
+<sect1 id="toolbox_introduction_funfun">
+<title>Introduction to the toolbox audio</title>
+<indexterm><primary>toolbox audio</primary></indexterm>
+<simpara>
+
+There will be some great features for audio manipulations
+in the future.
+
+</simpara>
+</sect1>
\ No newline at end of file
Added: JMathLib/trunk/doc/src/toolbox_introduction_general.xml
===================================================================
--- JMathLib/trunk/doc/src/toolbox_introduction_general.xml (rev 0)
+++ JMathLib/trunk/doc/src/toolbox_introduction_general.xml 2008-12-29 20:51:39 UTC (rev 578)
@@ -0,0 +1,10 @@
+<sect1 id="toolbox_introduction_general">
+<title>Introduction to the toolbox audio</title>
+<indexterm><primary>toolbox audio</primary></indexterm>
+<simpara>
+
+There will be some great features for audio manipulations
+in the future.
+
+</simpara>
+</sect1>
\ No newline at end of file
Added: JMathLib/trunk/doc/src/toolbox_introduction_image.xml
===================================================================
--- JMathLib/trunk/doc/src/toolbox_introduction_image.xml (rev 0)
+++ JMathLib/trunk/doc/src/toolbox_introduction_image.xml 2008-12-29 20:51:39 UTC (rev 578)
@@ -0,0 +1,10 @@
+<sect1 id="toolbox_introduction_image">
+<title>Introduction to the toolbox audio</title>
+<indexterm><primary>toolbox audio</primary></indexterm>
+<simpara>
+
+There will be some great features for audio manipulations
+in the future.
+
+</simpara>
+</sect1>
\ No newline at end of file
Added: JMathLib/trunk/doc/src/toolbox_introduction_integration.xml
===================================================================
--- JMathLib/trunk/doc/src/toolbox_introduction_integration.xml (rev 0)
+++ JMathLib/trunk/doc/src/toolbox_introduction_integration.xml 2008-12-29 20:51:39 UTC (rev 578)
@@ -0,0 +1,10 @@
+<sect1 id="toolbox_introduction_integration">
+<title>Introduction to the toolbox audio</title>
+<indexterm><primary>toolbox audio</primary></indexterm>
+<simpara>
+
+There will be some great features for audio manipulations
+in the future.
+
+</simpara>
+</sect1>
\ No newline at end of file
Added: JMathLib/trunk/doc/src/toolbox_introduction_io.xml
===================================================================
--- JMathLib/trunk/doc/src/toolbox_introduction_io.xml (rev 0)
+++ JMathLib/trunk/doc/src/toolbox_introduction_io.xml 2008-12-29 20:51:39 UTC (rev 578)
@@ -0,0 +1,10 @@
+<sect1 id="toolbox_introduction_io">
+<title>Introduction to the toolbox audio</title>
+<indexterm><primary>toolbox audio</primary></indexterm>
+<simpara>
+
+There will be some great features for this toolbox
+in the future.
+
+</simpara>
+</sect1>
\ No newline at end of file
Added: JMathLib/trunk/doc/src/toolbox_introduction_jmathlib.xml
===================================================================
--- JMathLib/trunk/doc/src/toolbox_introduction_jmathlib.xml (rev 0)
+++ JMathLib/trunk/doc/src/toolbox_introduction_jmathlib.xml 2008-12-29 20:51:39 UTC (rev 578)
@@ -0,0 +1,10 @@
+<sect1 id="toolbox_introduction_jmathlib">
+<title>Introduction to the toolbox audio</title>
+<indexterm><primary>toolbox audio</primary></indexterm>
+<simpara>
+
+There will be some great features for audio manipulations
+in the future.
+
+</simpara>
+</sect1>
\ No newline at end of file
Added: JMathLib/trunk/doc/src/toolbox_introduction_linearalgebra.xml
===================================================================
--- JMathLib/trunk/doc/src/toolbox_introduction_linearalgebra.xml (rev 0)
+++ JMathLib/trunk/doc/src/toolbox_introduction_linearalgebra.xml 2008-12-29 20:51:39 UTC (rev 578)
@@ -0,0 +1,10 @@
+<sect1 id="toolbox_introduction_linearalgebra">
+<title>Introduction to the toolbox audio</title>
+<indexterm><primary>toolbox audio</primary></indexterm>
+<simpara>
+
+There will be some great features for audio manipulations
+in the future.
+
+</simpara>
+</sect1>
\ No newline at end of file
Added: JMathLib/trunk/doc/src/toolbox_introduction_miscellaneous.xml
===================================================================
--- JMathLib/trunk/doc/src/toolbox_introduction_miscellaneous.xml (rev 0)
+++ JMathLib/trunk/doc/src/toolbox_introduction_miscellaneous.xml 2008-12-29 20:51:39 UTC (rev 578)
@@ -0,0 +1,10 @@
+<sect1 id="toolbox_introduction_miscellaneous">
+<title>Introduction to the toolbox audio</title>
+<indexterm><primary>toolbox audio</primary></indexterm>
+<simpara>
+
+There will be some great features for audio manipulations
+in the future.
+
+</simpara>
+</sect1>
\ No newline at end of file
Added: JMathLib/trunk/doc/src/toolbox_introduction_net.xml
===================================================================
--- JMathLib/trunk/doc/src/toolbox_introduction_net.xml (rev 0)
+++ JMathLib/trunk/doc/src/toolbox_introduction_net.xml 2008-12-29 20:51:39 UTC (rev 578)
@@ -0,0 +1,10 @@
+<sect1 id="toolbox_introduction_net">
+<title>Introduction to the toolbox audio</title>
+<indexterm><primary>toolbox audio</primary></indexterm>
+<simpara>
+
+There will be some great features for audio manipulations
+in the future.
+
+</simpara>
+</sect1>
\ No newline at end of file
Added: JMathLib/trunk/doc/src/toolbox_introduction_ode.xml
===================================================================
--- JMathLib/trunk/doc/src/toolbox_introduction_ode.xml (rev 0)
+++ JMathLib/trunk/doc/src/toolbox_introduction_ode.xml 2008-12-29 20:51:39 UTC (rev 578)
@@ -0,0 +1,10 @@
+<sect1 id="toolbox_introduction_ode">
+<title>Introduction to the toolbox audio</title>
+<indexterm><primary>toolbox audio</primary></indexterm>
+<simpara>
+
+There will be some great features for this toolbox
+in the future.
+
+</simpara>
+</sect1>
\ No newline at end of file
Added: JMathLib/trunk/doc/src/toolbox_introduction_optimization.xml
===================================================================
--- JMathLib/trunk/doc/src/toolbox_introduction_optimization.xml (rev 0)
+++ JMathLib/trunk/doc/src/toolbox_introduction_optimization.xml 2008-12-29 20:51:39 UTC (rev 578)
@@ -0,0 +1,10 @@
+<sect1 id="toolbox_introduction_optimization">
+<title>Introduction to the toolbox audio</title>
+<indexterm><primary>toolbox audio</primary></indexterm>
+<simpara>
+
+There will be some great features for this toolbox
+in the future.
+
+</simpara>
+</sect1>
\ No newline at end of file
Added: JMathLib/trunk/doc/src/toolbox_introduction_physicalconstants.xml
===================================================================
--- JMathLib/trunk/doc/src/toolbox_introduction_physicalconstants.xml (rev 0)
+++ JMathLib/trunk/doc/src/toolbox_introduction_physicalconstants.xml 2008-12-29 20:51:39 UTC (rev 578)
@@ -0,0 +1,10 @@
+<sect1 id="toolbox_introduction_physicalconstants">
+<title>Introduction to the toolbox audio</title>
+<indexterm><primary>toolbox audio</primary></indexterm>
+<simpara>
+
+There will be some great features for this toolbox
+in the future.
+
+</simpara>
+</sect1>
\ No newline at end of file
Added: JMathLib/trunk/doc/src/toolbox_introduction_polynomial.xml
===================================================================
--- JMathLib/trunk/doc/src/toolbox_introduction_polynomial.xml (rev 0)
+++ JMathLib/trunk/doc/src/toolbox_introduction_polynomial.xml 2008-12-29 20:51:39 UTC (rev 578)
@@ -0,0 +1,10 @@
+<sect1 id="toolbox_introduction_polynomial">
+<title>Introduction to the toolbox audio</title>
+<indexterm><primary>toolbox audio</primary></indexterm>
+<simpara>
+
+There will be some great features for this toolbox
+in the future.
+
+</simpara>
+</sect1>
\ No newline at end of file
Added: JMathLib/trunk/doc/src/toolbox_introduction_quaternion.xml
===================================================================
--- JMathLib/trunk/doc/src/toolbox_introduction_quaternion.xml (rev 0)
+++ JMathLib/trunk/doc/src/toolbox_introduction_quaternion.xml 2008-12-29 20:51:39 UTC (rev 578)
@@ -0,0 +1,10 @@
+<sect1 id="toolbox_introduction_quaternion">
+<title>Introduction to the toolbox audio</title>
+<indexterm><primary>toolbox audio</primary></indexterm>
+<simpara>
+
+There will be some great features for this toolbox
+in the future.
+
+</simpara>
+</sect1>
\ No newline at end of file
Added: JMathLib/trunk/doc/src/toolbox_introduction_set.xml
===================================================================
--- JMathLib/trunk/doc/src/toolbox_introduction_set.xml (rev 0)
+++ JMathLib/trunk/doc/src/toolbox_introduction_set.xml 2008-12-29 20:51:39 UTC (rev 578)
@@ -0,0 +1,10 @@
+<sect1 id="toolbox_introduction_set">
+<title>Introduction to the toolbox audio</title>
+<indexterm><primary>toolbox audio</primary></indexterm>
+<simpara>
+
+There will be some great features for this toolbox
+in the future.
+
+</simpara>
+</sect1>
\ No newline at end of file
Added: JMathLib/trunk/doc/src/toolbox_introduction_signal.xml
===================================================================
--- JMathLib/trunk/doc/src/toolbox_introduction_signal.xml (rev 0)
+++ JMathLib/trunk/doc/src/toolbox_introduction_signal.xml 2008-12-29 20:51:39 UTC (rev 578)
@@ -0,0 +1,10 @@
+<sect1 id="toolbox_introduction_signal">
+<title>Introduction to the toolbox audio</title>
+<indexterm><primary>toolbox audio</primary></indexterm>
+<simpara>
+
+There will be some great features for this toolbox
+in the future.
+
+</simpara>
+</sect1>
\ No newline at end of file
Added: JMathLib/trunk/doc/src/toolbox_introduction_sparse.xml
===================================================================
--- JMathLib/trunk/doc/src/toolbox_introduction_sparse.xml (rev 0)
+++ JMathLib/trunk/doc/src/toolbox_introduction_sparse.xml 2008-12-29 20:51:39 UTC (rev 578)
@@ -0,0 +1,10 @@
+<sect1 id="toolbox_introduction_sparse">
+<title>Introduction to the toolbox audio</title>
+<indexterm><primary>toolbox audio</primary></indexterm>
+<simpara>
+
+There will be some great features for this toolbox
+in the future.
+
+</simpara>
+</sect1>
\ No newline at end of file
Added: JMathLib/trunk/doc/src/toolbox_introduction_specfun.xml
===================================================================
--- JMathLib/trunk/doc/src/toolbox_introduction_specfun.xml (rev 0)
+++ JMathLib/trunk/doc/src/toolbox_introduction_specfun.xml 2008-12-29 20:51:39 UTC (rev 578)
@@ -0,0 +1,10 @@
+<sect1 id="toolbox_introduction_specfung">
+<title>Introduction to the toolbox audio</title>
+<indexterm><primary>toolbox audio</primary></indexterm>
+<simpara>
+
+There will be some great features for this toolbox
+in the future.
+
+</simpara>
+</sect1>
\ No newline at end of file
Added: JMathLib/trunk/doc/src/toolbox_introduction_specialmatrix.xml
===================================================================
--- JMathLib/trunk/doc/src/toolbox_introduction_specialmatrix.xml (rev 0)
+++ JMathLib/trunk/doc/src/toolbox_introduction_specialmatrix.xml 2008-12-29 20:51:39 UTC (rev 578)
@@ -0,0 +1,10 @@
+<sect1 id="toolbox_introduction_specialmatrix">
+<title>Introduction to the toolbox audio</title>
+<indexterm><primary>toolbox audio</primary></indexterm>
+<simpara>
+
+There will be some great features for this toolbox
+in the future.
+
+</simpara>
+</sect1>
\ No newline at end of file
Added: JMathLib/trunk/doc/src/toolbox_introduction_statistics.xml
===================================================================
--- JMathLib/trunk/doc/src/toolbox_introduction_statistics.xml (rev 0)
+++ JMathLib/trunk/doc/src/toolbox_introduction_statistics.xml 2008-12-29 20:51:39 UTC (rev 578)
@@ -0,0 +1,10 @@
+<sect1 id="toolbox_introduction_statistics">
+<title>Introduction to the toolbox audio</title>
+<indexterm><primary>toolbox audio</primary></indexterm>
+<simpara>
+
+There will be some great features for this toolbox
+in the future.
+
+</simpara>
+</sect1>
\ No newline at end of file
Added: JMathLib/trunk/doc/src/toolbox_introduction_string.xml
===================================================================
--- JMathLib/trunk/doc/src/toolbox_introduction_string.xml (rev 0)
+++ JMathLib/trunk/doc/src/toolbox_introduction_string.xml 2008-12-29 20:51:39 UTC (rev 578)
@@ -0,0 +1,10 @@
+<sect1 id="toolbox_introduction_string">
+<title>Introduction to the toolbox audio</title>
+<indexterm><primary>toolbox audio</primary></indexterm>
+<simpara>
+
+There will be some great features for this toolbox
+in the future.
+
+</simpara>
+</sect1>
\ No newline at end of file
Added: JMathLib/trunk/doc/src/toolbox_introduction_time.xml
===================================================================
--- JMathLib/trunk/doc/src/toolbox_introduction_time.xml (rev 0)
+++ JMathLib/trunk/doc/src/toolbox_introduction_time.xml 2008-12-29 20:51:39 UTC (rev 578)
@@ -0,0 +1,10 @@
+<sect1 id="toolbox_introduction_time">
+<title>Introduction to the toolbox audio</title>
+<indexterm><primary>toolbox audio</primary></indexterm>
+<simpara>
+
+There will be some great features for this toolbox
+in the future.
+
+</simpara>
+</sect1>
\ No newline at end of file
Added: JMathLib/trunk/doc/src/toolbox_introduction_toolbox_skeleton.xml
===================================================================
--- JMathLib/trunk/doc/src/toolbox_introduction_toolbox_skeleton.xml (rev 0)
+++ JMathLib/trunk/doc/src/toolbox_introduction_toolbox_skeleton.xml 2008-12-29 20:51:39 UTC (rev 578)
@@ -0,0 +1,10 @@
+<sect1 id="toolbox_introduction_toolbox_skeleton">
+<title>Introduction to the toolbox audio</title>
+<indexterm><primary>toolbox audio</primary></indexterm>
+<simpara>
+
+There will be some great features for this toolbox
+in the future.
+
+</simpara>
+</sect1>
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2008-12-29 20:27:41
|
Revision: 577
http://mathlib.svn.sourceforge.net/mathlib/?rev=577&view=rev
Author: st_mueller
Date: 2008-12-29 20:27:34 +0000 (Mon, 29 Dec 2008)
Log Message:
-----------
added year 2009
Modified Paths:
--------------
JMathLib/trunk/doc/src/doc.xml
Modified: JMathLib/trunk/doc/src/doc.xml
===================================================================
--- JMathLib/trunk/doc/src/doc.xml 2008-12-29 19:51:14 UTC (rev 576)
+++ JMathLib/trunk/doc/src/doc.xml 2008-12-29 20:27:34 UTC (rev 577)
@@ -29,6 +29,7 @@
<year>2006</year>
<year>2007</year>
<year>2008</year>
+ <year>2009</year>
<holder>Stefan Müller</holder>
</copyright>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2008-12-29 19:51:20
|
Revision: 576
http://mathlib.svn.sourceforge.net/mathlib/?rev=576&view=rev
Author: st_mueller
Date: 2008-12-29 19:51:14 +0000 (Mon, 29 Dec 2008)
Log Message:
-----------
removed generation of "website"
Modified Paths:
--------------
JMathLib/trunk/build.xml
Modified: JMathLib/trunk/build.xml
===================================================================
--- JMathLib/trunk/build.xml 2008-12-29 19:48:14 UTC (rev 575)
+++ JMathLib/trunk/build.xml 2008-12-29 19:51:14 UTC (rev 576)
@@ -323,56 +323,6 @@
</target>
<!-- ================================================================= -->
- <!-- W E B S I T E -->
- <!-- ================================================================= -->
- <target name="website"
- description="prepare website update"
- depends="alldocs, allinstallers">
-
- <delete includeEmptyDirs="true" dir="${website.dir}"/>
-
- <copy todir="${website.dir}">
- <fileset dir="${dist.dir}">
- <include name="bin/**"/>
- </fileset>
- </copy>
-
- <delete file="${website.dir}/Documentation.tar.gz"/>
- <delete file="${website.dir}/Documentation.zip"/>
-
-
- <delete file="${jar.dest}/${final.name}.jar"/>
- <jar jarfile="${jar.dest}/${final.name}.jar"
- compress="true">
- <fileset dir="${dist.dir}/Classes">
- <include name="**" />
- <exclude name="MathLib/Functions/*/*.class"/>
- <exclude name="MathLib/Functions/*/*.m"/>
- <include name="MathLib/Functions/*.class"/>
- <exclude name="MathLib/Tools/**"/>
- <exclude name="spoke/**"/>
- <include name="*.*"/>
- <exclude name="*.zip"/>
- <exclude name="*.jar"/>
- </fileset>
- </jar>
-
- <delete file="${zip.dir}/website.tar"/>
- <delete file="${zip.dir}/website.tar.gz"/>
-
- <tar tarfile="${zip.dir}/website.tar">
- <tarfileset dir="${dist.dir}/WebSite">
- <include name="**" />
- </tarfileset>
- </tar>
-
- <gzip zipfile="${zip.dir}/website.tar.gz"
- src="${zip.dir}/website.tar" />
-
- <delete file="${zip.dir}/website.tar"/>
- </target>
-
- <!-- ================================================================= -->
<!-- W E B D I S T -->
<!-- ================================================================= -->
<target name="webdist" description="prepare web distribution" depends="">
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2008-12-29 19:48:21
|
Revision: 575
http://mathlib.svn.sourceforge.net/mathlib/?rev=575&view=rev
Author: st_mueller
Date: 2008-12-29 19:48:14 +0000 (Mon, 29 Dec 2008)
Log Message:
-----------
fine tuning of all files going into JMathLibSmallApplet.jar
Modified Paths:
--------------
JMathLib/trunk/build.xml
Modified: JMathLib/trunk/build.xml
===================================================================
--- JMathLib/trunk/build.xml 2008-12-28 16:58:21 UTC (rev 574)
+++ JMathLib/trunk/build.xml 2008-12-29 19:48:14 UTC (rev 575)
@@ -377,7 +377,7 @@
<!-- ================================================================= -->
<target name="webdist" description="prepare web distribution" depends="">
- <delete file="${dist.dir}/Classes/JMathLibSmallApplet.jar"/>
+ <delete file="${dist.dir}/bin/JMathLibSmallApplet.jar"/>
<delete file="${upload.dir}/JMathLib-web.tar.gz"/>
<delete file="${upload.dir}/JMathLib-web.zip"/>
@@ -385,15 +385,24 @@
<!-- User functions and m-files are only loaded on demand -->
<jar jarfile="${dist.dir}/bin/JMathLibSmallApplet.jar" compress="true">
<fileset dir="${dist.dir}/bin">
- <include name="jmathlib/webFunctionsList.dat"/>
- <include name="**/*.class" />
- <exclude name="jmathlib/toolbox/*/*.class"/>
- <include name="jmathlib/toolbox/general/startup.m"/>
- <include name="jmathlib/toolbox/*.class"/>
- <exclude name="jmathlib/toolbox/tools/**"/>
- <exclude name="jmathlib/toolbox/ui/awt/**"/>
- <exclude name="jmathlib/toolbox/ui/swing/**"/>
+ <include name="**" />
+ <exclude name="jmathlib/webFunctionsList.dat"/>
+ <exclude name="jmathlib/core/tokens/SparseNumberToken.class"/>
+ <exclude name="jmathlib/plugins/**"/>
+ <exclude name="jmathlib/toolbox/**"/>
+ <exclude name="jmathlib/tools/**"/>
+ <exclude name="jmathlib/ui/awt/**"/>
+ <exclude name="jmathlib/ui/swing/**"/>
+ <exclude name="jmathlibtests/**"/>
</fileset>
+ <fileset dir="${dist.dir}/bin">
+ <include name="jmathlib/plugins/PluginsManager.class"/>
+ <include name="jmathlib/toolbox/general/rand.class"/>
+ <include name="jmathlib/toolbox/general/startup.m"/>
+ <include name="jmathlib/toolbox/jmathlib/system/disp.class"/>
+ <include name="jmathlib/toolbox/jmathlib/system/setdebug.class"/>
+ <include name="jmathlib/toolbox/jmathlib/graphics/graph2d/plot.class"/>
+ </fileset>
</jar>
<!-- copy jar-file to classes directory -->
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2008-12-28 16:58:24
|
Revision: 574
http://mathlib.svn.sourceforge.net/mathlib/?rev=574&view=rev
Author: st_mueller
Date: 2008-12-28 16:58:21 +0000 (Sun, 28 Dec 2008)
Log Message:
-----------
moved code from MFileWebLoader to WebFunctionLoader
Removed Paths:
-------------
JMathLib/trunk/src/jmathlib/core/functions/MFileWebLoader.java
Deleted: JMathLib/trunk/src/jmathlib/core/functions/MFileWebLoader.java
===================================================================
--- JMathLib/trunk/src/jmathlib/core/functions/MFileWebLoader.java 2008-12-28 16:58:06 UTC (rev 573)
+++ JMathLib/trunk/src/jmathlib/core/functions/MFileWebLoader.java 2008-12-28 16:58:21 UTC (rev 574)
@@ -1,204 +0,0 @@
-package jmathlib.core.functions;
-
-import jmathlib.core.interpreter.*;
-import java.io.*;
-import java.net.*;
-import java.util.*;
-
-
-/**Class for storing and managing the m- and p-functions
- *
- * JMH Should be more aptly named "WebFunctionLoader"
- */
-public class MFileWebLoader extends FunctionLoader
-{
-
- boolean pFileCachingEnabledB = false;
- private URL codeBase;
- private String directory;
- private Vector pathV = new Vector(30); // paths to external function for applet usage
-
-
- /**Default constructor*/
- public MFileWebLoader(URL _codeBase, String _directory)
- {
- codeBase = _codeBase;
- directory = _directory;
-
- try {
- System.out.println("web: new url"+ codeBase.toString());
- URL url = new URL(codeBase, "jmathlib/webFunctionsList.dat");
- InputStream in = url.openStream();
- BufferedReader br = new BufferedReader(new InputStreamReader(in));
-
- // read each line of the functions list
- String line = null;
- while ((line = br.readLine()) != null) {
- System.out.println("read =" + line);
- if (!line.startsWith("#")) {
- pathV.addElement(line);
- //functionLoaders.add(new MFileWebLoader(applet.getCodeBase(), line));
- }
- }
- } catch (Exception ex) {
- //ErrorLogger.debugLine("FunctionManager: applet error");
- ex.printStackTrace();
- }
-
- }
-
- public URL getCodeBase() {
- return codeBase;
- }
-
- public String getDirectory() {
- return directory;
- }
-
- /**loads an .m-file via the web
- @param directory = the directory containing the file
- @param mFileName = the name of the m file
- @return the result of the file as a FunktionToken*/
- public Function findFunction(String functionName)
- {
- //JMH TBD find functions on the classpath
-
-
-
- String code = "";
- UserFunction function = (UserFunction)getCachedFunction(functionName);
- if (function != null)
- return function;
-
- ErrorLogger.debugLine("MFileWebLoader: loading >"+functionName+".m<");
-
- boolean foundClassFileB = false;
- boolean foundMFileB = false;
- String functionPath = null;
-
- // Search filelist for wanted function
- for (int i=0; i<pathV.size(); i++)
- {
- // The searchstring is set to "/foo.class" to avoid matches
- // of substring of some other function like "barfoo.class"
- functionPath = ((String)pathV.elementAt(i));
-
- // !! Remark: the command toLowerCase() is necessary, because some filenames have upper case letters (e.g. Disp.class)
- if ( functionPath.toLowerCase().endsWith("/"+functionName+".class") )
- {
- foundClassFileB = true; // indicate that class file was found
- functionPath = functionPath.substring(0,functionPath.length()-6);
- functionPath = functionPath.replace('/', '.');
- functionPath = functionPath.replace('\\', '.');
- ErrorLogger.debugLine("MFileWebLoader found "+functionPath);
- break;
- }
-
- if ( functionPath.toLowerCase().endsWith("/"+functionName+".m") )
- {
- // functionsPath contains the path AND the m-filename
- foundMFileB = true; // indicate that m-file was found
- ErrorLogger.debugLine("MFileWebLoader found "+functionPath);
- break;
- }
- } // end for
-
- Function func;
-
- // check if class was found and load it
- try
- {
- if (foundClassFileB)
- {
- Class extFunctionClass = Class.forName(functionPath);
- //Class extFunctionClass = Class.forName("MathLib.Functions.Matrix.ones");
- Object funcObj = extFunctionClass.newInstance();
-
- func = ((Function)funcObj);
- return func;
- }
- }
- catch(Exception exception)
- {
- exception.printStackTrace();
- }
-
-
- ErrorLogger.debugLine("FunctionManager: webloader");
- // check if m-file was found and load it
- if (foundMFileB)
- {
- // load .m-file. could be script- or function-file
- //UserFunction userFunc = mLoader.loadMFileViaWeb(applet.getCodeBase(),
- // functionPath,
- // funcName);
-
- // open file and read m-file line by line
- try
- {
- ErrorLogger.debugLine("MFileWebLoader: "+codeBase+" "+directory+"/"+functionName+".m");
- //URL url = new URL(codeBase, directory+"/"+functionName+".m");
- URL url = new URL(codeBase, functionPath);
-
- InputStream in = url.openStream();
- BufferedReader inReader = new BufferedReader(new InputStreamReader(in));
- String line;
- while ((line = inReader.readLine()) != null)
- {
- ErrorLogger.debugLine("MFileWebLoader: "+line);
- code += line + "\n";
- }
- inReader.close();
- }
- catch (Exception e)
- {
- e.printStackTrace();
- Errors.throwMathLibException("MFileWebLoader: m-file exception via web");
-
- }
-
- ErrorLogger.debugLine("MFileWebLoader: code: begin \n"+code+"\ncode end");
-
- // send code to function parser and return function
- FunctionParser funcParser = new FunctionParser();
- function = funcParser.parseFunction(code);
-
- // set name of user function
- // remember: the name of the called function could be different compared
- // to the function's name inside the m-file
- function.setName(functionName);
-
- //addUserFunction(userFunc);
- cacheFunction(function);
-
- ErrorLogger.debugLine("MFileWebLoader: finished webloading >" + functionName + ".m<");
-
- return function;
- }
-
- return null;
- }
-
-
- /** set caching of p-file to on of off
- *
- * @param pFileCaching true= caching of p-files on; false: caching of p-files off
- */
- public void setPFileCaching(boolean pFileCaching)
- {
- pFileCachingEnabledB = pFileCaching;
- }
-
- /** return whether of not caching of p-files is enabled of not
- *
- * @return status of caching p-files
- */
- public boolean getPFileCaching()
- {
- return pFileCachingEnabledB;
- }
-
- public void checkAndRehashTimeStamps() {
- //TODO: Add timestamp checks
- }
-}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2008-12-28 16:58:12
|
Revision: 573
http://mathlib.svn.sourceforge.net/mathlib/?rev=573&view=rev
Author: st_mueller
Date: 2008-12-28 16:58:06 +0000 (Sun, 28 Dec 2008)
Log Message:
-----------
Modified Paths:
--------------
JMathLib/trunk/ChangeLog.txt
Modified: JMathLib/trunk/ChangeLog.txt
===================================================================
--- JMathLib/trunk/ChangeLog.txt 2008-12-28 16:57:25 UTC (rev 572)
+++ JMathLib/trunk/ChangeLog.txt 2008-12-28 16:58:06 UTC (rev 573)
@@ -17,6 +17,8 @@
stefan *
2008/12/27
+stefan + moved code from MFileWebLoader.java to WebFunctionLoader.java
+stefan - removed MFileWebLoader.java
stefan + plusplus.int describing the ++ command
stefan + minusminus.int describing the -- command
stefan # DoubleNumberToken.java support for [1,0,3].^0 = [1,1,1]
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2008-12-28 16:57:28
|
Revision: 572
http://mathlib.svn.sourceforge.net/mathlib/?rev=572&view=rev
Author: st_mueller
Date: 2008-12-28 16:57:25 +0000 (Sun, 28 Dec 2008)
Log Message:
-----------
moved code from MFileWebLoader to WebFunctionLoader
Modified Paths:
--------------
JMathLib/trunk/src/jmathlib/core/functions/FunctionManager.java
JMathLib/trunk/src/jmathlib/core/functions/WebFunctionLoader.java
Modified: JMathLib/trunk/src/jmathlib/core/functions/FunctionManager.java
===================================================================
--- JMathLib/trunk/src/jmathlib/core/functions/FunctionManager.java 2008-12-28 16:50:39 UTC (rev 571)
+++ JMathLib/trunk/src/jmathlib/core/functions/FunctionManager.java 2008-12-28 16:57:25 UTC (rev 572)
@@ -31,7 +31,7 @@
Applet applet = null;
// loader for m files via the web
- MFileWebLoader mWebLoader;
+ WebFunctionLoader webFunctionLoader;
/**Creates the function manager and defines any internal functions
if this is an application then it creates a class loader to load external functions
@@ -68,25 +68,8 @@
}
}
} else {
- try {
System.out.println("web:"+applet);
- System.out.println("web: new url"+ applet.getCodeBase().toString());
- URL url = new URL(applet.getCodeBase(), "jmathlib/webFunctionsList.dat");
- InputStream in = url.openStream();
- BufferedReader br = new BufferedReader(new InputStreamReader(in));
-
- // read each line of the functions list
- String line = null;
- while ((line = br.readLine()) != null) {
- System.out.println("read =" + line);
- if (!line.startsWith("#")) {
- functionLoaders.add(new MFileWebLoader(applet.getCodeBase(), line));
- }
- }
- } catch (Exception ex) {
- //ErrorLogger.debugLine("FunctionManager: applet error");
- ex.printStackTrace();
- }
+ functionLoaders.add(new WebFunctionLoader(applet.getCodeBase(), ""));
}
}
@@ -164,7 +147,7 @@
// use webloader
//Search for class, m or p file
for (int i = 0; i < functionLoaders.size(); i++) {
- FunctionLoader l = (FileFunctionLoader) functionLoaders.elementAt(i);
+ FunctionLoader l = (WebFunctionLoader) functionLoaders.elementAt(i);
func = l.findFunction(funcName);
if (func != null) {
Modified: JMathLib/trunk/src/jmathlib/core/functions/WebFunctionLoader.java
===================================================================
--- JMathLib/trunk/src/jmathlib/core/functions/WebFunctionLoader.java 2008-12-28 16:50:39 UTC (rev 571)
+++ JMathLib/trunk/src/jmathlib/core/functions/WebFunctionLoader.java 2008-12-28 16:57:25 UTC (rev 572)
@@ -1,89 +1,204 @@
package jmathlib.core.functions;
-import java.util.Hashtable;
-//import java.io.IOException;
-//import java.io.File;
-//import java.io.FileInputStream;
-//import java.util.Vector;
import jmathlib.core.interpreter.*;
-//import java.net.*;
-//import java.security.*;
-import java.applet.*;
+import java.io.*;
+import java.net.*;
+import java.util.*;
-/**Class to load any External functions used*/
-public class WebFunctionLoader
+
+/**Class for storing and managing the m- and p-functions
+ *
+ * JMH Should be more aptly named "WebFunctionLoader"
+ */
+public class WebFunctionLoader extends FunctionLoader
{
- /**Root directory to load the class from*/
- //private String baseClassDir;
- /**Directory for the last loaded class*/
- public String classDir;
-
- /**name of the last class loaded*/
- public String lastClassName;
+ boolean pFileCachingEnabledB = false;
+ private URL codeBase;
+ private String directory;
+ private Vector pathV = new Vector(30); // paths to external function for applet usage
- /**name of the last script-file (m-file) */
- public boolean mFileSwitch;
+
+ /**Default constructor*/
+ public WebFunctionLoader(URL _codeBase, String _directory)
+ {
+ codeBase = _codeBase;
+ directory = _directory;
+
+ try {
+ System.out.println("WebFunctionLoader: new url"+ codeBase.toString());
+ URL url = new URL(codeBase, "jmathlib/webFunctionsList.dat");
+ InputStream in = url.openStream();
+ BufferedReader br = new BufferedReader(new InputStreamReader(in));
- /**Hashtable to store classes that have already been loaded*/
- private Hashtable loadedClasses;
+ // read each line of the functions list
+ String line = null;
+ while ((line = br.readLine()) != null) {
+ System.out.println("read =" + line);
+ if (!line.startsWith("#")) {
+ pathV.addElement(line);
+ //functionLoaders.add(new MFileWebLoader(applet.getCodeBase(), line));
+ }
+ }
+ } catch (Exception ex) {
+ //ErrorLogger.debugLine("FunctionManager: applet error");
+ ex.printStackTrace();
+ }
- /**Pointer to the system flags*/
- //private Flags sysFlags;
+ }
- /**Pointer to applet context */
- //private Applet app;
+ public URL getCodeBase() {
+ return codeBase;
+ }
- public WebFunctionLoader()
- {
- //super(urls);
- //baseClassDir = _classDir;
-
- loadedClasses = new Hashtable();
+ public String getDirectory() {
+ return directory;
+ }
+
+ /**loads an .m-file via the web
+ @param directory = the directory containing the file
+ @param mFileName = the name of the m file
+ @return the result of the file as a FunktionToken*/
+ public Function findFunction(String functionName)
+ {
+ //JMH TBD find functions on the classpath
+
+
+ String code = "";
+ UserFunction function = (UserFunction)getCachedFunction(functionName);
+ if (function != null)
+ return function;
+
+ ErrorLogger.debugLine("WebFunctionLoader: loading >"+functionName+".m<");
+
+ boolean foundClassFileB = false;
+ boolean foundMFileB = false;
+ String functionPath = null;
+
+ // Search filelist for wanted function
+ for (int i=0; i<pathV.size(); i++)
+ {
+ // The searchstring is set to "/foo.class" to avoid matches
+ // of substring of some other function like "barfoo.class"
+ functionPath = ((String)pathV.elementAt(i));
+
+ // !! Remark: the command toLowerCase() is necessary, because some filenames have upper case letters (e.g. Disp.class)
+ if ( functionPath.toLowerCase().endsWith("/"+functionName+".class") )
+ {
+ foundClassFileB = true; // indicate that class file was found
+ functionPath = functionPath.substring(0,functionPath.length()-6);
+ functionPath = functionPath.replace('/', '.');
+ functionPath = functionPath.replace('\\', '.');
+ ErrorLogger.debugLine("WebFunctionLoader found "+functionPath);
+ break;
+ }
-// no function yet
+ if ( functionPath.toLowerCase().endsWith("/"+functionName+".m") )
+ {
+ // functionsPath contains the path AND the m-filename
+ foundMFileB = true; // indicate that m-file was found
+ ErrorLogger.debugLine("WebFunctionLoader found "+functionPath);
+ break;
+ }
+ } // end for
+
+ Function func;
+
+ // check if class was found and load it
+ try
+ {
+ if (foundClassFileB)
+ {
+ Class extFunctionClass = Class.forName(functionPath);
+ //Class extFunctionClass = Class.forName("MathLib.Functions.Matrix.ones");
+ Object funcObj = extFunctionClass.newInstance();
+
+ func = ((Function)funcObj);
+ return func;
+ }
+ }
+ catch(Exception exception)
+ {
+ exception.printStackTrace();
+ }
+
+
+ ErrorLogger.debugLine("WebFunctionLoader: webloader");
+ // check if m-file was found and load it
+ if (foundMFileB)
+ {
+ // load .m-file. could be script- or function-file
+ //UserFunction userFunc = mLoader.loadMFileViaWeb(applet.getCodeBase(),
+ // functionPath,
+ // funcName);
+ // open file and read m-file line by line
+ try
+ {
+ ErrorLogger.debugLine("WebFunctionLoader: "+codeBase+" "+directory+"/"+functionName+".m");
+ //URL url = new URL(codeBase, directory+"/"+functionName+".m");
+ URL url = new URL(codeBase, functionPath);
+
+ InputStream in = url.openStream();
+ BufferedReader inReader = new BufferedReader(new InputStreamReader(in));
+ String line;
+ while ((line = inReader.readLine()) != null)
+ {
+ ErrorLogger.debugLine("WebFunctionLoader: "+line);
+ code += line + "\n";
+ }
+ inReader.close();
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ Errors.throwMathLibException("WebFunctionLoader: m-file exception via web");
+
+ }
+
+ ErrorLogger.debugLine("WebFunctionLoader: code: begin \n"+code+"\ncode end");
+
+ // send code to function parser and return function
+ FunctionParser funcParser = new FunctionParser();
+ function = funcParser.parseFunction(code);
+
+ // set name of user function
+ // remember: the name of the called function could be different compared
+ // to the function's name inside the m-file
+ function.setName(functionName);
+
+ //addUserFunction(userFunc);
+ cacheFunction(function);
+
+ ErrorLogger.debugLine("WebFunctionLoader: finished webloading >" + functionName + ".m<");
+
+ return function;
+ }
- }
+ return null;
+ }
+
+
+ /** set caching of p-file to on of off
+ *
+ * @param pFileCaching true= caching of p-files on; false: caching of p-files off
+ */
+ public void setPFileCaching(boolean pFileCaching)
+ {
+ pFileCachingEnabledB = pFileCaching;
+ }
- /**first checks the hashtable of already loaded classes
- @param fileName = the name of the function to load*/
- /*public boolean isClassLoaded(String fileName)
- {
- Class newClass = ((Class)loadedClasses.get(fileName.toUpperCase()));
- if (newClass != null) return true;
- else return false;
-
-// no function yet
-
- }*/
-
- public void setApplet(Applet _app)
+ /** return whether of not caching of p-files is enabled of not
+ *
+ * @return status of caching p-files
+ */
+ public boolean getPFileCaching()
{
- //app = _app;
+ return pFileCachingEnabledB;
}
-
- public Class loadClass(String fileName) throws ClassNotFoundException
- {
- ErrorLogger.debugLine("web func loader loadClass "+ fileName);
- Class newClass = ((Class)loadedClasses.get(fileName.toUpperCase()));
-
- if(newClass != null)
- {
- return newClass;
- }
-
- return newClass;
-// no function yet
-
- }
-
- //private String findClassOrMFile(String path, String fileName)
- //{
- // String classDir = "nothing";
- // return classDir;
-// no function yet
-
- //}
-}
+
+ public void checkAndRehashTimeStamps() {
+ //TODO: Add timestamp checks
+ }
+}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2008-12-28 16:50:43
|
Revision: 571
http://mathlib.svn.sourceforge.net/mathlib/?rev=571&view=rev
Author: st_mueller
Date: 2008-12-28 16:50:39 +0000 (Sun, 28 Dec 2008)
Log Message:
-----------
fixed loading files and classes via web for applet version
Modified Paths:
--------------
JMathLib/trunk/src/jmathlib/core/functions/MFileWebLoader.java
Modified: JMathLib/trunk/src/jmathlib/core/functions/MFileWebLoader.java
===================================================================
--- JMathLib/trunk/src/jmathlib/core/functions/MFileWebLoader.java 2008-12-28 16:24:10 UTC (rev 570)
+++ JMathLib/trunk/src/jmathlib/core/functions/MFileWebLoader.java 2008-12-28 16:50:39 UTC (rev 571)
@@ -3,6 +3,7 @@
import jmathlib.core.interpreter.*;
import java.io.*;
import java.net.*;
+import java.util.*;
/**Class for storing and managing the m- and p-functions
@@ -15,12 +16,35 @@
boolean pFileCachingEnabledB = false;
private URL codeBase;
private String directory;
+ private Vector pathV = new Vector(30); // paths to external function for applet usage
+
/**Default constructor*/
public MFileWebLoader(URL _codeBase, String _directory)
{
codeBase = _codeBase;
directory = _directory;
+
+ try {
+ System.out.println("web: new url"+ codeBase.toString());
+ URL url = new URL(codeBase, "jmathlib/webFunctionsList.dat");
+ InputStream in = url.openStream();
+ BufferedReader br = new BufferedReader(new InputStreamReader(in));
+
+ // read each line of the functions list
+ String line = null;
+ while ((line = br.readLine()) != null) {
+ System.out.println("read =" + line);
+ if (!line.startsWith("#")) {
+ pathV.addElement(line);
+ //functionLoaders.add(new MFileWebLoader(applet.getCodeBase(), line));
+ }
+ }
+ } catch (Exception ex) {
+ //ErrorLogger.debugLine("FunctionManager: applet error");
+ ex.printStackTrace();
+ }
+
}
public URL getCodeBase() {
@@ -48,40 +72,111 @@
ErrorLogger.debugLine("MFileWebLoader: loading >"+functionName+".m<");
- // open file and read m-file line by line
- try
- {
- URL url = new URL(codeBase, directory+"/"+functionName+".m");
- InputStream in = url.openStream();
- BufferedReader inReader = new BufferedReader(new InputStreamReader(in));
- String line;
- while ((line = inReader.readLine()) != null)
- {
- code += line + "\n";
+ boolean foundClassFileB = false;
+ boolean foundMFileB = false;
+ String functionPath = null;
+
+ // Search filelist for wanted function
+ for (int i=0; i<pathV.size(); i++)
+ {
+ // The searchstring is set to "/foo.class" to avoid matches
+ // of substring of some other function like "barfoo.class"
+ functionPath = ((String)pathV.elementAt(i));
+
+ // !! Remark: the command toLowerCase() is necessary, because some filenames have upper case letters (e.g. Disp.class)
+ if ( functionPath.toLowerCase().endsWith("/"+functionName+".class") )
+ {
+ foundClassFileB = true; // indicate that class file was found
+ functionPath = functionPath.substring(0,functionPath.length()-6);
+ functionPath = functionPath.replace('/', '.');
+ functionPath = functionPath.replace('\\', '.');
+ ErrorLogger.debugLine("MFileWebLoader found "+functionPath);
+ break;
}
- inReader.close();
+
+ if ( functionPath.toLowerCase().endsWith("/"+functionName+".m") )
+ {
+ // functionsPath contains the path AND the m-filename
+ foundMFileB = true; // indicate that m-file was found
+ ErrorLogger.debugLine("MFileWebLoader found "+functionPath);
+ break;
+ }
+ } // end for
+
+ Function func;
+
+ // check if class was found and load it
+ try
+ {
+ if (foundClassFileB)
+ {
+ Class extFunctionClass = Class.forName(functionPath);
+ //Class extFunctionClass = Class.forName("MathLib.Functions.Matrix.ones");
+ Object funcObj = extFunctionClass.newInstance();
+
+ func = ((Function)funcObj);
+ return func;
+ }
}
- catch (Exception e)
+ catch(Exception exception)
{
- Errors.throwMathLibException("MFileWebLoader: m-file exception via web");
- }
-
- ErrorLogger.debugLine("MFileWebLoader: code: begin \n"+code+"\ncode end");
-
- // send code to function parser and return function
- FunctionParser funcParser = new FunctionParser();
- function = funcParser.parseFunction(code);
+ exception.printStackTrace();
+ }
+
+
+ ErrorLogger.debugLine("FunctionManager: webloader");
+ // check if m-file was found and load it
+ if (foundMFileB)
+ {
+ // load .m-file. could be script- or function-file
+ //UserFunction userFunc = mLoader.loadMFileViaWeb(applet.getCodeBase(),
+ // functionPath,
+ // funcName);
- // set name of user function
- // remember: the name of the called function could be different compared
- // to the function's name inside the m-file
- function.setName(functionName);
+ // open file and read m-file line by line
+ try
+ {
+ ErrorLogger.debugLine("MFileWebLoader: "+codeBase+" "+directory+"/"+functionName+".m");
+ //URL url = new URL(codeBase, directory+"/"+functionName+".m");
+ URL url = new URL(codeBase, functionPath);
+
+ InputStream in = url.openStream();
+ BufferedReader inReader = new BufferedReader(new InputStreamReader(in));
+ String line;
+ while ((line = inReader.readLine()) != null)
+ {
+ ErrorLogger.debugLine("MFileWebLoader: "+line);
+ code += line + "\n";
+ }
+ inReader.close();
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ Errors.throwMathLibException("MFileWebLoader: m-file exception via web");
+
+ }
+
+ ErrorLogger.debugLine("MFileWebLoader: code: begin \n"+code+"\ncode end");
+
+ // send code to function parser and return function
+ FunctionParser funcParser = new FunctionParser();
+ function = funcParser.parseFunction(code);
+
+ // set name of user function
+ // remember: the name of the called function could be different compared
+ // to the function's name inside the m-file
+ function.setName(functionName);
+
+ //addUserFunction(userFunc);
+ cacheFunction(function);
+
+ ErrorLogger.debugLine("MFileWebLoader: finished webloading >" + functionName + ".m<");
+
+ return function;
+ }
- cacheFunction(function);
-
- ErrorLogger.debugLine("MFileWebLoader: finished webloading >" + functionName + ".m<");
-
- return function;
+ return null;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2008-12-28 16:24:19
|
Revision: 570
http://mathlib.svn.sourceforge.net/mathlib/?rev=570&view=rev
Author: st_mueller
Date: 2008-12-28 16:24:10 +0000 (Sun, 28 Dec 2008)
Log Message:
-----------
Modified Paths:
--------------
JMathLib/trunk/ChangeLog.txt
Modified: JMathLib/trunk/ChangeLog.txt
===================================================================
--- JMathLib/trunk/ChangeLog.txt 2008-12-28 16:23:22 UTC (rev 569)
+++ JMathLib/trunk/ChangeLog.txt 2008-12-28 16:24:10 UTC (rev 570)
@@ -19,6 +19,8 @@
2008/12/27
stefan + plusplus.int describing the ++ command
stefan + minusminus.int describing the -- command
+stefan # DoubleNumberToken.java support for [1,0,3].^0 = [1,1,1]
+ and 0.^[1,0,2] = [0,1,0]
2008/12/26
stefan + toolbox/jmathlib/system/format.java for formatting numbers
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2008-12-28 16:23:25
|
Revision: 569
http://mathlib.svn.sourceforge.net/mathlib/?rev=569&view=rev
Author: st_mueller
Date: 2008-12-28 16:23:22 +0000 (Sun, 28 Dec 2008)
Log Message:
-----------
support for [1,0,3].^0 = [1,1,1] and 0.^[1,0,2] = [0,1,0]
Modified Paths:
--------------
JMathLib/trunk/src/jmathlib/core/tokens/numbertokens/DoubleNumberToken.java
Modified: JMathLib/trunk/src/jmathlib/core/tokens/numbertokens/DoubleNumberToken.java
===================================================================
--- JMathLib/trunk/src/jmathlib/core/tokens/numbertokens/DoubleNumberToken.java 2008-12-28 16:22:13 UTC (rev 568)
+++ JMathLib/trunk/src/jmathlib/core/tokens/numbertokens/DoubleNumberToken.java 2008-12-28 16:23:22 UTC (rev 569)
@@ -902,17 +902,33 @@
{
for (int x=0; x<argSizeX; x++)
{
-
- double re = Math.log(getValueAbs(0, 0));
- double im = getValueArg(0, 0);
-
- double re2 = (re*argValuesRe[y][x]) - (im*argValuesIm[y][x]);
- double im2 = (re*argValuesIm[y][x]) + (im*argValuesRe[y][x]);
-
- double scalar = Math.exp(re2);
-
- results[y][x][REAL] = scalar * Math.cos(im2);
- results[y][x][IMAG] = scalar * Math.sin(im2);
+ if ((values[0][REAL]==0) && (values[0][IMAG]==0) &&
+ (argValuesRe[y][x]==0) && (argValuesIm[y][x]==0) )
+ {
+ // 0^[1,0,3] -> [0,1,0]
+ results[y][x][REAL] = 1.0;
+ results[y][x][IMAG] = 0.0;
+ }
+ else if ((values[0][REAL]==0) && (values[0][IMAG]==0) &&
+ (argValuesRe[y][x]!=0) && (argValuesIm[y][x]==0) )
+ {
+ // 0^[1,0,3] -> [0,1,0]
+ results[y][x][REAL] = 0.0;
+ results[y][x][IMAG] = 0.0;
+ }
+ else
+ {
+ double re = Math.log(getValueAbs(0, 0));
+ double im = getValueArg(0, 0);
+
+ double re2 = (re*argValuesRe[y][x]) - (im*argValuesIm[y][x]);
+ double im2 = (re*argValuesIm[y][x]) + (im*argValuesRe[y][x]);
+
+ double scalar = Math.exp(re2);
+
+ results[y][x][REAL] = scalar * Math.cos(im2);
+ results[y][x][IMAG] = scalar * Math.sin(im2);
+ }
}
}
@@ -929,16 +945,33 @@
{
for (int x=0; x<sizeX; x++)
{
- double re = Math.log(getValueAbs(y, x));
- double im = getValueArg(y, x);
-
- double re2 = (re*argValuesRe[0][0]) - (im*argValuesIm[0][0]);
- double im2 = (re*argValuesIm[0][0]) + (im*argValuesRe[0][0]);
-
- double scalar = Math.exp(re2);
-
- results[y][x][REAL] = scalar * Math.cos(im2);
- results[y][x][IMAG] = scalar * Math.sin(im2);
+ if ((getValueRe(y,x)==0) && (getValueIm(y,x)==0) &&
+ ((argValuesRe[0][0]==0) && (argValuesIm[0][0]==0)) )
+ {
+ // [1,0,3].^0 -> [1,0,1]
+ results[y][x][REAL] = 1.0;
+ results[y][x][IMAG] = 0.0;
+ }
+ else if ((getValueRe(y,x)==0) && (getValueIm(y,x)==0) &&
+ ((argValuesRe[0][0]!=0) && (argValuesIm[0][0]==0)) )
+ {
+ // [2,0,3].^2 -> [4,1,9]
+ results[y][x][REAL] = 0.0;
+ results[y][x][IMAG] = 0.0;
+ }
+ else
+ {
+ double re = Math.log(getValueAbs(y, x));
+ double im = getValueArg(y, x);
+
+ double re2 = (re*argValuesRe[0][0]) - (im*argValuesIm[0][0]);
+ double im2 = (re*argValuesIm[0][0]) + (im*argValuesRe[0][0]);
+
+ double scalar = Math.exp(re2);
+
+ results[y][x][REAL] = scalar * Math.cos(im2);
+ results[y][x][IMAG] = scalar * Math.sin(im2);
+ }
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2008-12-28 16:22:19
|
Revision: 568
http://mathlib.svn.sourceforge.net/mathlib/?rev=568&view=rev
Author: st_mueller
Date: 2008-12-28 16:22:13 +0000 (Sun, 28 Dec 2008)
Log Message:
-----------
added tests for [1,0,3].^0 and 0.^[1,0,2]
Modified Paths:
--------------
JMathLib/trunk/src/jmathlibtests/core/tokens/numbertokens/testDoubleNumberToken.java
Modified: JMathLib/trunk/src/jmathlibtests/core/tokens/numbertokens/testDoubleNumberToken.java
===================================================================
--- JMathLib/trunk/src/jmathlibtests/core/tokens/numbertokens/testDoubleNumberToken.java 2008-12-28 14:28:53 UTC (rev 567)
+++ JMathLib/trunk/src/jmathlibtests/core/tokens/numbertokens/testDoubleNumberToken.java 2008-12-28 16:22:13 UTC (rev 568)
@@ -291,7 +291,7 @@
assertEquals(expectedResult, actualResult);
}
- public void testPower()
+ public void testPower01()
{
DoubleNumberToken expectedResult = new DoubleNumberToken(27);
@@ -300,6 +300,41 @@
assertEquals(expectedResult.toString(), actualResult.toString());
}
+ public void testPower02()
+ {
+ ml.executeExpression("b=0.^0");
+ double[][] r = {{1.0}};
+ assertTrue(Compare.ArrayEquals(r, ml.getArrayValueRe("b"), 0.001));
+ }
+
+ public void testPower03()
+ {
+ ml.executeExpression("b=0.^2");
+ double[][] r = {{0.0}};
+ assertTrue(Compare.ArrayEquals(r, ml.getArrayValueRe("b"), 0.001));
+ }
+
+ public void testPower04()
+ {
+ ml.executeExpression("b=[1,0,2].^0");
+ double[][] r = {{1.0, 1.0, 1.0}};
+ assertTrue(Compare.ArrayEquals(r, ml.getArrayValueRe("b"), 0.001));
+ }
+
+ public void testPower05()
+ {
+ ml.executeExpression("b=[1,0,2].^2");
+ double[][] r = {{1.0, 0.0, 4.0}};
+ assertTrue(Compare.ArrayEquals(r, ml.getArrayValueRe("b"), 0.001));
+ }
+
+ public void testPower06()
+ {
+ ml.executeExpression("b=0.^[1,0,2]");
+ double[][] r = {{0.0, 1.0, 0.0}};
+ assertTrue(Compare.ArrayEquals(r, ml.getArrayValueRe("b"), 0.001));
+ }
+
public void testMPower()
{
DoubleNumberToken expectedResult = new DoubleNumberToken(27);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2008-12-28 14:29:00
|
Revision: 567
http://mathlib.svn.sourceforge.net/mathlib/?rev=567&view=rev
Author: st_mueller
Date: 2008-12-28 14:28:53 +0000 (Sun, 28 Dec 2008)
Log Message:
-----------
description of ++ and --
Added Paths:
-----------
JMathLib/trunk/src/jmathlib/toolbox/jmathlib/internal/minusminus.int
JMathLib/trunk/src/jmathlib/toolbox/jmathlib/internal/plusplus.int
Added: JMathLib/trunk/src/jmathlib/toolbox/jmathlib/internal/minusminus.int
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/jmathlib/internal/minusminus.int (rev 0)
+++ JMathLib/trunk/src/jmathlib/toolbox/jmathlib/internal/minusminus.int 2008-12-28 14:28:53 UTC (rev 567)
@@ -0,0 +1,16 @@
+@GROUP
+internal
+@SYNTAX
+--
+@DOC
+subtract 1.0 to a number or variabe
+@EXAMPLES
+<programlisting>
+4--
+ans=3
+
+[1,2,3]--
+ans=[0,1,2]
+</programlisting>
+@SEE
+plusplus, plus, minus
Added: JMathLib/trunk/src/jmathlib/toolbox/jmathlib/internal/plusplus.int
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/jmathlib/internal/plusplus.int (rev 0)
+++ JMathLib/trunk/src/jmathlib/toolbox/jmathlib/internal/plusplus.int 2008-12-28 14:28:53 UTC (rev 567)
@@ -0,0 +1,16 @@
+@GROUP
+internal
+@SYNTAX
+++
+@DOC
+add 1.0 to a number or variabe
+@EXAMPLES
+<programlisting>
+2++
+ans=3
+
+[1,2,3]++
+ans=[2,3,4]
+</programlisting>
+@SEE
+minusminus, plus, minus
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2008-12-28 14:28:35
|
Revision: 566
http://mathlib.svn.sourceforge.net/mathlib/?rev=566&view=rev
Author: st_mueller
Date: 2008-12-28 14:28:26 +0000 (Sun, 28 Dec 2008)
Log Message:
-----------
Modified Paths:
--------------
JMathLib/trunk/ChangeLog.txt
Modified: JMathLib/trunk/ChangeLog.txt
===================================================================
--- JMathLib/trunk/ChangeLog.txt 2008-12-26 18:55:30 UTC (rev 565)
+++ JMathLib/trunk/ChangeLog.txt 2008-12-28 14:28:26 UTC (rev 566)
@@ -16,6 +16,10 @@
2008/12/xx
stefan *
+2008/12/27
+stefan + plusplus.int describing the ++ command
+stefan + minusminus.int describing the -- command
+
2008/12/26
stefan + toolbox/jmathlib/system/format.java for formatting numbers
stefan * GlobalValues.java RootObject.java for formatting numbers
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2008-12-26 18:55:33
|
Revision: 565
http://mathlib.svn.sourceforge.net/mathlib/?rev=565&view=rev
Author: st_mueller
Date: 2008-12-26 18:55:30 +0000 (Fri, 26 Dec 2008)
Log Message:
-----------
comments for test scripts
Modified Paths:
--------------
JMathLib/trunk/src/jmathlib/toolbox/general/nthroot.m
Modified: JMathLib/trunk/src/jmathlib/toolbox/general/nthroot.m
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/general/nthroot.m 2008-12-26 18:55:18 UTC (rev 564)
+++ JMathLib/trunk/src/jmathlib/toolbox/general/nthroot.m 2008-12-26 18:55:30 UTC (rev 565)
@@ -66,6 +66,6 @@
endfunction
-%!assert(nthroot(-1,[3,-3]), [-1,-1],eps);
-%!assert(nthroot([-1,1],[3.1,-3]), [-1,1].^(1./[3.1,-3]));
-%!assert(nthroot([-1+1i,-1-1i],3), [-1+1i,-1-1i].^(1/3));
+//%!assert(nthroot(-1,[3,-3]), [-1,-1],eps);
+//%!assert(nthroot([-1,1],[3.1,-3]), [-1,1].^(1./[3.1,-3]));
+//%!assert(nthroot([-1+1i,-1-1i],3), [-1+1i,-1-1i].^(1/3));
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2008-12-26 18:55:25
|
Revision: 564
http://mathlib.svn.sourceforge.net/mathlib/?rev=564&view=rev
Author: st_mueller
Date: 2008-12-26 18:55:18 +0000 (Fri, 26 Dec 2008)
Log Message:
-----------
comments for test scripts
Modified Paths:
--------------
JMathLib/trunk/src/jmathlib/toolbox/general/lookup.m
JMathLib/trunk/src/jmathlib/toolbox/general/mod.m
Modified: JMathLib/trunk/src/jmathlib/toolbox/general/lookup.m
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/general/lookup.m 2008-12-26 18:53:59 UTC (rev 563)
+++ JMathLib/trunk/src/jmathlib/toolbox/general/lookup.m 2008-12-26 18:55:18 UTC (rev 564)
@@ -86,16 +86,16 @@
endif
endfunction
-%!assert (lookup(1:3, 0.5), 0) # value before table
-%!assert (lookup(1:3, 3.5), 3) # value after table error
-%!assert (lookup(1:3, 1.5), 1) # value within table error
-%!assert (lookup(1:3, [3,2,1]), [3,2,1])
-%!assert (lookup([1:4]', [1.2, 3.5]'), [1, 3]');
-%!assert (lookup([1:4], [1.2, 3.5]'), [1, 3]');
-%!assert (lookup([1:4]', [1.2, 3.5]), [1, 3]);
-%!assert (lookup([1:4], [1.2, 3.5]), [1, 3]);
-%!assert (lookup(1:3, [3, 2, 1]), [3, 2, 1]);
-%!assert (lookup([3:-1:1], [3.5, 3, 1.2, 2.5, 2.5]), [0, 1, 2, 1, 1])
-%!assert (isempty(lookup([1:3], [])))
-%!assert (isempty(lookup([1:3]', [])))
-%!assert (lookup(1:3, [1, 2; 3, 0.5]), [1, 2; 3, 0]);
+//%!assert (lookup(1:3, 0.5), 0) # value before table
+//%!assert (lookup(1:3, 3.5), 3) # value after table error
+//%!assert (lookup(1:3, 1.5), 1) # value within table error
+//%!assert (lookup(1:3, [3,2,1]), [3,2,1])
+//%!assert (lookup([1:4]', [1.2, 3.5]'), [1, 3]');
+//%!assert (lookup([1:4], [1.2, 3.5]'), [1, 3]');
+//%!assert (lookup([1:4]', [1.2, 3.5]), [1, 3]);
+//%!assert (lookup([1:4], [1.2, 3.5]), [1, 3]);
+//%!assert (lookup(1:3, [3, 2, 1]), [3, 2, 1]);
+//%!assert (lookup([3:-1:1], [3.5, 3, 1.2, 2.5, 2.5]), [0, 1, 2, 1, 1])
+//%!assert (isempty(lookup([1:3], [])))
+//%!assert (isempty(lookup([1:3]', [])))
+//%!assert (lookup(1:3, [1, 2; 3, 0.5]), [1, 2; 3, 0]);
Modified: JMathLib/trunk/src/jmathlib/toolbox/general/mod.m
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/general/mod.m 2008-12-26 18:53:59 UTC (rev 563)
+++ JMathLib/trunk/src/jmathlib/toolbox/general/mod.m 2008-12-26 18:55:18 UTC (rev 564)
@@ -77,28 +77,28 @@
endfunction
## empty input test
-%!assert (isempty(mod([], [])));
+//%!assert (isempty(mod([], [])));
## x mod y, y != 0 tests
-%!assert (mod(5, 3), 2);
-%!assert (mod(-5, 3), 1);
-%!assert (mod(0, 3), 0);
-%!assert (mod([-5, 5, 0], [3, 3, 3]), [1, 2, 0]);
-%!assert (mod([-5; 5; 0], [3; 3; 3]), [1; 2; 0]);
-%!assert (mod([-5, 5; 0, 3], [3, 3 ; 3, 1]), [1, 2 ; 0, 0]);
+//%!assert (mod(5, 3), 2);
+//%!assert (mod(-5, 3), 1);
+//%!assert (mod(0, 3), 0);
+//%!assert (mod([-5, 5, 0], [3, 3, 3]), [1, 2, 0]);
+//%!assert (mod([-5; 5; 0], [3; 3; 3]), [1; 2; 0]);
+//%!assert (mod([-5, 5; 0, 3], [3, 3 ; 3, 1]), [1, 2 ; 0, 0]);
## x mod 0 tests
-%!assert (mod(5, 0), 5);
-%!assert (mod(-5, 0), -5);
-%!assert (mod([-5, 5, 0], [3, 0, 3]), [1, 5, 0]);
-%!assert (mod([-5; 5; 0], [3; 0; 3]), [1; 5; 0]);
-%!assert (mod([-5, 5; 0, 3], [3, 0 ; 3, 1]), [1, 5 ; 0, 0]);
-%!assert (mod([-5, 5; 0, 3], [0, 0 ; 0, 0]), [-5, 5; 0, 3]);
+//%!assert (mod(5, 0), 5);
+//%!assert (mod(-5, 0), -5);
+//%!assert (mod([-5, 5, 0], [3, 0, 3]), [1, 5, 0]);
+//%!assert (mod([-5; 5; 0], [3; 0; 3]), [1; 5; 0]);
+//%!assert (mod([-5, 5; 0, 3], [3, 0 ; 3, 1]), [1, 5 ; 0, 0]);
+//%!assert (mod([-5, 5; 0, 3], [0, 0 ; 0, 0]), [-5, 5; 0, 3]);
## mixed scalar/matrix tests
-%!assert (mod([-5, 5; 0, 3], 0), [-5, 5; 0, 3]);
-%!assert (mod([-5, 5; 0, 3], 3), [1, 2; 0, 0]);
-%!assert (mod(-5,[0,0; 0,0]), [-5, -5; -5, -5]);
-%!assert (mod(-5,[3,0; 3,1]), [1, -5; 1, 0]);
-%!assert (mod(-5,[3,2; 3,1]), [1, 1; 1, 0]);
+//%!assert (mod([-5, 5; 0, 3], 0), [-5, 5; 0, 3]);
+//%!assert (mod([-5, 5; 0, 3], 3), [1, 2; 0, 0]);
+//%!assert (mod(-5,[0,0; 0,0]), [-5, -5; -5, -5]);
+//%!assert (mod(-5,[3,0; 3,1]), [1, -5; 1, 0]);
+//%!assert (mod(-5,[3,2; 3,1]), [1, 1; 1, 0]);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2008-12-26 18:54:09
|
Revision: 563
http://mathlib.svn.sourceforge.net/mathlib/?rev=563&view=rev
Author: st_mueller
Date: 2008-12-26 18:53:59 +0000 (Fri, 26 Dec 2008)
Log Message:
-----------
Modified Paths:
--------------
JMathLib/trunk/ChangeLog.txt
Modified: JMathLib/trunk/ChangeLog.txt
===================================================================
--- JMathLib/trunk/ChangeLog.txt 2008-12-26 18:52:54 UTC (rev 562)
+++ JMathLib/trunk/ChangeLog.txt 2008-12-26 18:53:59 UTC (rev 563)
@@ -16,6 +16,13 @@
2008/12/xx
stefan *
+2008/12/26
+stefan + toolbox/jmathlib/system/format.java for formatting numbers
+stefan * GlobalValues.java RootObject.java for formatting numbers
+
+2008/12/15
+stefan + jmathlib.sh
+
2008/12/xx
stefan * tearDown() added this method to all test cases in order to save
resources and memory during test case evaluation
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2008-12-26 18:52:57
|
Revision: 562
http://mathlib.svn.sourceforge.net/mathlib/?rev=562&view=rev
Author: st_mueller
Date: 2008-12-26 18:52:54 +0000 (Fri, 26 Dec 2008)
Log Message:
-----------
added "format" property for formatting numbers
Added Paths:
-----------
JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/format.java
Added: JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/format.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/format.java (rev 0)
+++ JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/format.java 2008-12-26 18:52:54 UTC (rev 562)
@@ -0,0 +1,82 @@
+package jmathlib.toolbox.jmathlib.system;
+
+import jmathlib.core.functions.ExternalFunction;
+import jmathlib.core.tokens.Token;
+import jmathlib.core.tokens.CharToken;
+import jmathlib.core.tokens.OperandToken;
+import java.text.DecimalFormat;
+import java.text.DecimalFormatSymbols;
+import java.util.Locale;
+
+public class format extends ExternalFunction
+{
+ /**Returns an enviroment variable
+ @param operand[0] = the name of the variable
+ @param operand[1] = a default value (optional)
+ @return the enviroment value*/
+ public OperandToken evaluate(Token[] operands)
+ {
+ OperandToken result = null;
+
+ if (getNArgIn(operands)>1)
+ throwMathLibException("format: number of arguments > 1");
+
+
+ if ( (getNArgIn(operands)==1) &&
+ (!(operands[0] instanceof CharToken)) )
+ throwMathLibException("format: argument must be a string");
+
+ String type = "";
+
+ if (getNArgIn(operands)==1)
+ type = operands[0].toString();
+
+ //setNumberFormat(DecimalFormat.getInstance(Locale.ENGLISH));
+
+ if (type.equals("short"))
+ setNumberFormat(new DecimalFormat("0.0000", new DecimalFormatSymbols(Locale.ENGLISH)));
+ else if (type.equals("long"))
+ setNumberFormat(new DecimalFormat("0.000000000000000", new DecimalFormatSymbols(Locale.ENGLISH)));
+ else if (type.equals("short e"))
+ setNumberFormat(new DecimalFormat("0.0000E000", new DecimalFormatSymbols(Locale.ENGLISH)));
+ else if (type.equals("long e"))
+ setNumberFormat(new DecimalFormat("0.000000000000000E000", new DecimalFormatSymbols(Locale.ENGLISH)));
+ else if (type.equals("short g"))
+ setNumberFormat(new DecimalFormat("0.0000E000", new DecimalFormatSymbols(Locale.ENGLISH)));
+ else if (type.equals("long g"))
+ setNumberFormat(new DecimalFormat("0.000000000000000E000", new DecimalFormatSymbols(Locale.ENGLISH)));
+ else if (type.equals("short eng"))
+ setNumberFormat(new DecimalFormat("0.0000E000", new DecimalFormatSymbols(Locale.ENGLISH)));
+ else if (type.equals("long eng"))
+ setNumberFormat(new DecimalFormat("0.000000000000000E000", new DecimalFormatSymbols(Locale.ENGLISH)));
+ else
+ setNumberFormat(new DecimalFormat("0.0000", new DecimalFormatSymbols(Locale.ENGLISH)));
+
+ return result;
+ }
+}
+
+/*
+@GROUP
+system
+@SYNTAX
+format('type')
+@DOC
+changes the numerical format for numbers.
+@NOTES
+It only affects the display of numbers, the internal format
+of numbers is not affected at all.
+@EXAMPLES
+format()
+format('long')
+format('short')
+format('long e')
+format('short e')
+format('long g')
+format('short g')
+format('long eng')
+format('short eng')
+@SEE
+disp
+*/
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2008-12-26 18:52:31
|
Revision: 561
http://mathlib.svn.sourceforge.net/mathlib/?rev=561&view=rev
Author: st_mueller
Date: 2008-12-26 18:52:29 +0000 (Fri, 26 Dec 2008)
Log Message:
-----------
added "format" property for formatting numbers
Modified Paths:
--------------
JMathLib/trunk/src/jmathlib/core/interpreter/GlobalValues.java
JMathLib/trunk/src/jmathlib/core/interpreter/RootObject.java
Modified: JMathLib/trunk/src/jmathlib/core/interpreter/GlobalValues.java
===================================================================
--- JMathLib/trunk/src/jmathlib/core/interpreter/GlobalValues.java 2008-12-26 18:48:04 UTC (rev 560)
+++ JMathLib/trunk/src/jmathlib/core/interpreter/GlobalValues.java 2008-12-26 18:52:29 UTC (rev 561)
@@ -1,9 +1,12 @@
package jmathlib.core.interpreter;
import java.io.*;
+import java.util.Locale;
import java.applet.Applet;
+import java.text.DecimalFormat;
+import java.text.DecimalFormatSymbols;
+import java.text.NumberFormat;
-//import MathLib.Tokens.*;
import jmathlib.core.interpreter.Interpreter;
/**This class contains the global variables, which are accessible throughout the program.
@@ -40,6 +43,9 @@
/**sets whether to write debug lines to console and log files*/
static transient private boolean debug = true;
+ /**stores the number format for displaying the number*/
+ public transient static NumberFormat numFormat = new DecimalFormat("0.0000", new DecimalFormatSymbols(Locale.ENGLISH));
+
/**Initialises the global values
@param _interpreter = the Interpreter object
@param _runningStandalone = true if this was run from an application*/
@@ -154,5 +160,23 @@
{
debug= _debug;
}
+
+ /**
+ * returns the number format for displaying numbers
+ * @return format type
+ */
+ public NumberFormat getNumberFormat()
+ {
+ return numFormat;
+ }
+ /**
+ * sets the number format for displaying numbers
+ * @param _numFormat format type
+ */
+ public void setNumberFormat(NumberFormat _numFormat)
+ {
+ numFormat = _numFormat;
+ }
+
}
Modified: JMathLib/trunk/src/jmathlib/core/interpreter/RootObject.java
===================================================================
--- JMathLib/trunk/src/jmathlib/core/interpreter/RootObject.java 2008-12-26 18:48:04 UTC (rev 560)
+++ JMathLib/trunk/src/jmathlib/core/interpreter/RootObject.java 2008-12-26 18:52:29 UTC (rev 561)
@@ -1,11 +1,13 @@
package jmathlib.core.interpreter;
import java.io.*;
+import java.text.NumberFormat;
import java.applet.Applet;
import jmathlib.core.interpreter.Interpreter;
import jmathlib.core.tokens.OperandToken;
import jmathlib.core.functions.FunctionManager;
+
/**This universal the base class for all class define by MathLib.
It defines Global values as class variables and also defines functions for creating and accessing the working environment.*/
abstract public class RootObject implements java.io.Serializable,
@@ -184,4 +186,22 @@
globals.setDebug(_debug);
}
+ /**
+ * returns the number format for displaying numbers
+ * @return format type
+ */
+ public NumberFormat getNumberFormat()
+ {
+ return globals.getNumberFormat();
+ }
+
+ /**
+ * sets the number format for displaying numbers
+ * @param _numFormat format type
+ */
+ public void setNumberFormat(NumberFormat numFormat)
+ {
+ globals.setNumberFormat(numFormat);
+ }
+
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2008-12-26 18:48:07
|
Revision: 560
http://mathlib.svn.sourceforge.net/mathlib/?rev=560&view=rev
Author: st_mueller
Date: 2008-12-26 18:48:04 +0000 (Fri, 26 Dec 2008)
Log Message:
-----------
added "format" property for formatting numbers
Modified Paths:
--------------
JMathLib/trunk/src/jmathlib/core/tokens/numbertokens/DoubleNumberToken.java
Modified: JMathLib/trunk/src/jmathlib/core/tokens/numbertokens/DoubleNumberToken.java
===================================================================
--- JMathLib/trunk/src/jmathlib/core/tokens/numbertokens/DoubleNumberToken.java 2008-12-26 15:48:58 UTC (rev 559)
+++ JMathLib/trunk/src/jmathlib/core/tokens/numbertokens/DoubleNumberToken.java 2008-12-26 18:48:04 UTC (rev 560)
@@ -1,7 +1,5 @@
package jmathlib.core.tokens.numbertokens;
-import java.text.NumberFormat;
-
import jmathlib.core.interpreter.ErrorLogger;
import jmathlib.core.interpreter.Errors;
import jmathlib.core.tokens.DataToken;
@@ -31,10 +29,7 @@
/**Constant value set to j*/
public static final DoubleNumberToken j = new DoubleNumberToken(0,1);
- /**stores the number format for displaying the number*/
- private static NumberFormat numFormat = NumberFormat.getInstance();
-
/** Constructor creating empty number token
*/
public DoubleNumberToken()
@@ -638,6 +633,7 @@
@param _values[]={REAL,IMAG} real and imaginary part of number*/
public String toString(double _values[])
{
+
if (_values==null)
return "XXXXXX";
@@ -658,7 +654,7 @@
else if (Double.isNaN(re))
result.append("NaN");
else
- result.append(numFormat.format(re));
+ result.append(getNumberFormat().format(re));
// imaginary part of number
if((im != 0.0) || Double.isNaN(im))
@@ -674,7 +670,7 @@
else if (Double.isNaN(im))
result.append("NaN");
else
- result.append(numFormat.format(im));
+ result.append(getNumberFormat().format(im));
result.append("i)");
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|