reconciliation_lib 0.1
Library for data reconciliation algorithms
Loading...
Searching...
No Matches
dvrlib::recon_system Class Reference

Encapsulates a system to be reconciled, including variables, confidence intervals, covariance coefficient, etc. More...

#include <recon_system.h>

Classes

struct  extra_cov
 
struct  var
 

Public Member Functions

void add_var (const char *name, double val, double confint)
 Add a variable to be reconciled to the system.
 
void add_covariance_coeff (const char *name1, const char *name2, double cov_coeff)
 Register a covariance coefficient between two variables.
 
int find_var (const std::string &str) const
 Return the index of a variable by name, or -1 if not found.
 
void change_var (const char *name, double val, double confint)
 Update the measured value and confidence interval of an existing variable.
 
int get_number_measured () const
 Return the number of variables that have measurements (non-negative confint).
 
matrix get_covariance_matrix () const
 Build and return the full covariance matrix from the registered variables and covariance coefficients.
 
vector get_values () const
 Return a vector of all variable values in registration order.
 
recon_system updated (const vector &values, const vector &confints) const
 Return a new recon_system with updated values and confidence intervals.
 
void print_vars () const
 Print all variables with their values and confidence intervals to stdout.
 
void print_constraints (const matrix &F) const
 Print the constraint matrix F together with variable names to stdout.
 

Private Attributes

std::vector< varvars
 
std::vector< extra_covextra_covs
 

Detailed Description

Encapsulates a system to be reconciled, including variables, confidence intervals, covariance coefficient, etc.

Constraints still need to be implemented. Also, fixed variables should be treated here.

Member Function Documentation

◆ add_covariance_coeff()

void dvrlib::recon_system::add_covariance_coeff ( const char name1,
const char name2,
double  cov_coeff 
)

Register a covariance coefficient between two variables.

The coefficient is used when building the covariance matrix via get_covariance_matrix().

Parameters
[in]name1Name of the first variable.
[in]name2Name of the second variable.
[in]cov_coeffCovariance coefficient (fraction of the geometric mean of the two variances).

◆ add_var()

void dvrlib::recon_system::add_var ( const char name,
double  val,
double  confint 
)

Add a variable to be reconciled to the system.

If confint is negative, it is assumed that this variable is free (i.e., no measurements).

Todo:
If confint is zero it is assumed that this variable is fixed.
Parameters
[in]nameThe name of the variable
[in]valThe measured, estimated of fixed value of the variable
[in]confintThe confidence interval

◆ change_var()

void dvrlib::recon_system::change_var ( const char name,
double  val,
double  confint 
)

Update the measured value and confidence interval of an existing variable.

Parameters
[in]nameName of the variable to update.
[in]valNew measured value.
[in]confintNew confidence interval.

◆ find_var()

int dvrlib::recon_system::find_var ( const std::string &  str) const

Return the index of a variable by name, or -1 if not found.

Parameters
[in]strVariable name to search for.

◆ get_covariance_matrix()

matrix dvrlib::recon_system::get_covariance_matrix ( ) const

Build and return the full covariance matrix from the registered variables and covariance coefficients.

◆ get_number_measured()

int dvrlib::recon_system::get_number_measured ( ) const

Return the number of variables that have measurements (non-negative confint).

◆ get_values()

vector dvrlib::recon_system::get_values ( ) const

Return a vector of all variable values in registration order.

◆ print_constraints()

void dvrlib::recon_system::print_constraints ( const matrix F) const

Print the constraint matrix F together with variable names to stdout.

Parameters
[in]FConstraint (Jacobian) matrix whose columns correspond to the variables in this system.

◆ print_vars()

void dvrlib::recon_system::print_vars ( ) const

Print all variables with their values and confidence intervals to stdout.

◆ updated()

recon_system dvrlib::recon_system::updated ( const vector values,
const vector confints 
) const

Return a new recon_system with updated values and confidence intervals.

Keeps all variable names and covariance coefficients; replaces values and confidence intervals from the supplied vectors.

Parameters
[in]valuesNew variable values (one per variable, in order).
[in]confintsNew confidence intervals (one per variable, in order).

Member Data Documentation

◆ extra_covs

std::vector<extra_cov> dvrlib::recon_system::extra_covs
private

◆ vars

std::vector<var> dvrlib::recon_system::vars
private

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