Coder Social home page Coder Social logo

robol / mpsolve Goto Github PK

View Code? Open in Web Editor NEW
35.0 5.0 15.0 24.04 MB

Multiprecision Polynomial Solver

License: GNU General Public License v3.0

Shell 0.25% C 18.85% C++ 1.98% QML 0.11% QMake 0.06% Makefile 0.32% Lex 0.04% Yacc 0.10% M4 1.06% Python 0.20% Roff 0.07% Sage 0.07% ReScript 76.88%

mpsolve's People

Contributors

aecoleman avatar akobel avatar d-torrance avatar davidtoneian avatar jamesjer avatar robol avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

mpsolve's Issues

Memory leak fix

Hello,

I used MPSolve as a C library, and valgrind reported me memory leaks coming from MPSolve. You can reproduce the bug with the example roots_of_unity.c.

Here is a patch:

---
 MPSolve/src/libmps/floating-point/mpc.c  | 1 +
 MPSolve/src/libmps/secsolve/secular-ga.c | 6 ++++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/MPSolve/src/libmps/floating-point/mpc.c b/MPSolve/src/libmps/floating-point/mpc.c
index 8f017bf..51c21e4 100644
--- a/MPSolve/src/libmps/floating-point/mpc.c
+++ b/MPSolve/src/libmps/floating-point/mpc.c
@@ -36,6 +36,7 @@ mps_mpc_cache_cleanup (void * pointer)
   for (i = 0; i < MPS_MPF_TEMP_SIZE; i++)
     mpf_clear (ptr->data[i]);
 
+  free(ptr->data);
   free (ptr);
 }
 
diff --git a/MPSolve/src/libmps/secsolve/secular-ga.c b/MPSolve/src/libmps/secsolve/secular-ga.c
index 3155dd4..aabc699 100644
--- a/MPSolve/src/libmps/secsolve/secular-ga.c
+++ b/MPSolve/src/libmps/secsolve/secular-ga.c
@@ -637,7 +637,8 @@ cleanup:
       mps_improve (s);
 
 #ifdef NICE_DEBUG
-      MPS_DEBUG (s, "mps_improve took %lu ms", mps_stop_timer (my_timer));
+      long improve_time = mps_stop_timer(my_timer);
+      MPS_DEBUG (s, "mps_improve took %lu ms", improve_time);
 #endif
     }
 
@@ -646,6 +647,7 @@ cleanup:
 
   /* Debug total time taken but only if debug is enabled */
 #ifndef DISABLE_DEBUG
+  long tot_time = mps_stop_timer(total_clock);
   if (s->debug_level & MPS_DEBUG_TIMINGS)
     {
       MPS_DEBUG (s, "Time used for regeneration: %ld ms",
@@ -657,7 +659,7 @@ cleanup:
       MPS_DEBUG (s, "Time used in multiprecision iterations: %ld ms",
                  s->mp_iteration_time);
       MPS_DEBUG (s, "Total time using MPSolve: %ld ms",
-                 mps_stop_timer (total_clock));
+                 tot_time);
     }
 #endif
 }
-- 
2.20.1

Memory leaks

Thank you for creating the library.

I am testing pre-built Windows DLLs distributed from mpsolve homepage.

If I run following simple code, memory consumption of the process grows very fast and never drops:

for(int i = 0; i <= 4000000; i++)
{
       mps_context* s = mps_context_new();
       mps_context_free (s);
}

Eventually process gets all available memory and hangs. I guess some memory buffers are not released back to the system.
Could you please confirm?

insatlling:

Hi
I try to compile mpsolve ( from git repo)
so:
make

/bin/bash ./config.status --recheck
running CONFIG_SHELL=/bin/bash /bin/bash ./configure --no-create --no-recursion
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking how to print strings... printf
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @file support... @
checking for strip... strip
checking for ranlib... ranlib
checking for gawk... no
checking for mawk... mawk
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for mt... mt
checking if mt is a manifest tool... no
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking whether make sets $(MAKE)... yes
checking for style of include used by make... GNU
checking whether make supports nested variables... yes
checking dependency style of gcc... gcc3
checking whether make supports nested variables... (cached) yes
checking for gfortran... gfortran
checking whether we are using the GNU Fortran compiler... yes
checking whether gfortran accepts -g... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for gfortran option to produce PIC... -fPIC
checking if gfortran PIC flag -fPIC works... yes
checking if gfortran static flag -static works... yes
checking if gfortran supports -c -o file.o... yes
checking if gfortran supports -c -o file.o... (cached) yes
checking whether the gfortran linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... (cached) GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking whether gcc understands -c and -o together... (cached) yes
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking how to run the C++ preprocessor... g++ -E
checking for ld used by g++... /usr/bin/ld -m elf_x86_64
checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC -DPIC
checking if g++ PIC flag -fPIC -DPIC works... yes
checking if g++ static flag -static works... yes
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... (cached) GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking dependency style of g++... gcc3
checking for gcc option to accept ISO C99... none needed
checking for bison... no
checking for byacc... byacc
checking for flex... flex
checking lex output file root... lex.yy
checking lex library... -lfl
checking whether yytext is a pointer... yes
checking for inline... inline
checking whether C compiler accepts -fcx-limited-range... yes
checking whether C compiler accepts -fno-math-errno... yes
checking whether C compiler accepts -fomit-frame-pointer... yes
checking for stdbool.h that conforms to C99... yes
checking for _Bool... yes
checking for size_t... yes
checking for error_at_line... yes
checking for memset... yes
checking for modf... yes
checking for pow... no
checking for sqrt... no
checking for strchr... yes
checking for Win32 platform... no
checking for attribute((visibility("hidden")))... yes
checking for the pthreads library -lpthreads... no
checking whether pthreads work without any flags... no
checking whether pthreads work with -Kthread... no
checking whether pthreads work with -kthread... no
checking for the pthreads library -llthread... no
checking whether pthreads work with -pthread... yes
checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE
checking if more special flags are required for pthreads... no
checking whether to check for GCC pthread/shared inconsistencies... yes
checking whether -pthread is sufficient with -shared... yes
checking whether what we have so far is sufficient with -nostdlib... yes
checking if sysconf(_SC_NPROCESSORS_ONLN) is supported... yes
checking for malloc in -ltcmalloc_minimal... no
checking for snprintf... yes
checking for vsnprintf... yes
checking for working snprintf... yes
checking for working vsnprintf... yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking for unistd.h... (cached) yes
checking for getline... yes
checking for strndup... yes
checking if C99 complex.h is supported from the C++ compiler... no
checking for pow in -lm... yes
checking for __gmpz_init2 in -lgmp... yes
checking for main in -lgmpxx... yes
checking gmp.h usability... yes
checking gmp.h presence... yes
checking for gmp.h... yes
checking for mpfr_init in -lmpfr... yes
checking mpfr.h usability... yes
checking mpfr.h presence... yes
checking for mpfr.h... yes
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for CHECK... no
checking for GTK... yes
checking for CAIRO... yes
checking for QT4... yes
checking for QT5... no
checking for uic-qt4... uic-qt4
checking for moc-qt4... moc-qt4
checking for rcc-qt4... no
checking for rcc... rcc
checking for mkoctfile... no
checking for octave... no
checking for a valid mex compiler...
checking for a Python interpreter with version >= 2.3... python
checking for python... /usr/bin/python
checking for python version... 2.7
checking for python platform... linux2
checking for python script directory... ${prefix}/lib/python2.7/dist-packages
checking for python extension module directory... ${exec_prefix}/lib/python2.7/dist-packages
checking for python2.7-config... no
checking for python-config... no
configure: WARNING: cannot find python-config for /usr/bin/python.
checking for doxygen... no
configure: WARNING: Doxygen not found, documentation will not be generated
checking that generated files are newer than configure... done
configure: creating ./config.status

MPSolve configuration:

    Source location:	.
Pthread CFLAGS:		-pthread
    C compiler:		gcc
CFLAGS:			-D_REENTRANT -Wall -DMPS_USE_BUILTIN_COMPLEX  -DNICE_DEBUG -fcx-limited-range -fno-math-errno -fomit-frame-pointer -D_MPS_PRIVATE
    LDFLAGS:                 
Additional CFLAGS:	-g -O2
    Debug enabled:		yes
    Check enabled:		no
Octave module:		no
MATLAB (tm) module:	no
Graphical UI:		yes
Python module:          no

Type 'make' to compile MPSolve, and then make install
to install the binaries, the library and the headers
system-wide.

/bin/bash ./config.status
config.status: creating Makefile
config.status: creating include/Makefile
config.status: creating include/mps/Makefile
config.status: creating include/mps/private/Makefile
config.status: creating examples/Makefile
config.status: creating examples/fortran/Makefile
config.status: creating examples/octave/Makefile
config.status: creating examples/matlab/Makefile
config.status: creating examples/gtk/Makefile
config.status: creating examples/python/Makefile
config.status: creating examples/python/tests/Makefile
config.status: creating examples/mandelbrot-solver/Makefile
config.status: creating examples/mandelbrot-solver/mandelbrot-solver.1
config.status: creating examples/quadratic-solver/Makefile
config.status: creating examples/quadratic-solver/quadratic-solver.1
config.status: creating include/mps/mt.h
config.status: creating src/Makefile
config.status: creating src/mpsolve/Makefile
config.status: creating src/mpsolve/mpsolve.1
config.status: creating src/libmps/Makefile
config.status: creating src/tests/Makefile
config.status: creating src/xmpsolve/Makefile
config.status: creating src/xmpsolve/xmpsolve.desktop
config.status: creating src/xmpsolve/xmpsolve.1
config.status: creating doc/Makefile
config.status: creating doc/Doxyfile
config.status: creating mime/Makefile
config.status: creating config.h
config.status: executing libtool commands
config.status: executing depfiles commands
make all-recursive
make[1]: Wejście do katalogu '/home/a/MPSolve'
Making all in include
make[2]: Wejście do katalogu '/home/a/MPSolve/include'
Making all in mps
make[3]: Wejście do katalogu '/home/a/MPSolve/include/mps'
Making all in private
make[4]: Wejście do katalogu '/home/a/MPSolve/include/mps/private'
make[4]: Nie ma nic do zrobienia w 'all'.
make[4]: Opuszczenie katalogu '/home/a/MPSolve/include/mps/private'
make[4]: Wejście do katalogu '/home/a/MPSolve/include/mps'
make[4]: Nie ma nic do zrobienia w 'all-am'.
make[4]: Opuszczenie katalogu '/home/a/MPSolve/include/mps'
make[3]: Opuszczenie katalogu '/home/a/MPSolve/include/mps'
make[3]: Wejście do katalogu '/home/a/MPSolve/include'
make[3]: Nie ma nic do zrobienia w 'all-am'.
make[3]: Opuszczenie katalogu '/home/a/MPSolve/include'
make[2]: Opuszczenie katalogu '/home/a/MPSolve/include'
Making all in src
make[2]: Wejście do katalogu '/home/a/MPSolve/src'
Making all in libmps
make[3]: Wejście do katalogu '/home/a/MPSolve/src/libmps'
YACC monomial/yacc-parser.c
byacc: e - line 6 of "/home/a/MPSolve/src/libmps/monomial/yacc-parser.y", syntax error
%debug
^
Makefile:1900: polecenia dla obiektu 'monomial/yacc-parser.c' nie powiodły się
make[3]: *** [monomial/yacc-parser.c] Błąd 1
make[3]: Opuszczenie katalogu '/home/a/MPSolve/src/libmps'
Makefile:429: polecenia dla obiektu 'all-recursive' nie powiodły się
make[2]: *** [all-recursive] Błąd 1
make[2]: Opuszczenie katalogu '/home/a/MPSolve/src'
Makefile:486: polecenia dla obiektu 'all-recursive' nie powiodły się
make[1]: *** [all-recursive] Błąd 1
make[1]: Opuszczenie katalogu '/home/a/MPSolve'
Makefile:418: polecenia dla obiektu 'all' nie powiodły się
make: *** [all] Błąd 2

What should I do ?

~/MPSolve/examples/C

Hi,

I have Ubuntu 16.04 LTS
After :

git clone git://github.com/robol/MPSolve.git
Cloning into 'MPSolve'...
remote: Counting objects: 14647, done.
remote: Total 14647 (delta 0), reused 0 (delta 0), pack-reused 14647
Receiving objects: 100% (14647/14647), 23.56 MiB | 1.40 MiB/s, done.
Resolving deltas: 100% (11281/11281), done.
Checking connectivity... done.

Now in :
~/MPSolve/examples/C$ make

gives errror :

gcc -o mandelbrot mandelbrot.c -I../../include -DNOMPTEMP -g -O0 -lmps -lm -lgmp -lpthread -L../../src/libmps/.libs -static
In file included from mandelbrot.c:30:0:
../../include/mps/mps.h:64:20: fatal error: mps/mt.h: Nie ma takiego pliku ani katalogu
compilation terminated.
Makefile:8: polecenia dla obiektu 'mandelbrot' nie powiodły się
make: *** [mandelbrot] Błąd 1

No such file

Adam

octave_support.h missing in 3.2.1 release tarball at numpi.dm.unipi.it

Hi,
not quite an issue concerning this repo, but: The file octave_support.h is missing in the other official source for release tarballs, linked from the Uni of Pisa under https://numpi.dm.unipi.it/_media/software/mpsolve/mpsolve-3.2.1.tar.bz2.
This breaks compilation of the octave bindings. The upstream version of the file works as expected.

Other silent differences that don't break compilation: some examples (not sure if that's intended; probably not, as other examples are included) and some test polynomials (probably intended, as those are the huge ones).

Documentation for the -s option

I couldn't find documentation for the -s option of the binary (what kind of file is expected, etc.).
Could you point me to something ?

The isnan() macro defined in include/mps/types.h breaks the build on FreeBSD 14

libtool: compile:  cc -DHAVE_CONFIG_H -I. -I../.. -I../../include -I../../include -D_REENTRANT -Wall -DMPS_USE_BUILTIN_COMPLEX -DNICE_DEBUG -fno-math-errno -fomit-frame-pointer -D_MPS_PRIVATE -D_THREAD_SAFE -pthread -isystem /usr/local/include -O2 -pipe -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -MT common/parser.lo -MD -MP -MF common/.deps/parser.Tpo -c common/parser.c  -fPIC -DPIC -o common/.libs/parser.o
In file included from common/nroots-polynomial.cpp:11:
In file included from ../../include/mps/mps.h:99:
In file included from ../../include/mps/private/system/memory-file-stream.h:50:
In file included from /usr/include/c++/v1/iostream:43:
In file included from /usr/include/c++/v1/ios:221:
In file included from /usr/include/c++/v1/__locale:18:
In file included from /usr/include/c++/v1/mutex:191:
In file included from /usr/include/c++/v1/__memory/shared_ptr.h:42:
In file included from /usr/include/c++/v1/atomic:2669:
/usr/include/c++/v1/cmath:587:17: error: expected unqualified-id
    return std::isnan(__lcpp_x);
                ^
../../include/mps/types.h:27:3: note: expanded from macro 'isnan'
  (sizeof(x) == sizeof(long double) ? isnan_ld (x) \
  ^

You assume that isnan() has to be a macro or otherwise isnan() isn't defined. But isnan() can be a function too.

Please consider using std::isnan instead.

Possible memory leak

A memory leak has been reported at the end of the discussion in Issue #23. It seems less severe than the first one reported in that issues (which has been solved).

monomial/monomial-parser.c:276: off by one error ?

Static analyser cppcheck says:

monomial/monomial-parser.c:276:18: error: Width 3 given in format string (no. 1) is larger than destination buffer 'data_type[3]', use %2s to prevent overflowing it. [invalidScanfFormatWidth]

Source code is

if (!token || !sscanf (token, "%3s", data_type))

Problem with installing MPsolve for Matlab

I am using MacBook Pro and after entering "./configure" on terminal, I receive the following summary:
MPSolve configuration:

    Source location:	.
Pthread CFLAGS:		-D_THREAD_SAFE 
    C compiler:		gcc
CFLAGS:			-D_REENTRANT -Wall -DMPS_USE_BUILTIN_COMPLEX  -DNICE_DEBUG -fno-math-errno -fomit-frame-pointer -D_MPS_PRIVATE
    LDFLAGS:                 -L/usr/local/opt/gmp/lib -lgmp 
Additional CFLAGS:	-I/usr/local/opt/gmp/ -g -O2
    Debug enabled:		yes
    Check enabled:		no
Octave module:		no
MATLAB (tm) module:	yes (generates examples/matlab/mpsolve-toolbox.tar.gz)
Graphical UI:		no
Python module:          yes

Type 'make' to compile MPSolve, and then make install
to install the binaries, the library and the headers
system-wide.

As you can see I have: MATLAB (tm) module: yes
But then we I enter "make" in the terminal I receive the following error regarding gmp.h file.

Making all in matlab
clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated]
In file included from /Users/mahradvaghefi/Desktop/mpsolve-3.2.1/examples/matlab/mps_roots_string.c:2:
In file included from /Users/mahradvaghefi/Desktop/mpsolve-3.2.1/examples/matlab/mps_option_parser.h:2:
In file included from ../../include/mps/mps.h:65:
../../include/mps/gmptools.h:18:10: fatal error: 'gmp.h' file not found
#include <gmp.h>
^~~~~~~
1 error generated.

Python example expects a "libmps.so.3"

Downloaded and installed MPSolve 3.1.7 per the directions in the README. (including the optional 'sudo make install'). However, trying to import the mpsolve python module in the examples folder raises an error. In Python 2.7.15 and 3.6.7 the errors are respectively:

Python 2.7.15rc1 (default, Nov 12 2018, 14:31:15) 
[GCC 7.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import mpsolve
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "mpsolve.py", line 8, in <module>
    _mps = ctypes.CDLL("libmps.so.3")
  File "/usr/lib/python2.7/ctypes/__init__.py", line 366, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: libmps.so.3: cannot open shared object file: No such file or directory

Python 3.6.7 (default, Oct 22 2018, 11:32:17) 
[GCC 8.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import mpsolve
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/moon/mpsolve-3.1.7/examples/python/mpsolve.py", line 8, in <module>
    _mps = ctypes.CDLL("libmps.so.3")
  File "/usr/lib/python3.6/ctypes/__init__.py", line 348, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: libmps.so.3: cannot open shared object file: No such file or directory
>>> 

It seems like it expects a "libmps.so.3" file that isn't included in the directory. I looked into the libmps directory and couldn't find anything that looked promising. Perhaps there's a dependency that I'm missing?

Support thread affinity

This is feature request/suggestion.

In order to improve multi-threading, it would be very nice to bind threads to particular (hardware) CPU code.
For example, thread 0 runs on core 0, thread 1 on core 2 (to skip the logical core), so on.
This would allow to skip the inefficient/logical cores and bolster up the performance.

Most importantly, it would allow to assign different sets of CPU cores to different processes which use MPSolve. Now, if we run several processes with MPSolve - we see heavy collision, threads are fighting for the same CPU cores.

The OpenMP has KMP_AFFINITY, OMP_PLACES and OMP_PROC_BIND. The pthreads provides similar functionality for threads affinity control: https://stackoverflow.com/questions/25472441/pthread-affinity-before-create-threads

Overall it would be absolutely the best, if MPSolve would give end-user fine control over thread management. Most important settings to support are:
(a) How many threads to use.
(b) What threads run of what cores (e.g. user can provide map threadID -> coreID).

There is a function mps_thread_pool_set_concurrency_limit (it controls the number of threads to use) but currently it is not part of public interface for libmps library. So that question (a) is answered to some degree.

Would it be possible to add thread map parameter to the function to resolve question (b)?

Note.
OpenMP allows setting thread affinity by environment variables. Unfortunately pthreads doesn't allow this and thread affinity control must be implemented in each end-user software.

How to stop MPSolve iterations prematurely if any of converged roots have large magnitude

This is not a bug or issue report, but cry for help.

I use MPSolve to find roots for a huge number of different polynomials - to select those polynomials with roots magnitude less than some threshold (|z| < T for all roots z).

To speed-up the search, I would like MPSolve to stop internal Ehrich-Aberth iterations as soon as at least one root |z| > T. So that such polynomials is quickly skipped.

I really need your help on how to implement this properly with MPSolve.

MPSolve stops iterations based on conditions are checked in mps_check_stop - it checks various combinations of root statuses and inclusion properties of the root.

Could you please advise what combinations of root status and inclusion indicate that root value is already reliable (won't change much) so that we can check if |z| < T?

I included following code to mps_check_stop :

for (i = 0; i < s->n; i++)
{
    if(MPS_ROOT_STATUS_IS_COMPUTED(s->root[i]->status))
    {
          if(s->lastphase == float_phase)
          {
                double r = hypot(cplx_Re(s->root[i]->fvalue),cplx_Im(s->root[i]->fvalue));
                if(r > threshold)
                {
                    return true; /* return 'true' to stop further iterations */
                }
          }
          else if(s->lastphase == dpe_phase)
          {
                double r = hypot(rdpe_get_d(cdpe_Re(s->root[i]->dvalue)),rdpe_get_d(cdpe_Im(s->root[i]->dvalue)));
                if(r > threshold)
                {
                    return true; /* return 'true' to stop further iterations */
                }
          }
          else if(s->lastphase == mp_phase)
          {
                double r = hypot(mpf_get_d(mpc_Re(s->root[i]->mvalue)),mpf_get_d(mpc_Im(s->root[i]->mvalue)));
                if(r > threshold)
                {
                    return true; /* return 'true' to stop further iterations */
                }
          }
    }
}

I use MPS_OUTPUT_GOAL_APPROXIMATE in mps_context_set_output_goal.
Should I include any other conditions, e.g. s->root[i]->inclusion == MPS_ROOT_INCLUSION_OUT?

mpsolve runs forever and other issues

If you divide the Mandelbrot polynomial of degree 255 by x^3+2x^2+x+1 and call mpsolve with 30 digits and goal approximate, it runs forever. This is a polynomial of degree 252 (I paste the coefficients at the end of this message).

I have another issue trying to integrate mps in giac/xcas: for the same polynomial, with
mps_context_select_algorithm(s, MPS_ALGORITHM_SECULAR_GA);
mps_context_set_output_goal (s, MPS_OUTPUT_GOAL_APPROXIMATE);
mps_context_set_output_prec (s, nmps);
after a call to mps_mpsolve and mps_context_get_roots_m (s, &mroot, &drad), I don't understand what's in drad. I was expecting to get for each root a radius of a circle containing the root. But here for a radius of about 1e-50, I get some roots near -2 with a small imaginary part of about 1e-20 instead of a real root and that should not happen with a radius of 1e-50.
Is this a bug or did I miss something about radius using the secular algorithm?
If you want to reproduce this, you can compile this source file https://www-fourier.univ-grenoble-alpes.fr/~parisse/giac/mps.cc (see first line for compilation command, it requires installing giac). Then run ./a.out -1e-30 bug1 where bug1 contains
quo(x*(x*(x*(x*(x*(x*(x*(x+1)^2+1)^2+1)^2+1)^2+1)^2+1)^2+1)^2+1,x^3+2x^2+x+1)

The file content that runs forever with mpsolve:
!mand252 dri 0 252 1 0 0 4 10 24 84 287 951 2997 9178 27687 82556 243856 714585 2078280 5998812 17186929 48889915 138114909 387573696 1080521975 2993201892 8239628896 22541699645 61292110635 165648278291 444993617790 1188285124297 3154274100432 8323365625136 21833611738404 56935515935122 147595804188348 380362965100104 974440000395468 2481664860255580 6282905072767168 15812679064764308 39561848766736998 98394972185596230 243273059572206654 597915751348686360 1460869301670406434 3548207176726510040 8567100294413053988 20563028996235601018 49064758617351911624 116381070793653314652 274426190054250116886 643278853540344137698 1499004645324515350418 3472446557055584539388 7996415371966954046646 18305431438069836678640 41656854387498307358540 94234787788137846291862 211909348279228052595706 473694408447088023970366 1052568436777891016642880 2324879849307308568372858 5104373412871346915808664 11139593594723103421807956 24164291696373902576228079 52101361251502337612586455 111657134497566931483282397 237836287050758287757045146 503518607597445726740390027 1059473209511917069577151200 2215605877396961021904587692 4604833195011426627081136241 9511406079677090136143201629 19524292560534994911294803489 39828666195714780201575631656 80741344554785614084215406545 162654321296352348418309695770 325607251868991308438695497716 647695000342969277990806348415 1280218095487171279512895725391 2514334119407674328680750090605 4906547729325343987449558428786 9513300235029901414552242909369 18326365856000555025898036806830 35075108112717763787986035486546 66693950162339297877753829361697 125986945792112781492786055959413 236430200489990810033586740088743 440762802678721850309427744481370 816239227408104249760060532941083 1501502833203250348314778683413170 2743571645769631576905706605080238 4979352399564455747309950378859435 8975950305969162888779027374232439 16070274849360973974171589345200181 28574943948058539844782894214411474 50460351882391902777145303908769815 88491430062273438773224457455735988 154106554106558018808628911662075624 266497125222998608198876904259564737 457612308230538279464774415066091383 780222557140420530555521163538941655 1320798271021936842861451168771318418 2219897253784442894648596076598855449 3704149579364669331851947285419450584 6135980096438938374271231438934380636 10090189738586806610215270842667263427 16470793417469467146156999038941575389 26687567124836072364485447111202351609 42920211312746756712924764297244660154 68509671385517768691813113597656171623 108531918568469339361867098170543383500 170630499708668247646002106744408794304 266211660290453711659915011840192245545 412141140152976240831705460749674927875 633126077448923740702730747212620231227 965019801895808101096986796997676673070 1459352049289286853554462196910618918281 2189461698425262159196377285271385508048 3258691420167757295307214984244810539408 4811189386004281545551759667455149890159 7045945286624262283317492984912936708977 10234755621571758337718405959614452418385 14744851525146655066976723485413485796734 21066911571041400838292594348647234121407 29849097615744059462040080929973174808340 41937565309697394435466159544820640095888 58423581459647121219861700040286018103369 80696897271874610222108063833711695650600 110504353330505868194360806075008413879652 150011812562140623631032740157586686745709 201866431716627526975994762123160572873703 269255014741534243112846920387757736481453 355952799665216303368853083523639507499732 466355609884295823542401076982592755326447 605486989712979049861639782587542436034500 778970924164994812225987862717338349231468 992960232256249044288638894609457990218473 1254010962349185517981797548800874234152327 1568894348038134604696840832284788849651059 1944340313672929563141574442454321621763242 2386710290672834954953397085977977800633857 2901602249256742702698508321056317389867072 3493397243661753232136370564641630349556516 4164764106885675529102483916680275361210701 4916146706938452485689227422872436559091959 5745265688926011316234248235338146899395559 6646673014599327402739073324354174299577942 7611401919759035009417310651827971353292641 8626756193531784019789975797989662117949492 9676280126159359510481949090451819102353388 10739943524440086993522417207277279950340731 11794564704560525358218193823205615751852109 12814478690342378203474111362657013469931881 13772438877482642666057306163746586010020922 14640719623275077467595656789322406890180247 15392366493912262499347909569570063252574772 16002522440229883064693703353424939153958612 16449744216963849787487715510633821849316669 16717215915016696508994823990450549525819271 16793767022807396063419059642469257036652437 16674611678186333232869898974123146893204380 16361743474512920859610314087668548493599727 15863945093374811555840349881787634380906636 15196401970917802214929286944395133884790262 14379941265884801536300026689911532571395355 13439948297574846795950205869821236588392709 12405039087829422319915699449425864238072415 11305586834509163355372467684736208055745736 10172210036085060411249893234190321458299277 9034329629688998834924043552120455147976428 7918892153562551921061175965494488812793954 6849337013239235867233927357869224189428657 5844860785148600946876696803264015192296783 4920003115154670564630896735320654644310237 4084550353907705318885119678802977853401972 3343727594225425277533054113253696508939271 2698629637235855342862390144179816766071612 2146828173097010404173407996719291117064474 1683086715798839359171013339740594019716983 1300116237494349277850941700541143038440913 989311875821176731310991531503371283468055 741422863731658926007266314555818873981696 547122026447575846373793891040784678962081 397455904810095142175278005495070635152144 284170166302694560853979356547707370671742 199916251641761881900299277117488709271601 138353477114239217880573624021811438092899 94165866155856297665370993828102931944525 63015031255763103626146403954243449841628 41449981596817406352863029236795976050759 26792470274130960217049521279520647381876 17013133556865718415732497168082789993824 10609867226949952265604580990783166251677 6496156256555611630882019714991270209475 3903788548934274879571139876062442345707 2301745351369922604628254042492184829078 1331136136949366126323009384998158884233 754796472288282538407626162307449889512 419490453862031076228895689057869476608 228421063935254070651639502950385721547 121815664156547193963675767630192072421 63598640934015290584853045258001358557 32492893522631783380974164449208643134 16238125637316785478936785617492790923 7934032971656751534902163622643995788 3788422497234760313630595571052249392 1766918012141675347561528176023375821 804537498221816965451998777722152443 357451274396562064956122658978546995 154876901626909507886996442696987714 65403861944406301400261264649916781 26903150172348840705009446188965108 10772325932769008315078742291805792 4195973050453187491171293392288315 1588797906223844547503851274109361 584383407679091465847149601082241 208633583083104706674446086650354 72239316450388827526592199125963 24237771243762962689100556581488 7873121699317727136423739719320 2473541944423162834122334731229 750875002985972525980816143523 220000191260424917675928877771 62142246279022242430515094750 16901619952372627556503545473 4420593332141187339484265120 1110293065896595516798729744 267392905433875417733776055 61648022056008527270618745 13582916117819981462926233 2854684982536065044694110 571126909604570193624159 108531611296180592029884 19542488870688729646552 3325460310307654860529 533213823047865269939 80300708407938706483 11317031962306706582 1486526260201046545 181149002760529256 20371911509824784 2101421454112735 197416860698809 16748342652361 1270113848134 85022516111 4944696540 244703088 10016937 325563 7875 126 1

Build fails on Ubuntu 20.04 via git as well as tarball

Hi,
I tried installing MPSolve via Git. However, it failed. configure executed without any error. I tried installing with tarball, but it failed again giving the same error.

The error is seems to be caused by this:
CXX xmpsolve-polynomialsolver_moc.o polynomialsolver_moc.cpp:205:18: error: ‘QMetaObject::SuperData’ has not been declared 205 | QMetaObject::SuperData::link<QObject::staticMetaObject>(), | ^~~~~~~~~ polynomialsolver_moc.cpp:205:61: error: expected primary-expression before ‘)’ token 205 | QMetaObject::SuperData::link<QObject::staticMetaObject>(), | ^ make[4]: *** [Makefile:933: xmpsolve-polynomialsolver_moc.o] Error 1 make[4]: Leaving directory '/home/tanmay/MPSolve/src/xmpsolve' make[3]: *** [Makefile:598: all] Error 2

I have a system Qt version installed along with the online installer version and a manual build (system Qt has preference).
the entire shell output can be found here: https://pastebin.com/5JNn7Z3j

mpcf_set_str() does not set imaginary part

There is probably a bug in the function mpcf_set_str(), as it seems to me it does not set the imaginary part of the complex number. As mpf_set_str() returns 0 if the provided string is a valid number, I think there should be no logical negation in the conditional statement, as it follows:

int
mpcf_set_str (mpcf_t c, char *sr, char *si, int base)
{
  if (mpf_set_str (mpcf_Re (c), sr, base))
    return -1;
  return mpf_set_str (mpcf_Im (c), si, base);
}

"no Qt platform plugin could be initialized."

I am on Windows 10. Whenever I try to open MPSolve, a window titled "xmpsolve" appears with the error message "This application failed to start because no Qt platform plugin could be initialized. Reinstalling this application may fix this problem." Mind you, this is after freshly installing it, so I doubt a reinstallation will do anything at all. I searched for this error online, and it turns out that it's usually caused by a mistake in the building process, not the system it's installed on. As a result, I essentially can't try out the program, and it looks very promising.

Error during compilation

I got the following error during the compilation (I'm using the latest tarball)

Making all in mpsolve
make[3]: Entering directory `/u/math/userName/mpsolve-3.1.8/src/mpsolve'
  CXXLD    mpsolve
../../src/libmps/.libs/libmps.so: undefined reference to `operator<<(std::ostream&, __mpq_struct const*)'
collect2: error: ld returned 1 exit status

Any idea how to fix this ?

Build problem with autoconf 2.70

Hi,
compilation from git source breaks with autoconf 2.70. (Noticed in the arch package at https://aur.archlinux.org/packages/mpsolve-git/). autogen.sh just throws some warnings, but configure breaks completely down the road.

I'm not well-versed with autoconf, unfortunately, and couldn't find a quick fix. I'm attaching the configure script created on my machine by autoconf 2.70 in the hope that it can help. The error reported is:

./configure: line 21675: syntax error near unexpected token `newline'
./configure: line 21675: `    '''

and indeed that line looks fishy, but I have no clue how and why autoconf created it...

For what it's worth, the release tarball of 3.2.1 builds perfectly on that system. Reverting to autoconf 2.69 helps, too.

mpc_t conflicts with GNU MPC

There is a name clash between mpc_t as defined by MPSolve, and mpc_t defined by the GNU MPC library. The solution could be either move to using mpfr library instead of mpf_t, or simply rename mpc_t to something like mpsc_t. Any thoughts?

Problem with compiling MPSolve with Matlab

I am getting the following errors when using the "make" command in terminal:

.../examples/matlab/mps_roots_string.c:77:25: error: non-constant-expression cannot be narrowed from type 'int' to 'mwSize' (aka 'unsigned long') in initializer list [-Wc++11-narrowing]
mwSize dims[] = { n-1, 4 };

.../examples/matlab/mps_roots_string.c:87:33: error: non-constant-expression cannot be narrowed from type 'int' to 'mwIndex' (aka 'unsigned long') in initializer list [-Wc++11-narrowing]
mwIndex indices[] = { i, 0 };

I would appreciate to hear about your suggestion.

Wrong algorithm in complex diision

Function mpc_ui_div() is wrong, it divides integer numerator separately by imaginary and real part of denominator.

From the file src/libmps/floating-point/mpc.c

void
mpc_ui_div (mpc_t rc, unsigned long int i, mpc_t c)
{
  mpf_ui_div (mpc_Re (rc), i, mpc_Re (c));
  mpf_ui_div (mpc_Im (rc), i, mpc_Im (c));
}

Under octave-5.2.0 mps_roots([1 0 0],'s') and mps_roots([1 0 0 0 0 0 0],'u') fail

Firstly, thank you for the mpsolve package.

Building the mpsolve-3.1.7 zipfile downloaded from github.com:

wget -c https://github.com/robol/MPSolve/archive/master.zip
unzip master.zip
cd MPSolve-master
sh ./autogen.sh
./configure --prefix=$OCTAVE_DIR
make -j 6 && make install

Testing:

octave:1> version
ans = 5.2.0-robj
octave:2> pkg load mpsolve
octave:3> pkg list mpsolve
Package Name  | Version | Installation directory
--------------+---------+-----------------------
     mpsolve *|   3.1.7 | .../octave-5.2.0/share/octave/packages/mpsolve-3.1.7
octave:4> mps_roots([1 0 0],'u')
ans =

   6.9093e-310 + 8.6590e-317i
   1.3809e-319 + 1.7319e-306i

octave:5> mps_roots([1 0 0],'s')
ans =

   6.9952e-317 +  0.0000e+00i
   2.5736e+151 + 3.8537e+255i

octave:6> roots([1 0 0])
ans =

   0
   0

octave:7> mps_roots([1 0 0 0 0 0 0],'u')
ans =

   7.0663e-317 +  0.0000e+00i
    2.1322e-81 + 2.8664e+161i
   1.9253e+161 + 7.3681e+228i
    3.4546e-86 +  3.5641e-57i
   4.5663e+257 + 2.1335e+233i
   3.6247e+233 +  6.2591e-85i

octave:9> roots([1 0 0 0 0 0 0])
ans =

   0
   0
   0
   0
   0
   0

Unfortunately, the version of MPSolve available at
https://numpi.dm.unipi.it/_media/software/mpsolve/mpsolve-3.2.1.tar.gz
fails to compile under octave-5.2.0 because octave_support.h, mps_polyeig.m and DESCRIPTION are missing from examples/octave. However, at the command line:

$ src/mpsolve/mpsolve -v
MPSolve 3.2.1
[robj@morgawr mpsolve-3.2.1]$ src/mpsolve/mpsolve test.pol
(0, 0)
(0, 0)
(0, 0)
(0, 0)
(0, 0)
(0, 0)
[robj@morgawr mpsolve-3.2.1]$ cat test.pol
  ! File: test.pol 
    Degree=6;
    Monomial;
    Real;
    Integer;
    
     0
     0
     0
     0
     0
     0
     1
    
    ! EOF

Compiling with debugging symbols:

[mpsolve-3.2.1]$ CFLAGS="-ggdb3 -O0" LDFLAGS="-g" ./configure --prefix=$OCTAVE_DIR
make V=1

and running valgrind:

$ valgrind octave-cli
==67796== Memcheck, a memory error detector
==67796== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==67796== Using Valgrind-3.16.0 and LibVEX; rerun with -h for copyright info
==67796== Command: octave-cli
==67796== 
GNU Octave, version 5.2.0-robj
Copyright (C) 2020 John W. Eaton and others.
This is free software; see the source code for copying conditions.
There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.  For details, type 'warranty'.

Octave was configured for "x86_64-pc-linux-gnu".

Additional information about Octave is available at https://www.octave.org.

Please contribute if you find this software useful.
For more information, visit https://www.octave.org/get-involved.html

Read https://www.octave.org/bugs.html to learn how to submit bug reports.
For information about changes from previous versions, type 'news'.

octave:1> pkg load mpsolve
octave:2> pkg list mpsolve
Package Name  | Version | Installation directory
--------------+---------+-----------------------
     mpsolve *|   3.1.7 | .../octave-5.2.0/share/octave/packages/mpsolve-3.1.7
octave:3> mps_roots([1 0 0 0 0 0 0],'u')
==67796== Invalid read of size 8
==67796==    at 0xBB80731: mps_raise_data (data.c:123)
==67796==    by 0xBB80CFE: mps_prepare_data (data.c:189)
==67796==    by 0xBB85F6E: mps_standard_mpsolve (main.c:153)
==67796==    by 0xBB356F5: mps_mpsolve (interface.c:74)
==67796==    by 0x5DA82E5: Fmps_roots(octave_value_list const&, int) (in /usr/local/octave-5.2.0/lib/octave/packages/mpsolve-3.1.7/x86_64-pc-linux-gnu-api-v53/mps_roots.oct)
==67796==    by 0x4EF1173: octave_builtin::call(octave::tree_evaluator&, int, octave_value_list const&) (in /usr/local/octave-5.2.0/lib/octave/5.2.0-robj/liboctinterp.so.7.0.1)
==67796==    by 0x4EDBE74: octave::tree_evaluator::visit_index_expression(octave::tree_index_expression&) (in /usr/local/octave-5.2.0/lib/octave/5.2.0-robj/liboctinterp.so.7.0.1)
==67796==    by 0x4ED5C64: octave::tree_evaluator::evaluate(octave::tree_expression*, int) (in /usr/local/octave-5.2.0/lib/octave/5.2.0-robj/liboctinterp.so.7.0.1)
==67796==    by 0x4ECF2B3: octave::tree_evaluator::visit_statement(octave::tree_statement&) (in /usr/local/octave-5.2.0/lib/octave/5.2.0-robj/liboctinterp.so.7.0.1)
==67796==    by 0x4ECF161: octave::tree_evaluator::visit_statement_list(octave::tree_statement_list&) (in /usr/local/octave-5.2.0/lib/octave/5.2.0-robj/liboctinterp.so.7.0.1)
==67796==    by 0x4DF0A6A: octave::tree_evaluator::repl(bool) (in /usr/local/octave-5.2.0/lib/octave/5.2.0-robj/liboctinterp.so.7.0.1)
==67796==    by 0x4AEA0C9: octave::interpreter::execute() [clone .cold] (in /usr/local/octave-5.2.0/lib/octave/5.2.0-robj/liboctinterp.so.7.0.1)
==67796==  Address 0x94550c0 is 0 bytes after a block of size 0 alloc'd
==67796==    at 0x483A809: malloc (vg_replace_malloc.c:307)
==67796==    by 0xBB35817: mps_malloc (interface.c:117)
==67796==    by 0xBB802A3: mps_allocate_data (data.c:51)
==67796==    by 0xBB85AEE: mps_standard_mpsolve (main.c:51)
==67796==    by 0xBB356F5: mps_mpsolve (interface.c:74)
==67796==    by 0x5DA82E5: Fmps_roots(octave_value_list const&, int) (in /usr/local/octave-5.2.0/lib/octave/packages/mpsolve-3.1.7/x86_64-pc-linux-gnu-api-v53/mps_roots.oct)
==67796==    by 0x4EF1173: octave_builtin::call(octave::tree_evaluator&, int, octave_value_list const&) (in /usr/local/octave-5.2.0/lib/octave/5.2.0-robj/liboctinterp.so.7.0.1)
==67796==    by 0x4EDBE74: octave::tree_evaluator::visit_index_expression(octave::tree_index_expression&) (in /usr/local/octave-5.2.0/lib/octave/5.2.0-robj/liboctinterp.so.7.0.1)
==67796==    by 0x4ED5C64: octave::tree_evaluator::evaluate(octave::tree_expression*, int) (in /usr/local/octave-5.2.0/lib/octave/5.2.0-robj/liboctinterp.so.7.0.1)
==67796==    by 0x4ECF2B3: octave::tree_evaluator::visit_statement(octave::tree_statement&) (in /usr/local/octave-5.2.0/lib/octave/5.2.0-robj/liboctinterp.so.7.0.1)
==67796==    by 0x4ECF161: octave::tree_evaluator::visit_statement_list(octave::tree_statement_list&) (in /usr/local/octave-5.2.0/lib/octave/5.2.0-robj/liboctinterp.so.7.0.1)
==67796==    by 0x4DF0A6A: octave::tree_evaluator::repl(bool) (in /usr/local/octave-5.2.0/lib/octave/5.2.0-robj/liboctinterp.so.7.0.1)
==67796== 
==67796== Invalid read of size 4
==67796==    at 0xBBFB364: __gmpf_get_prec (in /usr/lib64/libgmp.so.10.3.2)
==67796==    by 0xBB4C43B: mpc_get_prec (mpc.c:149)
==67796==    by 0xBB8073F: mps_raise_data (data.c:123)
==67796==    by 0xBB80CFE: mps_prepare_data (data.c:189)
==67796==    by 0xBB85F6E: mps_standard_mpsolve (main.c:153)
==67796==    by 0xBB356F5: mps_mpsolve (interface.c:74)
==67796==    by 0x5DA82E5: Fmps_roots(octave_value_list const&, int) (in /usr/local/octave-5.2.0/lib/octave/packages/mpsolve-3.1.7/x86_64-pc-linux-gnu-api-v53/mps_roots.oct)
==67796==    by 0x4EF1173: octave_builtin::call(octave::tree_evaluator&, int, octave_value_list const&) (in /usr/local/octave-5.2.0/lib/octave/5.2.0-robj/liboctinterp.so.7.0.1)
==67796==    by 0x4EDBE74: octave::tree_evaluator::visit_index_expression(octave::tree_index_expression&) (in /usr/local/octave-5.2.0/lib/octave/5.2.0-robj/liboctinterp.so.7.0.1)
==67796==    by 0x4ED5C64: octave::tree_evaluator::evaluate(octave::tree_expression*, int) (in /usr/local/octave-5.2.0/lib/octave/5.2.0-robj/liboctinterp.so.7.0.1)
==67796==    by 0x4ECF2B3: octave::tree_evaluator::visit_statement(octave::tree_statement&) (in /usr/local/octave-5.2.0/lib/octave/5.2.0-robj/liboctinterp.so.7.0.1)
==67796==    by 0x4ECF161: octave::tree_evaluator::visit_statement_list(octave::tree_statement_list&) (in /usr/local/octave-5.2.0/lib/octave/5.2.0-robj/liboctinterp.so.7.0.1)
==67796==  Address 0x30 is not stack'd, malloc'd or (recently) free'd
==67796== 
fatal: caught signal Segmentation fault -- stopping myself...
==67796== 
==67796== Process terminating with default action of signal 11 (SIGSEGV): dumping core
==67796==    at 0x75528F3: raise (in /usr/lib64/libpthread-2.31.so)
==67796==    by 0x7552A8F: ??? (in /usr/lib64/libpthread-2.31.so)
==67796==    by 0xBBFB363: __gmpf_get_prec (in /usr/lib64/libgmp.so.10.3.2)
==67796==    by 0xBB4C43B: mpc_get_prec (mpc.c:149)
==67796==    by 0xBB8073F: mps_raise_data (data.c:123)
==67796==    by 0xBB80CFE: mps_prepare_data (data.c:189)
==67796==    by 0xBB85F6E: mps_standard_mpsolve (main.c:153)
==67796==    by 0xBB356F5: mps_mpsolve (interface.c:74)
==67796==    by 0x5DA82E5: Fmps_roots(octave_value_list const&, int) (in /usr/local/octave-5.2.0/lib/octave/packages/mpsolve-3.1.7/x86_64-pc-linux-gnu-api-v53/mps_roots.oct)
==67796==    by 0x4EF1173: octave_builtin::call(octave::tree_evaluator&, int, octave_value_list const&) (in /usr/local/octave-5.2.0/lib/octave/5.2.0-robj/liboctinterp.so.7.0.1)
==67796==    by 0x4EDBE74: octave::tree_evaluator::visit_index_expression(octave::tree_index_expression&) (in /usr/local/octave-5.2.0/lib/octave/5.2.0-robj/liboctinterp.so.7.0.1)
==67796==    by 0x4ED5C64: octave::tree_evaluator::evaluate(octave::tree_expression*, int) (in /usr/local/octave-5.2.0/lib/octave/5.2.0-robj/liboctinterp.so.7.0.1)
==67796== 
==67796== HEAP SUMMARY:
==67796==     in use at exit: 7,112,158 bytes in 73,163 blocks
==67796==   total heap usage: 421,721 allocs, 348,558 frees, 52,582,073 bytes allocated
==67796== 
==67796== LEAK SUMMARY:
==67796==    definitely lost: 671 bytes in 83 blocks
==67796==    indirectly lost: 0 bytes in 0 blocks
==67796==      possibly lost: 105,448 bytes in 3,188 blocks
==67796==    still reachable: 7,006,039 bytes in 69,892 blocks
==67796==                       of which reachable via heuristic:
==67796==                         newarray           : 224,728 bytes in 1,697 blocks
==67796==         suppressed: 0 bytes in 0 blocks
==67796== Rerun with --leak-check=full to see details of leaked memory
==67796== 
==67796== For lists of detected and suppressed errors, rerun with: -s
==67796== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)
Segmentation fault (core dumped)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.