LSSTApplications  8.0.0.0+107,8.0.0.1+13,9.1+18,9.2,master-g084aeec0a4,master-g0aced2eed8+6,master-g15627eb03c,master-g28afc54ef9,master-g3391ba5ea0,master-g3d0fb8ae5f,master-g4432ae2e89+36,master-g5c3c32f3ec+17,master-g60f1e072bb+1,master-g6a3ac32d1b,master-g76a88a4307+1,master-g7bce1f4e06+57,master-g8ff4092549+31,master-g98e65bf68e,master-ga6b77976b1+53,master-gae20e2b580+3,master-gb584cd3397+53,master-gc5448b162b+1,master-gc54cf9771d,master-gc69578ece6+1,master-gcbf758c456+22,master-gcec1da163f+63,master-gcf15f11bcc,master-gd167108223,master-gf44c96c709
LSSTDataManagementBasePackage
Public Types | Public Member Functions | Private Attributes | List of all members
lsst::afw::table::CovarianceMatrixKey< T, N > Class Template Reference

#include <aggregates.h>

Inheritance diagram for lsst::afw::table::CovarianceMatrixKey< T, N >:
lsst::afw::table::FunctorKey< Eigen::Matrix< T, N, N > > lsst::afw::table::OutputFunctorKey< Eigen::Matrix< T, N, N > > lsst::afw::table::InputFunctorKey< Eigen::Matrix< T, N, N > >

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...
 
template<typename U >
 CovarianceMatrixKey (Key< Covariance< U > > const &other)
 Construct from a (now-deprecated Key<Covariance<U>>) 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...
 
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 ()
 

Private Attributes

bool _isDiagonalVariance
 
SigmaKeyArray _sigma
 
CovarianceKeyArray _cov
 

Detailed Description

template<typename T, int N>
class lsst::afw::table::CovarianceMatrixKey< T, N >

Definition at line 276 of file aggregates.h.

Member Typedef Documentation

template<typename T, int N>
typedef std::vector< Key<T> > lsst::afw::table::CovarianceMatrixKey< T, N >::CovarianceKeyArray

Definition at line 280 of file aggregates.h.

template<typename T, int N>
typedef std::vector<std::string> lsst::afw::table::CovarianceMatrixKey< T, N >::NameArray

Definition at line 281 of file aggregates.h.

template<typename T, int N>
typedef std::vector< Key<T> > lsst::afw::table::CovarianceMatrixKey< T, N >::SigmaKeyArray

Definition at line 279 of file aggregates.h.

Constructor & Destructor Documentation

template<typename T, int N>
lsst::afw::table::CovarianceMatrixKey< T, N >::CovarianceMatrixKey ( )

Construct an invalid instance; must assign before subsequent use.

template<typename T, int N>
lsst::afw::table::CovarianceMatrixKey< T, N >::CovarianceMatrixKey ( SigmaKeyArray const &  sigma,
CovarianceKeyArray const &  cov = CovarianceKeyArray() 
)
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:

* sigma[0]^2 cov[0] cov[1] cov[3]
* cov[0] sigma[1]^2 cov[2] cov[4]
* cov[1] cov[2] sigma[2]^2 cov[5]
* cov[3] cov[4] cov[5] sigma[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 sigma matrix.

template<typename T, int N>
template<typename U >
lsst::afw::table::CovarianceMatrixKey< T, N >::CovarianceMatrixKey ( Key< Covariance< U > > const &  other)
explicit

Construct from a (now-deprecated Key<Covariance<U>>)

This template is only instantiated for the following combinations of template parameters:

  • CovarianceMatrixKey<float,Eigen::Dynamic> and Key< ovariance<float> >
  • CovarianceMatrixKey<float,2> and Key< Covariance< Point<float> >
  • CovarianceMatrixKey<float,3> and Key< Covariance< Moments<float> > Calling templates other than these will result in linker errors.

To access this functionality in Python, please use the makeCovarianceMatrixKey free functions; Swig wasn't able to instantiate the templated constructors.

template<typename T, int N>
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:

  • diagonal elements should have names like "p1Sigma", where "p1" is the name of the parameter, and should contain the square root of the variance in that parameter.
  • off-diagonal elements hould have names like "p1_p2_Cov", where "p1" and "p2" are names of parameters. For example, for the covariance matrix of a position, we'd look for "xSigma", "ySigma", and "x_y_Cov".

Member Function Documentation

template<typename T, int N>
virtual Eigen::Matrix<T,N,N> lsst::afw::table::CovarianceMatrixKey< T, N >::get ( BaseRecord const &  record) const
virtual

Get a covariance matrix from the given record.

Implements lsst::afw::table::OutputFunctorKey< Eigen::Matrix< T, N, N > >.

template<typename T, int N>
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.

template<typename T, int N>
bool lsst::afw::table::CovarianceMatrixKey< T, N >::operator!= ( CovarianceMatrixKey< T, N > const &  other) const
inline

Compare the FunctorKey for equality with another, using its constituent Keys.

Definition at line 355 of file aggregates.h.

355 { return !(*this == other); }
template<typename T, int N>
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.

template<typename T, int N>
virtual void lsst::afw::table::CovarianceMatrixKey< T, N >::set ( BaseRecord record,
Eigen::Matrix< T, N, N > const &  value 
) const
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 > >.

Member Data Documentation

template<typename T, int N>
CovarianceKeyArray lsst::afw::table::CovarianceMatrixKey< T, N >::_cov
private

Definition at line 361 of file aggregates.h.

template<typename T, int N>
bool lsst::afw::table::CovarianceMatrixKey< T, N >::_isDiagonalVariance
private

Definition at line 359 of file aggregates.h.

template<typename T, int N>
SigmaKeyArray lsst::afw::table::CovarianceMatrixKey< T, N >::_sigma
private

Definition at line 360 of file aggregates.h.


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