home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Los Alamos National Laboratory
/
LANL_CD.ISO
/
software
/
compres
/
src
/
conv_ds2.c
< prev
next >
Wrap
C/C++ Source or Header
|
1992-02-11
|
2KB
|
87 lines
/****************************************************************
COPYRIGHT (C) 1992 UNIVERSITY OF CALIFORNIA
***************************************************************/
conv_ds_lp_rbc(x, x1, h, m, npt)
int m, npt;
float *x, *h;
register float *x1;
{
int nptl, nptr, flag;
register int m1, m2;
float *max1, *max3, *hmax2;
register float *hptr, *ptr1, *ptr2, *hmax1, *max2, *xptr;
m1 = m - 1;
nptl = m2 = m/2;
nptr = m - nptl;
flag = ( m2 % 2 ) ? 1 : 0;
hmax2 = h + m2;
max1 = (flag) ? x1 + nptl/2 + 1 : x1 + nptl/2;
max2 = x1 + (npt - nptr) / 2 + 1;
max3 = x1 + npt/2;
/*________________________________________________________________*/
hmax1 = (hptr = h) + nptl;
ptr1 = x + nptl;
ptr2 = x + nptr - 1;
*x1 = 0.;
while(hptr < hmax1)
*x1 += *hptr++ * (*ptr1-- + *ptr2--);
*x1++ += *hptr * *ptr2;
nptr += 2;
nptl -= 2;
while(x1 < max1) {
hmax1 = (hptr = h) + nptl;
ptr1 = x + nptl;
ptr2 = x + nptr - 1;
nptr += 2;
nptl -= 2;
*x1 = 0.;
while( ptr1 >= x )
*x1 += *hptr++ * (*ptr1-- + *ptr2--);
ptr1 = x + 1;
while(hptr < hmax2)
*x1 += *hptr++ * (*ptr1++ + *ptr2--);
*x1++ += *hptr * *ptr2;
}
/*________________________________________________________________*/
xptr = ( flag ) ? x + 1 : x;
while(x1 < max2) {
ptr2 = (ptr1 = xptr) + m1;
hmax1 = (hptr = h) + m2;
*x1 = 0.;
while(hptr < hmax1)
*x1 += *hptr++ * (*ptr1++ + *ptr2--);
*x1++ += *hptr * *ptr1;
xptr += 2;
}
/*________________________________________________________________*/
nptr = ( flag ) ? 2 : 1;
nptl = m - nptr;
while(x1 < max3) {
hptr = h;
hmax1 = h + nptr + 1;
ptr1 = x + npt - nptl;
ptr2 = x + npt - nptr - 1;
nptr += 2;
nptl -= 2;
*x1 = 0;
while(hptr < hmax1)
*x1 += *hptr++ * (*ptr1++ + *ptr2++);
ptr2 = x + npt - 2;
while(hptr < hmax2)
*x1 += *hptr++ * (*ptr1++ + *ptr2--);
*x1++ += *hptr * *ptr2;
}
}