LSSTApplications
10.0+286,10.0+36,10.0+46,10.0-2-g4f67435,10.1+152,10.1+37,11.0,11.0+1,11.0-1-g47edd16,11.0-1-g60db491,11.0-1-g7418c06,11.0-2-g04d2804,11.0-2-g68503cd,11.0-2-g818369d,11.0-2-gb8b8ce7
LSSTDataManagementBasePackage
|
#include <aggregates.h>
Public Types | |
typedef std::vector< Key< T > > | SigmaKeyArray |
typedef std::vector< Key< T > > | CovarianceKeyArray |
typedef std::vector< std::string > | NameArray |
Public Member Functions | |
CovarianceMatrixKey () | |
Construct an invalid instance; must assign before subsequent use. More... | |
CovarianceMatrixKey (SigmaKeyArray const &sigma, 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... | |
virtual Eigen::Matrix< T, N, N > | get (BaseRecord const &record) const |
Get a covariance matrix from the given record. More... | |
virtual void | set (BaseRecord &record, Eigen::Matrix< T, N, N > const &value) const |
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 |
Return True if all the constituent sigma Keys are valid. More... | |
bool | operator== (CovarianceMatrixKey const &other) const |
Compare the FunctorKey for equality with another, using its constituent Keys. More... | |
bool | operator!= (CovarianceMatrixKey const &other) const |
Compare the FunctorKey for equality with another, using its constituent Keys. More... | |
Public Member Functions inherited from lsst::afw::table::OutputFunctorKey< Eigen::Matrix< T, N, N > > | |
virtual | ~OutputFunctorKey () |
Public Member Functions inherited from lsst::afw::table::InputFunctorKey< Eigen::Matrix< T, N, N > > | |
virtual | ~InputFunctorKey () |
Static Public Member Functions | |
static CovarianceMatrixKey | addFields (Schema &schema, std::string const &prefix, NameArray const &names, std::string const &unit, bool diagonalOnly=false) |
static CovarianceMatrixKey | addFields (Schema &schema, std::string const &prefix, NameArray const &names, NameArray const &units, bool diagonalOnly=false) |
Private Attributes | |
SigmaKeyArray | _sigma |
CovarianceKeyArray | _cov |
Definition at line 332 of file aggregates.h.
typedef std::vector< Key<T> > lsst::afw::table::CovarianceMatrixKey< T, N >::CovarianceKeyArray |
Definition at line 336 of file aggregates.h.
typedef std::vector<std::string> lsst::afw::table::CovarianceMatrixKey< T, N >::NameArray |
Definition at line 337 of file aggregates.h.
typedef std::vector< Key<T> > lsst::afw::table::CovarianceMatrixKey< T, N >::SigmaKeyArray |
Definition at line 335 of file aggregates.h.
lsst::afw::table::CovarianceMatrixKey< T, N >::CovarianceMatrixKey | ( | ) |
Construct an invalid instance; must assign before subsequent use.
|
explicit |
Construct a from arrays of per-element Keys.
The sigma 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:
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 sigma matrix.
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:
|
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 '_xSigma' 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 sigma 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 Sigma values. |
|
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 '_xSigma' 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 sigma 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 Sigma values. |
|
virtual |
Get a covariance matrix from the given record.
Implements lsst::afw::table::OutputFunctorKey< Eigen::Matrix< T, N, N > >.
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.
bool lsst::afw::table::CovarianceMatrixKey< T, N >::isValid | ( | ) | const |
Return True if all the constituent sigma 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.
|
inline |
Compare the FunctorKey for equality with another, using its constituent Keys.
Definition at line 445 of file aggregates.h.
bool lsst::afw::table::CovarianceMatrixKey< T, N >::operator== | ( | CovarianceMatrixKey< T, N > const & | other | ) | const |
Compare the FunctorKey for equality with another, using its constituent Keys.
|
virtual |
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 > >.
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.
|
private |
Definition at line 450 of file aggregates.h.
|
private |
Definition at line 449 of file aggregates.h.