svn-gvsig-desktop / trunk / libraries / libjni-proj4 / src / p_series.c @ 7098
History | View | Annotate | Download (1.06 KB)
1 |
/* print row coefficients of Tseries structure */
|
---|---|
2 |
#ifndef lint
|
3 |
static const char SCCSID[]="@(#)p_series.c 4.6 95/08/19 GIE REL"; |
4 |
#endif
|
5 |
#include <stdio.h> |
6 |
#include <string.h> |
7 |
#include <projects.h> |
8 |
#define NF 20 /* length of final format string */ |
9 |
#define CUT 60 /* check length of line */ |
10 |
void
|
11 |
p_series(Tseries *T, FILE *file, char *fmt) {
|
12 |
int i, j, n, L;
|
13 |
char format[NF+1]; |
14 |
|
15 |
*format = ' ';
|
16 |
strncpy(format + 1, fmt, NF - 3); |
17 |
strcat(format, "%n");
|
18 |
fprintf(file, "u: %d\n", T->mu+1); |
19 |
for (i = 0; i <= T->mu; ++i) |
20 |
if (T->cu[i].m) {
|
21 |
fprintf(file, "%d %d%n", i, T->cu[i].m, &L);
|
22 |
n = 0;
|
23 |
for (j = 0; j < T->cu[i].m; ++j) { |
24 |
if ((L += n) > CUT)
|
25 |
fprintf(file, "\n %n", &L);
|
26 |
fprintf(file, format, T->cu[i].c[j], &n); |
27 |
} |
28 |
fputc('\n', file);
|
29 |
} |
30 |
fprintf(file, "v: %d\n", T->mv+1); |
31 |
for (i = 0; i <= T->mv; ++i) |
32 |
if (T->cv[i].m) {
|
33 |
fprintf(file, "%d %d%n", i, T->cv[i].m, &L);
|
34 |
n = 0;
|
35 |
for (j = 0; j < T->cv[i].m; ++j) { |
36 |
if ((L += n) > 60) |
37 |
fprintf(file, "\n %n", &L);
|
38 |
fprintf(file, format, T->cv[i].c[j], &n); |
39 |
} |
40 |
fputc('\n', file);
|
41 |
} |
42 |
} |