Matrix input ijv coordinate format
Hello MaPHys developers,
I want to use matrix ijv format as matrix input for MaPHys solver because it is the format used by other solvers.
I am using matrices from Florida sparse collection. I used the following matlab code to convert matlab matrix format into ijv format:
function convertToIJV(file_name,S)
[i,j,v] = find(S);
file_id = fopen(file_name,'wt');
% the first line for number of rows , number of columns and nnz
fprintf(file_id,'%d %d %d\n', size(S,1) ,size(S,2),size(v,1) );
fprintf(file_id,'%d %d %g\n',[i-1,j-1,v]');
fclose(file_id);
end
but I got this error form maphys with two converted matrix:lddor and barrier2-4
***************************************
* MaPHyS 0.9.6.0 [ Real (KIND=8) ] *
***************************************
* Starting Job1 (Analysis)
==========================
ERROR: graphCheck: arc data do not match
This is the first 20 lines of barrier2-4 matrix:
113076 113076 2129496
0 0 38.3734
1 0 -0.0861911
3 0 -0.0861911
4 0 -19.1005
36747 0 -1.4092
36770 0 0.0316341
36773 0 -0.0367471
36775 0 2.2903e-05
36777 0 2.2903e-05
36778 0 0.00506717
74923 0 -175199
74926 0 1.44618e+07
74928 0 -63788.4
74930 0 -63788.4
74931 0 -1.4159e+07
0 1 -0.0861911
1 1 76.7469
2 1 -0.172382
6 1 -38.201
One more question please, If the matrix is symmetric in values, do I need to provide only half of it or the whole values using this ijv coordinate format.