forked from robol/MPSolve
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
87 lines (64 loc) · 2.31 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
MPSOLVE 3.1.5
=============
MPSolve is a C package to solve polynomials and secular equations. It released under the terms
of the GNU General public license as it specified in the COPYING file inside the source directory.
### How to install MPSolve
If you have downloaded an official MPSolve tarball you can
install MPSolve simply by typing these commands in a shell:
./configure
make
[sudo] make install
whilst, if you have checked out the git repository directly
you have to use the script `autogen.sh` first, and then the
usual `configure`, `make`, `make install` sequence.
The last command is optional and install mpsolve system-wide. You can simply
use the mpsolve executable built in its directory by launching
`./src/mpsolve/mpsolve` from the source directory.
Full install is needed to use MPSolve as a library in other C,
FORTRAN, Matlab, ... software without further tweaking.
The `examples/` folder contains a mix of example source files that use
MPSolve and bindings for other programming languages such as Python,
Octave, Matlab (TM), ...
### Using the mpsolve binary
The mpsolve binary is thought as a simple way to solve polynomials
and/or secular equation using a text file as input. A generic
input file for mpsolve is composed by a preamble and
a body. The comments are identified by lines starting with '!'.
In the preamble will be specified all the options for solving
and some general information about the polynomial.
The body will contain the coefficients.
Every option in the preamble has to be specified as Key; or Key=value;
This is an example of a valid input for mpsolve that specifies
the polynomial x^5 - 1
! File: nroots5.pol
Degree=5;
Monomial;
Real;
Integer;
-1
0
0
0
0
1
! EOF
The same polynomial can be specified by using sparse notation:
! File nroots5sparse.pol
Degree=5;
Monomial;
Real;
Integer;
Sparse;
5 1 ! Highest degree coefficient
0 -1 ! Coefficient of degree 0
! EOF
If the `Real` option is not specified real and imaginary part of the coefficients
will be needed as input. Rational input is also used in here:
! File: random-poly.pol
Degree=3;
Monomial;
Rational;
45/9 7/4
3/23 293/34234
234/2369234 2348234/324
324 234324/23