1#ifndef LINEARALGEBRA_SRC_MOLPRO_LINALG_ITSOLV_WRAP_UTIL_H
2#define LINEARALGEBRA_SRC_MOLPRO_LINALG_ITSOLV_WRAP_UTIL_H
3#include <molpro/linalg/itsolv/wrap.h>
16template <
typename R,
typename ForwardIt>
18 auto indices = std::vector<size_t>{};
19 for (
auto it = begin;
it != end; ++
it) {
21 [&
it](
const auto&
w) {
return std::addressof(
w.get()) == std::addressof(*
it); });
23 indices.emplace_back(std::distance(begin,
it));
35 auto indices = std::vector<size_t>{};
38 [&
it](
const auto&
w) {
return std::addressof(
w.get()) == std::addressof(
it->get()); });
40 indices.emplace_back(std::distance(
wparams_ref.cbegin(),
it));
53template <
typename T,
typename U>
55 const auto n = params.size();
56 for (
size_t i = 0,
j = 0;
i <
n; ++
i) {
57 if (std::find(begin(indices), end(indices),
i) != end(indices)) {
58 params.erase(begin(params) +
j);
4-parameter interpolation of a 1-dimensional function given two points for which function values and ...
Definition helper.h:14
std::unique_ptr< LinearEigensystem< R, Q, P > > create_LinearEigensystem(const LinearEigensystemOptions &options, const std::shared_ptr< ArrayHandlers< R, Q, P > > &handlers=std::make_shared< molpro::linalg::itsolv::ArrayHandlers< R, Q, P > >())
Definition SolverFactory.h:111
auto remove_elements(std::vector< T > params, const std::vector< U > &indices)
Removes indices from a vector.
Definition wrap_util.h:54
std::vector< std::reference_wrapper< const A > > CVecRef
Definition wrap.h:14
std::vector< std::reference_wrapper< A > > VecRef
Definition wrap.h:11
std::vector< size_t > find_ref(const VecRef< R > &wparams, ForwardIt begin, ForwardIt end)
Given wrapped references in wparams and a range of original parameters [begin, end),...
Definition wrap_util.h:17