aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFrank Warmerdam <warmerdam@pobox.com>2000-03-21 14:44:20 +0000
committerFrank Warmerdam <warmerdam@pobox.com>2000-03-21 14:44:20 +0000
commite80ad92ee405333be12cf6a9367990b4beff753d (patch)
treec76ff22516f8e68d16915ddd85ffc964df2c084a /src
parent659ba490528fffad34db301109e477e2788a3694 (diff)
downloadPROJ-e80ad92ee405333be12cf6a9367990b4beff753d.tar.gz
PROJ-e80ad92ee405333be12cf6a9367990b4beff753d.zip
changed UV to projUV
git-svn-id: http://svn.osgeo.org/metacrs/proj/trunk@782 4e78687f-474d-0410-85f9-8d5e500ac6b2
Diffstat (limited to 'src')
-rw-r--r--src/bch2bps.c38
-rw-r--r--src/bchgen.c8
-rw-r--r--src/biveval.c18
-rw-r--r--src/gen_cheb.c4
-rw-r--r--src/mk_cheby.c12
-rw-r--r--src/nad2nad.c6
-rw-r--r--src/proj.c18
-rw-r--r--src/projects.h20
8 files changed, 62 insertions, 62 deletions
diff --git a/src/bch2bps.c b/src/bch2bps.c
index 0d773575..7fd5b74a 100644
--- a/src/bch2bps.c
+++ b/src/bch2bps.c
@@ -5,40 +5,40 @@ static const char SCCSID[]="@(#)bch2bps.c 4.5 94/03/22 GIE REL";
#include <projects.h>
/* basic support procedures */
static void /* clear vector to zero */
-clear(UV *p, int n) { static const UV c = {0., 0.}; while (n--) *p++ = c; }
+clear(projUV *p, int n) { static const projUV c = {0., 0.}; while (n--) *p++ = c; }
static void /* clear matrix rows to zero */
-bclear(UV **p, int n, int m) { while (n--) clear(*p++, m); }
+bclear(projUV **p, int n, int m) { while (n--) clear(*p++, m); }
static void /* move vector */
-bmove(UV *a, UV *b, int n) { while (n--) *a++ = *b++; }
+bmove(projUV *a, projUV *b, int n) { while (n--) *a++ = *b++; }
static void /* a <- m * b - c */
-submop(UV *a, double m, UV *b, UV *c, int n) {
+submop(projUV *a, double m, projUV *b, projUV *c, int n) {
while (n--) {
a->u = m * b->u - c->u;
a++->v = m * b++->v - c++->v;
}
}
static void /* a <- b - c */
-subop(UV *a, UV *b, UV *c, int n) {
+subop(projUV *a, projUV *b, projUV *c, int n) {
while (n--) {
a->u = b->u - c->u;
a++->v = b++->v - c++->v;
}
}
static void /* multiply vector a by scalar m */
-dmult(UV *a, double m, int n) { while(n--) { a->u *= m; a->v *= m; ++a; } }
+dmult(projUV *a, double m, int n) { while(n--) { a->u *= m; a->v *= m; ++a; } }
static void /* row adjust a[] <- a[] - m * b[] */
-dadd(UV *a, UV *b, double m, int n) {
+dadd(projUV *a, projUV *b, double m, int n) {
while(n--) {
a->u -= m * b->u;
a++->v -= m * b++->v;
}
}
static void /* convert row to pover series */
-rows(UV *c, UV *d, int n) {
- UV sv, *dd;
+rows(projUV *c, projUV *d, int n) {
+ projUV sv, *dd;
int j, k;
- dd = (UV *)vector1(n-1, sizeof(UV));
+ dd = (projUV *)vector1(n-1, sizeof(projUV));
sv.u = sv.v = 0.;
for (j = 0; j < n; ++j) d[j] = dd[j] = sv;
d[0] = c[n-1];
@@ -63,12 +63,12 @@ rows(UV *c, UV *d, int n) {
pj_dalloc(dd);
}
static void /* convert columns to power series */
-cols(UV **c, UV **d, int nu, int nv) {
- UV *sv, **dd;
+cols(projUV **c, projUV **d, int nu, int nv) {
+ projUV *sv, **dd;
int j, k;
- dd = (UV **)vector2(nu, nv, sizeof(UV));
- sv = (UV *)vector1(nv, sizeof(UV));
+ dd = (projUV **)vector2(nu, nv, sizeof(projUV));
+ sv = (projUV *)vector1(nv, sizeof(projUV));
bclear(d, nu, nv);
bclear(dd, nu, nv);
bmove(d[0], c[nu-1], nv);
@@ -89,7 +89,7 @@ cols(UV **c, UV **d, int nu, int nv) {
pj_dalloc(sv);
}
static void /* row adjust for range -1 to 1 to a to b */
-rowshft(double a, double b, UV *d, int n) {
+rowshft(double a, double b, projUV *d, int n) {
int k, j;
double fac, cnst;
@@ -108,7 +108,7 @@ rowshft(double a, double b, UV *d, int n) {
}
}
static void /* column adjust for range -1 to 1 to a to b */
-colshft(double a, double b, UV **d, int n, int m) {
+colshft(double a, double b, projUV **d, int n, int m) {
int k, j;
double fac, cnst;
@@ -124,11 +124,11 @@ colshft(double a, double b, UV **d, int n, int m) {
dadd(d[k], d[k+1], cnst, m);
}
int /* entry point */
-bch2bps(UV a, UV b, UV **c, int nu, int nv) {
- UV **d;
+bch2bps(projUV a, projUV b, projUV **c, int nu, int nv) {
+ projUV **d;
int i;
- if (nu < 1 || nv < 1 || !(d = (UV **)vector2(nu, nv, sizeof(UV))))
+ if (nu < 1 || nv < 1 || !(d = (projUV **)vector2(nu, nv, sizeof(projUV))))
return 0;
/* do rows to power series */
for (i = 0; i < nu; ++i) {
diff --git a/src/bchgen.c b/src/bchgen.c
index cc03f037..4baf73a6 100644
--- a/src/bchgen.c
+++ b/src/bchgen.c
@@ -4,9 +4,9 @@ static const char SCCSID[]="@(#)bchgen.c 4.5 94/03/22 GIE REL";
#endif
#include <projects.h>
int
-bchgen(UV a, UV b, int nu, int nv, UV **f, UV(*func)(UV)) {
+bchgen(projUV a, projUV b, int nu, int nv, projUV **f, projUV(*func)(projUV)) {
int i, j, k;
- UV arg, *t, bma, bpa, *c;
+ projUV arg, *t, bma, bpa, *c;
double d, fac;
bma.u = 0.5 * (b.u - a.u); bma.v = 0.5 * (b.v - a.v);
@@ -20,7 +20,7 @@ bchgen(UV a, UV b, int nu, int nv, UV **f, UV(*func)(UV)) {
return(1);
}
}
- if (!(c = vector1(nu, sizeof(UV)))) return 1;
+ if (!(c = vector1(nu, sizeof(projUV)))) return 1;
fac = 2. / nu;
for ( j = 0; j < nv ; ++j) {
for ( i = 0; i < nu; ++i) {
@@ -38,7 +38,7 @@ bchgen(UV a, UV b, int nu, int nv, UV **f, UV(*func)(UV)) {
f[i][j] = c[i];
}
pj_dalloc(c);
- if (!(c = vector1(nv, sizeof(UV)))) return 1;
+ if (!(c = vector1(nv, sizeof(projUV)))) return 1;
fac = 2. / nv;
for ( i = 0; i < nu; ++i) {
t = f[i];
diff --git a/src/biveval.c b/src/biveval.c
index 3dcd7461..ba34e085 100644
--- a/src/biveval.c
+++ b/src/biveval.c
@@ -4,7 +4,7 @@ static const char SCCSID[]="@(#)biveval.c 4.4 93/06/12 GIE REL";
#endif
# include <projects.h>
# define NEAR_ONE 1.00001
- static UV
+ static projUV
w2, w;
static double /* basic bivariate Chebyshev evaluation */
ceval(C, n) struct PW_COEF *C; {
@@ -33,9 +33,9 @@ ceval(C, n) struct PW_COEF *C; {
} else
return (w.u * d - dd);
}
- UV /* bivariate Chebyshev polynomial entry point */
-bcheval(UV in, Tseries *T) {
- UV out;
+ projUV /* bivariate Chebyshev polynomial entry point */
+bcheval(projUV in, Tseries *T) {
+ projUV out;
/* scale to +-1 */
w.u = ( in.u + in.u - T->a.u ) * T->b.u;
w.v = ( in.v + in.v - T->a.v ) * T->b.v;
@@ -50,9 +50,9 @@ bcheval(UV in, Tseries *T) {
}
return out;
}
- UV /* bivariate power polynomial entry point */
-bpseval(UV in, Tseries *T) {
- UV out;
+ projUV /* bivariate power polynomial entry point */
+bpseval(projUV in, Tseries *T) {
+ projUV out;
double *c, row;
int i, m;
@@ -77,7 +77,7 @@ bpseval(UV in, Tseries *T) {
}
return out;
}
- UV /* general entry point selecting evaluation mode */
-biveval(UV in, Tseries *T) {
+ projUV /* general entry point selecting evaluation mode */
+biveval(projUV in, Tseries *T) {
return (T->power ? bpseval(in, T) : bcheval(in, T));
}
diff --git a/src/gen_cheb.c b/src/gen_cheb.c
index 14ac3ce9..191cb822 100644
--- a/src/gen_cheb.c
+++ b/src/gen_cheb.c
@@ -12,10 +12,10 @@ static const char SCCSID[]="@(#)gen_cheb.c 4.9 95/09/23 GIE REL";
#define COEF_LINE_MAX 60
#endif
void
-gen_cheb(int inverse, UV (*proj)(), char *s, PJ *P, int iargc, char **iargv) {
+gen_cheb(int inverse, projUV (*proj)(), char *s, PJ *P, int iargc, char **iargv) {
int NU = 15, NV = 15, i, res = -1, errin = 0, pwr;
char *arg, fmt[15];
- UV low, upp, resid;
+ projUV low, upp, resid;
Tseries *F;
extern void p_series(Tseries *, FILE *, char *);
double (*input)();
diff --git a/src/mk_cheby.c b/src/mk_cheby.c
index 65b47890..3a28e652 100644
--- a/src/mk_cheby.c
+++ b/src/mk_cheby.c
@@ -3,10 +3,10 @@ static const char SCCSID[]="@(#)mk_cheby.c 4.5 94/03/22 GIE REL";
#endif
#include <projects.h>
static void /* sum coefficients less than res */
-eval(UV **w, int nu, int nv, double res, UV *resid) {
+eval(projUV **w, int nu, int nv, double res, projUV *resid) {
int i, j;
double ab;
- UV *s;
+ projUV *s;
resid->u = resid->v = 0.;
for (i = 0; i < nu; ++i)
@@ -36,19 +36,19 @@ makeT(int nru, int nrv) {
return 0;
}
Tseries *
-mk_cheby(UV a, UV b, double res, UV *resid, UV (*func)(UV),
+mk_cheby(projUV a, projUV b, double res, projUV *resid, projUV (*func)(projUV),
int nu, int nv, int power) {
int j, i, nru, nrv, *ncu, *ncv;
Tseries *T;
- UV **w;
+ projUV **w;
double cutres;
- if (!(w = (UV **)vector2(nu, nv, sizeof(UV))) ||
+ if (!(w = (projUV **)vector2(nu, nv, sizeof(projUV))) ||
!(ncu = (int *)vector1(nu + nv, sizeof(int))))
return 0;
ncv = ncu + nu;
if (!bchgen(a, b, nu, nv, w, func)) {
- UV *s;
+ projUV *s;
double ab, *p;
/* analyse coefficients and adjust until residual OK */
diff --git a/src/nad2nad.c b/src/nad2nad.c
index 210854e6..b6f158dd 100644
--- a/src/nad2nad.c
+++ b/src/nad2nad.c
@@ -144,12 +144,12 @@ set_ops(char *s, struct IO_CON *io) {
static void
process(FILE *fid) {
char line[MAX_LINE], *s, t, pline[100];
- UV val;
+ projUV val;
double tmp;
for (;;) {
if (input.bin)
- fread(&val, sizeof(UV), 1, fid);
+ fread(&val, sizeof(projUV), 1, fid);
else if (s = fgets(line, MAX_LINE, fid)) {
if (*s == tag) {
fputs(line, stdout);
@@ -188,7 +188,7 @@ process(FILE *fid) {
val.v = tmp;
}
if (output.bin)
- (void)fwrite(&val, sizeof(UV), 1, stdout);
+ (void)fwrite(&val, sizeof(projUV), 1, stdout);
else {
if (echoin) {
t = *s;
diff --git a/src/proj.c b/src/proj.c
index e14b5b26..9f49d47d 100644
--- a/src/proj.c
+++ b/src/proj.c
@@ -15,8 +15,8 @@ static const char SCCSID[]="@(#)proj.c 4.12 95/09/23 GIE REL";
#define PJ_INVERS(P) (P->inv ? 1 : 0)
static PJ
*Proj;
- static UV
-(*proj)(UV, PJ *);
+ static projUV
+(*proj)(projUV, PJ *);
static int
reversein = 0, /* != 0 reverse input arguments */
reverseout = 0, /* != 0 reverse output arguments */
@@ -41,8 +41,8 @@ facs;
static double
(*informat)(const char *, char **), /* input data deformatter function */
fscale = 0.; /* cartesian scale factor */
- static UV
-int_proj(data) UV data; {
+ static projUV
+int_proj(data) projUV data; {
if (prescale) { data.u *= fscale; data.v *= fscale; }
data = (*proj)(data, Proj);
if (postscale && data.u != HUGE_VAL)
@@ -52,12 +52,12 @@ int_proj(data) UV data; {
static void /* file processing function */
process(FILE *fid) {
char line[MAX_LINE+3], *s, pline[40];
- UV data;
+ projUV data;
for (;;) {
++emess_dat.File_line;
if (bin_in) { /* binary input */
- if (fread(&data, sizeof(UV), 1, fid) != 1)
+ if (fread(&data, sizeof(projUV), 1, fid) != 1)
break;
} else { /* ascii input */
if (!(s = fgets(line, MAX_LINE, fid)))
@@ -103,7 +103,7 @@ process(FILE *fid) {
{ data.u *= fscale; data.v *= fscale; }
}
if (bin_out) { /* binary output */
- (void)fwrite(&data, sizeof(UV), 1, stdout);
+ (void)fwrite(&data, sizeof(projUV), 1, stdout);
continue;
} else if (data.u == HUGE_VAL) /* error output */
(void)fputs(oterr, stdout);
@@ -143,7 +143,7 @@ process(FILE *fid) {
static void /* file processing function --- verbosely */
vprocess(FILE *fid) {
char line[MAX_LINE+3], *s, pline[40];
- UV dat_ll, dat_xy;
+ projUV dat_ll, dat_xy;
int linvers;
if (!oform)
@@ -400,7 +400,7 @@ badscale:
} else
proj = pj_fwd;
if (cheby_str) {
- extern void gen_cheb(int, UV(*)(), char *, PJ *, int, char **);
+ extern void gen_cheb(int, projUV(*)(), char *, PJ *, int, char **);
gen_cheb(inverse, int_proj, cheby_str, Proj, iargc, iargv);
exit(0);
diff --git a/src/projects.h b/src/projects.h
index 7f4a30c3..da4a1149 100644
--- a/src/projects.h
+++ b/src/projects.h
@@ -38,12 +38,12 @@ extern double hypot(double, double);
#define DIR_CHAR '/'
#endif
-typedef struct { double u, v; } UV;
+typedef struct { double u, v; } projUV;
typedef struct { double r, i; } COMPLEX;
#ifndef PJ_LIB__
-#define XY UV
-#define LP UV
+#define XY projUV
+#define LP projUV
#else
typedef struct { double x, y; } XY;
typedef struct { double lam, phi; } LP;
@@ -213,7 +213,7 @@ void pj_dalloc(void *);
char *pj_strerrno(int);
/* Approximation structures and procedures */
typedef struct { /* Chebyshev or Power series structure */
- UV a, b; /* power series range for evaluation */
+ projUV a, b; /* power series range for evaluation */
/* or Chebyshev argument shift/scaling */
struct PW_COEF {/* row coefficient structure */
int m; /* number of c coefficients (=0 for none) */
@@ -222,14 +222,14 @@ typedef struct { /* Chebyshev or Power series structure */
int mu, mv; /* maximum cu and cv index (+1 for count) */
int power; /* != 0 if power series, else Chebyshev */
} Tseries;
-Tseries *mk_cheby(UV, UV, double, UV *, UV (*)(UV), int, int, int);
-UV bpseval(UV, Tseries *);
-UV bcheval(UV, Tseries *);
-UV biveval(UV, Tseries *);
+Tseries *mk_cheby(projUV, projUV, double, projUV *, projUV (*)(projUV), int, int, int);
+projUV bpseval(projUV, Tseries *);
+projUV bcheval(projUV, Tseries *);
+projUV biveval(projUV, Tseries *);
void *vector1(int, int);
void **vector2(int, int, int);
-int bchgen(UV, UV, int, int, UV **, UV(*)(UV));
-int bch2bps(UV, UV, UV **, int, int);
+int bchgen(projUV, projUV, int, int, projUV **, projUV(*)(projUV));
+int bch2bps(projUV, projUV, projUV **, int, int);
/* nadcon related protos */
LP nad_intr(LP, struct CTABLE *);
LP nad_cvt(LP, int, struct CTABLE *);