Lemma is an Electromagnetics API
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

ParticleSwarmOptimizer.h 2.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. /* This file is part of Lemma, a geophysical modelling and inversion API.
  2. * More information is available at http://lemmasoftware.org
  3. */
  4. /* This Source Code Form is subject to the terms of the Mozilla Public
  5. * License, v. 2.0. If a copy of the MPL was not distributed with this
  6. * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  7. */
  8. /**
  9. * @file
  10. * @date 01/27/2015 01:50:59 PM
  11. * @version $Id$
  12. * @author Trevor Irons (ti)
  13. * @email Trevor.Irons@xri-geo.com
  14. * @copyright Copyright (c) 2015, XRI Geophysics, LLC
  15. * @copyright Copyright (c) 2015, Trevor Irons
  16. */
  17. #ifndef PARTICLESWARMOPTIMIZER_INC
  18. #define PARTICLESWARMOPTIMIZER_INC
  19. #include "LemmaObject.h"
  20. namespace Lemma {
  21. struct Particle{
  22. Real fitness;
  23. VectorXr best;
  24. };
  25. /**
  26. \brief
  27. \details
  28. */
  29. class ParticleSwarmOptimizer : public LemmaObject {
  30. friend std::ostream &operator<<(std::ostream &stream,
  31. const ParticleSwarmOptimizer &ob);
  32. public:
  33. // ==================== LIFECYCLE =======================
  34. /**
  35. * @copybrief LemmaObject::New()
  36. * @copydetails LemmaObject::New()
  37. */
  38. static ParticleSwarmOptimizer* New();
  39. /**
  40. * @copybrief LemmaObject::Delete()
  41. * @copydetails LemmaObject::Delete()
  42. */
  43. void Delete();
  44. // ==================== OPERATORS =======================
  45. // ==================== OPERATIONS =======================
  46. // ==================== ACCESS =======================
  47. // ==================== INQUIRY =======================
  48. #ifdef HAVE_YAMLCPP
  49. /**
  50. * Uses YAML to serialize this object.
  51. * @return a YAML::Node
  52. */
  53. YAML::Node Serialize() const;
  54. /**
  55. * Constructs an object from a YAML::Node.
  56. */
  57. static ParticleSwarmOptimizer* DeSerialize(const YAML::Node& node);
  58. #endif
  59. protected:
  60. // ==================== LIFECYCLE =======================
  61. /** Default protected constructor, use New */
  62. ParticleSwarmOptimizer (const std::string& name);
  63. #ifdef HAVE_YAMLCPP
  64. /** Protected DeDerializing constructor, use factory DeSerialize method*/
  65. ParticleSwarmOptimizer (const YAML::Node& node);
  66. #endif
  67. /** Default protected destructor, use Delete */
  68. ~ParticleSwarmOptimizer ();
  69. /**
  70. * @copybrief LemmaObject::Release()
  71. * @copydetails LemmaObject::Release()
  72. */
  73. void Release();
  74. private:
  75. // ==================== DATA MEMBERS =========================
  76. }; // ----- end of class ParticleSwarmOptimizer -----
  77. } // ----- end of Lemma name -----
  78. #endif // ----- #ifndef PARTICLESWARMOPTIMIZER_INC -----