Changeset 235 for trunk/src/SDMathWrapper.cc
- Timestamp:
- 01/21/05 12:21:36 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/SDMathWrapper.cc
r227 r235 46 46 47 47 48 SDMemTableWrapper SDMathWrapper::simpleBinaryOperate(const SDMemTableWrapper& left, 49 const SDMemTableWrapper& right, 50 const std::string& op) 51 { 52 SDMath sdm; 53 return SDMemTableWrapper(sdm.simpleBinaryOperate(left.getCP(), right.getCP(), 54 String(op))); 55 } 56 57 48 58 void SDMathWrapper::scaleInSitu(SDMemTableWrapper& in, float factor, bool doAll) 49 59 { … … 142 152 SDMemTable* pIn = in.getPtr(); 143 153 SDMath sdm; 144 SDMemTable* pOut = sdm.averagePol (*pIn, mask); 154 Vector<Bool> tMask(mask); 155 SDMemTable* pOut = sdm.averagePol (*pIn, tMask); 145 156 *pIn = *pOut; 146 157 delete pOut; … … 153 164 const CountedPtr<SDMemTable>& pIn = in.getCP(); 154 165 SDMath sdm; 155 return CountedPtr<SDMemTable>(sdm.averagePol(*pIn, mask)); 166 Vector<Bool> tMask(mask); 167 return CountedPtr<SDMemTable>(sdm.averagePol(*pIn, tMask)); 156 168 } 157 169 … … 159 171 std::vector<float> SDMathWrapper::statistic(const SDMemTableWrapper& in, 160 172 const std::vector<bool>& mask, 161 const std::string& which) 162 { 163 SDMath sdm; 164 return sdm.statistic(in.getCP(), mask, String(which)); 173 const std::string& which, int row) 174 { 175 SDMath sdm; 176 Vector<Bool> tMask(mask); 177 return sdm.statistic(in.getCP(), tMask, String(which), Int(row)); 165 178 } 166 179 … … 186 199 187 200 188 void SDMathWrapper::gainElevationInSitu(SDMemTableWrapper& in, const string& fileName, 201 void SDMathWrapper::gainElevationInSitu(SDMemTableWrapper& in, 202 const std::vector<float>& coeffs, 203 const string& fileName, 189 204 const string& method, bool doAll) 190 205 { 191 206 SDMemTable* pIn = in.getPtr(); 192 SDMath sdm; 193 SDMemTable* pOut = sdm.gainElevation(*pIn, String(fileName), String(method), Bool(doAll)); 207 Vector<Float> tCoeffs(coeffs); 208 SDMath sdm; 209 SDMemTable* pOut = sdm.gainElevation(*pIn, tCoeffs, String(fileName), 210 String(method), Bool(doAll)); 194 211 *pIn = *pOut; 195 212 delete pOut; … … 198 215 199 216 SDMemTableWrapper SDMathWrapper::gainElevation(const SDMemTableWrapper& in, 217 const std::vector<float>& coeffs, 200 218 const string& fileName, 201 219 const string& method, bool doAll) 202 220 { 203 221 const CountedPtr<SDMemTable>& pIn = in.getCP(); 204 SDMath sdm; 205 return CountedPtr<SDMemTable>(sdm.gainElevation(*pIn, String(fileName), 222 Vector<Float> tCoeffs(coeffs); 223 SDMath sdm; 224 return CountedPtr<SDMemTable>(sdm.gainElevation(*pIn, tCoeffs, String(fileName), 206 225 String(method), Bool(doAll))); 207 226 } 208 227 228 void SDMathWrapper::opacityInSitu(SDMemTableWrapper& in, float tau, bool doAll) 229 { 230 SDMemTable* pIn = in.getPtr(); 231 SDMath sdm; 232 SDMemTable* pOut = sdm.opacity(*pIn, Float(tau), Bool(doAll)); 233 *pIn = *pOut; 234 delete pOut; 235 } 236 237 238 SDMemTableWrapper SDMathWrapper::opacity(const SDMemTableWrapper& in, 239 float tau, bool doAll) 240 { 241 const CountedPtr<SDMemTable>& pIn = in.getCP(); 242 SDMath sdm; 243 return CountedPtr<SDMemTable>(sdm.opacity(*pIn, Float(tau), Bool(doAll))); 244 } 245
Note:
See TracChangeset
for help on using the changeset viewer.