JayBeams  0.1
Another project to have fun coding.
plan.cpp
Go to the documentation of this file.
1 #include "jb/fftw/plan.hpp"
2 
3 #include <sstream>
4 #include <stdexcept>
5 
6 namespace jb {
7 namespace fftw {
8 namespace detail {
9 
11  std::size_t in_elements, std::size_t on_elements, std::size_t in_nsamples,
12  std::size_t on_nsamples, char const* function_name) {
13  if (in_nsamples != on_nsamples) {
14  std::ostringstream os;
15  os << "mismatched number of samples (" << in_nsamples
16  << " != " << on_nsamples << ") in " << function_name;
17  throw std::invalid_argument(os.str());
18  }
19  if (in_elements != on_elements) {
20  std::ostringstream os;
21  os << "mismatched element count (" << in_elements << " != " << on_elements
22  << ") in " << function_name;
23  throw std::invalid_argument(os.str());
24  }
25  if (in_nsamples == 0) {
26  std::ostringstream os;
27  os << "nsamples must be non-zero in " << function_name;
28  throw std::invalid_argument(os.str());
29  }
30 }
31 
32 } // namespace detail
33 } // namespace fftw
34 } // namespace jb
void check_plan_inputs(std::size_t in_elements, std::size_t on_elements, std::size_t in_nsamples, std::size_t on_nsamples, char const *function_name)
Helper function to check the inputs to a create_*_plan_*()
Definition: plan.cpp:10
The top-level namespace for the JayBeams library.
Definition: as_hhmmss.hpp:7