Main Lemma Repository
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

quasinewtonbfgs.cpp 2.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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.cpp 87 2013-09-05 22:44:05Z tirons $
  10. **/
  11. #include "quasinewtonbfgs.h"
  12. namespace Lemma {
  13. // ==================== STREAMS =======================
  14. std::ostream &operator<<(std::ostream &stream,
  15. const QuasiNewtonBFGS &ob) {
  16. stream << *(InverseSolver*)(&ob);
  17. return stream;
  18. }
  19. // ==================== LIFECYCLE =======================
  20. QuasiNewtonBFGS* QuasiNewtonBFGS::New() {
  21. QuasiNewtonBFGS* Object = new QuasiNewtonBFGS("QuasiNewtonBFGS");
  22. Object->AttachTo(Object);
  23. return Object;
  24. }
  25. QuasiNewtonBFGS::QuasiNewtonBFGS(const std::string &name) :
  26. InverseSolver(name) {
  27. }
  28. void QuasiNewtonBFGS::Delete() {
  29. this->DetachFrom(this);
  30. }
  31. void QuasiNewtonBFGS::Release() {
  32. delete this;
  33. }
  34. QuasiNewtonBFGS::~QuasiNewtonBFGS() {
  35. if (this->NumberOfReferences != 0)
  36. throw DeleteObjectWithReferences( this );
  37. }
  38. // ==================== INQUIRY =======================
  39. int QuasiNewtonBFGS::NumberOfIterations() {
  40. return 0;
  41. }
  42. bool QuasiNewtonBFGS::Success () {
  43. return false;
  44. }
  45. void QuasiNewtonBFGS::PrintNorm() {
  46. std::cout << "Norm " << std::endl;
  47. PredictedData->Zero();
  48. std::cout << ObservedData->Norm(PredictedData) << std::endl;
  49. }
  50. VectorXr QuasiNewtonBFGS::GetPhiMVector() {
  51. VectorXr NewVec(2);
  52. return NewVec;
  53. }
  54. VectorXr QuasiNewtonBFGS::GetPhiDVector() {
  55. VectorXr NewVec(2);
  56. return NewVec;
  57. }
  58. void QuasiNewtonBFGS::FillInG(const Vector3r& pos, const Vector3r& step) {
  59. }
  60. // ==================== ACCESS =======================
  61. } // ----- end of Lemma name -----