13 std::sprintf(buf,
"%4d ",
v);
20 std::sprintf(buf,
"%4u ",
v);
32 std::sprintf(buf,
"%8d ", 0);
34 std::sprintf(buf,
"%8.5f ",
v);
38 std::sprintf(buf,
"%6d ", 0);
40 std::sprintf(buf,
"%6.3f ",
v);
43 std::sprintf(buf,
"%11.7e ",
v);
46 std::sprintf(buf,
"%8.4e ",
v);
48 default: std::abort();
61 std::sprintf(buf,
"%16d ", 0);
63 std::sprintf(buf,
"%16.13f ",
v);
67 std::sprintf(buf,
"%8d ", 0);
69 std::sprintf(buf,
"%8.4f ",
v);
72 std::sprintf(buf,
"%20.14e ",
v);
75 std::sprintf(buf,
"%10.4e ",
v);
110 default: std::abort();
122 default: std::abort();
125 double r = std::real(
v);
126 double i = std::imag(
v);
131 std::sprintf(fmt,
"%%" "%d" "d ", width);
132 std::sprintf(buf, fmt, 0);
135 std::sprintf(fmt,
"%%" "%d" "." "%d" "%c ", width, precision, conv);
136 std::sprintf(buf, fmt, r);
139 buf += std::strlen(buf);
143 std::sprintf(fmt,
" %%" "%d" "s ", width-1);
144 std::sprintf(buf, fmt,
"");
151 std::sprintf(fmt,
"%c%%" "%d.%d%ci ", sign, width-1, precision, conv);
152 std::sprintf(buf, fmt, i);
177 default: std::abort();
189 default: std::abort();
192 float r = std::real(
v);
193 float i = std::imag(
v);
198 std::sprintf(fmt,
"%%" "%d" "d ", width);
199 std::sprintf(buf, fmt, 0);
202 std::sprintf(fmt,
"%%" "%d" "." "%d" "%c ", width, precision, conv);
203 std::sprintf(buf, fmt, r);
206 buf += std::strlen(buf);
210 std::sprintf(fmt,
" %%" "%d" "s ", width-1);
211 std::sprintf(buf, fmt,
"");
218 std::sprintf(fmt,
"%c%%" "%d.%d%ci ", sign, width-1, precision, conv);
219 std::sprintf(buf, fmt, i);
241 #define inst(T) template std::ostream &vnl_matlab_print_scalar(std::ostream &, T, vnl_matlab_print_format) 246 inst(std::complex<float>);
247 inst(std::complex<double>);
248 inst(std::complex<long double>);
void vnl_matlab_print_scalar(int v, char *buf, vnl_matlab_print_format)