.. _program_listing_file_src_interpolator2_at.tpp: Program Listing for File interpolator2_at.tpp ============================================= |exhale_lsh| :ref:`Return to documentation for file ` (``src/interpolator2_at.tpp``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp /* This file is part of brille. Copyright © 2020 Greg Tucker brille is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. brille 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 Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with brille. If not, see . */ template void Interpolator::interpolate_at_mix( const std::vector>& perms, const std::vector& indices, const std::vector& weights, bArray& out, const ind_t to, const bool arbitrary_phase_allowed ) const { if (indices.size()==0 || weights.size()==0) throw std::logic_error("Interpolation requires input data!"); ind_t b_{this->branches()}, s_{this->branch_span()}; verbose_update("Combining\n",data_.extract(indices).to_string(),"with weights ", weights); T *ox = out.ptr(to); if (arbitrary_phase_allowed){ const T *d0 = data_.ptr(indices[0]); // a reference point for the phase calculation for (size_t x=0; x // void Interpolator::interpolate_at_mix( // const std::vector>& perms, // const std::vector>& idx_wgt, // bArray& out, // const ind_t to, // const bool arbitrary_phase_allowed // ) const { // if (idx_wgt.size()==0) // throw std::logic_error("Interpolation requires input data!"); // std::vector dummy; // ind_t b_{this->branches()}, s_{this->branch_span()}; // T * ox = out.ptr(to); // if (arbitrary_phase_allowed){ // const T *d0 = data_.ptr(idx_wgt[0].first); // std::transform(perms.begin(), perms.end(), idx_wgt.begin(), std::back_inserter(dummy), // [&](const std::vector& perm, const std::pair& iw){ // const T *dx = data_.ptr(iw.first); // for (ind_t b=0; b& perm, const std::pair& iw){ // const T *dx = data_.ptr(iw.first); // for (ind_t b=0; b void Interpolator::interpolate_at_mix( const std::vector>& perms, const std::vector>& idx_wgt, bArray& out, const ind_t to, const bool arbitrary_phase_allowed ) const { if (idx_wgt.size()==0) throw std::logic_error("Interpolation requires input data!"); std::vector dummy; ind_t b_{this->branches()}, s_{this->branch_span()}; T * ox = out.ptr(to); if (arbitrary_phase_allowed){ const T *d0 = data_.ptr(idx_wgt[0].first); for (ind_t i=0; i