home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / n / newmat06.zip / NEWMATAP.H < prev    next >
C/C++ Source or Header  |  1992-11-27  |  3KB  |  104 lines

  1. //$$ newmatap.h           definition file for matrix package applications
  2.  
  3. // Copyright (C) 1991,2: R B Davies
  4.  
  5. #ifndef MATRIXAP_LIB
  6. #define MATRIXAP_LIB 0
  7.  
  8. #include "newmat.h"
  9.  
  10.  
  11. /**************************** applications *****************************/
  12.  
  13.  
  14. void HHDecompose(Matrix&, LowerTriangularMatrix&);
  15.  
  16. void HHDecompose(const Matrix&, Matrix&, Matrix&);
  17.  
  18. ReturnMatrix Cholesky(const SymmetricMatrix&);
  19.  
  20. ReturnMatrix Cholesky(const SymmetricBandMatrix&);
  21.  
  22. #ifndef GXX
  23. void SVD(const Matrix&, DiagonalMatrix&, Matrix&, Matrix&,
  24.     Boolean=TRUE, Boolean=TRUE);
  25. #else
  26. void SVD(const Matrix&, DiagonalMatrix&, Matrix&, Matrix&,
  27.     Boolean=(Boolean)TRUE, Boolean=(Boolean)TRUE);
  28. #endif
  29.  
  30.  
  31. void SVD(const Matrix&, DiagonalMatrix&);
  32.  
  33. #ifndef GXX
  34. inline void SVD(const Matrix& A, DiagonalMatrix& D, Matrix& U,
  35.    Boolean withU = TRUE) { SVD(A, D, U, U, withU, FALSE); }
  36. #else
  37. inline void SVD(const Matrix& A, DiagonalMatrix& D, Matrix& U,
  38.    Boolean withU = (Boolean)TRUE) { SVD(A, D, U, U, withU, FALSE); }
  39. #endif
  40.  
  41. void Jacobi(const SymmetricMatrix&, DiagonalMatrix&);
  42.  
  43. void Jacobi(const SymmetricMatrix&, DiagonalMatrix&, SymmetricMatrix&);
  44.  
  45. void Jacobi(const SymmetricMatrix&, DiagonalMatrix&, Matrix&);
  46.  
  47. #ifndef GXX
  48. void Jacobi(const SymmetricMatrix&, DiagonalMatrix&, SymmetricMatrix&,
  49.    Matrix&, Boolean=TRUE);
  50. #else
  51. void Jacobi(const SymmetricMatrix&, DiagonalMatrix&, SymmetricMatrix&,
  52.    Matrix&, Boolean=(Boolean)TRUE);
  53. #endif
  54.  
  55. void EigenValues(const SymmetricMatrix&, DiagonalMatrix&);
  56.  
  57. void EigenValues(const SymmetricMatrix&, DiagonalMatrix&, SymmetricMatrix&);
  58.  
  59. void EigenValues(const SymmetricMatrix&, DiagonalMatrix&, Matrix&);
  60.  
  61. class SymmetricEigenAnalysis
  62. // not implemented yet
  63. {
  64. public:
  65.    SymmetricEigenAnalysis(const SymmetricMatrix&);
  66. private:
  67.    DiagonalMatrix diag;
  68.    DiagonalMatrix offdiag;
  69.    SymmetricMatrix backtransform;
  70.    FREE_CHECK(SymmetricEigenAnalysis)
  71. };
  72.  
  73. void SortAscending(GeneralMatrix&);
  74.  
  75. void SortDescending(GeneralMatrix&);
  76.  
  77.  
  78. void FFT(const ColumnVector&, const ColumnVector&,
  79.    ColumnVector&, ColumnVector&);
  80.  
  81.  
  82. /********************** linear equation solving ****************************/
  83.  
  84. class LinearEquationSolver : public BaseMatrix
  85. {
  86.    GeneralMatrix* gm;
  87.    int search(const BaseMatrix*) const { return 0; }
  88.    MatrixType Type() const { return gm->Type(); }
  89.    friend BaseMatrix;
  90. public:
  91.    LinearEquationSolver(const BaseMatrix& bm);
  92.    ~LinearEquationSolver() { delete gm; }
  93.    void CleanUp() { delete gm; } 
  94.    GeneralMatrix* Evaluate(MatrixType) { return gm; }
  95.    // probably should have an error message if MatrixType != UnSp
  96.    NEW_DELETE(LinearEquationSolver)
  97. };
  98.  
  99.  
  100.  
  101.  
  102.  
  103. #endif
  104.