home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / sources / misc / 4250 / newmatap.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-01-11  |  2.8 KB  |  110 lines

  1. //$$ newmatap.h           definition file for matrix package applications
  2.  
  3. // Copyright (C) 1991,2,3: 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 __GNUG__
  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 __GNUG__
  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 __GNUG__
  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. void FFTI(const ColumnVector&, const ColumnVector&,
  82.    ColumnVector&, ColumnVector&);
  83.  
  84. void RealFFT(const ColumnVector&, ColumnVector&, ColumnVector&);
  85.  
  86. void RealFFTI(const ColumnVector&, const ColumnVector&, ColumnVector&);
  87.  
  88.  
  89. /********************** linear equation solving ****************************/
  90.  
  91. class LinearEquationSolver : public BaseMatrix
  92. {
  93.    GeneralMatrix* gm;
  94.    int search(const BaseMatrix*) const { return 0; }
  95.    friend class BaseMatrix;
  96. public:
  97.    LinearEquationSolver(const BaseMatrix& bm);
  98.    ~LinearEquationSolver() { delete gm; }
  99.    void CleanUp() { delete gm; } 
  100.    GeneralMatrix* Evaluate(MatrixType) { return gm; }
  101.    // probably should have an error message if MatrixType != UnSp
  102.    NEW_DELETE(LinearEquationSolver)
  103. };
  104.  
  105.  
  106.  
  107.  
  108.  
  109. #endif
  110.