Changeset 9434 in ntrip for trunk/BNC/newmat/submat.cpp
- Timestamp:
- May 19, 2021, 1:32:38 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/newmat/submat.cpp
r8901 r9434 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"));262 259 MatrixRow mrx(gmx, LoadOnEntry); 263 260 MatrixRow mr(gm, LoadOnEntry+StoreOnExit+DirectPart, row_skip); … … 280 277 } 281 278 282 void GetSubMatrix:: SP_eq(const BaseMatrix& bmx)283 { 284 REPORT 285 Tracer tr("SubMatrix( SP_eq)"); GeneralMatrix* gmx = 0;279 void GetSubMatrix::operator-=(const BaseMatrix& bmx) 280 { 281 REPORT 282 Tracer tr("SubMatrix(-=)"); GeneralMatrix* gmx = 0; 286 283 // MatrixConversionCheck mcc; // Check for loss of info 287 284 Try … … 290 287 if (row_number != gmx->Nrows() || col_number != gmx->Ncols()) 291 288 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 LoadOnEntry298 MatrixRowCol sub; int i = row_number;299 while (i--)300 {301 mr.SubRowCol(sub, col_skip, col_number); // put values in sub302 sub.Multiply(mrx); mr.Next(); mrx.Next();303 }304 gmx->tDelete();305 }306 307 CatchAll308 {309 if (gmx) gmx->tDelete();310 ReThrow;311 }312 }313 314 void GetSubMatrix::operator-=(const BaseMatrix& bmx)315 {316 REPORT317 Tracer tr("SubMatrix(-=)"); GeneralMatrix* gmx = 0;318 // MatrixConversionCheck mcc; // Check for loss of info319 Try320 {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"));327 289 MatrixRow mrx(gmx, LoadOnEntry); 328 290 MatrixRow mr(gm, LoadOnEntry+StoreOnExit+DirectPart, row_skip);
Note:
See TracChangeset
for help on using the changeset viewer.