29 template<
bool NORMALIZE>
31 const auto &s = this->getSettings();
32 const size_t n = s.otherDims.n();
33 const size_t z = s.otherDims.z();
34 const size_t y = s.otherDims.y();
35 const size_t x = s.otherDims.x();
37 auto &res = this->getFiguresOfMerit();
39 auto workload = [&](
int id,
size_t signalId){
41 T *
address = others + signalId * s.otherDims.sizeSingle();
50 auto futures = std::vector<std::future<void>>();
51 for (
size_t i = 0;
i <
n; ++
i) {
52 futures.emplace_back(m_threadPool.push(workload,
i));
54 for (
auto &
f : futures) {
61 bool isReady = this->isInitialized() && this->isRefLoaded();
65 const auto &s = this->getSettings();
68 if (s.normalizeResult) {
69 computeOneToN<true>(others);
71 computeOneToN<false>(others);
83 this->setIsRefLoaded(
nullptr != ref);
88 const auto &s = this->getSettings();
91 for (
auto &hw : s.hw) {
92 if ( ! dynamic_cast<CPU*>(hw)) {
108 m_threadPool.resize(0);
114 if ( ! this->isInitialized()) {
117 auto &sOrig = this->getSettings();
118 result = result && sOrig.type == s.
type;
119 result = result && (sOrig.otherDims.size() >= s.
otherDims.
size());
Case or algorithm not implemented yet.
#define REPORT_ERROR(nerr, ErrormMsg)
double correlationIndex(const MultidimArray< T > &x, const MultidimArray< T > &y, const MultidimArray< int > *mask=NULL, MultidimArray< double > *Contributions=NULL)
static unsigned findCores()
void compute(T *others) override
T fastCorrelation(const MultidimArray< T > &x, const MultidimArray< T > &y)
constexpr size_t size() const
void loadReference(const T *ref) override
Some logical error in the pipeline.