Changeset 1020 for trunk/psLib/src/dataManip/psFunctions.c
- Timestamp:
- Jun 14, 2004, 9:33:09 AM (22 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/dataManip/psFunctions.c (modified) (17 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/dataManip/psFunctions.c
r889 r1020 4 4 * routines. 5 5 * 6 * @author George Gusciora, MHPCC 6 * This file will hold the functions for allocated, freeing, and evaluating 7 * polynomials. It also contains a Gaussian functions. 7 8 * 8 * @version $Revision: 1.1 1$ $Name: not supported by cvs2svn $9 * @date $Date: 2004-06- 07 00:32:53$9 * @version $Revision: 1.12 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2004-06-14 19:32:42 $ 10 11 * 11 12 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 103 104 psPolynomial1D *psPolynomial1DAlloc(int n) 104 105 { 106 int i = 0; 105 107 psPolynomial1D *newPoly = NULL; 106 108 … … 110 112 newPoly->coeffErr = (float *) psAlloc(n * sizeof(float)); 111 113 newPoly->mask = (char *) psAlloc(n * sizeof(char)); 114 for (i=0;i<n;i++) { 115 newPoly->coeff[i] = 0.0; 116 newPoly->coeffErr[i] = 0.0; 117 newPoly->mask[i] = 0.0; 118 } 112 119 113 120 return(newPoly); … … 117 124 { 118 125 int x = 0; 126 int y = 0; 119 127 psPolynomial2D *newPoly = NULL; 120 128 … … 131 139 newPoly->mask[x] = (char *) psAlloc(nY * sizeof(char)); 132 140 } 133 141 for (x=0;x<nX;x++) { 142 for (y=0;y<nY;y++) { 143 newPoly->coeff[x][y] = 0.0; 144 newPoly->coeffErr[x][y] = 0.0; 145 newPoly->mask[x][y] = 0; 146 } 147 } 134 148 135 149 return(newPoly); … … 140 154 int x = 0; 141 155 int y = 0; 156 int z = 0; 142 157 psPolynomial3D *newPoly = NULL; 143 158 … … 160 175 } 161 176 } 177 for (x=0;x<nX;x++) { 178 for (y=0;y<nY;y++) { 179 for (z=0;z<nZ;z++) { 180 newPoly->coeff[x][y][z] = 0.0; 181 newPoly->coeffErr[x][y][z] = 0.0; 182 newPoly->mask[x][y][z] = 0; 183 } 184 } 185 } 162 186 163 187 return(newPoly); … … 169 193 int x = 0; 170 194 int y = 0; 195 int z = 0; 171 196 psPolynomial4D *newPoly = NULL; 172 197 … … 195 220 } 196 221 } 222 for (w=0;w<nW;w++) { 223 for (x=0;x<nX;x++) { 224 for (y=0;y<nY;y++) { 225 for (z=0;z<nZ;z++) { 226 newPoly->coeff[w][x][y][z] = 0.0; 227 newPoly->coeffErr[w][x][y][z] = 0.0; 228 newPoly->mask[w][x][y][z] = 0; 229 } 230 } 231 } 232 } 197 233 198 234 return(newPoly); … … 394 430 psDPolynomial1D *psDPolynomial1DAlloc(int n) 395 431 { 432 int i = 0; 396 433 psDPolynomial1D *newPoly = NULL; 397 434 … … 401 438 newPoly->coeffErr = (double *) psAlloc(n * sizeof(double)); 402 439 newPoly->mask = (char *) psAlloc(n * sizeof(char)); 440 for (i=0;i<n;i++) { 441 newPoly->coeff[i] = 0.0; 442 newPoly->coeffErr[i] = 0.0; 443 newPoly->mask[i] = 0.0; 444 } 403 445 404 446 return(newPoly); … … 408 450 { 409 451 int x = 0; 452 int y = 0; 410 453 psDPolynomial2D *newPoly = NULL; 411 454 … … 422 465 newPoly->mask[x] = (char *) psAlloc(nY * sizeof(char)); 423 466 } 467 for (x=0;x<nX;x++) { 468 for (y=0;y<nY;y++) { 469 newPoly->coeff[x][y] = 0.0; 470 newPoly->coeffErr[x][y] = 0.0; 471 newPoly->mask[x][y] = 0; 472 } 473 } 424 474 425 475 return(newPoly); … … 430 480 int x = 0; 431 481 int y = 0; 482 int z = 0; 432 483 psDPolynomial3D *newPoly = NULL; 433 484 … … 450 501 } 451 502 } 503 for (x=0;x<nX;x++) { 504 for (y=0;y<nY;y++) { 505 for (z=0;z<nZ;z++) { 506 newPoly->coeff[x][y][z] = 0.0; 507 newPoly->coeffErr[x][y][z] = 0.0; 508 newPoly->mask[x][y][z] = 0; 509 } 510 } 511 } 452 512 453 513 return(newPoly); … … 459 519 int x = 0; 460 520 int y = 0; 521 int z = 0; 461 522 psDPolynomial4D *newPoly = NULL; 462 523 … … 485 546 } 486 547 } 548 for (w=0;w<nW;w++) { 549 for (x=0;x<nX;x++) { 550 for (y=0;y<nY;y++) { 551 for (z=0;z<nZ;z++) { 552 newPoly->coeff[w][x][y][z] = 0.0; 553 newPoly->coeffErr[w][x][y][z] = 0.0; 554 newPoly->mask[w][x][y][z] = 0; 555 } 556 } 557 } 558 } 487 559 488 560 return(newPoly);
Note:
See TracChangeset
for help on using the changeset viewer.
