Added constructor

release/4.3a0
krunalchande 2014-12-18 20:47:14 -05:00 committed by thduynguyen
parent b4c5237925
commit 7d2f69335d
1 changed files with 10 additions and 0 deletions

View File

@ -41,6 +41,16 @@ public:
Base() { Base() {
} }
/**
* Construct from a constrained noisemodel JacobianFactor with a dual key.
*/
explicit LinearEquality(const JacobianFactor& jf, Key dualKey) : Base(jf), dualKey_(dualKey){
if (!jf.isConstrained()) {
throw std::runtime_error("Cannot convert an unconstrained JacobianFactor to LinearEquality");
}
}
/** Conversion from HessianFactor (does Cholesky to obtain Jacobian matrix) */ /** Conversion from HessianFactor (does Cholesky to obtain Jacobian matrix) */
explicit LinearEquality(const HessianFactor& hf) { explicit LinearEquality(const HessianFactor& hf) {
throw std::runtime_error("Cannot convert HessianFactor to LinearEquality"); throw std::runtime_error("Cannot convert HessianFactor to LinearEquality");