|
129 | 129 | if max_diff > 0 |
130 | 130 | k = find(~(abs(got_minus_expected(:)) < 10^(-prec)) & ~isnan(got_minus_expected(:))); |
131 | 131 | nk = length(k); |
132 | | - fprintf(' index got expected abs(got - exp)\n'); |
133 | | - fprintf('--------------- ---------------- ---------------- ----------------'); |
| 132 | + mp_printf(' index got expected abs(got - exp)\n'); |
| 133 | + mp_printf('--------------- ---------------- ---------------- ----------------'); |
134 | 134 | if nk > 15 |
135 | 135 | [~, kk] = sort(abs(got_minus_expected(k)), 'descend'); |
136 | 136 | k = k(kk(1:10)); |
|
153 | 153 | idxstr = sprintf('(%s%d)', idxstr, idx{end}); |
154 | 154 | end |
155 | 155 | if cplx |
156 | | - fprintf('\n%14s %16s %16s %16g', ... |
| 156 | + mp_printf('\n%14s %16s %16s %16g', ... |
157 | 157 | idxstr, format_complex(full(got(k(u))), '%g'), ... |
158 | 158 | format_complex(full(ex), '%g'), full(abs(got(k(u)) - ex))); |
159 | 159 | else |
160 | | - fprintf('\n%14s %16g %16g %16g', ... |
| 160 | + mp_printf('\n%14s %16g %16g %16g', ... |
161 | 161 | idxstr, full(got(k(u))), full(ex), full(abs(got(k(u)) - ex))); |
162 | 162 | end |
163 | 163 | if u == kk |
164 | | - fprintf(' *'); |
| 164 | + mp_printf(' *'); |
165 | 165 | idxstrkk = idxstr; |
166 | 166 | end |
167 | 167 | end |
168 | 168 | if nk > 15 |
169 | | - fprintf('\n ... and %d more ...', nk-10); |
| 169 | + mp_printf('\n ... and %d more ...', nk-10); |
170 | 170 | end |
171 | | - fprintf('\nmax diff @ %s = %g > allowed tol of %g\n\n', ... |
| 171 | + mp_printf('\nmax diff @ %s = %g > allowed tol of %g\n\n', ... |
172 | 172 | idxstrkk, full(max_diff), 10^(-prec)); |
173 | 173 | elseif max_diff == -1 |
174 | | - fprintf(' mismatch in locations of NaNs\n'); |
| 174 | + mp_printf(' mismatch in locations of NaNs\n'); |
175 | 175 | else |
176 | 176 | gidxstr = sprintf('%d x ', gdims(1:end-1)); |
177 | 177 | gidxstr = sprintf('%s%d', gidxstr, gdims(end)); |
178 | 178 | eidxstr = sprintf('%d x ', edims(1:end-1)); |
179 | 179 | eidxstr = sprintf('%s%d', eidxstr, edims(end)); |
180 | | - fprintf(' dimension mismatch:\n'); |
181 | | - fprintf(' got: %s\n', gidxstr); |
182 | | - fprintf(' expected: %s\n\n', eidxstr); |
| 180 | + mp_printf(' dimension mismatch:\n'); |
| 181 | + mp_printf(' got: %s\n', gidxstr); |
| 182 | + mp_printf(' expected: %s\n\n', eidxstr); |
183 | 183 | end |
184 | 184 | end |
185 | 185 | if nargout |
|
0 commit comments