Changeset 8901 in ntrip for trunk/BNC/newmat/submat.cpp


Ignore:
Timestamp:
Mar 18, 2020, 11:06:13 AM (4 years ago)
Author:
stuerze
Message:

upgrade to newmat11 library

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/newmat/submat.cpp

    r2013 r8901  
    257257      if (row_number != gmx->Nrows() || col_number != gmx->Ncols())
    258258         Throw(IncompatibleDimensionsException());
     259      if (gm->type().is_symmetric() &&
     260         ( ! gmx->type().is_symmetric() || row_skip != col_skip) )
     261         Throw(ProgramException("Illegal operation on symmetric"));
    259262      MatrixRow mrx(gmx, LoadOnEntry);
    260263      MatrixRow mr(gm, LoadOnEntry+StoreOnExit+DirectPart, row_skip);
     
    277280}
    278281
    279 void GetSubMatrix::operator-=(const BaseMatrix& bmx)
    280 {
    281    REPORT
    282    Tracer tr("SubMatrix(-=)"); GeneralMatrix* gmx = 0;
     282void GetSubMatrix::SP_eq(const BaseMatrix& bmx)
     283{
     284   REPORT
     285   Tracer tr("SubMatrix(SP_eq)"); GeneralMatrix* gmx = 0;
    283286   // MatrixConversionCheck mcc;         // Check for loss of info
    284287   Try
     
    287290      if (row_number != gmx->Nrows() || col_number != gmx->Ncols())
    288291         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
     314void 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"));
    289327      MatrixRow mrx(gmx, LoadOnEntry);
    290328      MatrixRow mr(gm, LoadOnEntry+StoreOnExit+DirectPart, row_skip);
Note: See TracChangeset for help on using the changeset viewer.