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


Ignore:
Timestamp:
May 19, 2021, 1:32:38 PM (3 years ago)
Author:
stuerze
Message:

newmat is reverted to its stable version 10 because version 11beta was not working with mac compilers

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/newmat/newmat.h

    r8901 r9434  
    447447class GeneralMatrix : public BaseMatrix         // declarable matrix types
    448448{
     449   virtual GeneralMatrix* Image() const;        // copy of matrix
    449450protected:
    450451   int tag_val;                                 // shows whether can reuse
     
    464465   void ReverseElements();                      // internal reverse of elements
    465466   void ReverseElements(GeneralMatrix*);        // reverse order of elements
     467   void operator=(Real);                        // set matrix to constant
    466468   Real* GetStore();                            // get store or copy
    467469   GeneralMatrix* BorrowStore(GeneralMatrix*, MatrixType);
    468470                                                // temporarily access store
    469471   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
    470476   int search(const BaseMatrix*) const;
    471477   virtual GeneralMatrix* Transpose(TransposedMatrix*, MatrixType);
     
    478484             // CleanUp when the data array has already been deleted
    479485   void PlusEqual(const GeneralMatrix& gm);
    480    void SP_Equal(const GeneralMatrix& gm);
    481486   void MinusEqual(const GeneralMatrix& gm);
    482487   void PlusEqual(Real f);
     
    485490public:
    486491   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
    491492   virtual MatrixType type() const = 0;         // type of a matrix
    492493   MatrixType Type() const { return type(); }
     
    502503   const Real* data() const { return store; }
    503504   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&);
    529528   void operator-=(const BaseMatrix&);
    530529   void operator*=(const BaseMatrix&);
     
    580579//   ReturnMatrix Reverse() const;                // reverse order of elements
    581580   void cleanup();                              // to clear store
    582    virtual GeneralMatrix* Image() const;        // copy of matrix
    583581
    584582   friend class Matrix;
     
    627625class Matrix : public GeneralMatrix
    628626{
     627   GeneralMatrix* Image() const;                // copy of matrix
    629628public:
    630629   Matrix() {}
     
    669668   Real minimum2(int& i, int& j) const;
    670669   void operator+=(const Matrix& M) { PlusEqual(M); }
    671    void SP_eq(const Matrix& M) { SP_Equal(M); }
    672670   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); }
    676671   void operator+=(Real f) { GeneralMatrix::Add(f); }
    677672   void operator-=(Real f) { GeneralMatrix::Add(-f); }
    678673   void swap(Matrix& gm) { GeneralMatrix::swap((GeneralMatrix&)gm); }
    679    GeneralMatrix* Image() const;                // copy of matrix
    680674   friend Real dotproduct(const Matrix& A, const Matrix& B);
    681675   NEW_DELETE(Matrix)
     
    685679class SquareMatrix : public Matrix
    686680{
     681   GeneralMatrix* Image() const;                // copy of matrix
    687682public:
    688683   SquareMatrix() {}
     
    706701   void ReSize(const GeneralMatrix& A) { resize(A); }
    707702   void operator+=(const Matrix& M) { PlusEqual(M); }
    708    void SP_eq(const Matrix& M) { SP_Equal(M); }
    709703   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); }
    713704   void operator+=(Real f) { GeneralMatrix::Add(f); }
    714705   void operator-=(Real f) { GeneralMatrix::Add(-f); }
    715706   void swap(SquareMatrix& gm) { GeneralMatrix::swap((GeneralMatrix&)gm); }
    716    GeneralMatrix* Image() const;                // copy of matrix
    717707   NEW_DELETE(SquareMatrix)
    718708};
     
    721711class nricMatrix : public Matrix
    722712{
     713   GeneralMatrix* Image() const;                // copy of matrix
    723714   Real** row_pointer;                          // points to rows
    724715   void MakeRowPointer();                       // build rowpointer
     
    752743   void MiniCleanUp();
    753744   void operator+=(const Matrix& M) { PlusEqual(M); }
    754    void SP_eq(const Matrix& M) { SP_Equal(M); }
    755745   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); }
    759746   void operator+=(Real f) { GeneralMatrix::Add(f); }
    760747   void operator-=(Real f) { GeneralMatrix::Add(-f); }
    761748   void swap(nricMatrix& gm);
    762    GeneralMatrix* Image() const;                // copy of matrix
    763749   NEW_DELETE(nricMatrix)
    764750};
     
    767753class SymmetricMatrix : public GeneralMatrix
    768754{
     755   GeneralMatrix* Image() const;                // copy of matrix
    769756public:
    770757   SymmetricMatrix() {}
     
    802789   void ReSize(const GeneralMatrix& A) { resize(A); }
    803790   void operator+=(const SymmetricMatrix& M) { PlusEqual(M); }
    804    void SP_eq(const SymmetricMatrix& M) { SP_Equal(M); }
    805791   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); }
    809792   void operator+=(Real f) { GeneralMatrix::Add(f); }
    810793   void operator-=(Real f) { GeneralMatrix::Add(-f); }
    811794   void swap(SymmetricMatrix& gm) { GeneralMatrix::swap((GeneralMatrix&)gm); }
    812    GeneralMatrix* Image() const;                // copy of matrix
    813795   NEW_DELETE(SymmetricMatrix)
    814796};
     
    817799class UpperTriangularMatrix : public GeneralMatrix
    818800{
     801   GeneralMatrix* Image() const;                // copy of matrix
    819802public:
    820803   UpperTriangularMatrix() {}
     
    854837   MatrixBandWidth bandwidth() const;
    855838   void operator+=(const UpperTriangularMatrix& M) { PlusEqual(M); }
    856    void SP_eq(const UpperTriangularMatrix& M) { SP_Equal(M); }
    857839   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); }
    861840   void operator+=(Real f) { GeneralMatrix::operator+=(f); }
    862841   void operator-=(Real f) { GeneralMatrix::operator-=(f); }
    863842   void swap(UpperTriangularMatrix& gm)
    864843      { GeneralMatrix::swap((GeneralMatrix&)gm); }
    865    GeneralMatrix* Image() const;                // copy of matrix
    866844   NEW_DELETE(UpperTriangularMatrix)
    867845};
     
    870848class LowerTriangularMatrix : public GeneralMatrix
    871849{
     850   GeneralMatrix* Image() const;                // copy of matrix
    872851public:
    873852   LowerTriangularMatrix() {}
     
    906885   MatrixBandWidth bandwidth() const;
    907886   void operator+=(const LowerTriangularMatrix& M) { PlusEqual(M); }
    908    void SP_eq(const LowerTriangularMatrix& M) { SP_Equal(M); }
    909887   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); }
    913888   void operator+=(Real f) { GeneralMatrix::operator+=(f); }
    914889   void operator-=(Real f) { GeneralMatrix::operator-=(f); }
    915890   void swap(LowerTriangularMatrix& gm)
    916891      { GeneralMatrix::swap((GeneralMatrix&)gm); }
    917    GeneralMatrix* Image() const;                // copy of matrix
    918892   NEW_DELETE(LowerTriangularMatrix)
    919893};
     
    922896class DiagonalMatrix : public GeneralMatrix
    923897{
     898   GeneralMatrix* Image() const;                // copy of matrix
    924899public:
    925900   DiagonalMatrix() {}
     
    967942//   ReturnMatrix Reverse() const;                // reverse order of elements
    968943   void operator+=(const DiagonalMatrix& M) { PlusEqual(M); }
    969    void SP_eq(const DiagonalMatrix& M) { SP_Equal(M); }
    970944   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); }
    974945   void operator+=(Real f) { GeneralMatrix::operator+=(f); }
    975946   void operator-=(Real f) { GeneralMatrix::operator-=(f); }
    976947   void swap(DiagonalMatrix& gm)
    977948      { GeneralMatrix::swap((GeneralMatrix&)gm); }
    978    GeneralMatrix* Image() const;                // copy of matrix
    979949   NEW_DELETE(DiagonalMatrix)
    980950};
     
    983953class RowVector : public Matrix
    984954{
     955   GeneralMatrix* Image() const;                // copy of matrix
    985956public:
    986957   RowVector() { nrows_val = 1; }
     
    1026997   // friend ReturnMatrix GetMatrixRow(Matrix& A, int row);
    1027998   void operator+=(const Matrix& M) { PlusEqual(M); }
    1028    void SP_eq(const Matrix& M) { SP_Equal(M); }
    1029999   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); }
    10331000   void operator+=(Real f) { GeneralMatrix::Add(f); }
    10341001   void operator-=(Real f) { GeneralMatrix::Add(-f); }
    10351002   void swap(RowVector& gm)
    10361003      { GeneralMatrix::swap((GeneralMatrix&)gm); }
    1037    GeneralMatrix* Image() const;                // copy of matrix
    10381004   NEW_DELETE(RowVector)
    10391005};
     
    10421008class ColumnVector : public Matrix
    10431009{
     1010   GeneralMatrix* Image() const;                // copy of matrix
    10441011public:
    10451012   ColumnVector() { ncols_val = 1; }
     
    10791046//   ReturnMatrix Reverse() const;                // reverse order of elements
    10801047   void operator+=(const Matrix& M) { PlusEqual(M); }
    1081    void SP_eq(const Matrix& M) { SP_Equal(M); }
    10821048   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); }
    10861049   void operator+=(Real f) { GeneralMatrix::Add(f); }
    10871050   void operator-=(Real f) { GeneralMatrix::Add(-f); }
    10881051   void swap(ColumnVector& gm)
    10891052      { GeneralMatrix::swap((GeneralMatrix&)gm); }
    1090    GeneralMatrix* Image() const;                // copy of matrix
    10911053   NEW_DELETE(ColumnVector)
    10921054};
     
    11021064   void ludcmp();
    11031065   void get_aux(CroutMatrix&);                  // for copying indx[] etc
     1066   GeneralMatrix* Image() const;                // copy of matrix
    11041067public:
    11051068   CroutMatrix(const BaseMatrix&);
     
    11251088   bool even_exchanges() const { return d; }
    11261089   void swap(CroutMatrix& gm);
    1127    GeneralMatrix* Image() const;                // copy of matrix
    11281090   NEW_DELETE(CroutMatrix)
    11291091};
     
    11341096class BandMatrix : public GeneralMatrix
    11351097{
     1098   GeneralMatrix* Image() const;                // copy of matrix
    11361099protected:
    11371100   void CornerClear() const;                    // set unused elements to zero
     
    11981161   void operator<<(const BaseMatrix& X) { GeneralMatrix::operator<<(X); }
    11991162   void swap(BandMatrix& gm);
    1200    GeneralMatrix* Image() const;                // copy of matrix
    12011163   NEW_DELETE(BandMatrix)
    12021164};
     
    12051167class UpperBandMatrix : public BandMatrix
    12061168{
     1169   GeneralMatrix* Image() const;                // copy of matrix
    12071170public:
    12081171   UpperBandMatrix() {}
     
    12371200   void swap(UpperBandMatrix& gm)
    12381201      { BandMatrix::swap((BandMatrix&)gm); }
    1239    GeneralMatrix* Image() const;                // copy of matrix
    12401202   NEW_DELETE(UpperBandMatrix)
    12411203};
     
    12441206class LowerBandMatrix : public BandMatrix
    12451207{
     1208   GeneralMatrix* Image() const;                // copy of matrix
    12461209public:
    12471210   LowerBandMatrix() {}
     
    12761239   void swap(LowerBandMatrix& gm)
    12771240      { BandMatrix::swap((BandMatrix&)gm); }
    1278    GeneralMatrix* Image() const;                // copy of matrix
    12791241   NEW_DELETE(LowerBandMatrix)
    12801242};
     
    12831245class SymmetricBandMatrix : public GeneralMatrix
    12841246{
     1247   GeneralMatrix* Image() const;                // copy of matrix
    12851248   void CornerClear() const;                    // set unused elements to zero
    12861249   short SimpleAddOK(const GeneralMatrix* gm);
     
    13371300   void operator<<(const BaseMatrix& X) { GeneralMatrix::operator<<(X); }
    13381301   void swap(SymmetricBandMatrix& gm);
    1339    GeneralMatrix* Image() const;                // copy of matrix
    13401302   NEW_DELETE(SymmetricBandMatrix)
    13411303};
     
    13521314   void ludcmp();
    13531315   void get_aux(BandLUMatrix&);                 // for copying indx[] etc
     1316   GeneralMatrix* Image() const;                // copy of matrix
    13541317public:
    13551318   BandLUMatrix(const BaseMatrix&);
     
    13791342   MatrixBandWidth bandwidth() const;
    13801343   void swap(BandLUMatrix& gm);
    1381    GeneralMatrix* Image() const;                // copy of matrix
    13821344   NEW_DELETE(BandLUMatrix)
    13831345};
     
    13881350class IdentityMatrix : public GeneralMatrix
    13891351{
     1352   GeneralMatrix* Image() const;          // copy of matrix
    13901353public:
    13911354   IdentityMatrix() {}
     
    14231386   void swap(IdentityMatrix& gm)
    14241387      { GeneralMatrix::swap((GeneralMatrix&)gm); }
    1425    GeneralMatrix* Image() const;          // copy of matrix
    14261388   NEW_DELETE(IdentityMatrix)
    14271389};
     
    14471409   void operator=(const BaseMatrix&);
    14481410   void operator+=(const BaseMatrix&);
    1449    void SP_eq(const BaseMatrix&);
    14501411   void operator-=(const BaseMatrix&);
    14511412   void operator*=(const BaseMatrix&);
     
    18201781   void operator=(const BaseMatrix&);
    18211782   void operator+=(const BaseMatrix&);
    1822    void SP_eq(const BaseMatrix&);
    18231783   void operator-=(const BaseMatrix&);
    18241784   void operator=(const GetSubMatrix& m) { operator=((const BaseMatrix&)m); }
Note: See TracChangeset for help on using the changeset viewer.