Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F120331041
fft_engine.hh
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Thu, Jul 3, 14:21
Size
1 KB
Mime Type
text/x-c
Expires
Sat, Jul 5, 14:21 (1 d, 17 h)
Engine
blob
Format
Raw Data
Handle
27173472
Attached To
rMSPPROTO µSpectre prototype implementation
fft_engine.hh
View Options
/**
* file fft_engine.hh
*
* @author Till Junge <till.junge@epfl.ch>
*
* @date 11 May 2017
*
* @brief abstract base class defining interface for fft_systems
*
* @section LICENCE
*
* Copyright (C) 2017 Till Junge
*
* µSpectre 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 3, or (at
* your option) any later version.
*
* µSpectre 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 GNU Emacs; see the file COPYING. If not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include "common/common.hh"
#include <algorithm>
#include <utility>
#ifndef FFT_ENGINE_H
#define FFT_ENGINE_H
namespace muSpectre {
enum class FFT_PlanFlags {estimate, measure, patient};
template<Dim_t DimS, Dim_t DimM>
class FFT_Engine {
public:
using Ccoord = Ccoord_t<DimS>;
FFT_Engine(Ccoord nb_pixels)
:nb_pixels(nb_pixels),
tot_nb_pixels(std::accumulate(nb_pixels.begin(), nb_pixels.end(),
1, std::multiplies<size_t>())){};
virtual Real * convolve(const Real * const Ghat, const Real * const arr) = 0;
//! out-of place convolution
virtual void convolve (const Real * const Ghat, const Real * const in, Real * out) = 0;
size_t get_tot_nb_pixels() const {return this->tot_nb_pixels;}
protected:
virtual void init(FFT_PlanFlags flags) = 0;
const Ccoord nb_pixels;
size_t tot_nb_pixels;
};
} // muSpectre
#endif /* FFT_ENGINE_H */
Event Timeline
Log In to Comment