Changeset 8901 in ntrip for trunk/BNC/newmat/submat.cpp
- Timestamp:
- Mar 18, 2020, 11:06:13 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/newmat/submat.cpp
r2013 r8901 257 257 if (row_number != gmx->Nrows() || col_number != gmx->Ncols()) 258 258 Throw(IncompatibleDimensionsException()); 259 if (gm->type().is_symmetric() && 260 ( ! gmx->type().is_symmetric() || row_skip != col_skip) ) 261 Throw(ProgramException("Illegal operation on symmetric")); 259 262 MatrixRow mrx(gmx, LoadOnEntry); 260 263 MatrixRow mr(gm, LoadOnEntry+StoreOnExit+DirectPart, row_skip); … … 277 280 } 278 281 279 void GetSubMatrix:: operator-=(const BaseMatrix& bmx)280 { 281 REPORT 282 Tracer tr("SubMatrix( -=)"); GeneralMatrix* gmx = 0;282 void GetSubMatrix::SP_eq(const BaseMatrix& bmx) 283 { 284 REPORT 285 Tracer tr("SubMatrix(SP_eq)"); GeneralMatrix* gmx = 0; 283 286 // MatrixConversionCheck mcc; // Check for loss of info 284 287 Try … … 287 290 if (row_number != gmx->Nrows() || col_number != gmx->Ncols()) 288 291 Throw(IncompatibleDimensionsException()); 292 if (gm->type().is_symmetric() && 293 ( ! gmx->type().is_symmetric() || row_skip != col_skip) ) 294 Throw(ProgramException("Illegal operation on symmetric")); 295 MatrixRow mrx(gmx, LoadOnEntry); 296 MatrixRow mr(gm, LoadOnEntry+StoreOnExit+DirectPart, row_skip); 297 // do need LoadOnEntry 298 MatrixRowCol sub; int i = row_number; 299 while (i--) 300 { 301 mr.SubRowCol(sub, col_skip, col_number); // put values in sub 302 sub.Multiply(mrx); mr.Next(); mrx.Next(); 303 } 304 gmx->tDelete(); 305 } 306 307 CatchAll 308 { 309 if (gmx) gmx->tDelete(); 310 ReThrow; 311 } 312 } 313 314 void GetSubMatrix::operator-=(const BaseMatrix& bmx) 315 { 316 REPORT 317 Tracer tr("SubMatrix(-=)"); GeneralMatrix* gmx = 0; 318 // MatrixConversionCheck mcc; // Check for loss of info 319 Try 320 { 321 SetUpLHS(); gmx = ((BaseMatrix&)bmx).Evaluate(); 322 if (row_number != gmx->Nrows() || col_number != gmx->Ncols()) 323 Throw(IncompatibleDimensionsException()); 324 if (gm->type().is_symmetric() && 325 ( ! gmx->type().is_symmetric() || row_skip != col_skip) ) 326 Throw(ProgramException("Illegal operation on symmetric")); 289 327 MatrixRow mrx(gmx, LoadOnEntry); 290 328 MatrixRow mr(gm, LoadOnEntry+StoreOnExit+DirectPart, row_skip);
Note:
See TracChangeset
for help on using the changeset viewer.