Changed programming interface of newSpectrumRaw

This commit is contained in:
Guilhem Lavaux 2012-11-20 08:45:48 -05:00
parent bb20fcee05
commit 50142e3189
2 changed files with 3 additions and 4 deletions

View File

@ -160,7 +160,7 @@ namespace CosmoTool
virtual Spectrum_ptr estimateSpectrumFromMap(const FMap& m) const = 0; virtual Spectrum_ptr estimateSpectrumFromMap(const FMap& m) const = 0;
virtual Spectrum_ptr newSpectrumFromRaw(T *data, long size, virtual Spectrum_ptr newSpectrumFromRaw(T *data, long size,
Spectrum_ptr like_spec) const = 0; const Spectrum& like_spec) const = 0;
}; };
}; };

View File

@ -46,10 +46,9 @@ namespace CosmoTool
} }
Spectrum_ptr newSpectrumFromRaw(T *data, long size, Spectrum_ptr newSpectrumFromRaw(T *data, long size,
Spectrum_ptr like_spec) const const Spectrum& like_spec) const
{ {
Spectrum *s = like_spec.get(); const HealpixSpectrum<T>& in_spec = dynamic_cast<const HealpixSpectrum<T>&>(like_spec);
HealpixSpectrum<T>& in_spec = dynamic_cast<HealpixSpectrum<T>&>(*s);
HealpixSpectrum<T> *new_spectrum = new HealpixSpectrum<T>(in_spec.Lmax()); HealpixSpectrum<T> *new_spectrum = new HealpixSpectrum<T>(in_spec.Lmax());
T *out_d = new_spectrum->data(); T *out_d = new_spectrum->data();