Ваши комментарии
We have just released new version (Windows) with speed-optimized conversion for your case. In our tests speed-up is ~20 times.
Please download and try new trial from our website (our just use this link: https://bit.ly/3mvxXqg ).
Let me know what kind of speed improvement you see in your tests.
Thank you for the details. We are looking into the conversion code to make it faster. Will update you shortly..
Thank you for your question.
Frankly, we didn't expect that conversion to string would be an important part of numerical computations (e.g. running in O(n^2) loop or similar). That is why we didn't optimize it to the maximum extent. I guess your case is very special in this regard.
What do you with the number after conversion (e.g. numeric computations)? I am pretty sure computations will be way more faster compared to vpa.
We have just updated toolbox distribution/installer with the 'flintmax.m' already included.
Please download and use the latest toolbox version.
There is a quick way to make the built-in 'nchoosek()' work with toolbox. Create flintmax.m file in [toolbox_folder]\@char directory with following content:
function r = flintmax( classname )
if strcmpi('mp',classname)
r = 2^ceil(mp.Digits() * mp('log2(10)'));
else
r = builtin('flintmax',classname);
end
end
Restart MATLAB and test 'nchoosek()', e.g.:
>> mp.Digits(100); >> x = nchoosek(mp(1000),50) x = 9460461017585217574825413104128279942327590136138287606176460370151247948488653144064
Toolbox doesn't include this function at the moment. Now I am considering to add it.
How do you use it? Just to compute binomial coefficient or to generate all combinations?
In our changelog we use 100 digits, but speed-up is implemented for any precision level.
Ok, we can make quadruple even faster, e.g. like this:
>> mp.Digits(34);M=500;A=(rand(M,'mp'))*10;
>> tic; expm(A); toc; % new Elapsed time is 5.859282 seconds. >> tic; expm(A); toc; % old Elapsed time is 26.809653 seconds.
Roughly ~5 times speed-up.
Give me a minute, I will send you mpexpm.p with appropriate changes for quadruple.
Speed-up is valid for all precisions, including quadruple. For quadruple speed is improved by ~2 times, e.g.:
>> mp.Digits(34);M=500;A=(rand(M,'mp'))*10;
>> tic; expm(A); toc; % new Elapsed time is 12.147127 seconds. >> tic; expm(A); toc; % old Elapsed time is 26.809653 seconds.
We can make it 4 times for quadruple is well, let me know if you are interested.
Сервис поддержки клиентов работает на платформе UserEcho
Ok, great, please keep us updated on your experience with toolbox.