Enter forum description here ...
0
Under review

It is possible to use mp computations in a simulink block or S-function ?

JLD95 5 years ago updated by Pavel Holoborodko 5 years ago 1

I would like a simulink block which have double precision floating point in input and output but internal computations in this block are made in quadruple precision: it is possible to use with MP Toolbox ?

0
Not a bug

matlab coder

Meboo Publishing 5 years ago updated 5 years ago 2

it is not possible to use the Matlab Coder while Advanpix is installed.

(Windows 7, Matlab 2018b.)

Target for coder is turbine20.m below which calls no multiprecision functions or definitions,

Only solution is to uninstall multiprecision  toolbox.

Does anyone know how to get around this?

Image 7

0
Under review

Suggestion for development of optimization solvers under MPT

Mark Stone 5 years ago updated by Mark L. Stone 4 years ago 14

Pavel,

Given as you say (in https://mct.userecho.com/communities/1/topics/125-mp-linprog-support) the high demand for optimization solvers and the complexity and difficulty of implementing high quality optimization solvers "from scratch", i.e., without access to existing double precision code as starting point for modification, I suggest a different development approach.:

Work with developers//vendors of high-end optimization solvers to modify their code to produce an MPT version. Perhaps the vendor would agree to make such a version available to its customers at no extra cost. What would be in it for the vendor would be potential extra sales. This could still be a non-trivial effort to do well, because even though solvers have a large number of settable parameters related to various tolerances, there may be some algorithmic and implementation decisions which might be implicitly predicated on an assumption that the code is double precision. I have no idea of the do-ability of an MPT version, for instance, if the solver code is in C or C++ and the vendors produce mex file, as I think is the case for the following.

Some suggestions  - these are all top-end, under active development, and all have MATLAB toolbox versions.

Note: LP = Linear Program, QP = (linearly constrained) Quadratic Program. QCQP = Quadrqatically Constrained Quadratic Program.. Mi = mixed integer. SOCP = Second Order Cone Problem, which subsumes LP, convex QP and convex QCQP. LMI = Linear Matrix Inequality. = Linear Semidefinite Program.

CPLEX (see https://www.ibm.com/support/knowledgecenter/en/SSSA5P_12.6.3/ilog.odms.cplex.help/CPLEX/MATLAB/topics/gs_ov_toolbox.html ) - LP, MILP,, convex QP, MIQP, convex QCQP, convex MIQCQP, SOCP, MISOCP, local optimal and globally optimal solution of non-convex QP and MIQP, drop-in replacement for lsqlin (linearly constrained linear least squares)

Mosek - LP, MILP, convex QP, convex MIQP, SOCP, MISOCP, LMI, exponential cone (in  forthcoming Mosek version 9.0)

KNITRO -all problem classes handled by FMINCON + integer constraints + special handling of complementarity constraints (MPEC) and SOC constraints.  Higher performance and more robust than corresponding FMINCON algorithms.

Gurobi - same problem classes as CPLEX, except no non-concex QP and MIQP capability

0
Answered

Linux version update delay

Michal Kvasnicka 6 years ago updated by Pavel Holoborodko 6 years ago 5

When we can expect latest version of MCT for linux?

0
Not a bug

ODE's benchmark is slower with MCT

Michal Kvasnicka 6 years ago updated by dattorro 8 months ago 8

Hello, I just found strange behavior (bug?) of MATLAB R2018a (update 3) with latest version of MCT on the Path (Ubuntu Linux 16.04, 64bit).


If I run the bench() function with MCT on the path I get the following results:


>> bench(5)

ans =

    0.0743    0.1146    0.0462    0.0832    0.4225    0.5393
    0.0750    0.1108    0.0462    0.0845    0.3682    0.4330
    0.0739    0.1176    0.0521    0.0895    0.4052    0.4539
    0.0785    0.1275    0.0473    0.0826    0.3355    0.4691
    0.0744    0.1155    0.0464    0.1066    0.3874    0.4228


The same benchmark run without MCT on the path produce the following results:

>> bench(5)

ans =

    0.0745    0.1184    0.0130    0.0839    0.4043    0.5116
    0.0798    0.1139    0.0133    0.0834    0.3796    0.4141
    0.0809    0.1275    0.0141    0.1051    0.4728    0.4096
    0.0850    0.1182    0.0132    0.0839    0.3576    0.4142
    0.0884    0.1132    0.0134    0.0859    0.4168    0.4460

As you can see, the 3rd column (corresponding to the ODE's part of MATLAB benchmark) shows significantly (~4x) slower runs in a case of MCT on the path.


Could you clarify and/or reproduce this situation, please?

Answer
Pavel Holoborodko 6 years ago

Hello Michal,


Toolbox overloads standard MATLAB routines to create elementary arrays - zeros, ones, eye, etc.

This is needed to support 'mp' type as argument in such functions, e.g. eye(100,'mp'). 


If requested type is not 'mp' then toolbox dispatches the call to built-in MATLAB functions (see arrayCreationOverload.m  for more details). Dispatch is quick but I expect it to be slower than direct call to double-precision functions.

MATLAB picks up toolbox overload when it is on the path.


Probably this is what causing slow-down in your tests.

0
Not a bug

R2018a_update3 (Linux) slow down MCT fft related functions

Michal Kvasnicka 6 years ago updated 6 years ago 8

After installation of R2018a_update3 (Ubuntu 16.04 64 bit) was observed significant slow down of some MCT built-in functions (especially fft, ifft,fft2 and ifft2).

Answer
Pavel Holoborodko 6 years ago

I see, thank you for clarification.  MATLAB is huge, maybe something went wrong during update.

But definitely, this it is not a toolbox bug :).

0
Fixed

latest version is not compatible with R2018a for linux

Michal Kvasnicka 6 years ago updated by Pavel Holoborodko 6 years ago 10

>> mp
Invalid MEX-file '/home/kva/Documents/MATLAB/AdvanpixMCT/mpimpl.mexa64': /home/kva/Documents/MATLAB/AdvanpixMCT/mpimpl.mexa64: undefined symbol:
_Z19mxGetPropertySharedPK11mxArray_tagmPKc.

Error in mp (line 1255)
           if nargin == 0,     this.id = mpimpl(0);             % create mp-entity of default precision


The latest version of AdvanpixMCT 4.4.6.12719 is not compatible with Matlab R2018a (linux version). Please could you fix it?

0
Under review

Performance of besselh function

Michael_ 6 years ago updated by Pavel Holoborodko 6 years ago 1

Hello Pavel.


I noticed some performance issues with the besselh-function.

I used mp.Digits(34), mp.GuardDigits(0) and got the following


value=mp(rand(100,100));
tic
value1=besselh(mp('2'),2,mp('1i').*value);
toc
tic
value2=besselj(mp('2'),mp('1i').*value)-mp('1i')*bessely(mp('2'),mp('1i').*value);
toc
tic
value3=besselk(mp('2'),-value)*mp('2')/(mp('1i')*mp('pi'));
toc
Elapsed time is 3.986968 seconds.
Elapsed time is 1.879375 seconds.
Elapsed time is 0.772351 seconds.

which gives of course the same results for value1, value2 and value3. Any possibilty to enhance the performance of besselh to that of besselk?


Best regrads,

Michael


0
Answered

Will the Multiprecision Computing Toolbox work under WindowsXP x32?

Segey 6 years ago updated 6 years ago 2

Will the Multiprecision Computing Toolbox work under WindowsXP x32?

0
Fixed

Bug in function isreal

Michael_ 6 years ago updated by Pavel Holoborodko 6 years ago 2

Hello Pavel.


I found another bug in the isreal() function.


If we store real and complex data in the same array, the function isreal() gives always 0, even for entries with 0 imaginary part.


test(1,1)=mp('1i');
test(1,2)=mp('1');
isreal(test(1,1))
isreal(test(1,2))

ans =

  logical

   0

ans =

  logical

   0

This is differnt compared to the standard Matlab behaviour:


test(1,1)=1i;
test(1,2)=1;
isreal(test(1,1))
isreal(test(1,2))

ans =

  logical

   0

ans =

  logical

   1

Best regards,

Michael