Commit dde8c508 authored by Martin Reinecke's avatar Martin Reinecke
Browse files

tweaks

parent c34b08c1
...@@ -610,7 +610,7 @@ MRUTIL_NOINLINE void sharp_job::execute() ...@@ -610,7 +610,7 @@ MRUTIL_NOINLINE void sharp_job::execute()
vector<dcmplx> phasebuffer; vector<dcmplx> phasebuffer;
//FIXME: needs to be changed to "nm" //FIXME: needs to be changed to "nm"
alloc_phase(mmax+1,chunksize, phasebuffer); alloc_phase(mmax+1,chunksize, phasebuffer);
std::atomic<unsigned long long> a_opcnt = 0; std::atomic<unsigned long long> a_opcnt(0);
/* chunk loop */ /* chunk loop */
for (int chunk=0; chunk<nchunks; ++chunk) for (int chunk=0; chunk<nchunks; ++chunk)
......
...@@ -39,7 +39,7 @@ class GL_Integrator ...@@ -39,7 +39,7 @@ class GL_Integrator
vector<double> x, w; vector<double> x, w;
static inline double one_minus_x2 (double x) static inline double one_minus_x2 (double x)
{ return (abs(x)>0.1) ? (1.+x)*(1.-x) : 1.-x*x; } { return (std::abs(x)>0.1) ? (1.+x)*(1.-x) : 1.-x*x; }
public: public:
GL_Integrator(int n, size_t nthreads=1) GL_Integrator(int n, size_t nthreads=1)
...@@ -86,7 +86,7 @@ class GL_Integrator ...@@ -86,7 +86,7 @@ class GL_Integrator
x0 = x1; x0 = x1;
if (dobreak) break; if (dobreak) break;
if (abs(dx)<=eps) dobreak=1; if (std::abs(dx)<=eps) dobreak=1;
MR_assert(++j<100, "convergence problem"); MR_assert(++j<100, "convergence problem");
} }
...@@ -132,6 +132,8 @@ class GL_Integrator ...@@ -132,6 +132,8 @@ class GL_Integrator
} }
return res; return res;
} }
const vector<double> &coordsSymmetric() const
{ return x; }
vector<double> weights() const vector<double> weights() const
{ {
...@@ -140,6 +142,13 @@ class GL_Integrator ...@@ -140,6 +142,13 @@ class GL_Integrator
res[i]=res[n_-1-i]=w[w.size()-1-i]; res[i]=res[n_-1-i]=w[w.size()-1-i];
return res; return res;
} }
vector<double> weightsSymmetric() const
{
auto res = w;
if (n_&1) res[0]*=0.5;
for (auto &v:res) v*=2;
return res;
}
}; };
} }
......
...@@ -27,9 +27,7 @@ ...@@ -27,9 +27,7 @@
namespace mr { namespace mr {
namespace mav { namespace detail_mav {
namespace detail {
using namespace std; using namespace std;
...@@ -114,11 +112,11 @@ template<typename T, size_t ndim> const_mav<T, ndim> nullmav() ...@@ -114,11 +112,11 @@ template<typename T, size_t ndim> const_mav<T, ndim> nullmav()
} }
using detail::mav; using detail_mav::mav;
using detail::const_mav; using detail_mav::const_mav;
using detail::cmav; using detail_mav::cmav;
using detail::nullmav; using detail_mav::nullmav;
}} }
#endif #endif
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment