[Numerics] [CSparseMatrix_print_in_Matlab_file] Increase the precision of printing. If not, a risk of wrong computation for extremely small values.
@@ -982,7 +982,7 @@ int CSparseMatrix_print_in_Matlab_file(const CSparseMatrix *A, int brief, FILE*
fprintf(file," col %lld : locations %lld to %lld\n", (long long int)j, (long long int)Ap [j], (long long int)Ap [j+1]-1);
for(p = Ap [j] ; p < Ap [j+1] ; p++)
{
- fprintf(file," %lld : %g\n", (long long int)Ai [p], Ax ? Ax [p] : 1) ;
+ fprintf(file," %lld : %10.50g\n", (long long int)Ai [p], Ax ? Ax [p] : 1) ;
if(brief && p > 20)
{
fprintf(file," ...\n") ;
@@ -995,7 +995,7 @@ int CSparseMatrix_print_in_Matlab_file(const CSparseMatrix *A, int brief, FILE*
{
for(p = 0 ; p < nz ; p++)
{
- fprintf(file," %lld %lld %g\n", (long long int)Ai [p] + 1, (long long int)Ap [p] + 1, Ax ? Ax [p] : 1) ;
+ fprintf(file," %lld %lld %10.50g\n", (long long int)Ai [p] + 1, (long long int)Ap [p] + 1, Ax ? Ax [p] : 1) ;
if(brief && p > 20)
{
fprintf(file," ...\n") ;
