Loading...
Searching...
No Matches
gpr::neb::BandLayout Struct Reference

Map between caller coordinates and the moving coordinates of a band. More...

#include <gpr/neb/BandLayout.h>

Public Member Functions

bool packed () const
Eigen::VectorXd pack (const Eigen::VectorXd &full) const
Eigen::VectorXd unpack (const Eigen::VectorXd &moving) const
Eigen::VectorXd unpack_gradient (const Eigen::VectorXd &moving) const

Public Attributes

std::vector< int > moving_index
Eigen::VectorXd full_template

Detailed Description

Map between caller coordinates and the moving coordinates of a band.

Definition at line 16 of file BandLayout.h.

Member Function Documentation

◆ pack()

Eigen::VectorXd gpr::neb::BandLayout::pack ( const Eigen::VectorXd & full) const
inline

Definition at line 22 of file BandLayout.h.

23 {
24 if (!packed()) return full;
25 if (full.size() != full_template.size()) {
26 throw std::invalid_argument(
27 "GP NEB layout pack expects a full-size coordinate vector");
28 }
29 Eigen::VectorXd out(3 * static_cast<Eigen::Index>(moving_index.size()));
30 for (std::size_t k = 0; k < moving_index.size(); ++k)
31 out.segment<3>(3 * static_cast<Eigen::Index>(k)) =
32 full.segment<3>(3 * moving_index[k]);
33 return out;
34 }
eon_relax_band_t eon_relax_surface_fn void eon_relax_outcome_t * out
Eigen::VectorXd full_template
Definition BandLayout.h:18
bool packed() const
Definition BandLayout.h:20
std::vector< int > moving_index
Definition BandLayout.h:17

◆ packed()

bool gpr::neb::BandLayout::packed ( ) const
inline

Definition at line 20 of file BandLayout.h.

20{ return !moving_index.empty(); }

◆ unpack()

Eigen::VectorXd gpr::neb::BandLayout::unpack ( const Eigen::VectorXd & moving) const
inline

Definition at line 36 of file BandLayout.h.

37 {
38 if (!packed()) return moving;
39 return scatter(moving, full_template);
40 }

◆ unpack_gradient()

Eigen::VectorXd gpr::neb::BandLayout::unpack_gradient ( const Eigen::VectorXd & moving) const
inline

Definition at line 42 of file BandLayout.h.

43 {
44 if (!packed()) return moving;
45 return scatter(moving, Eigen::VectorXd::Zero(full_template.size()));
46 }

Member Data Documentation

◆ full_template

Eigen::VectorXd gpr::neb::BandLayout::full_template

Definition at line 18 of file BandLayout.h.

◆ moving_index

std::vector<int> gpr::neb::BandLayout::moving_index

Definition at line 17 of file BandLayout.h.


The documentation for this struct was generated from the following file: