Your comments
Of course, toolbox supports large/small numbers:
>> mp.Digits(34); >> besselk(0,1000) % double ans = 0 >> besselk(0,mp(1000)) % multiprecision ans = 2.0115e-436 >> besselk(0,mp(10000)) ans = 1.4231e-4345
Do you have a simple example demonstrating your issue?
We have User's Manual with many details on how to use the toolbox: http://www.advanpix.com/documentation/users-manual/
1. The usual commands save/load works with "mp" variables:
A = mp(rand(100)); B = A; save('A.mat','A') clear A; load('A.mat','A'); norm(A-B,1) ans = 0
Use them if you intend to load/save matrices on the same computer using the same version of MATLAB/toolbox.
2. If you want to transfer mp-matrices from one computer to another, it is better to convert it to text.
Toolbox provides two special commands for file I/O with preserving accuracy and cross-platforms compatibility:
mp.Digits(34); A = mp(rand(25)); mp.write(A,'matrix.txt'); % Write mp-matrix to the text file B = mp.read('matrix.txt'); % Read it back norm(A-B,1) % check accuracy - difference should be 0 0
Linearize n-diminsional array before saving: mp.write(A(:),'matrix.txt')
New version of toolbox (with sortrows) has been released for Windows. Please download it from here:
http://www.advanpix.com/wp-content/plugins/download-monitor/download.php?id=1
Yes, I meant next version of toolbox for Windows, Linux and Mac OSX.
We support all three platforms and new versions of toolbox are released for Windows first.
It will be released in Windows version first, then in Linux & MacOSX.
The 'sortrows' in MATLAB is hard-coded to double type, as it calls the internal MEX module which accepts only double inputs.
Please do the following changes to fix this:
1. Open sortrows.m in editor:
>> open sortrows
2. Find & change the line:
if isreal(x) && ~issparse(x) && n > 3
to
if false && isreal(x) && ~issparse(x) && n > 3
This disables call to internal MEX, switching to pure m-language implementation which is able to work with mp-matrices.
After the fix, 'sortrows' will start working for multiprecision objects:
>> A = mp(floor(gallery('uniformdata',[6 7],0)*100)); >> A(1:4,1) = 95; A(5:6,1) = 76; A(2:4,2) = 7; A(3,3) = 73; >> D = sortrows(A,[1 7]) D = 76 79 91 0 19 41 1 76 61 93 81 27 46 83 95 7 73 5 19 44 20 95 7 73 89 20 74 52 95 7 40 35 60 93 67 95 45 92 41 13 1 84
I will include proper implementation of 'sortrows' into next version of toolbox (will be released in few days)
The 'subs' is part of Symbolic Math Toolbox and it requires input to be of 'sym' type.
To use it with multiprecision toolbox, please use explicit conversion function: mp2sym.
So that the code becomes:
digits(mp.Digits()); % make sure we use the same precision for 'sym' as in multiprecision toolbox. .... t=subs(T,{'A','B','C'},{mp2sym(a),mp2sym(b),mp2sym(c)})
Reverse conversion can be done with sym2mp function.
Let me know if this fixes the issue.
Customer support service by UserEcho
The code mp(1e+500) is incorrect. The 1e+500 is converted to double precision first (truncated to 1e+308).
Use mp('1e+500') instead.
mp.Digits(1000000) is too high. The usual mp.Digits(34) is enough to handle such small number as 1e+500 :).
Also please check the following chapter in our User Guide, it has examples on the issue:
http://www.advanpix.com/documentation/users-manual/#More_on_Existing_Code_Porting