seams-core v2.14.2
libyodaLib, the C++ engine of d-SEAMS
Loading...
Searching...
No Matches
seams::HbondTcf Class Reference

Owned streaming hydrogen-bond lifetime accumulator. More...

#include <include/seams.hpp>

Inheritance diagram for seams::HbondTcf:

Public Member Functions

 HbondTcf (std::size_t max_lag, std::size_t origin_stride, double dt, bool directed=true)
 Allocate an H-bond lifetime accumulator.
void push (std::span< const int > donors, std::span< const int > acceptors)
 Push one frame's (donor, acceptor) arrays.
HbondLifetimeCurve curve () const
 Read intermittent C_HB and continuous S_HB curves.
HbondLifetimeFit fit (double t_start=0.0, double t_end=0.0) const
 Fit integrated and single-exponential lifetimes.
Public Member Functions inherited from seams::detail::Handle< seams_hbond_tcf, seams_hbond_tcf_destroy >
 Handle ()=default
Handle & operator= (const Handle &)=delete
 ~Handle ()
 operator bool () const noexcept

Additional Inherited Members

Protected Member Functions inherited from seams::detail::Handle< seams_hbond_tcf, seams_hbond_tcf_destroy >
seams_hbond_tcf * get () const noexcept
void reset () noexcept
Protected Attributes inherited from seams::detail::Handle< seams_hbond_tcf, seams_hbond_tcf_destroy >
seams_hbond_tcf * ptr_

Detailed Description

Owned streaming hydrogen-bond lifetime accumulator.

Definition at line 1156 of file seams.hpp.

Constructor & Destructor Documentation

◆ HbondTcf()

seams::HbondTcf::HbondTcf ( std::size_t max_lag,
std::size_t origin_stride,
double dt,
bool directed = true )
inline

Allocate an H-bond lifetime accumulator.

Parameters
max_lagMaximum lag in frames, or 0 for all lags.
origin_strideFrame stride between origins.
dtFrame spacing.
directedTrue for directed (donor, acceptor) edges.

Definition at line 1165 of file seams.hpp.

1165 {
1166 seams_hbond_tcf *raw = nullptr;
1167 detail::check(seams_hbond_tcf_create(max_lag, origin_stride, dt, directed ? 1 : 0, &raw),
1168 nullptr);
1169 *this = HbondTcf(raw);
1170 }
HbondTcf(std::size_t max_lag, std::size_t origin_stride, double dt, bool directed=true)
Allocate an H-bond lifetime accumulator.
Definition seams.hpp:1165
SEAMS_API seams_status seams_hbond_tcf_create(size_t max_lag, size_t origin_stride, double dt, int directed, seams_hbond_tcf **out)
Create a streaming H-bond lifetime accumulator from per-frame edges.
struct seams_hbond_tcf seams_hbond_tcf
Streaming hydrogen-bond lifetime accumulator.
Definition seams.h:262
void check(int status, const void *handle)
Definition seams.hpp:699

Member Function Documentation

◆ curve()

HbondLifetimeCurve seams::HbondTcf::curve ( ) const
inlinenodiscard

Read intermittent C_HB and continuous S_HB curves.

Definition at line 1186 of file seams.hpp.

1186 {
1187 std::size_t nl = 0;
1188 detail::check(seams_hbond_tcf_curve(get(), nullptr, nullptr, nullptr, nullptr, 0, &nl), get());
1189 HbondLifetimeCurve out;
1190 out.lag_time.resize(nl);
1191 out.c_intermittent.resize(nl);
1192 out.s_continuous.resize(nl);
1193 out.n_origins.resize(nl);
1194 detail::check(seams_hbond_tcf_curve(get(), out.lag_time.data(), out.c_intermittent.data(),
1195 out.s_continuous.data(), out.n_origins.data(), nl, &nl),
1196 get());
1197 return out;
1198 }
SEAMS_API seams_status seams_hbond_tcf_curve(const seams_hbond_tcf *tcf, double *lag_time, double *c_intermittent, double *s_continuous, size_t *n_origins, size_t cap, size_t *n_lags)
Read intermittent C_HB(t) and continuous S_HB(t) lifetime curves.

◆ fit()

HbondLifetimeFit seams::HbondTcf::fit ( double t_start = 0.0,
double t_end = 0.0 ) const
inlinenodiscard

Fit integrated and single-exponential lifetimes.

Definition at line 1201 of file seams.hpp.

1201 {
1202 HbondLifetimeFit out;
1203 detail::check(seams_hbond_tcf_fit(get(), t_start, t_end, &out.tau_c_int, &out.tau_c_exp,
1204 &out.tau_s_int, &out.tau_s_exp),
1205 get());
1206 return out;
1207 }
SEAMS_API seams_status seams_hbond_tcf_fit(const seams_hbond_tcf *tcf, double t_start, double t_end, double *tau_c_int, double *tau_c_exp, double *tau_s_int, double *tau_s_exp)
Integrated and single-exponential lifetimes for C_HB and S_HB.

◆ push()

void seams::HbondTcf::push ( std::span< const int > donors,
std::span< const int > acceptors )
inline

Push one frame's (donor, acceptor) arrays.

Definition at line 1175 of file seams.hpp.

1175 {
1176 if (donors.size() != acceptors.size()) {
1177 throw Error(SEAMS_ERR_ARG, "donors and acceptors differ in length");
1178 }
1180 seams_hbond_tcf_push(get(), donors.empty() ? nullptr : donors.data(),
1181 acceptors.empty() ? nullptr : acceptors.data(), donors.size()),
1182 get());
1183 }
Error(int status, std::string message)
Build an error from a status and a message.
Definition seams.hpp:186
SEAMS_API seams_status seams_hbond_tcf_push(seams_hbond_tcf *tcf, const int *donors, const int *acceptors, size_t n_edges)
Push one frame's hydrogen-bond edge set into the lifetime accumulator.
@ SEAMS_ERR_ARG
A caller argument is the wrong shape, or a coordinate is not finite.
Definition seams.h:159

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