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.

datatem.cpp 2.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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 03/23/2010
  9. @version $Id: datatem.cpp 87 2013-09-05 22:44:05Z tirons $
  10. **/
  11. #include "datatem.h"
  12. namespace Lemma {
  13. std::ostream &operator<<(std::ostream &stream,
  14. const DataTEM &ob) {
  15. stream << *(Data*)(&ob);
  16. return stream;
  17. }
  18. // ==================== LIFECYCLE =======================
  19. void DataTEM::Delete() {
  20. this->DetachFrom(this);
  21. }
  22. void DataTEM::Release() {
  23. delete this;
  24. }
  25. DataTEM * DataTEM::New() {
  26. DataTEM* Obj = new DataTEM("DataTEM");
  27. Obj->AttachTo(Obj);
  28. return Obj;
  29. }
  30. DataTEM * DataTEM::Clone() {
  31. DataTEM* Obj = new DataTEM("DataTEM");
  32. Obj->AttachTo(Obj);
  33. // TODO Copy
  34. return Obj;
  35. }
  36. DataTEM::DataTEM(const std::string &name) : Data(name) {
  37. }
  38. DataTEM::~DataTEM() {
  39. if (this->NumberOfReferences != 0)
  40. throw DeleteObjectWithReferences( this );
  41. }
  42. // ==================== OPERATIONS =======================
  43. void DataTEM::Zero() {
  44. }
  45. Real DataTEM::Norm(Data* Data2) {
  46. return 0;
  47. }
  48. void DataTEM::SetSize(const int &nObs,const int &nGates) {
  49. this->nObs = nObs;
  50. this->nGates = nGates;
  51. }
  52. void DataTEM::SetData(const MatrixXr &inputdata) {
  53. this->TEMDataCube = inputdata;
  54. }
  55. void DataTEM::SetPositions(const Vector3Xr &positions) {
  56. this->locations = positions;
  57. }
  58. int DataTEM::GetnGates() {
  59. return this->nGates;
  60. }
  61. int DataTEM::GetnObs() {
  62. return this->nObs;
  63. }
  64. MatrixXr DataTEM::GetData() {
  65. return this->TEMDataCube;
  66. }
  67. Real DataTEM::GetDataCoeff(const int &x, const int &y) {
  68. return this->TEMDataCube.coeff(x,y);
  69. }
  70. VectorXr DataTEM::GetTimes() {
  71. return this->times;
  72. }
  73. Vector3Xr DataTEM::GetPositions() {
  74. return this->locations;
  75. }
  76. } // ----- end of Lemma name -----