Solving for X the equation
2
aX + bX + c = 0 where a, b,c are inputs of the program
using iterative Newton method.
Delta = b*b - 4ac
X0 = Delta/2
n>= 0 Xn+1 = Xn*Xn + Delta / 2 Xn
stop when | X(n-1) -X(n) | < epsilon
It is not a reactive program.
- graphical version: equationSolving.gpk
- textual version : equationSolving.SIG
Use one of the following compiling command
with C code production
(1) signal -tra -c equationSolving.SIG
with Cluster and C code production
(2) signal -tra -c -clu equationSolving.SIG
with Cluster and C code production with threads (results in the directory Threads)
(3) signal -tra -c -threads equationSolving.SIG -d=Threads
- With input data files: Goto the equationSolving subdirectory
- The data files are Ra.dat (values for a), Rb.dat (values for b) and Rc.dat (values for c)
- (optional) Makefile generating: genMake C equationSolving
- Production of the binary: make
- execution: equationSolving
- results in files: Woc.dat (no solution or infinite solution), Wx1.dat (first solution), Wx2.dat (second solution when it exists). The waited results are in files: Woc.ok Wx1.ok Wx2.ok
- Graphical:
- Using Motif (linux, solaris).
- You must add -d=MotifSimu in the compiling command, then go to the MotifSimu subdirectory. (ie: signal -tra -c equationSolving.SIG -d=MotifSimu).
- The graphical features are defined in the following files: vtequationSolving.c, gest_fen_m.c, ioequationSolving_m.c
- Production of the binary: make
- execution: vtequationsolving
- Using Java (awt+Swing)
- you must add -d=JavaSimu in the compiling command, then go to the JavaSimu subdirectory. (ie: signal -tra -c equationSolving.SIG -d=JavaSimu)
- Execute the command: make Then, follow the instructions generated by this command.
- The simulation uses the following (graphical descriptions) files:button.txt checkbox.txt frame.txt label.txt panel.txt textarea.txt. The interface C/java is defined in the file equationSolving_javaC.c
- input data files: Goto the equationSolving subdirectory
- Ra.dat: values for a
- Rb.dat: values for b
- Rc.dat: values for c
- Production of the binary: make threads
- execution: equationSolving
- results in files: Woc.dat (no solution or infinite solution), Wx1.dat (first solution), Wx2.dat (second solution when it exists). The waited results are in the files: Woc.ok, Wx1.ok, Wx2.ok.
If the Makefile file does not exist, use the cmake command. For example, in the directory Threads, execute the command
(cmake takes the CMakeLists.txt file as input description).