Main Lemma Repository
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. /* This file is part of Lemma, a geophysical modelling and inversion API */
  2. /* This Source Code Form is subject to the terms of the Mozilla Public
  3. * License, v. 2.0. If a copy of the MPL was not distributed with this
  4. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  5. /**
  6. @file
  7. @author Trevor Irons
  8. @date 08/09/2010
  9. @version $Id: quasinewtonbfgs.h 193 2014-11-10 23:51:41Z tirons $
  10. **/
  11. #ifndef QUASINEWTONBFGS_INC
  12. #define QUASINEWTONBFGS_INC
  13. #include "inversesolver.h"
  14. namespace Lemma {
  15. // ===================================================================
  16. // Class: QuasiNewtonBFGS
  17. /**
  18. @class QuasiNewtonBFGS
  19. \brief Implimentation of a quasi-newton BFGS solver applied to
  20. inverse problems.
  21. \details Based of the algorithm described in Nocedal and Wright book.
  22. */
  23. // ===================================================================
  24. class QuasiNewtonBFGS : public InverseSolver {
  25. friend std::ostream &operator<<(std::ostream &stream,
  26. const QuasiNewtonBFGS &ob);
  27. public:
  28. // ==================== LIFECYCLE =======================
  29. /** Returns a pointer to a new object of type QuasiNewtonBFGS.
  30. * It allocates all necessary memory.
  31. */
  32. static QuasiNewtonBFGS* New();
  33. /**
  34. * @copybrief LemmaObject::Delete()
  35. * @copydetails LemmaObject::Delete()
  36. */
  37. void Delete();
  38. // ==================== OPERATORS =======================
  39. // ==================== OPERATIONS =======================
  40. // ==================== ACCESS =======================
  41. // ==================== INQUIRY =======================
  42. /** @copybrief InverseSolver::NumberOfIterations()
  43. * @copydetails InverseSolver::NumberOfIterations()
  44. */
  45. int NumberOfIterations();
  46. /** @copybrief InverseSolver::Success()
  47. * @copydetails InverseSolver::Success()
  48. */
  49. bool Success();
  50. /** @copybrief InverseSolver::GetPhiMVector()
  51. * @copydetails InverseSolver::GetPhiMVector()
  52. */
  53. VectorXr GetPhiMVector();
  54. /** @copybrief InverseSolver::GetPhiDVector()
  55. * @copydetails InverseSolver::GetPhiDVector()
  56. */
  57. VectorXr GetPhiDVector();
  58. /// TODO remove this, test
  59. void PrintNorm();
  60. protected:
  61. // ==================== LIFECYCLE =======================
  62. /// Default protected constructor.
  63. QuasiNewtonBFGS (const std::string& cname);
  64. /// Default protected constructor.
  65. ~QuasiNewtonBFGS ();
  66. /**
  67. * @copybrief LemmaObject::Release()
  68. * @copydetails LemmaObject::Release()
  69. */
  70. void Release();
  71. // ==================== OPERATIONS =======================
  72. /// Just a filler
  73. void FillInG(const Vector3r& pos, const Vector3r& step);
  74. // ==================== DATA MEMBERS =========================
  75. private:
  76. }; // ----- end of class QuasiNewtonBFGS -----
  77. } // ----- end of Lemma name -----
  78. #endif // ----- #ifndef QUASINEWTONBFGS_INC -----