LSSTApplications
18.0.0+106,18.0.0+50,19.0.0,19.0.0+1,19.0.0+10,19.0.0+11,19.0.0+13,19.0.0+17,19.0.0+2,19.0.0-1-g20d9b18+6,19.0.0-1-g425ff20,19.0.0-1-g5549ca4,19.0.0-1-g580fafe+6,19.0.0-1-g6fe20d0+1,19.0.0-1-g7011481+9,19.0.0-1-g8c57eb9+6,19.0.0-1-gb5175dc+11,19.0.0-1-gdc0e4a7+9,19.0.0-1-ge272bc4+6,19.0.0-1-ge3aa853,19.0.0-10-g448f008b,19.0.0-12-g6990b2c,19.0.0-2-g0d9f9cd+11,19.0.0-2-g3d9e4fb2+11,19.0.0-2-g5037de4,19.0.0-2-gb96a1c4+3,19.0.0-2-gd955cfd+15,19.0.0-3-g2d13df8,19.0.0-3-g6f3c7dc,19.0.0-4-g725f80e+11,19.0.0-4-ga671dab3b+1,19.0.0-4-gad373c5+3,19.0.0-5-ga2acb9c+2,19.0.0-5-gfe96e6c+2,w.2020.01
LSSTDataManagementBasePackage
|
#include <aggregates.h>
Public Types | |
typedef std::vector< Key< T > > | ErrKeyArray |
typedef std::vector< Key< T > > | CovarianceKeyArray |
typedef std::vector< std::string > | NameArray |
using | Value = Eigen::Matrix< T, N, N > |
The data type for get and set. More... | |
Public Member Functions | |
CovarianceMatrixKey () | |
Construct an invalid instance; must assign before subsequent use. More... | |
CovarianceMatrixKey (ErrKeyArray const &err, CovarianceKeyArray const &cov=CovarianceKeyArray()) | |
Construct a from arrays of per-element Keys. More... | |
CovarianceMatrixKey (SubSchema const &s, NameArray const &names) | |
Construct from a subschema and an array of names for each parameter of the matrix. More... | |
CovarianceMatrixKey (CovarianceMatrixKey const &) | |
CovarianceMatrixKey (CovarianceMatrixKey &&) | |
CovarianceMatrixKey & | operator= (CovarianceMatrixKey const &) |
CovarianceMatrixKey & | operator= (CovarianceMatrixKey &&) |
~CovarianceMatrixKey () noexcept override | |
Eigen::Matrix< T, N, N > | get (BaseRecord const &record) const override |
Get a covariance matrix from the given record. More... | |
void | set (BaseRecord &record, Eigen::Matrix< T, N, N > const &value) const override |
Set a covariance matrix in the given record (uses only the lower triangle of the given matrix) More... | |
T | getElement (BaseRecord const &record, int i, int j) const |
Return the element in row i and column j. More... | |
void | setElement (BaseRecord &record, int i, int j, T value) const |
Set the element in row i and column j. More... | |
bool | isValid () const noexcept |
Return True if all the constituent error Keys are valid. More... | |
std::size_t | hash_value () const noexcept |
Return a hash of this object. More... | |
bool | operator== (CovarianceMatrixKey const &other) const noexcept |
Compare the FunctorKey for equality with another, using its constituent Keys. More... | |
bool | operator!= (CovarianceMatrixKey const &other) const noexcept |
Compare the FunctorKey for equality with another, using its constituent Keys. More... | |
Static Public Member Functions | |
static CovarianceMatrixKey | addFields (Schema &schema, std::string const &prefix, NameArray const &names, std::string const &unit, bool diagonalOnly=false) |
Add covariance matrix fields to a Schema, and return a CovarianceMatrixKey to manage them. More... | |
static CovarianceMatrixKey | addFields (Schema &schema, std::string const &prefix, NameArray const &names, NameArray const &units, bool diagonalOnly=false) |
Add covariance matrix fields to a Schema, and return a CovarianceMatrixKey to manage them. More... | |
Definition at line 432 of file aggregates.h.
typedef std::vector<Key<T> > lsst::afw::table::CovarianceMatrixKey< T, N >::CovarianceKeyArray |
Definition at line 435 of file aggregates.h.
typedef std::vector<Key<T> > lsst::afw::table::CovarianceMatrixKey< T, N >::ErrKeyArray |
Definition at line 434 of file aggregates.h.
typedef std::vector<std::string> lsst::afw::table::CovarianceMatrixKey< T, N >::NameArray |
Definition at line 436 of file aggregates.h.
|
inherited |
The data type for get and set.
Definition at line 77 of file FunctorKey.h.
lsst::afw::table::CovarianceMatrixKey< T, N >::CovarianceMatrixKey | ( | ) |
Construct an invalid instance; must assign before subsequent use.
Definition at line 185 of file aggregates.cc.
|
explicit |
Construct a from arrays of per-element Keys.
The err array Keys should point to the square root of the diagonal of the covariance matrix. The cov array Keys should point to the off-diagonal elements of the lower-triangle, packed first in rows, then in columns (or equivalently, in the upper-triangle, packed first in columns, then in rows). For a 4x4 matrix, the order is is:
err[0]^2 cov[0] cov[1] cov[3] cov[0] err[1]^2 cov[2] cov[4] cov[1] cov[2] err[2]^2 cov[5] cov[3] cov[4] cov[5] err[3]^2
The cov array may also be empty, to indicate that no off-diagonal elements are stored, and should be set to zero. If not empty, the size of the cov matrix must be exactly n*(n-1)/2, where n is the size of the err matrix.
Definition at line 188 of file aggregates.cc.
lsst::afw::table::CovarianceMatrixKey< T, N >::CovarianceMatrixKey | ( | SubSchema const & | s, |
NameArray const & | names | ||
) |
Construct from a subschema and an array of names for each parameter of the matrix.
The field names should match the following convention:
Definition at line 206 of file aggregates.cc.
|
default |
|
default |
|
overridedefaultnoexcept |
|
static |
Add covariance matrix fields to a Schema, and return a CovarianceMatrixKey to manage them.
[out] | schema | Schema to add fields to. |
[in] | prefix | String used to form the first part of all field names. Suffixes of the form '_xErr' and '_x_y_Cov' will be added to form the full field names (using names={'x', 'y'} as an example). |
[in] | unit | Unit for for error (standard deviation) values; covariance matrix elements will be unit^2. |
[in] | names | Vector of strings containing the names of the quantities the covariance matrix represents the uncertainty of. |
[in] | diagonalOnly | If true, only create fields for the error values. |
Definition at line 141 of file aggregates.cc.
|
static |
Add covariance matrix fields to a Schema, and return a CovarianceMatrixKey to manage them.
[out] | schema | Schema to add fields to. |
[in] | prefix | String used to form the first part of all field names. Suffixes of the form '_xErr' and '_x_y_Cov' will be added to form the full field names (using names={'x', 'y'} as an example). |
[in] | units | Vector of units for for error (standard deviation) values; covariance matrix elements will have "{units[i]} {units[j]}" or "{units[i]}^2", depending on whether units[i] == units[j]. |
[in] | names | Vector of strings containing the names of the quantities the covariance matrix represents the uncertainty of. |
[in] | diagonalOnly | If true, only create fields for the error values. |
Definition at line 149 of file aggregates.cc.
|
overridevirtual |
Get a covariance matrix from the given record.
Implements lsst::afw::table::OutputFunctorKey< Eigen::Matrix< T, N, N > >.
Definition at line 259 of file aggregates.cc.
T lsst::afw::table::CovarianceMatrixKey< T, N >::getElement | ( | BaseRecord const & | record, |
int | i, | ||
int | j | ||
) | const |
Return the element in row i and column j.
Definition at line 336 of file aggregates.cc.
|
noexcept |
Return a hash of this object.
Definition at line 329 of file aggregates.cc.
|
noexcept |
Return True if all the constituent error Keys are valid.
Note that if the only one or more off-diagonal keys are invalid, we assume that means those terms are zero, not that the whole FunctorKey is invalid.
Definition at line 294 of file aggregates.cc.
|
inlinenoexcept |
Compare the FunctorKey for equality with another, using its constituent Keys.
Definition at line 537 of file aggregates.h.
|
default |
|
default |
|
noexcept |
Compare the FunctorKey for equality with another, using its constituent Keys.
Definition at line 304 of file aggregates.cc.
|
overridevirtual |
Set a covariance matrix in the given record (uses only the lower triangle of the given matrix)
Implements lsst::afw::table::InputFunctorKey< Eigen::Matrix< T, N, N > >.
Definition at line 278 of file aggregates.cc.
void lsst::afw::table::CovarianceMatrixKey< T, N >::setElement | ( | BaseRecord & | record, |
int | i, | ||
int | j, | ||
T | value | ||
) | const |
Set the element in row i and column j.
Definition at line 349 of file aggregates.cc.