diff --git a/build.xml b/build.xml
index 44ed88f..cc8db15 100644
--- a/build.xml
+++ b/build.xml
@@ -1,73 +1,73 @@
-
-
-
-
-
-
-
-
-
-
- Builds, tests, and runs the project SyMAT.
-
-
-
+
+
+
+
+
+
+
+
+
+
+ Builds, tests, and runs the project SyMAT.
+
+
+
diff --git a/nbproject/build-impl.xml b/nbproject/build-impl.xml
index b0e40ae..302d494 100644
--- a/nbproject/build-impl.xml
+++ b/nbproject/build-impl.xml
@@ -1,1456 +1,1421 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Must set platform.home
- Must set platform.bootcp
- Must set platform.java
- Must set platform.javac
-
- The J2SE Platform is not correctly set up.
- Your active platform is: ${platform.active}, but the corresponding property "platforms.${platform.active}.home" is not found in the project's properties files.
- Either open the project in the IDE and setup the Platform with the same name or add it manually.
- For example like this:
- ant -Duser.properties.file=<path_to_property_file> jar (where you put the property "platforms.${platform.active}.home" in a .properties file)
- or ant -Dplatforms.${platform.active}.home=<path_to_JDK_home> jar (where no properties file is used)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Must set src.dir
- Must set build.dir
- Must set dist.dir
- Must set build.classes.dir
- Must set dist.javadoc.dir
- Must set build.test.classes.dir
- Must set build.test.results.dir
- Must set build.classes.excludes
- Must set dist.jar
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Must set javac.includes
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- No tests executed.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Must set JVM to use for profiling in profiler.info.jvm
- Must set profiler agent JVM arguments in profiler.info.jvmargs.agent
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Must select some files in the IDE or set javac.includes
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- To run this application from the command line without Ant, try:
-
- ${platform.java} -jar "${dist.jar.resolved}"
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Must select one file in the IDE or set run.class
-
-
-
- Must select one file in the IDE or set run.class
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Must select one file in the IDE or set debug.class
-
-
-
-
- Must select one file in the IDE or set debug.class
-
-
-
-
- Must set fix.includes
-
-
-
-
-
-
-
-
-
- This target only works when run from inside the NetBeans IDE.
-
-
-
-
-
-
-
-
- Must select one file in the IDE or set profile.class
- This target only works when run from inside the NetBeans IDE.
-
-
-
-
-
-
-
-
- This target only works when run from inside the NetBeans IDE.
-
-
-
-
-
-
-
-
-
-
-
-
- This target only works when run from inside the NetBeans IDE.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Must select one file in the IDE or set run.class
-
-
-
-
-
- Must select some files in the IDE or set test.includes
-
-
-
-
- Must select one file in the IDE or set run.class
-
-
-
-
- Must select one file in the IDE or set applet.url
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Must select some files in the IDE or set javac.includes
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Some tests failed; see details above.
-
-
-
-
-
-
-
-
- Must select some files in the IDE or set test.includes
-
-
-
- Some tests failed; see details above.
-
-
-
- Must select some files in the IDE or set test.class
- Must select some method in the IDE or set test.method
-
-
-
- Some tests failed; see details above.
-
-
-
-
- Must select one file in the IDE or set test.class
-
-
-
- Must select one file in the IDE or set test.class
- Must select some method in the IDE or set test.method
-
-
-
-
-
-
-
-
-
-
-
-
-
- Must select one file in the IDE or set applet.url
-
-
-
-
-
-
-
-
- Must select one file in the IDE or set applet.url
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must set src.dir
+ Must set build.dir
+ Must set dist.dir
+ Must set build.classes.dir
+ Must set dist.javadoc.dir
+ Must set build.test.classes.dir
+ Must set build.test.results.dir
+ Must set build.classes.excludes
+ Must set dist.jar
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must set javac.includes
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ No tests executed.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must set JVM to use for profiling in profiler.info.jvm
+ Must set profiler agent JVM arguments in profiler.info.jvmargs.agent
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must select some files in the IDE or set javac.includes
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ To run this application from the command line without Ant, try:
+
+ java -jar "${dist.jar.resolved}"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must select one file in the IDE or set run.class
+
+
+
+ Must select one file in the IDE or set run.class
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must select one file in the IDE or set debug.class
+
+
+
+
+ Must select one file in the IDE or set debug.class
+
+
+
+
+ Must set fix.includes
+
+
+
+
+
+
+
+
+
+ This target only works when run from inside the NetBeans IDE.
+
+
+
+
+
+
+
+
+ Must select one file in the IDE or set profile.class
+ This target only works when run from inside the NetBeans IDE.
+
+
+
+
+
+
+
+
+ This target only works when run from inside the NetBeans IDE.
+
+
+
+
+
+
+
+
+
+
+
+
+ This target only works when run from inside the NetBeans IDE.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must select one file in the IDE or set run.class
+
+
+
+
+
+ Must select some files in the IDE or set test.includes
+
+
+
+
+ Must select one file in the IDE or set run.class
+
+
+
+
+ Must select one file in the IDE or set applet.url
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must select some files in the IDE or set javac.includes
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Some tests failed; see details above.
+
+
+
+
+
+
+
+
+ Must select some files in the IDE or set test.includes
+
+
+
+ Some tests failed; see details above.
+
+
+
+ Must select some files in the IDE or set test.class
+ Must select some method in the IDE or set test.method
+
+
+
+ Some tests failed; see details above.
+
+
+
+
+ Must select one file in the IDE or set test.class
+
+
+
+ Must select one file in the IDE or set test.class
+ Must select some method in the IDE or set test.method
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must select one file in the IDE or set applet.url
+
+
+
+
+
+
+
+
+ Must select one file in the IDE or set applet.url
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/nbproject/genfiles.properties b/nbproject/genfiles.properties
index d4c64e8..dbf3943 100644
--- a/nbproject/genfiles.properties
+++ b/nbproject/genfiles.properties
@@ -1,8 +1,8 @@
-build.xml.data.CRC32=0dfe898c
-build.xml.script.CRC32=cfce77fe
-build.xml.stylesheet.CRC32=8064a381@1.75.2.48
-# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
-# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
-nbproject/build-impl.xml.data.CRC32=0dfe898c
-nbproject/build-impl.xml.script.CRC32=eaffabc7
-nbproject/build-impl.xml.stylesheet.CRC32=876e7a8f@1.75.2.48
+build.xml.data.CRC32=70b2413f
+build.xml.script.CRC32=cfce77fe
+build.xml.stylesheet.CRC32=8064a381@1.75.2.48
+# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
+# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
+nbproject/build-impl.xml.data.CRC32=70b2413f
+nbproject/build-impl.xml.script.CRC32=e6773cad
+nbproject/build-impl.xml.stylesheet.CRC32=876e7a8f@1.75.2.48
diff --git a/nbproject/project.properties b/nbproject/project.properties
index 0a320f8..8c18150 100644
--- a/nbproject/project.properties
+++ b/nbproject/project.properties
@@ -1,128 +1,128 @@
-annotation.processing.enabled=true
-annotation.processing.enabled.in.editor=false
-annotation.processing.processors.list=
-annotation.processing.run.all.processors=true
-annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
-application.desc=Teach, learn, and use math and programming skills with SyMAT.
-application.homepage=https://symatapp.com/
-application.splash=C:\\Users\\Skylar\\Documents\\Apocalypse Labs\\appmedia\\SyMAT\\splashscreen.png
-application.title=SyMAT
-application.vendor=Apocalypse Laboratories
-auxiliary.org-netbeans-spi-editor-hints-projects.perProjectHintSettingsFile=nbproject/cfg_hints.xml
-build.classes.dir=${build.dir}/classes
-build.classes.excludes=**/*.java,**/*.form
-# This directory is removed when the project is cleaned:
-build.dir=build
-build.generated.dir=${build.dir}/generated
-build.generated.sources.dir=${build.dir}/generated-sources
-# Only compile against the classpath explicitly listed here:
-build.sysclasspath=ignore
-build.test.classes.dir=${build.dir}/test/classes
-build.test.results.dir=${build.dir}/test/results
-# Uncomment to specify the preferred debugger connection transport:
-#debug.transport=dt_socket
-debug.classpath=\
- ${run.classpath}
-debug.test.classpath=\
- ${run.test.classpath}
-# Files in build.classes.dir which should be excluded from distribution jar
-dist.archive.excludes=
-# This directory is removed when the project is cleaned:
-dist.dir=dist
-dist.jar=${dist.dir}/SyMAT.jar
-dist.javadoc.dir=${dist.dir}/javadoc
-endorsed.classpath=
-excludes=
-file.reference.autocomplete-2.5.4.jar=lib/autocomplete-2.5.4.jar
-file.reference.beautyeye_lnf.jar=lib/beautyeye_lnf.jar
-file.reference.flamingo-6.3.jar=lib/flamingo-6.3.jar
-file.reference.htmlcleaner-2.10.jar=lib/htmlcleaner-2.10.jar
-file.reference.iText-4.2.0-com.itextpdf.jar=lib/iText-4.2.0-com.itextpdf.jar
-file.reference.JavaPrettify-1.2.1.jar=lib\\JavaPrettify-1.2.1.jar
-file.reference.jmathplot.jar=lib/jmathplot.jar
-file.reference.js-engine.jar=lib/js-engine.jar
-file.reference.js.jar=lib/js.jar
-file.reference.json-simple-1.1.1.jar=lib/json-simple-1.1.1.jar
-file.reference.jython-standalone-2.7-b3.jar=lib/jython-standalone-2.7-b3.jar
-file.reference.log4j-1.2.11.jar=lib/log4j-1.2.11.jar
-file.reference.rsyntaxtextarea-2.5.6.jar=lib/rsyntaxtextarea-2.5.6.jar
-file.reference.seaglasslookandfeel-0.2.jar=lib/seaglasslookandfeel-0.2.jar
-file.reference.SyMAT-src=src
-file.reference.symja-2014-11-01.jar=lib/symja-2014-11-01.jar
-file.reference.trident-6.3.jar=lib/trident-6.3.jar
-includes=**
-jar.archive.disabled=${jnlp.enabled}
-jar.compress=false
-jar.index=${jnlp.enabled}
-javac.classpath=\
- ${file.reference.autocomplete-2.5.4.jar}:\
- ${file.reference.beautyeye_lnf.jar}:\
- ${file.reference.flamingo-6.3.jar}:\
- ${file.reference.htmlcleaner-2.10.jar}:\
- ${file.reference.iText-4.2.0-com.itextpdf.jar}:\
- ${file.reference.jmathplot.jar}:\
- ${file.reference.js-engine.jar}:\
- ${file.reference.js.jar}:\
- ${file.reference.json-simple-1.1.1.jar}:\
- ${file.reference.jython-standalone-2.7-b3.jar}:\
- ${file.reference.log4j-1.2.11.jar}:\
- ${file.reference.rsyntaxtextarea-2.5.6.jar}:\
- ${file.reference.seaglasslookandfeel-0.2.jar}:\
- ${file.reference.symja-2014-11-01.jar}:\
- ${file.reference.trident-6.3.jar}:\
- ${file.reference.JavaPrettify-1.2.1.jar}
-# Space-separated list of extra javac options
-javac.compilerargs=
-javac.deprecation=false
-javac.processorpath=\
- ${javac.classpath}
-javac.source=1.8
-javac.target=1.8
-javac.test.classpath=\
- ${javac.classpath}:\
- ${build.classes.dir}
-javac.test.processorpath=\
- ${javac.test.classpath}
-javadoc.additionalparam=
-javadoc.author=false
-javadoc.encoding=${source.encoding}
-javadoc.noindex=false
-javadoc.nonavbar=false
-javadoc.notree=false
-javadoc.private=false
-javadoc.reference.flamingo-6.3.jar=lib/flamingo-6.3-javadoc.jar
-javadoc.splitindex=true
-javadoc.use=true
-javadoc.version=false
-javadoc.windowtitle=
-jnlp.codebase.type=no.codebase
-jnlp.descriptor=application
-jnlp.enabled=false
-jnlp.mixed.code=default
-jnlp.offline-allowed=false
-jnlp.signed=false
-jnlp.signing=
-jnlp.signing.alias=
-jnlp.signing.keystore=
-main.class=net.apocalypselabs.symat.Main
-# Optional override of default Codebase manifest attribute, use to prevent RIAs from being repurposed
-manifest.custom.codebase=
-# Optional override of default Permissions manifest attribute (supported values: sandbox, all-permissions)
-manifest.custom.permissions=
-manifest.file=manifest.mf
-meta.inf.dir=${src.dir}/META-INF
-mkdist.disabled=false
-platform.active=JDK_1.8
-project.license=aplabs-oss_1
-run.classpath=\
- ${javac.classpath}:\
- ${build.classes.dir}
-# Space-separated list of JVM arguments used when running the project.
-# You may also define separate properties like run-sys-prop.name=value instead of -Dname=value.
-# To set system properties for unit tests define test-sys-prop.name=value:
-run.jvmargs=
-run.test.classpath=\
- ${javac.test.classpath}:\
- ${build.test.classes.dir}
-source.encoding=UTF-8
-src.dir=${file.reference.SyMAT-src}
+annotation.processing.enabled=true
+annotation.processing.enabled.in.editor=false
+annotation.processing.processors.list=
+annotation.processing.run.all.processors=true
+annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
+application.desc=Math and Programming for People
+application.homepage=https://symatapp.com/
+application.splash=C:\\Users\\Skylar\\Documents\\Apocalypse Labs\\appmedia\\SyMAT\\splashscreen.png
+application.title=SyMAT
+application.vendor=Apocalypse Laboratories
+auxiliary.org-netbeans-spi-editor-hints-projects.perProjectHintSettingsFile=nbproject/cfg_hints.xml
+build.classes.dir=${build.dir}/classes
+build.classes.excludes=**/*.java,**/*.form
+# This directory is removed when the project is cleaned:
+build.dir=build
+build.generated.dir=${build.dir}/generated
+build.generated.sources.dir=${build.dir}/generated-sources
+# Only compile against the classpath explicitly listed here:
+build.sysclasspath=ignore
+build.test.classes.dir=${build.dir}/test/classes
+build.test.results.dir=${build.dir}/test/results
+# Uncomment to specify the preferred debugger connection transport:
+#debug.transport=dt_socket
+debug.classpath=\
+ ${run.classpath}
+debug.test.classpath=\
+ ${run.test.classpath}
+# Files in build.classes.dir which should be excluded from distribution jar
+dist.archive.excludes=
+# This directory is removed when the project is cleaned:
+dist.dir=dist
+dist.jar=${dist.dir}/SyMAT.jar
+dist.javadoc.dir=${dist.dir}/javadoc
+endorsed.classpath=
+excludes=
+file.reference.autocomplete-2.5.4.jar=lib/autocomplete-2.5.4.jar
+file.reference.beautyeye_lnf.jar=lib/beautyeye_lnf.jar
+file.reference.flamingo-6.3.jar=lib/flamingo-6.3.jar
+file.reference.htmlcleaner-2.10.jar=lib/htmlcleaner-2.10.jar
+file.reference.iText-4.2.0-com.itextpdf.jar=lib/iText-4.2.0-com.itextpdf.jar
+file.reference.JavaPrettify-1.2.1.jar=lib\\JavaPrettify-1.2.1.jar
+file.reference.jmathplot.jar=lib/jmathplot.jar
+file.reference.js-engine.jar=lib/js-engine.jar
+file.reference.js.jar=lib/js.jar
+file.reference.json-simple-1.1.1.jar=lib/json-simple-1.1.1.jar
+file.reference.jython-standalone-2.7-b3.jar=lib/jython-standalone-2.7-b3.jar
+file.reference.log4j-1.2.11.jar=lib/log4j-1.2.11.jar
+file.reference.rsyntaxtextarea-2.5.6.jar=lib/rsyntaxtextarea-2.5.6.jar
+file.reference.seaglasslookandfeel-0.2.jar=lib/seaglasslookandfeel-0.2.jar
+file.reference.SyMAT-src=src
+file.reference.symja-2014-11-01.jar=lib/symja-2014-11-01.jar
+file.reference.trident-6.3.jar=lib/trident-6.3.jar
+includes=**
+jar.archive.disabled=${jnlp.enabled}
+jar.compress=false
+jar.index=${jnlp.enabled}
+javac.classpath=\
+ ${file.reference.autocomplete-2.5.4.jar}:\
+ ${file.reference.beautyeye_lnf.jar}:\
+ ${file.reference.flamingo-6.3.jar}:\
+ ${file.reference.htmlcleaner-2.10.jar}:\
+ ${file.reference.iText-4.2.0-com.itextpdf.jar}:\
+ ${file.reference.jmathplot.jar}:\
+ ${file.reference.js-engine.jar}:\
+ ${file.reference.js.jar}:\
+ ${file.reference.json-simple-1.1.1.jar}:\
+ ${file.reference.jython-standalone-2.7-b3.jar}:\
+ ${file.reference.log4j-1.2.11.jar}:\
+ ${file.reference.rsyntaxtextarea-2.5.6.jar}:\
+ ${file.reference.seaglasslookandfeel-0.2.jar}:\
+ ${file.reference.symja-2014-11-01.jar}:\
+ ${file.reference.trident-6.3.jar}:\
+ ${file.reference.JavaPrettify-1.2.1.jar}
+# Space-separated list of extra javac options
+javac.compilerargs=
+javac.deprecation=false
+javac.processorpath=\
+ ${javac.classpath}
+javac.source=1.8
+javac.target=1.8
+javac.test.classpath=\
+ ${javac.classpath}:\
+ ${build.classes.dir}
+javac.test.processorpath=\
+ ${javac.test.classpath}
+javadoc.additionalparam=
+javadoc.author=false
+javadoc.encoding=${source.encoding}
+javadoc.noindex=false
+javadoc.nonavbar=false
+javadoc.notree=false
+javadoc.private=false
+javadoc.reference.flamingo-6.3.jar=lib/flamingo-6.3-javadoc.jar
+javadoc.splitindex=true
+javadoc.use=true
+javadoc.version=false
+javadoc.windowtitle=
+jnlp.codebase.type=no.codebase
+jnlp.descriptor=application
+jnlp.enabled=false
+jnlp.mixed.code=default
+jnlp.offline-allowed=false
+jnlp.signed=false
+jnlp.signing=
+jnlp.signing.alias=
+jnlp.signing.keystore=
+main.class=net.apocalypselabs.symat.Main
+# Optional override of default Codebase manifest attribute, use to prevent RIAs from being repurposed
+manifest.custom.codebase=
+# Optional override of default Permissions manifest attribute (supported values: sandbox, all-permissions)
+manifest.custom.permissions=
+manifest.file=manifest.mf
+meta.inf.dir=${src.dir}/META-INF
+mkdist.disabled=false
+platform.active=default_platform
+project.license=aplabs-oss_1
+run.classpath=\
+ ${javac.classpath}:\
+ ${build.classes.dir}
+# Space-separated list of JVM arguments used when running the project.
+# You may also define separate properties like run-sys-prop.name=value instead of -Dname=value.
+# To set system properties for unit tests define test-sys-prop.name=value:
+run.jvmargs=
+run.test.classpath=\
+ ${javac.test.classpath}:\
+ ${build.test.classes.dir}
+source.encoding=UTF-8
+src.dir=${file.reference.SyMAT-src}
diff --git a/nbproject/project.xml b/nbproject/project.xml
index 03d903d..66bf976 100644
--- a/nbproject/project.xml
+++ b/nbproject/project.xml
@@ -1,17 +1,16 @@
-
-
- org.netbeans.modules.java.j2seproject
-
-
- SyMAT
-
-
-
-
-
-
-
- .\lib\nblibraries.properties
-
-
-
+
+
+ org.netbeans.modules.java.j2seproject
+
+
+ SyMAT
+
+
+
+
+
+
+ .\lib\nblibraries.properties
+
+
+
diff --git a/src/net/apocalypselabs/symat/Debug.java b/src/net/apocalypselabs/symat/Debug.java
index 1b8bfd2..b71ed07 100644
--- a/src/net/apocalypselabs/symat/Debug.java
+++ b/src/net/apocalypselabs/symat/Debug.java
@@ -1,73 +1,73 @@
-/*
- * This class is public domain because it is standalone and
- * is potentially useful to other projects.
- *
- * If this cannot be placed in the public domain, it is licensed under
- * the Creative Commons Zero license.
- *
- * Feel free to use it however you wish!
- */
-package net.apocalypselabs.symat;
-
-/**
- * This class handles debug logging, so it's easy to disable.
- *
- * @author Skylar
- */
-public class Debug {
-
- // If output should be on or off
- public static boolean debug = true;
-
- /**
- * Turn debug output on and off.
- *
- * @param b
- */
- public static void setDebug(boolean b) {
- debug = b;
- }
-
- /**
- * Check if debug output is enabled.
- *
- * @return true if it is.
- */
- public static boolean getDebug() {
- return debug;
- }
-
- /**
- * Call System.out.println(data) if debug output enabled.
- *
- * @param data Data to print.
- */
- public static void println(Object data) {
- if (debug) {
- System.out.println(data);
- }
- }
-
- /**
- * Call System.err.println(data) if debug output enabled.
- *
- * @param data Data to print.
- */
- public static void printerr(Object data) {
- if (debug) {
- System.err.println(data);
- }
- }
-
- /**
- * Call e.printStackTrace() if debug output enabled.
- *
- * @param e an Exception.
- */
- @SuppressWarnings(value = {"CallToPrintStackTrace"})
- public static void stacktrace(Exception e) {
- if (debug) {
- e.printStackTrace();
- }
- }
-}
+/*
+ * This class is public domain because it is standalone and
+ * is potentially useful to other projects.
+ *
+ * If this cannot be placed in the public domain, it is licensed under
+ * the Creative Commons Zero license.
+ *
+ * Feel free to use it however you wish!
+ */
+package net.apocalypselabs.symat;
+
+/**
+ * This class handles debug logging, so it's easy to disable.
+ *
+ * @author Skylar
+ */
+public class Debug {
+
+ // If output should be on or off
+ public static boolean debug = true;
+
+ /**
+ * Turn debug output on and off.
+ *
+ * @param b
+ */
+ public static void setDebug(boolean b) {
+ debug = b;
+ }
+
+ /**
+ * Check if debug output is enabled.
+ *
+ * @return true if it is.
+ */
+ public static boolean getDebug() {
+ return debug;
+ }
+
+ /**
+ * Call System.out.println(data) if debug output enabled.
+ *
+ * @param data Data to print.
+ */
+ public static void println(Object data) {
+ if (debug) {
+ System.out.println(data);
+ }
+ }
+
+ /**
+ * Call System.err.println(data) if debug output enabled.
+ *
+ * @param data Data to print.
+ */
+ public static void printerr(Object data) {
+ if (debug) {
+ System.err.println(data);
+ }
+ }
+
+ /**
+ * Call e.printStackTrace() if debug output enabled.
+ *
+ * @param e an Exception.
+ */
+ @SuppressWarnings(value = {"CallToPrintStackTrace"})
+ public static void stacktrace(Exception e) {
+ if (debug) {
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/src/net/apocalypselabs/symat/Functions.java b/src/net/apocalypselabs/symat/Functions.java
index ce86084..d5e9c55 100644
--- a/src/net/apocalypselabs/symat/Functions.java
+++ b/src/net/apocalypselabs/symat/Functions.java
@@ -1,1297 +1,1297 @@
-/*
- * CODE LICENSE =====================
- * Copyright (c) 2015, Apocalypse Laboratories
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation and/or
- * other materials provided with the distribution.
- *
- * 3. Neither the name of the copyright holder nor the names of its contributors
- * may be used to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * 4. You adhere to the Media License detailed below. If you do not, this license
- * is automatically revoked and you must purge all copies of the software you
- * possess, in source or binary form.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * MEDIA LICENSE ====================
- * All images and other graphical files (the "graphics") included with this
- * software are copyright (c) 2015 Apocalypse Laboratories. You may not distribute
- * the graphics or any program, source code repository, or other digital storage
- * media containing them without written permission from Apocalypse Laboratories.
- * This ban on distribution only applies to publicly available systems.
- * A password-protected network file share, USB drive, or other storage scheme that
- * cannot be easily accessed by the public is generally allowed. If in doubt,
- * contact Apocalypse Laboratories. If Apocalypse Laboratories allows or denies
- * you permission, that decision is considered final and binding.
- */
-package net.apocalypselabs.symat;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import static java.lang.Math.*;
-import java.lang.reflect.Array;
-import java.math.BigInteger;
-import java.net.URL;
-import java.security.SecureRandom;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.NoSuchElementException;
-import java.util.Set;
-import java.util.prefs.Preferences;
-import javax.swing.JFileChooser;
-import javax.swing.JOptionPane;
-import static net.apocalypselabs.symat.Main.API_URL;
-import net.apocalypselabs.symat.components.TextBox;
-import org.matheclipse.core.eval.EvalUtilities;
-import org.matheclipse.core.interfaces.IExpr;
-import org.matheclipse.parser.client.math.MathException;
-import org.mozilla.javascript.NativeArray;
-import org.python.core.PyList;
-
-/**
- * These functions are accessible from JavaScript.
- *
- * There are a lot of aliases in here too.
- *
- * @author Skylar
- */
-public class Functions {
-
- public static final HashMap GLOBALS = new HashMap<>();
-
- private final EvalUtilities util = new EvalUtilities(true, true);
- Graph graphwin = new Graph(true);
-
- private String lang = "py";
-
- private final SecureRandom rng = new SecureRandom();
-
- /*
- Useful interactions
- */
- /**
- * Display a message dialog box.
- *
- * @param message The message to give.
- */
- public void notify(Object message) {
- JOptionPane.showInternalMessageDialog(Main.mainPane, message.toString());
- }
-
- /**
- * Display message dialog.
- *
- * This is an alias to help JavaScript programmers.
- *
- * @param message The message
- */
- public void alert(Object message) {
- notify(message);
- }
-
- /**
- * Display an input dialog box with a text field.
- *
- * @param question Text to label dialog
- * @return The inputted text
- */
- public String ask(String question) {
- return JOptionPane.showInternalInputDialog(Main.mainPane, question);
- }
-
- /**
- * Pause execution for the specified number of milliseconds.
- *
- * @param millis
- */
- public void pause(long millis) {
- try {
- Thread.sleep(millis);
- } catch (InterruptedException e) {
- // Nothing to do.
- }
- }
-
- /**
- * @see pause()
- * @param millis
- */
- public void sleep(long millis) {
- pause(millis);
- }
-
- /**
- * Quit SyMAT.
- */
- public void quitApplication() {
- System.exit(0);
- }
-
- /*
- Math commands
- */
- /**
- * Find the factorial (n!) of a number.
- *
- * @param n positive integer
- * @return n! as String
- * @throws net.apocalypselabs.symat.BadInputException
- */
- public String factorial(long n) throws BadInputException {
- if (n <= 0) {
- throw new BadInputException("Input must be greater than zero!");
- }
-
- BigInteger inc = new BigInteger("1");
- BigInteger fact = new BigInteger("1");
-
- for (long c = 1; c <= n; c++) {
- fact = fact.multiply(inc);
- inc = inc.add(BigInteger.ONE);
- }
- return fact.toString();
- }
-
- /**
- * Take (a^b) mod m. If b is -1, finds the modular inverse of a mod m.
- *
- * @param a Number
- * @param b Exponent
- * @param m Modulus
- * @return pow(a,b)%m.
- */
- public double powermod(double a, double b, double m) {
- if (b == -1) {
- BigInteger in = new BigInteger(String.valueOf((int) a));
- return in.modInverse(new BigInteger(String.valueOf((int) m))).doubleValue();
- }
- return (pow(a, b) % m + m) % m;
- }
-
- /**
- * Take (a^b) mod m. If b is -1, finds the modular inverse of a mod m.
- *
- * @param a Number
- * @param b Exponent
- * @param m Modulus
- * @return pow(a,b)%m.
- */
- public String powermod(String a, String b, String m) {
- BigInteger in = new BigInteger(a);
- if (b.equals("-1")) {
- return in.modInverse(new BigInteger(m)).toString();
- }
- return in.modPow(new BigInteger(b), new BigInteger(m)).toString();
- }
-
- public long gcd(long a, long b) {
- if (b == 0) {
- return a;
- }
- return gcd(b, a % b);
- }
-
- public String gcd(String a, String b) {
- return (new BigInteger(a).gcd(new BigInteger(b)).toString());
- }
-
- /**
- * Differentiate the function with respect to idv.
- *
- * @param function Function
- * @param idv independent variable
- * @return Differentiated function
- */
- public String diff(String function, String idv) {
- return util.evaluate("diff(" + function + "," + idv + ")").toString();
- }
-
- /**
- * Differentiate the function with respect to x.
- *
- * @param function Function
- * @return Differentiated function
- */
- public String diff(String function) {
- // Assume "x" as var
- return diff(function, "x");
- }
-
- @Deprecated
- public String D(String function, String idv) {
- return diff(function, idv);
- }
-
- public double[] solve(String function, String idv, int eq) {
- String res = $("Solve[" + function + "==" + eq + ", " + idv + "]");
- res = res.substring(1, res.length() - 1);
- String[] cmp = res.split(",");
- for (int i = 0; i < cmp.length; i++) {
- cmp[i] = cmp[i].replace("{" + idv + "->", "");
- cmp[i] = cmp[i].replace("}", "");
- }
- double[] out = new double[cmp.length];
- for (int i = 0; i < cmp.length; i++) {
- try {
- if (cmp[i].contains("I")) {
- if (cmp[i].contains("-I")) {
- out[i] = Double.NEGATIVE_INFINITY;
- } else {
- out[i] = Double.POSITIVE_INFINITY;
- }
- } else {
- out[i] = Double.parseDouble(cmp[i]);
- }
- } catch (Exception ex) {
- return new double[]{Double.NaN};
- }
- }
- return out;
- }
-
- public double[] solve(String function, String idv) {
- return solve(function, idv, 0);
- }
-
- public double[] solve(String function) {
- return solve(function, "x");
- }
-
- private String printa(double[] o) {
- String out = "[";
- for (int i = 0; i < o.length; i++) {
- out += o[i] + (i == o.length - 1 ? "" : ", ");
- }
- out += "]";
- return out;
- }
-
- private String printa(int[] o) {
- String out = "[";
- for (int i = 0; i < o.length; i++) {
- out += o[i] + (i == o.length - 1 ? "" : ", ");
- }
- out += "]";
- return out;
- }
-
- private String printa(boolean[] o) {
- String out = "[";
- for (int i = 0; i < o.length; i++) {
- out += (o[i] ? "true" : "false") + (i == o.length - 1 ? "" : ", ");
- }
- out += "]";
- return out;
- }
-
- public String printa(Object o) {
- String out = "[";
- if (o instanceof int[]) {
- int[] arr = (int[]) o;
- for (int i = 0; i < arr.length; i++) {
- out += arr[i] + (i == arr.length - 1 ? "" : ", ");
- }
- } else if (o instanceof double[]) {
- double[] arr = (double[]) o;
- for (int i = 0; i < arr.length; i++) {
- out += arr[i] + (i == arr.length - 1 ? "" : ", ");
- }
- } else if (o instanceof boolean[]) {
- double[] arr = (double[]) o;
- for (int i = 0; i < arr.length; i++) {
- out += arr[i] + (i == arr.length - 1 ? "" : ", ");
- }
- } else if (o instanceof int[][]) {
- int[][] arr = (int[][]) o;
- for (int i = 0; i < arr.length; i++) {
- out += printa(arr[i]) + (i == arr.length - 1 ? "" : ", ");
- }
- } else if (o instanceof double[][]) {
- double[][] arr = (double[][]) o;
- for (int i = 0; i < arr.length; i++) {
- out += printa(arr[i]) + (i == arr.length - 1 ? "" : ", ");
- }
- } else if (o instanceof boolean[][]) {
- boolean[][] arr = (boolean[][]) o;
- for (int i = 0; i < arr.length; i++) {
- out += printa(arr[i]) + (i == arr.length - 1 ? "" : ", ");
- }
- } else if (o instanceof NativeArray) {
- NativeArray arr = (NativeArray) o;
- for (long i = 0; i < arr.getLength(); i++) {
-
- out += (arr.get(i) instanceof NativeArray ? printa(arr.get(i))
- : arr.get(i).toString())
- + (i == arr.getLength() - 1 ? "" : ", ");
- }
- } else if (o instanceof PyList) {
- PyList arr = (PyList) o;
- Object[] oo = arr.toArray();
- for (int i = 0; i < oo.length; i++) {
- out += (oo[i] instanceof Object[] ? printa(oo[i]) : oo[i].toString())
- + (i == oo.length - 1 ? "" : ", ");
- }
- } else {
- Object[] arr = (Object[]) o;
- for (int i = 0; i < arr.length; i++) {
- out += (arr[i] instanceof Object[] ? printa(arr[i]) : arr[i].toString())
- + (i == arr.length - 1 ? "" : ", ");
- }
- }
- out += "]";
- return out;
- }
-
- /**
- * Integrate the function with respect to idv.
- *
- * @param function Function
- * @param idv independent variable
- * @return Integrated function
- */
- public String integrate(String function, String idv) {
- return util.evaluate("integrate(" + function + "," + idv + ")").toString();
- }
-
- /**
- * Integrate the function with respect to x.
- *
- * @param function Function
- * @return Integrated function
- */
- public String integrate(String function) {
- return integrate(function, "x");
- }
-
- public String factor(String function) {
- return sym("Factor(" + function + ")");
- }
-
- /**
- * Simplify the given expression.
- *
- * @param expr expression
- * @return simplified expression
- */
- public String simplify(String expr) {
- return sym("Simplify(" + expr + ")");
- }
-
- public Object vpa(String expr) {
- IExpr ans = util.evaluate("N(" + expr + ")");
- if (ans.isNumber()) {
- return Double.parseDouble(ans.toString());
- }
- return ans.toString();
- }
-
- public int[] primes(int in) {
- boolean[] prime = new boolean[in];
- for (int i = 0; i < prime.length; i++) {
- prime[i] = true;
- }
- for (int i = 2; i < sqrt(in); i++) {
- if (prime[i]) {
- int x = 0;
- for (int j = i * i; j < in; j = i * i + x * i) {
- prime[j] = false;
- x++;
- }
- }
- }
- List arr = new ArrayList<>();
- for (int i = 2; i < prime.length; i++) {
- if (prime[i]) {
- arr.add(i);
- }
- }
- int[] out = new int[arr.size()];
- for (int i = 0; i < arr.size(); i++) {
- out[i] = arr.get(i);
- }
- return out;
- }
-
- public double sec(double d) {
- return 1.0 / Math.cos(d);
- }
-
- public double csc(double d) {
- return 1.0 / Math.sin(d);
- }
-
- public double cot(double d) {
- return 1.0 / Math.tan(d);
- }
-
- public double asec(double d) {
- return Math.acos(1.0 / d);
- }
-
- public double acsc(double d) {
- return Math.asin(1.0 / d);
- }
-
- public double acot(double d) {
- return Math.atan(1.0 / d);
- }
-
- public double sinh(double d) {
- return Math.sinh(d);
- }
-
- public double cosh(double d) {
- return Math.cosh(d);
- }
-
- public double tanh(double d) {
- return Math.tanh(d);
- }
-
- public double sech(double d) {
- return pow(Math.cosh(d), -1);
- }
-
- public double csch(double d) {
- return pow(Math.sinh(d), -1);
- }
-
- public double coth(double d) {
- return Math.cosh(d) / Math.sinh(d);
- }
-
- /**
- * Multiplies the given numbers together.
- *
- * @param a numbers. Calculates first * second * third, etc.
- * @return The product of the numbers or the value of input if there is only
- * one input.
- */
- public double times(double... a) {
- double ans = 0;
- for (int i = 0; i < a.length; i++) {
- if (i == 0) {
- ans = a[i];
- } else {
- ans *= a[i];
- }
- }
- return ans;
- }
-
- /**
- * Multiplies the given numbers together.
- *
- * @param a
- * @param b
- * @return The product of the numbers or the value of input if there is only
- * one input.
- */
- public String times(String a, String b) {
- return (new BigInteger(a).multiply(new BigInteger(b))).toString();
- }
-
- /**
- * Divide the given numbers.
- *
- * @param a numbers. Calculates (first / second) / third, etc.
- * @return The quotient of the numbers or the value of input if there is
- * only one input.
- */
- public double divide(double... a) {
- double ans = 0;
- for (int i = 0; i < a.length; i++) {
- if (i == 0) {
- ans = a[i];
- } else {
- ans /= a[i];
- }
- }
- return ans;
- }
-
- /**
- * Divide the given numbers.
- *
- * @param a
- * @param b
- * @return The quotient of the numbers or the value of input if there is
- * only one input.
- */
- public String divide(String a, String b) {
- return (new BigInteger(a).divide(new BigInteger(b))).toString();
- }
-
- /**
- * Divide the first number by the second and return the remainder.
- *
- * @param a numbers. Calculates (first mod second) mod third, etc.
- * @return The modulus of the numbers or the value of input if there is only
- * one input.
- */
- public double mod(double... a) {
- double ans = 0;
- for (int i = 0; i < a.length; i++) {
- if (i == 0) {
- ans = a[i];
- } else {
- ans %= a[i];
- }
- }
- return ans;
- }
-
- /**
- * Divide the first number by the second and return the remainder.
- *
- * @param a
- * @param b
- * @return The modulus of the numbers or the value of input if there is only
- * one input.
- */
- public String mod(String a, String b) {
- return (new BigInteger(a).mod(new BigInteger(b))).toString();
- }
-
- /**
- * Add the given numbers together.
- *
- * @param a numbers. Calculates first + second + third, etc.
- * @return The sum of the numbers or the value of input if there is only one
- * input.
- */
- public double add(double... a) {
- double ans = 0;
- for (double d : a) {
- ans += d;
- }
- return ans;
- }
-
- /**
- * Add the given numbers together.
- *
- * @param a numbers. Calculates first + second + third, etc.
- * @return The sum of the numbers or the value of input if there is only one
- * input.
- */
- public String add(String a, String b) {
- return (new BigInteger(a).subtract(new BigInteger(b))).toString();
- }
-
- /**
- * Subtract the given numbers.
- *
- * @param a numbers. Calculates (first - second) - third, etc.
- * @return The difference of the numbers or the value of input if there is
- * only one input.
- */
- public double subtract(double... a) {
- double ans = 0;
- for (int i = 0; i < a.length; i++) {
- if (i == 0) {
- ans = a[i];
- } else {
- ans -= a[i];
- }
- }
- return ans;
- }
-
- /**
- * Subtract the given numbers.
- *
- * @param a numbers. Calculates (first - second) - third, etc.
- * @return The difference of the numbers or the value of input if there is
- * only one input.
- */
- public String subtract(String a, String b) {
- BigInteger ans = new BigInteger(a);
- ans = ans.subtract(new BigInteger(b));
- return ans.toString();
- }
-
- public double[][] minvert(double a[][]) {
- int n = a.length;
- double x[][] = new double[n][n];
- double b[][] = new double[n][n];
- int index[] = new int[n];
- for (int i = 0; i < n; ++i) {
- b[i][i] = 1;
- }
- // Transform the matrix into an upper triangle
- gaussian(a, index);
- // Update the matrix b[i][j] with the ratios stored
- for (int i = 0; i < n - 1; ++i) {
- for (int j = i + 1; j < n; ++j) {
- for (int k = 0; k < n; ++k) {
- b[index[j]][k]
- -= a[index[j]][i] * b[index[i]][k];
- }
- }
- }
- // Perform backward substitutions
- for (int i = 0; i < n; ++i) {
- x[n - 1][i] = b[index[n - 1]][i] / a[index[n - 1]][n - 1];
- for (int j = n - 2; j >= 0; --j) {
- x[j][i] = b[index[j]][i];
- for (int k = j + 1; k < n; ++k) {
- x[j][i] -= a[index[j]][k] * x[k][i];
- }
- x[j][i] /= a[index[j]][j];
- }
- }
- return x;
- }
-
- // Method to carry out the partial-pivoting Gaussian
- // elimination. Here index[] stores pivoting order.
- private void gaussian(double a[][], int index[]) {
- int n = index.length;
- double c[] = new double[n];
- // Initialize the index
- for (int i = 0; i < n; ++i) {
- index[i] = i;
- }
- // Find the rescaling factors, one from each row
- for (int i = 0; i < n; ++i) {
- double c1 = 0;
- for (int j = 0; j < n; ++j) {
- double c0 = Math.abs(a[i][j]);
- if (c0 > c1) {
- c1 = c0;
- }
- }
- c[i] = c1;
- }
-
- // Search the pivoting element from each column
- int k = 0;
- for (int j = 0; j < n - 1; ++j) {
- double pi1 = 0;
- for (int i = j; i < n; ++i) {
- double pi0 = Math.abs(a[index[i]][j]);
- pi0 /= c[index[i]];
- if (pi0 > pi1) {
- pi1 = pi0;
- k = i;
- }
- }
-
- // Interchange rows according to the pivoting order
- int itmp = index[j];
- index[j] = index[k];
- index[k] = itmp;
- for (int i = j + 1; i < n; ++i) {
- double pj = a[index[i]][j] / a[index[j]][j];
- // Record pivoting ratios below the diagonal
- a[index[i]][j] = pj;
- // Modify other elements accordingly
- for (int l = j + 1; l < n; ++l) {
- a[index[i]][l] -= pj * a[index[j]][l];
- }
- }
- }
- }
-
- /**
- * Get all prime factors of input number.
- *
- * @param n An integer number.
- * @return Array of primes.
- *
- * Thanks to
- * http://www.javacodegeeks.com/2014/05/how-to-find-prime-factors-of-integer-numbers-in-java-factorization.html
- * and http://stackoverflow.com/a/2451219/2534036
- */
- public long[] factor(long n) {
- long i;
- Set primes = new HashSet<>();
- long copyOfInput = n;
-
- for (i = 2; i <= copyOfInput; i++) {
- if (copyOfInput % i == 0) {
- primes.add(i); // prime factor
- copyOfInput /= i;
- i--;
- }
- }
- long[] a = new long[primes.size()];
- int j = 0;
- for (Object val : primes) {
- a[j++] = (long) val;
- }
- return a;
- }
-
- public boolean isprime(long n) {
- int i = 2;
- while (i <= sqrt(n)) {
- if (n % i == 0) {
- return false;
- }
- i++;
- }
- return true;
- }
-
- public boolean isprime(String nn) {
- BigInteger n = new BigInteger(nn);
- BigInteger i = new BigInteger("2");
- BigInteger ns = bigIntSqRootCeil(n);
- while (i.compareTo(ns) <= 0) {
- if (n.mod(i).toString().equals("0")) {
- return false;
- }
- i = i.add(BigInteger.ONE);
- }
- return true;
- }
-
- /**
- * Thanks to http://stackoverflow.com/a/11962756/2534036
- *
- * @param x
- * @return
- * @throws IllegalArgumentException
- */
- private BigInteger bigIntSqRootCeil(BigInteger x) throws IllegalArgumentException {
- if (x.compareTo(BigInteger.ZERO) < 0) {
- throw new IllegalArgumentException("Negative argument.");
- }
- // square roots of 0 and 1 are trivial and
- // y == 0 will cause a divide-by-zero exception
- if (x == BigInteger.ZERO || x == BigInteger.ONE) {
- return x;
- } // end if
- BigInteger two = BigInteger.valueOf(2L);
- BigInteger y;
- // starting with y = x / 2 avoids magnitude issues with x squared
- for (y = x.divide(two); y.compareTo(x.divide(y)) > 0; y = ((x.divide(y)).add(y)).divide(two)) {
- }
- if (x.compareTo(y.multiply(y)) == 0) {
- return y;
- } else {
- return y.add(BigInteger.ONE);
- }
-
- } // end bigIntSqRootCeil
-
- /**
- * Get all unique permutations of the given array.
- *
- * @param objs Array of items.
- * @return Matrix
- */
- public Object[] perms(Object... objs) {
- Permutations