Changeset 8901 in ntrip for trunk/BNC/newmat/newmat.h


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/newmat.h

    r2013 r8901  
    447447class GeneralMatrix : public BaseMatrix         // declarable matrix types
    448448{
    449    virtual GeneralMatrix* Image() const;        // copy of matrix
    450449protected:
    451450   int tag_val;                                 // shows whether can reuse
     
    465464   void ReverseElements();                      // internal reverse of elements
    466465   void ReverseElements(GeneralMatrix*);        // reverse order of elements
    467    void operator=(Real);                        // set matrix to constant
    468466   Real* GetStore();                            // get store or copy
    469467   GeneralMatrix* BorrowStore(GeneralMatrix*, MatrixType);
    470468                                                // temporarily access store
    471469   void GetMatrix(const GeneralMatrix*);        // used by = and initialise
    472    void Eq(const BaseMatrix&, MatrixType);      // used by =
    473    void Eq(const GeneralMatrix&);               // version with no conversion
    474    void Eq(const BaseMatrix&, MatrixType, bool);// used by <<
    475    void Eq2(const BaseMatrix&, MatrixType);     // cut down version of Eq
    476470   int search(const BaseMatrix*) const;
    477471   virtual GeneralMatrix* Transpose(TransposedMatrix*, MatrixType);
     
    484478             // CleanUp when the data array has already been deleted
    485479   void PlusEqual(const GeneralMatrix& gm);
     480   void SP_Equal(const GeneralMatrix& gm);
    486481   void MinusEqual(const GeneralMatrix& gm);
    487482   void PlusEqual(Real f);
     
    490485public:
    491486   GeneralMatrix* Evaluate(MatrixType mt=MatrixTypeUnSp);
     487   void Eq(const BaseMatrix&, MatrixType);      // used by =
     488   void Eq(const GeneralMatrix&);               // version with no conversion
     489   void Eq(const BaseMatrix&, MatrixType, bool);// used by <<
     490   void Eq2(const BaseMatrix&, MatrixType);     // cut down version of Eq
    492491   virtual MatrixType type() const = 0;         // type of a matrix
    493492   MatrixType Type() const { return type(); }
     
    503502   const Real* data() const { return store; }
    504503   const Real* const_data() const { return store; }
     504   void operator=(Real);                        // set matrix to constant
    505505   virtual ~GeneralMatrix();                    // delete store if set
    506506   void tDelete();                              // delete if tag_val permits
     
    526526   void Inject(const GeneralMatrix& GM) { inject(GM); }
    527527   void operator+=(const BaseMatrix&);
     528   void SP_eq(const BaseMatrix&);
    528529   void operator-=(const BaseMatrix&);
    529530   void operator*=(const BaseMatrix&);
     
    579580//   ReturnMatrix Reverse() const;                // reverse order of elements
    580581   void cleanup();                              // to clear store
     582   virtual GeneralMatrix* Image() const;        // copy of matrix
    581583
    582584   friend class Matrix;
     
    625627class Matrix : public GeneralMatrix
    626628{
    627    GeneralMatrix* Image() const;                // copy of matrix
    628629public:
    629630   Matrix() {}
     
    668669   Real minimum2(int& i, int& j) const;
    669670   void operator+=(const Matrix& M) { PlusEqual(M); }
     671   void SP_eq(const Matrix& M) { SP_Equal(M); }
    670672   void operator-=(const Matrix& M) { MinusEqual(M); }
     673   void operator+=(const BaseMatrix& M) { GeneralMatrix::operator+=(M); }
     674   void SP_eq(const BaseMatrix& M) { GeneralMatrix::SP_eq(M); }
     675   void operator-=(const BaseMatrix& M) { GeneralMatrix::operator-=(M); }
    671676   void operator+=(Real f) { GeneralMatrix::Add(f); }
    672677   void operator-=(Real f) { GeneralMatrix::Add(-f); }
    673678   void swap(Matrix& gm) { GeneralMatrix::swap((GeneralMatrix&)gm); }
     679   GeneralMatrix* Image() const;                // copy of matrix
    674680   friend Real dotproduct(const Matrix& A, const Matrix& B);
    675681   NEW_DELETE(Matrix)
     
    679685class SquareMatrix : public Matrix
    680686{
    681    GeneralMatrix* Image() const;                // copy of matrix
    682687public:
    683688   SquareMatrix() {}
     
    701706   void ReSize(const GeneralMatrix& A) { resize(A); }
    702707   void operator+=(const Matrix& M) { PlusEqual(M); }
     708   void SP_eq(const Matrix& M) { SP_Equal(M); }
    703709   void operator-=(const Matrix& M) { MinusEqual(M); }
     710   void operator+=(const BaseMatrix& M) { GeneralMatrix::operator+=(M); }
     711   void SP_eq(const BaseMatrix& M) { GeneralMatrix::SP_eq(M); }
     712   void operator-=(const BaseMatrix& M) { GeneralMatrix::operator-=(M); }
    704713   void operator+=(Real f) { GeneralMatrix::Add(f); }
    705714   void operator-=(Real f) { GeneralMatrix::Add(-f); }
    706715   void swap(SquareMatrix& gm) { GeneralMatrix::swap((GeneralMatrix&)gm); }
     716   GeneralMatrix* Image() const;                // copy of matrix
    707717   NEW_DELETE(SquareMatrix)
    708718};
     
    711721class nricMatrix : public Matrix
    712722{
    713    GeneralMatrix* Image() const;                // copy of matrix
    714723   Real** row_pointer;                          // points to rows
    715724   void MakeRowPointer();                       // build rowpointer
     
    743752   void MiniCleanUp();
    744753   void operator+=(const Matrix& M) { PlusEqual(M); }
     754   void SP_eq(const Matrix& M) { SP_Equal(M); }
    745755   void operator-=(const Matrix& M) { MinusEqual(M); }
     756   void operator+=(const BaseMatrix& M) { GeneralMatrix::operator+=(M); }
     757   void SP_eq(const BaseMatrix& M) { GeneralMatrix::SP_eq(M); }
     758   void operator-=(const BaseMatrix& M) { GeneralMatrix::operator-=(M); }
    746759   void operator+=(Real f) { GeneralMatrix::Add(f); }
    747760   void operator-=(Real f) { GeneralMatrix::Add(-f); }
    748761   void swap(nricMatrix& gm);
     762   GeneralMatrix* Image() const;                // copy of matrix
    749763   NEW_DELETE(nricMatrix)
    750764};
     
    753767class SymmetricMatrix : public GeneralMatrix
    754768{
    755    GeneralMatrix* Image() const;                // copy of matrix
    756769public:
    757770   SymmetricMatrix() {}
     
    789802   void ReSize(const GeneralMatrix& A) { resize(A); }
    790803   void operator+=(const SymmetricMatrix& M) { PlusEqual(M); }
     804   void SP_eq(const SymmetricMatrix& M) { SP_Equal(M); }
    791805   void operator-=(const SymmetricMatrix& M) { MinusEqual(M); }
     806   void operator+=(const BaseMatrix& M) { GeneralMatrix::operator+=(M); }
     807   void SP_eq(const BaseMatrix& M) { GeneralMatrix::SP_eq(M); }
     808   void operator-=(const BaseMatrix& M) { GeneralMatrix::operator-=(M); }
    792809   void operator+=(Real f) { GeneralMatrix::Add(f); }
    793810   void operator-=(Real f) { GeneralMatrix::Add(-f); }
    794811   void swap(SymmetricMatrix& gm) { GeneralMatrix::swap((GeneralMatrix&)gm); }
     812   GeneralMatrix* Image() const;                // copy of matrix
    795813   NEW_DELETE(SymmetricMatrix)
    796814};
     
    799817class UpperTriangularMatrix : public GeneralMatrix
    800818{
    801    GeneralMatrix* Image() const;                // copy of matrix
    802819public:
    803820   UpperTriangularMatrix() {}
     
    837854   MatrixBandWidth bandwidth() const;
    838855   void operator+=(const UpperTriangularMatrix& M) { PlusEqual(M); }
     856   void SP_eq(const UpperTriangularMatrix& M) { SP_Equal(M); }
    839857   void operator-=(const UpperTriangularMatrix& M) { MinusEqual(M); }
     858   void operator+=(const BaseMatrix& M) { GeneralMatrix::operator+=(M); }
     859   void SP_eq(const BaseMatrix& M) { GeneralMatrix::SP_eq(M); }
     860   void operator-=(const BaseMatrix& M) { GeneralMatrix::operator-=(M); }
    840861   void operator+=(Real f) { GeneralMatrix::operator+=(f); }
    841862   void operator-=(Real f) { GeneralMatrix::operator-=(f); }
    842863   void swap(UpperTriangularMatrix& gm)
    843864      { GeneralMatrix::swap((GeneralMatrix&)gm); }
     865   GeneralMatrix* Image() const;                // copy of matrix
    844866   NEW_DELETE(UpperTriangularMatrix)
    845867};
     
    848870class LowerTriangularMatrix : public GeneralMatrix
    849871{
    850    GeneralMatrix* Image() const;                // copy of matrix
    851872public:
    852873   LowerTriangularMatrix() {}
     
    885906   MatrixBandWidth bandwidth() const;
    886907   void operator+=(const LowerTriangularMatrix& M) { PlusEqual(M); }
     908   void SP_eq(const LowerTriangularMatrix& M) { SP_Equal(M); }
    887909   void operator-=(const LowerTriangularMatrix& M) { MinusEqual(M); }
     910   void operator+=(const BaseMatrix& M) { GeneralMatrix::operator+=(M); }
     911   void SP_eq(const BaseMatrix& M) { GeneralMatrix::SP_eq(M); }
     912   void operator-=(const BaseMatrix& M) { GeneralMatrix::operator-=(M); }
    888913   void operator+=(Real f) { GeneralMatrix::operator+=(f); }
    889914   void operator-=(Real f) { GeneralMatrix::operator-=(f); }
    890915   void swap(LowerTriangularMatrix& gm)
    891916      { GeneralMatrix::swap((GeneralMatrix&)gm); }
     917   GeneralMatrix* Image() const;                // copy of matrix
    892918   NEW_DELETE(LowerTriangularMatrix)
    893919};
     
    896922class DiagonalMatrix : public GeneralMatrix
    897923{
    898    GeneralMatrix* Image() const;                // copy of matrix
    899924public:
    900925   DiagonalMatrix() {}
     
    942967//   ReturnMatrix Reverse() const;                // reverse order of elements
    943968   void operator+=(const DiagonalMatrix& M) { PlusEqual(M); }
     969   void SP_eq(const DiagonalMatrix& M) { SP_Equal(M); }
    944970   void operator-=(const DiagonalMatrix& M) { MinusEqual(M); }
     971   void operator+=(const BaseMatrix& M) { GeneralMatrix::operator+=(M); }
     972   void SP_eq(const BaseMatrix& M) { GeneralMatrix::SP_eq(M); }
     973   void operator-=(const BaseMatrix& M) { GeneralMatrix::operator-=(M); }
    945974   void operator+=(Real f) { GeneralMatrix::operator+=(f); }
    946975   void operator-=(Real f) { GeneralMatrix::operator-=(f); }
    947976   void swap(DiagonalMatrix& gm)
    948977      { GeneralMatrix::swap((GeneralMatrix&)gm); }
     978   GeneralMatrix* Image() const;                // copy of matrix
    949979   NEW_DELETE(DiagonalMatrix)
    950980};
     
    953983class RowVector : public Matrix
    954984{
    955    GeneralMatrix* Image() const;                // copy of matrix
    956985public:
    957986   RowVector() { nrows_val = 1; }
     
    9971026   // friend ReturnMatrix GetMatrixRow(Matrix& A, int row);
    9981027   void operator+=(const Matrix& M) { PlusEqual(M); }
     1028   void SP_eq(const Matrix& M) { SP_Equal(M); }
    9991029   void operator-=(const Matrix& M) { MinusEqual(M); }
     1030   void operator+=(const BaseMatrix& M) { GeneralMatrix::operator+=(M); }
     1031   void SP_eq(const BaseMatrix& M) { GeneralMatrix::SP_eq(M); }
     1032   void operator-=(const BaseMatrix& M) { GeneralMatrix::operator-=(M); }
    10001033   void operator+=(Real f) { GeneralMatrix::Add(f); }
    10011034   void operator-=(Real f) { GeneralMatrix::Add(-f); }
    10021035   void swap(RowVector& gm)
    10031036      { GeneralMatrix::swap((GeneralMatrix&)gm); }
     1037   GeneralMatrix* Image() const;                // copy of matrix
    10041038   NEW_DELETE(RowVector)
    10051039};
     
    10081042class ColumnVector : public Matrix
    10091043{
    1010    GeneralMatrix* Image() const;                // copy of matrix
    10111044public:
    10121045   ColumnVector() { ncols_val = 1; }
     
    10461079//   ReturnMatrix Reverse() const;                // reverse order of elements
    10471080   void operator+=(const Matrix& M) { PlusEqual(M); }
     1081   void SP_eq(const Matrix& M) { SP_Equal(M); }
    10481082   void operator-=(const Matrix& M) { MinusEqual(M); }
     1083   void operator+=(const BaseMatrix& M) { GeneralMatrix::operator+=(M); }
     1084   void SP_eq(const BaseMatrix& M) { GeneralMatrix::SP_eq(M); }
     1085   void operator-=(const BaseMatrix& M) { GeneralMatrix::operator-=(M); }
    10491086   void operator+=(Real f) { GeneralMatrix::Add(f); }
    10501087   void operator-=(Real f) { GeneralMatrix::Add(-f); }
    10511088   void swap(ColumnVector& gm)
    10521089      { GeneralMatrix::swap((GeneralMatrix&)gm); }
     1090   GeneralMatrix* Image() const;                // copy of matrix
    10531091   NEW_DELETE(ColumnVector)
    10541092};
     
    10641102   void ludcmp();
    10651103   void get_aux(CroutMatrix&);                  // for copying indx[] etc
    1066    GeneralMatrix* Image() const;                // copy of matrix
    10671104public:
    10681105   CroutMatrix(const BaseMatrix&);
     
    10881125   bool even_exchanges() const { return d; }
    10891126   void swap(CroutMatrix& gm);
     1127   GeneralMatrix* Image() const;                // copy of matrix
    10901128   NEW_DELETE(CroutMatrix)
    10911129};
     
    10961134class BandMatrix : public GeneralMatrix
    10971135{
    1098    GeneralMatrix* Image() const;                // copy of matrix
    10991136protected:
    11001137   void CornerClear() const;                    // set unused elements to zero
     
    11611198   void operator<<(const BaseMatrix& X) { GeneralMatrix::operator<<(X); }
    11621199   void swap(BandMatrix& gm);
     1200   GeneralMatrix* Image() const;                // copy of matrix
    11631201   NEW_DELETE(BandMatrix)
    11641202};
     
    11671205class UpperBandMatrix : public BandMatrix
    11681206{
    1169    GeneralMatrix* Image() const;                // copy of matrix
    11701207public:
    11711208   UpperBandMatrix() {}
     
    12001237   void swap(UpperBandMatrix& gm)
    12011238      { BandMatrix::swap((BandMatrix&)gm); }
     1239   GeneralMatrix* Image() const;                // copy of matrix
    12021240   NEW_DELETE(UpperBandMatrix)
    12031241};
     
    12061244class LowerBandMatrix : public BandMatrix
    12071245{
    1208    GeneralMatrix* Image() const;                // copy of matrix
    12091246public:
    12101247   LowerBandMatrix() {}
     
    12391276   void swap(LowerBandMatrix& gm)
    12401277      { BandMatrix::swap((BandMatrix&)gm); }
     1278   GeneralMatrix* Image() const;                // copy of matrix
    12411279   NEW_DELETE(LowerBandMatrix)
    12421280};
     
    12451283class SymmetricBandMatrix : public GeneralMatrix
    12461284{
    1247    GeneralMatrix* Image() const;                // copy of matrix
    12481285   void CornerClear() const;                    // set unused elements to zero
    12491286   short SimpleAddOK(const GeneralMatrix* gm);
     
    13001337   void operator<<(const BaseMatrix& X) { GeneralMatrix::operator<<(X); }
    13011338   void swap(SymmetricBandMatrix& gm);
     1339   GeneralMatrix* Image() const;                // copy of matrix
    13021340   NEW_DELETE(SymmetricBandMatrix)
    13031341};
     
    13141352   void ludcmp();
    13151353   void get_aux(BandLUMatrix&);                 // for copying indx[] etc
    1316    GeneralMatrix* Image() const;                // copy of matrix
    13171354public:
    13181355   BandLUMatrix(const BaseMatrix&);
     
    13421379   MatrixBandWidth bandwidth() const;
    13431380   void swap(BandLUMatrix& gm);
     1381   GeneralMatrix* Image() const;                // copy of matrix
    13441382   NEW_DELETE(BandLUMatrix)
    13451383};
     
    13501388class IdentityMatrix : public GeneralMatrix
    13511389{
    1352    GeneralMatrix* Image() const;          // copy of matrix
    13531390public:
    13541391   IdentityMatrix() {}
     
    13861423   void swap(IdentityMatrix& gm)
    13871424      { GeneralMatrix::swap((GeneralMatrix&)gm); }
     1425   GeneralMatrix* Image() const;          // copy of matrix
    13881426   NEW_DELETE(IdentityMatrix)
    13891427};
     
    14091447   void operator=(const BaseMatrix&);
    14101448   void operator+=(const BaseMatrix&);
     1449   void SP_eq(const BaseMatrix&);
    14111450   void operator-=(const BaseMatrix&);
    14121451   void operator*=(const BaseMatrix&);
     
    17811820   void operator=(const BaseMatrix&);
    17821821   void operator+=(const BaseMatrix&);
     1822   void SP_eq(const BaseMatrix&);
    17831823   void operator-=(const BaseMatrix&);
    17841824   void operator=(const GetSubMatrix& m) { operator=((const BaseMatrix&)m); }
Note: See TracChangeset for help on using the changeset viewer.