moved [symbol] function to LinearFactor
parent
11f0d04cb6
commit
422169873c
|
@ -237,7 +237,7 @@ LinearFactor::eliminate(const string& key)
|
||||||
FOREACH_PAIR(j,A,As) {
|
FOREACH_PAIR(j,A,As) {
|
||||||
if (j != key) {
|
if (j != key) {
|
||||||
const size_t nj = A.size2(); // get dimension of variable
|
const size_t nj = A.size2(); // get dimension of variable
|
||||||
cg->add(j, sub(A,0,n,0,nj)); // add a parent to conditional gaussian
|
cg->add(j, sub(A,0,n,0,nj)); // add a parent to conditional Gaussian
|
||||||
lf->insert(j,sub(A,n,m,0,nj)); // insert into linear factor
|
lf->insert(j,sub(A,n,m,0,nj)); // insert into linear factor
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -245,3 +245,13 @@ LinearFactor::eliminate(const string& key)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
|
namespace gtsam {
|
||||||
|
|
||||||
|
string symbol(char c, int index) {
|
||||||
|
stringstream ss;
|
||||||
|
ss << c << index;
|
||||||
|
return ss.str();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
/* ************************************************************************* */
|
||||||
|
|
|
@ -228,4 +228,12 @@ public:
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* creates a C++ string a la "x3", "m768"
|
||||||
|
* @param c the base character
|
||||||
|
* @param index the integer to be added
|
||||||
|
* @return a C++ string
|
||||||
|
*/
|
||||||
|
std::string symbol(char c, int index);
|
||||||
|
|
||||||
} // namespace gtsam
|
} // namespace gtsam
|
||||||
|
|
Loading…
Reference in New Issue