sharp_almhelpers.h 4.3 KB
 Martin Reinecke committed Jan 04, 2020 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 ``````/* * This file is part of libsharp2. * * libsharp2 is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * libsharp2 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with libsharp2; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* libsharp2 is being developed at the Max-Planck-Institut fuer Astrophysik */ /*! \file sharp_almhelpers.h * SHARP helper function for the creation of a_lm data structures * * Copyright (C) 2008-2019 Max-Planck-Society * \author Martin Reinecke */ #ifndef SHARP2_ALMHELPERS_H #define SHARP2_ALMHELPERS_H `````` Martin Reinecke committed Jan 09, 2020 31 32 `````` #include `````` Martin Reinecke committed Jan 04, 2020 33 34 ``````#include "libsharp2/sharp.h" `````` Martin Reinecke committed Jan 16, 2020 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 ``````/*! \internal Helper type for index calculation in a_lm arrays. */ class sharp_standard_alm_info: public sharp_alm_info { private: /*! Maximum \a l index of the array */ size_t lmax_; /*! Array with \a nm entries containing the individual m values */ std::vector mval_; /*! Array with \a nm entries containing the (hypothetical) indices of the coefficients with quantum numbers 0,\a mval[i] */ std::vector mvstart; /*! Stride between a_lm and a_(l+1),m */ ptrdiff_t stride; public: /*! Creates an a_lm data structure from the following parameters: \param lmax maximum \a l quantum number (>=0) \param mmax maximum \a m quantum number (0<= \a mmax <= \a lmax) \param stride the stride between entries with identical \a m, and \a l differing by 1. \param mstart the index of the (hypothetical) coefficient with the quantum numbers 0,\a m. Must have \a mmax+1 entries. */ sharp_standard_alm_info(size_t lmax__, size_t mmax_, ptrdiff_t stride_, const ptrdiff_t *mstart); /*! Creates an a_lm data structure which from the following parameters: \param lmax maximum \a l quantum number (\a >=0) \param nm number of different \a m (\a 0<=nm<=lmax+1) \param stride the stride between entries with identical \a m, and \a l differing by 1. \param mval array with \a nm entries containing the individual m values \param mvstart array with \a nm entries containing the (hypothetical) indices of the coefficients with the quantum numbers 0,\a mval[i] */ sharp_standard_alm_info (size_t lmax__, size_t nm__, ptrdiff_t stride_, const size_t *mval__, const ptrdiff_t *mvstart_); /*! Returns the index of the coefficient with quantum numbers \a l, \a mval_[mi]. \note for a \a sharp_alm_info generated by sharp_make_alm_info() this is the index for the coefficient with the quantum numbers \a l, \a mi. */ ptrdiff_t index (int l, int mi); virtual size_t lmax() const { return lmax_; } virtual size_t mmax() const; virtual size_t nm() const { return mval_.size(); } virtual size_t mval(size_t i) const { return mval_[i]; } virtual void clear_alm(std::complex *alm) const; virtual void clear_alm(std::complex *alm) const; virtual void get_alm(size_t mi, const std::complex *alm, std::complex *almtmp, size_t nalm) const; virtual void get_alm(size_t mi, const std::complex *alm, std::complex *almtmp, size_t nalm) const; virtual void add_alm(size_t mi, const std::complex *almtmp, std::complex *alm, size_t nalm) const; virtual void add_alm(size_t mi, const std::complex *almtmp, std::complex *alm, size_t nalm) const; }; `````` Martin Reinecke committed Jan 04, 2020 90 91 92 ``````/*! Initialises an a_lm data structure according to the scheme used by Healpix_cxx. \ingroup almgroup */ `````` Martin Reinecke committed Jan 15, 2020 93 ``````std::unique_ptr sharp_make_triangular_alm_info (int lmax, int mmax, int stride); `````` Martin Reinecke committed Jan 04, 2020 94 95 96 97 `````` /*! Initialises an a_lm data structure according to the scheme used by Fortran Healpix \ingroup almgroup */ `````` Martin Reinecke committed Jan 15, 2020 98 ``````std::unique_ptr sharp_make_rectangular_alm_info (int lmax, int mmax, int stride); `````` Martin Reinecke committed Jan 04, 2020 99 100 `````` #endif``````