Added dense matrix accessor for JointMarginals

release/4.3a0
Stephen Williams 2012-08-15 17:17:52 +00:00
parent 44a3ec1e1d
commit 355141f985
2 changed files with 8 additions and 0 deletions

View File

@ -1239,6 +1239,7 @@ class Marginals {
class JointMarginal { class JointMarginal {
Matrix at(size_t iVariable, size_t jVariable) const; Matrix at(size_t iVariable, size_t jVariable) const;
Matrix fullMatrix() const;
void print(string s) const; void print(string s) const;
void print() const; void print() const;
}; };

View File

@ -116,6 +116,13 @@ public:
Block at(Key iVariable, Key jVariable) const { Block at(Key iVariable, Key jVariable) const {
return (*this)(iVariable, jVariable); } return (*this)(iVariable, jVariable); }
/** The full, dense covariance/information matrix of the joint marginal. This returns
* a reference to the JointMarginal object, so the JointMarginal object must be kept
* in scope while this view is needed. Otherwise assign this block object to a Matrix
* to store it.
*/
const Matrix& fullMatrix() const { return fullMatrix_; }
/** Copy constructor */ /** Copy constructor */
JointMarginal(const JointMarginal& other); JointMarginal(const JointMarginal& other);