Changeset 5294 for trunk/psLib/src/astro/psCoord.c
- Timestamp:
- Oct 12, 2005, 11:02:20 AM (21 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/astro/psCoord.c (modified) (19 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/astro/psCoord.c
r5090 r5294 10 10 * @author GLG, MHPCC 11 11 * 12 * @version $Revision: 1.8 7$ $Name: not supported by cvs2svn $13 * @date $Date: 2005- 09-22 02:47:16$12 * @version $Revision: 1.88 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2005-10-12 21:02:20 $ 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 90 90 91 91 A = transform->x->coeff[0][0]; 92 if (transform->x-> COOL_2D_nX >= 1) {92 if (transform->x->nX >= 1) { 93 93 B = transform->x->coeff[1][0]; 94 94 } 95 if (transform->x-> COOL_2D_nY >= 1) {95 if (transform->x->nY >= 1) { 96 96 C = transform->x->coeff[0][1]; 97 97 } 98 98 D = transform->y->coeff[0][0]; 99 if (transform->y-> COOL_2D_nX >= 1) {99 if (transform->y->nX >= 1) { 100 100 E = transform->y->coeff[1][0]; 101 101 } 102 if (transform->y-> COOL_2D_nY >= 1) {102 if (transform->y->nY >= 1) { 103 103 F = transform->y->coeff[0][1]; 104 104 } … … 154 154 PS_ASSERT_PTR_NON_NULL(transform->y, 0); 155 155 156 for (psS32 i=0;i<(1 + transform->x-> COOL_2D_nX);i++) {157 for (psS32 j=0;j<(1 + transform->x-> COOL_2D_nY);j++) {156 for (psS32 i=0;i<(1 + transform->x->nX);i++) { 157 for (psS32 j=0;j<(1 + transform->x->nY);j++) { 158 158 if (transform->x->coeff[i][j] != 0.0) { 159 159 if (!(((i == 0) && (j == 0)) || … … 166 166 } 167 167 168 for (psS32 i=0;i<(1 + transform->y-> COOL_2D_nX);i++) {169 for (psS32 j=0;j<(1 + transform->y-> COOL_2D_nY);j++) {168 for (psS32 i=0;i<(1 + transform->y->nX);i++) { 169 for (psS32 j=0;j<(1 + transform->y->nY);j++) { 170 170 if (transform->y->coeff[i][j] != 0.0) { 171 171 if (!(((i == 0) && (j == 0)) || … … 501 501 psPolynomial2D *trans2) 502 502 { 503 //TRACE: printf("multiplyDPoly2D(%d %d: %d %d)\n", trans1-> COOL_2D_nX, trans1->COOL_2D_nY, trans2->COOL_2D_nX, trans2->COOL_2D_nY);503 //TRACE: printf("multiplyDPoly2D(%d %d: %d %d)\n", trans1->nX, trans1->nY, trans2->nX, trans2->nY); 504 504 // XXX: OLD: psS32 orderX = (trans1->nX + trans2->nX) - 1; 505 505 // XXX: Verify this (the poly order change) 506 psS32 orderX = trans1-> COOL_2D_nX + trans2->COOL_2D_nX + 1;507 psS32 orderY = trans1-> COOL_2D_nY + trans2->COOL_2D_nY + 1;506 psS32 orderX = trans1->nX + trans2->nX + 1; 507 psS32 orderY = trans1->nY + trans2->nY + 1; 508 508 509 509 // XXX: Verify this (the poly order change) 510 510 psPolynomial2D *out = psPolynomial2DAlloc(orderX-1, orderY-1, PS_POLYNOMIAL_ORD); 511 511 //TRACE: printf("Creating poly (%d, %d)\n", orderX, orderY); 512 for (psS32 i = 0 ; i < (1 + out-> COOL_2D_nX); i++) {513 for (psS32 j = 0 ; j < (1 + out-> COOL_2D_nY); j++) {512 for (psS32 i = 0 ; i < (1 + out->nX); i++) { 513 for (psS32 j = 0 ; j < (1 + out->nY); j++) { 514 514 out->coeff[i][j] = 0.0; 515 515 out->mask[i][j] = 0; … … 517 517 } 518 518 519 for (psS32 t1x = 0 ; t1x < (1 + trans1-> COOL_2D_nX) ; t1x++) {520 for (psS32 t1y = 0 ; t1y < (1 + trans1-> COOL_2D_nY) ; t1y++) {519 for (psS32 t1x = 0 ; t1x < (1 + trans1->nX) ; t1x++) { 520 for (psS32 t1y = 0 ; t1y < (1 + trans1->nY) ; t1y++) { 521 521 if (0.0 != trans1->coeff[t1x][t1y]) { 522 for (psS32 t2x = 0 ; t2x < (1 + trans2-> COOL_2D_nX) ; t2x++) {523 for (psS32 t2y = 0 ; t2y < (1 + trans2-> COOL_2D_nY) ; t2y++) {522 for (psS32 t2x = 0 ; t2x < (1 + trans2->nX) ; t2x++) { 523 for (psS32 t2y = 0 ; t2y < (1 + trans2->nY) ; t2y++) { 524 524 /* Possible debug-only macro which checks these coords? 525 525 if ((t1x+t2x) >= orderX) … … 552 552 PS_ASSERT_PTR_NON_NULL(trans1, NULL); 553 553 PS_ASSERT_PTR_NON_NULL(trans2, NULL); 554 //TRACE: printf("psPlaneTransformCombine(%d, %d, %d, %d: %d, %d, %d, %d)\n", trans1->x-> COOL_2D_nX, trans1->x->COOL_2D_nY, trans1->y->COOL_2D_nX, trans1->y->COOL_2D_nY, trans2->x->COOL_2D_nX, trans2->x->COOL_2D_nY, trans2->y->COOL_2D_nX, trans2->y->COOL_2D_nY);554 //TRACE: printf("psPlaneTransformCombine(%d, %d, %d, %d: %d, %d, %d, %d)\n", trans1->x->nX, trans1->x->nY, trans1->y->nX, trans1->y->nY, trans2->x->COOL_2D_nX, trans2->x->COOL_2D_nY, trans2->y->COOL_2D_nX, trans2->y->COOL_2D_nY); 555 555 // 556 556 // Determine the size of the new psPlaneTransform. … … 558 558 // PS_MAX( Number of x terms in T2->x * number of x terms in T1->x, 559 559 // Number of y terms in T2->x * number of x terms in T1->y, 560 psS32 orderXnX = PS_MAX(((1 + trans2->x-> COOL_2D_nX) * (1 + trans1->x->COOL_2D_nX)),561 ((1 + trans2->x-> COOL_2D_nY) * (1 + trans1->y->COOL_2D_nX)));562 psS32 orderXnY = PS_MAX(((1 + trans2->x-> COOL_2D_nX) * (1 + trans1->x->COOL_2D_nY)),563 ((1 + trans2->x-> COOL_2D_nY) * (1 + trans1->y->COOL_2D_nY)));564 565 psS32 orderYnX = PS_MAX(((1 + trans2->y-> COOL_2D_nX) * (1 + trans1->x->COOL_2D_nX)),566 ((1 + trans2->y-> COOL_2D_nY) * (1 + trans1->y->COOL_2D_nX)));567 psS32 orderYnY = PS_MAX(((1 + trans2->y-> COOL_2D_nX) * (1 + trans1->x->COOL_2D_nY)),568 ((1 + trans2->y-> COOL_2D_nY) * (1 + trans1->y->COOL_2D_nY)));560 psS32 orderXnX = PS_MAX(((1 + trans2->x->nX) * (1 + trans1->x->nX)), 561 ((1 + trans2->x->nY) * (1 + trans1->y->nX))); 562 psS32 orderXnY = PS_MAX(((1 + trans2->x->nX) * (1 + trans1->x->nY)), 563 ((1 + trans2->x->nY) * (1 + trans1->y->nY))); 564 565 psS32 orderYnX = PS_MAX(((1 + trans2->y->nX) * (1 + trans1->x->nX)), 566 ((1 + trans2->y->nY) * (1 + trans1->y->nX))); 567 psS32 orderYnY = PS_MAX(((1 + trans2->y->nX) * (1 + trans1->x->nY)), 568 ((1 + trans2->y->nY) * (1 + trans1->y->nY))); 569 569 psS32 orderX = PS_MAX(orderXnX, orderYnX); 570 570 psS32 orderY = PS_MAX(orderXnY, orderYnY); … … 578 578 myPT = psPlaneTransformAlloc(orderX, orderY); 579 579 } else { 580 if (((1 + out->x-> COOL_2D_nX) == orderX) && ((1 + out->x->COOL_2D_nY) == orderY) &&581 ((1 + out->y-> COOL_2D_nX) == orderX) && ((1 + out->y->COOL_2D_nY) == orderY)) {580 if (((1 + out->x->nX) == orderX) && ((1 + out->x->nY) == orderY) && 581 ((1 + out->y->nX) == orderX) && ((1 + out->y->nY) == orderY)) { 582 582 myPT = out; 583 583 } else { … … 609 609 // 610 610 611 for (psS32 t2x = 0 ; t2x < (1 + trans2->x-> COOL_2D_nX) ; t2x++) {612 for (psS32 t2y = 0 ; t2y < (1 + trans2->x-> COOL_2D_nX) ; t2y++) {611 for (psS32 t2x = 0 ; t2x < (1 + trans2->x->nX) ; t2x++) { 612 for (psS32 t2y = 0 ; t2y < (1 + trans2->x->nX) ; t2y++) { 613 613 // XXX: Verify this (poly order/nterm change) 614 614 psPolynomial2D *currPoly = psPolynomial2DAlloc(1-1, 1-1, PS_POLYNOMIAL_ORD); … … 634 634 635 635 // Set the appropriate coeffs in myPT->x 636 for (psS32 i = 0 ; i < (1 + currPoly-> COOL_2D_nX) ; i++) {637 for (psS32 j = 0 ; j < (1 + currPoly-> COOL_2D_nY) ; j++) {636 for (psS32 i = 0 ; i < (1 + currPoly->nX) ; i++) { 637 for (psS32 j = 0 ; j < (1 + currPoly->nY) ; j++) { 638 638 myPT->x->coeff[i][j]+= currPoly->coeff[i][j] * trans2->x->coeff[t2x][t2y]; 639 639 } … … 645 645 646 646 647 for (psS32 t2x = 0 ; t2x < (1 + trans2->y-> COOL_2D_nX) ; t2x++) {648 for (psS32 t2y = 0 ; t2y < (1 + trans2->y-> COOL_2D_nY) ; t2y++) {647 for (psS32 t2x = 0 ; t2x < (1 + trans2->y->nX) ; t2x++) { 648 for (psS32 t2y = 0 ; t2y < (1 + trans2->y->nY) ; t2y++) { 649 649 // XXX: Verify this (poly order/nterm change) 650 650 psPolynomial2D *currPoly = psPolynomial2DAlloc(1-1, 1-1, PS_POLYNOMIAL_ORD); … … 670 670 671 671 // Set the appropriate coeffs in myPT->x 672 for (psS32 i = 0 ; i < (1 + currPoly-> COOL_2D_nX) ; i++) {673 for (psS32 j = 0 ; j < (1 + currPoly-> COOL_2D_nY) ; j++) {672 for (psS32 i = 0 ; i < (1 + currPoly->nX) ; i++) { 673 for (psS32 j = 0 ; j < (1 + currPoly->nY) ; j++) { 674 674 myPT->y->coeff[i][j]+= currPoly->coeff[i][j] * trans2->y->coeff[t2x][t2y]; 675 675 } … … 702 702 703 703 psS32 numCoords = PS_MIN(source->n, dest->n); 704 psS32 order = PS_MAX(trans->x-> COOL_2D_nX, trans->x->COOL_2D_nY);705 order = PS_MAX(order, trans->y-> COOL_2D_nX);706 order = PS_MAX(order, trans->y-> COOL_2D_nY);704 psS32 order = PS_MAX(trans->x->nX, trans->x->nY); 705 order = PS_MAX(order, trans->y->nX); 706 order = PS_MAX(order, trans->y->nY); 707 707 // XXX: Verify, or recode, after the poly norder/nterm change. 708 708 order++; … … 822 822 823 823 // Ensure that the input transformation is symmetrical. 824 if ((in->x-> COOL_2D_nX != in->x->COOL_2D_nY) ||825 (in->y-> COOL_2D_nX != in->y->COOL_2D_nY) ||826 (in->x-> COOL_2D_nX != in->y->COOL_2D_nX)) {824 if ((in->x->nX != in->x->nY) || 825 (in->y->nX != in->y->nY) || 826 (in->x->nX != in->y->nX)) { 827 827 psError(PS_ERR_BAD_PARAMETER_TYPE, true, "Input transformation must have same nX==nY."); 828 828 } 829 829 // XXX: recode or verify after poly changes 830 psS32 order = 1 + in->x-> COOL_2D_nX;830 psS32 order = 1 + in->x->nX; 831 831 832 832 psPlaneTransform *myPT = NULL; … … 842 842 } else { 843 843 // XXX: recode or verify after poly changes 844 if (((1 + out->x-> COOL_2D_nX) == order) && ((1 + out->x->COOL_2D_nY) == order) &&845 ((1 + out->y-> COOL_2D_nX) == order) && ((1 + out->y->COOL_2D_nX) == order)) {844 if (((1 + out->x->nX) == order) && ((1 + out->x->nY) == order) && 845 ((1 + out->y->nX) == order) && ((1 + out->y->nX) == order)) { 846 846 myPT = out; 847 847 } else { … … 854 854 // Copy the input transform to myPT. 855 855 // 856 for (psS32 i = 0 ; i < (1 + in->x-> COOL_2D_nX) ; i++) {857 for (psS32 j = 0 ; j < (1 + in->x-> COOL_2D_nY) ; j++) {856 for (psS32 i = 0 ; i < (1 + in->x->nX) ; i++) { 857 for (psS32 j = 0 ; j < (1 + in->x->nY) ; j++) { 858 858 myPT->x->coeff[i][j] = in->x->coeff[i][j]; 859 859 } 860 860 } 861 for (psS32 i = 0 ; i < (1 + in->y-> COOL_2D_nX) ; i++) {862 for (psS32 j = 0 ; j < (1 + in->y-> COOL_2D_nY) ; j++) {861 for (psS32 i = 0 ; i < (1 + in->y->nX) ; i++) { 862 for (psS32 j = 0 ; j < (1 + in->y->nY) ; j++) { 863 863 myPT->y->coeff[i][j] = in->y->coeff[i][j]; 864 864 } … … 940 940 941 941 // This loop starts at loop_x=1 since the derivative of the loop_x=0 terms are all 0.0 942 for (psS32 loop_x = 1; loop_x < (1 + xPoly-> COOL_2D_nX); loop_x++) {942 for (psS32 loop_x = 1; loop_x < (1 + xPoly->nX); loop_x++) { 943 943 ySum = 1.0; 944 for (psS32 loop_y = 0; loop_y < (1 + xPoly-> COOL_2D_nY); loop_y++) {944 for (psS32 loop_y = 0; loop_y < (1 + xPoly->nY); loop_y++) { 945 945 // 946 946 // For each iteration of the loop, we multiple the (x, y) coefficient … … 960 960 961 961 // This loop starts at loop_y=1 since the derivative of the loop_y=0 terms are all 0.0 962 for (psS32 loop_x = 0; loop_x < (1 + yPoly-> COOL_2D_nX); loop_x++) {962 for (psS32 loop_x = 0; loop_x < (1 + yPoly->nX); loop_x++) { 963 963 ySum = 1.0; 964 for (psS32 loop_y = 1; loop_y < (1 + yPoly-> COOL_2D_nY); loop_y++) {964 for (psS32 loop_y = 1; loop_y < (1 + yPoly->nY); loop_y++) { 965 965 // 966 966 // For each iteration of the loop, we multiple the (x, y) coefficient
Note:
See TracChangeset
for help on using the changeset viewer.
