Changeset 3520 in Sophya for trunk/SophyaPI/PIext/pitvmaad.cc
- Timestamp:
- Sep 11, 2008, 2:45:01 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PIext/pitvmaad.cc
r2930 r3520 71 71 72 72 /* --Methode-- */ 73 template <class T> 74 double POTMatrixAdapter<T>::MeanVal(int ix1, int ix2, int jy1, int jy2) 75 { 76 int ec; 77 if (ix1>ix2) { ec=ix1; ix1=ix2; ix2=ec; } 78 if (jy1>jy2) { ec=jy1; jy1=jy2; jy2=ec; } 79 double ss = 0.; 80 for(int j=jy1; j<=jy2; j++) 81 for(int i=ix1; i<=ix2; i++) ss += (double)((*mMtx)(j, i)); 82 ss /= (double)((jy2-jy1+1)*(ix2-ix1+1)); 83 return ss; 84 } 85 86 87 /* --Methode-- */ 73 88 DECL_TEMP_SPEC /* equivalent a template <> , pour SGI-CC en particulier */ 74 89 double POTMatrixAdapter< complex<float> >::Value(int ix, int iy) … … 89 104 return(sqrt(re*re+im*im)); 90 105 } 106 107 /* --Methode-- */ 108 DECL_TEMP_SPEC /* equivalent a template <> , pour SGI-CC en particulier */ 109 double POTMatrixAdapter< complex<float> >::MeanVal(int ix1, int ix2, int jy1, int jy2) 110 { 111 int ec; 112 if (ix1>ix2) { ec=ix1; ix1=ix2; ix2=ec; } 113 if (jy1>jy2) { ec=jy1; jy1=jy2; jy2=ec; } 114 complex<float> ss = 0.; 115 for(int j=jy1; j<=jy2; j++) 116 for(int i=ix1; i<=ix2; i++) ss += (*mMtx)(j, i); 117 ss /= (double)((jy2-jy1+1)*(ix2-ix1+1)); 118 return sqrt(ss.real()*ss.real()+ss.imag()*ss.imag()); 119 } 120 121 /* --Methode-- */ 122 DECL_TEMP_SPEC /* equivalent a template <> , pour SGI-CC en particulier */ 123 double POTMatrixAdapter< complex<double> >::MeanVal(int ix1, int ix2, int jy1, int jy2) 124 { 125 int ec; 126 if (ix1>ix2) { ec=ix1; ix1=ix2; ix2=ec; } 127 if (jy1>jy2) { ec=jy1; jy1=jy2; jy2=ec; } 128 complex<double> ss = 0.; 129 for(int j=jy1; j<=jy2; j++) 130 for(int i=ix1; i<=ix2; i++) ss += (*mMtx)(j, i); 131 ss /= (double)((jy2-jy1+1)*(ix2-ix1+1)); 132 return sqrt(ss.real()*ss.real()+ss.imag()*ss.imag()); 133 } 91 134 92 135 #ifdef __CXX_PRAGMA_TEMPLATES__
Note:
See TracChangeset
for help on using the changeset viewer.