Overload element-wise operators
I think element-wise operators need overloaded. Here is an example of why. With double precision in MATLAB, this works. I think it should work for the mp data type too.
>> x = 1:10, y = (11:20)'
x =
1 2 3 4 5 6 7 8 9 10
y =
11
12
13
14
15
16
17
18
19
20
>> A = x.*y
A =
11 22 33 44 55 66 77 88 99 110
12 24 36 48 60 72 84 96 108 120
13 26 39 52 65 78 91 104 117 130
14 28 42 56 70 84 98 112 126 140
15 30 45 60 75 90 105 120 135 150
16 32 48 64 80 96 112 128 144 160
17 34 51 68 85 102 119 136 153 170
18 36 54 72 90 108 126 144 162 180
19 38 57 76 95 114 133 152 171 190
20 40 60 80 100 120 140 160 180 200
>> A = mp(x).*mp(y)
Error using .* (line 1644)
Matrix dimensions must agree
How would you use mp on a GPU?
This page says about fast quadruple precision:
'...this allows more efficient usage of hardware capabilities of modern CPUs, even exploiting some of the advanced instructions, not to mention possibilities of harnessing power of the GPU!'
I've been trying to use mp to solve the example singular value decomposition problem (illustrated on the same page) on an NVIDIA Quadro 2000 GPU that I've successfully used MATLAB's gpu functions on. I try the following code:
mp.Digits(34); mp.GuardDigits(0); format longG
A = gpuArray.rand(1000);
X = mp(A); tic; [U,S,V] = svd(X); toc;
But on encountering line 3 MATLAB says:
Error using mp: unsupported argument type
This is probably because the argument I'm passing to mp is a GPU array that it doesn't know how to handle.
How can I get mp to do this?
How to accelerate the advanpix code ?!
Hello! is there anyway to accelerate the advanpix code , it takes too long time to run, any suggestions ?!
Support for IEEE 754 octuple precision
Advanpix already allows the declaration of quadruple precision as in the IEEE 754 standard.
It would be great to do the same with octuple precision since it is defined by this standard.
My point here is not speed, but to test algorithms with this peculiar precision in a quite portable way.
ORDEIG fails
Hi Pavel,
I hope you are doing fine?! I'm running Advanpix Version 3.9.4 Build 10481 on Windows and ORDEIG crashes MATLAB 2015B with a "FatalException" on the following problem:
KK = [ mp('1.2856486930664507983834710103110410e+00'), mp('0.0000000000000000000000000000000000e+00') ;
ee = ordeig(HH,KK);
When calling ordeig(double(HH),double(KK)), everything works fine. Please see below for my mp.Info output and the crash report.
Cheers, Stefan
>> mp.Info
This error was detected while a MEX-file was running. If the MEX-file
(I CAN SEND YOU THE CRASH DUMP IF NECESSARY.)
Missing accumarray()
Hello,
I need to implement MATLAB built-in function accumarray(), which is not supported by the Advanpix toolbox (yet?). In order to use the same code for single/double/mp precision, I tried to overload accumarray by creating a new function in the mp class. Whenever I want to pass a vector of mp values to that function, it gets "messed up".
I have put this piece of code into the methods section of mp class:
function result = accumarray(subs, val, sz)
size(val)
val(1)
val(2)
keyboard
...
end
The code...
>> accumarray([1; 2; 2; 1; 1], mp([1;2;3;4;5]))
...returns...
ans =
5 1
ans =
1
2
3
4
5
Index exceeds matrix dimensions.
Error in mp/accumarray (line 5038)
val(2)
As you can see, the second argument has still its size (and numel) but all the content was somehow shrinked into the first element. Could you, please, help me with implementing of my own methods into the toolbox?
Best regards,
Vladimir
Bsxfun with empty input
Hello,
I think I have found bug/different behavior in bsxfun():
a = pi;
a(1) = [];
bsxfun(@plus, a, ones(4,1))
...returns...
ans =
Empty matrix: 4-by-0
but
a = mp('pi');
a(1) = [];
bsxfun(@plus, a, ones(4,1))
...returns...
Error using mp/subsref (line 990)
Index exceeds matrix dimensions.
Error in mpbsxfun (line 71)
Error in mp/bsxfun (line 1132)
[varargout{1:nargout}] = mpbsxfun(varargin{:});
I am running:
MATLAB Version: 8.5.0.197613 (R2015a)
Multiprecision Computing Toolbox, (c) 2008-2017 Advanpix LLC.
Version : 4.3.2 Build 12170
Platform: Win64
Release : 2017-01-16
Trial version. Valid until 2017-01-30
Best regards,
Vladimir
Error for boolean operation at certain precision
Hello Pavel.
I got the following problem:
mp.Digits(349);
array=mp('2')*mp('10')^mp('-4'):mp('2')*mp('10')^mp('-4'):mp('1');
array(1,100)==mp('0.02')
ans =
logical
1
mp.Digits(350);
array=mp('2')*mp('10')^mp('-4'):mp('2')*mp('10')^mp('-4'):mp('1');
array(1,100)==mp('0.02')
ans =
logical
0
mp.Digits(351);
array=mp('2')*mp('10')^mp('-4'):mp('2')*mp('10')^mp('-4'):mp('1');
array(1,100)==mp('0.02')
ans =
logical
1
This apperas quite randomly, deppending on the used precision. You can try for example mp.Digits(352) to mp.Digits(355).
Thank you for your help.
Service d'assistance aux clients par UserEcho