Changeset 668 in Sophya for trunk/SophyaLib/SkyT/specrespvector.cc
- Timestamp:
- Nov 29, 1999, 3:16:10 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/SkyT/specrespvector.cc
r610 r668 1 1 //-------------------------------------------------------------------------- 2 2 // File and Version Information: 3 // $Id: specrespvector.cc,v 1. 3 1999-11-21 23:25:47ansari Exp $3 // $Id: specrespvector.cc,v 1.4 1999-11-29 14:16:09 ansari Exp $ 4 4 // 5 5 // Description: … … 22 22 #include "specrespvector.h" 23 23 #include "pexceptions.h" 24 25 24 //---------------- 26 25 // Constructor -- 27 26 //---------------- 27 SpecRespVec::SpecRespVec() 28 : SpectralResponse() 29 { 30 } 31 28 32 SpecRespVec::SpecRespVec(Vector const & nu, Vector const & fdenu, double numin, double numax) 29 33 : SpectralResponse(numin, numax) … … 35 39 _numin = nu(0); 36 40 _numax = nu(nu.NElts()-1); 41 _size = nu.NElts(); 37 42 if(_vecOfNu.NElts() != _vecOfFDeNu.NElts()) cout << "vectors are not compatible" << exit; 38 43 } … … 91 96 92 97 } 98 99 100 void 101 ObjFileIO<SpecRespVec>::WriteSelf(POutPersist& s) const 102 { 103 if(dobj == NULL) 104 { 105 cout << " ObjFileIO<SpecRespVec>::WriteSelf:: dobj= null " << endl; 106 return; 107 } 108 109 int_4 version, nothing; 110 version = 1; 111 nothing = 0; // Reserved for future use 112 s.PutI4(version); 113 s.PutI4(nothing); 114 115 s.PutR8(dobj->minFreq()); 116 s.PutR8(dobj->maxFreq()); 117 118 // TVector<T> has Persistence Manager 119 s << dobj->getNuVec(); 120 s << dobj->getTNuVec(); 121 } 122 123 void 124 ObjFileIO<SpecRespVec>::ReadSelf(PInPersist& s) 125 { 126 int_4 version, nothing; 127 version = 1; 128 nothing = 0; // Reserved for future use 129 s.GetI4(version); 130 s.GetI4(nothing); 131 132 if(dobj == NULL) 133 { 134 Vector v1(10); 135 Vector v2(10); 136 dobj= new SpecRespVec(); 137 ownobj= true; 138 } 139 140 r_8 minf, maxf; 141 s.GetR8(minf); 142 s.GetR8(maxf); 143 dobj->setMinMaxFreq(minf, maxf); 144 // TVector<T> has Persistence Manager 145 s >> dobj->getNuVec(); 146 s >> dobj->getTNuVec(); 147 } 148 149 150 #ifdef __CXX_PRAGMA_TEMPLATES__ 151 #pragma define_template ObjFileIO<SpecRespVec> 152 #endif 153 154 #if defined(ANSI_TEMPLATES) || defined(GNU_TEMPLATES) 155 template class ObjFileIO<SpecRespVec>; 156 #endif
Note:
See TracChangeset
for help on using the changeset viewer.