Made private some members that should not have been public
parent
4a23971b80
commit
05b0110ac2
|
|
@ -65,7 +65,6 @@ protected:
|
||||||
typedef VerticalBlockView<AbMatrix> BlockAb;
|
typedef VerticalBlockView<AbMatrix> BlockAb;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
typedef GaussianConditional Conditional;
|
typedef GaussianConditional Conditional;
|
||||||
typedef boost::shared_ptr<GaussianFactor> shared_ptr;
|
typedef boost::shared_ptr<GaussianFactor> shared_ptr;
|
||||||
typedef BlockAb::Block ABlock;
|
typedef BlockAb::Block ABlock;
|
||||||
|
|
@ -73,6 +72,7 @@ public:
|
||||||
typedef BlockAb::Column BVector;
|
typedef BlockAb::Column BVector;
|
||||||
typedef BlockAb::constColumn constBVector;
|
typedef BlockAb::constColumn constBVector;
|
||||||
|
|
||||||
|
protected:
|
||||||
SharedDiagonal model_; // Gaussian noise model with diagonal covariance matrix
|
SharedDiagonal model_; // Gaussian noise model with diagonal covariance matrix
|
||||||
std::vector<size_t> firstNonzeroBlocks_;
|
std::vector<size_t> firstNonzeroBlocks_;
|
||||||
AbMatrix matrix_; // the full matrix correponding to the factor
|
AbMatrix matrix_; // the full matrix correponding to the factor
|
||||||
|
|
@ -229,9 +229,6 @@ public:
|
||||||
|
|
||||||
void set_firstNonzeroBlocks(size_t row, size_t varpos) { firstNonzeroBlocks_[row] = varpos; }
|
void set_firstNonzeroBlocks(size_t row, size_t varpos) { firstNonzeroBlocks_[row] = varpos; }
|
||||||
|
|
||||||
friend class GaussianFactorGraph;
|
|
||||||
friend class Inference;
|
|
||||||
|
|
||||||
}; // GaussianFactor
|
}; // GaussianFactor
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -180,8 +180,8 @@ bool GaussianFactorGraph::split(const std::map<Index, Index> &M, GaussianFactorG
|
||||||
Ab2.push_back(factor);
|
Ab2.push_back(factor);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
Index key1 = factor->keys_[0];
|
Index key1 = factor->keys()[0];
|
||||||
Index key2 = factor->keys_[1];
|
Index key2 = factor->keys()[1];
|
||||||
|
|
||||||
if ((M.find(key1) != M.end() && M.find(key1)->second == key2) ||
|
if ((M.find(key1) != M.end() && M.find(key1)->second == key2) ||
|
||||||
(M.find(key2) != M.end() && M.find(key2)->second == key1))
|
(M.find(key2) != M.end() && M.find(key2)->second == key1))
|
||||||
|
|
@ -210,11 +210,9 @@ bool GaussianFactorGraph::getDiagonalOfHessian(VectorValues &values) const {
|
||||||
values.makeZero() ;
|
values.makeZero() ;
|
||||||
|
|
||||||
BOOST_FOREACH( const sharedFactor& factor, factors_) {
|
BOOST_FOREACH( const sharedFactor& factor, factors_) {
|
||||||
Index i = 0 ;
|
for(GaussianFactor::const_iterator j = factor->begin(); j != factor->end(); ++j) {
|
||||||
BOOST_FOREACH( const Index& idx, factor->keys_) {
|
Vector v = columnNormSquare(factor->getA(j));
|
||||||
Vector v = columnNormSquare(factor->Ab_(i)) ;
|
values[*j] += v;
|
||||||
values[idx] += v;
|
|
||||||
++i ;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true ;
|
return true ;
|
||||||
|
|
@ -233,10 +231,8 @@ void GaussianFactorGraph::multiply(const VectorValues &x, VectorValues &r) const
|
||||||
r.makeZero() ;
|
r.makeZero() ;
|
||||||
Index i = 0 ;
|
Index i = 0 ;
|
||||||
BOOST_FOREACH(const sharedFactor& factor, factors_) {
|
BOOST_FOREACH(const sharedFactor& factor, factors_) {
|
||||||
Index j = 0 ;
|
for(GaussianFactor::const_iterator j = factor->begin(); j != factor->end(); ++j) {
|
||||||
BOOST_FOREACH( const Index& idx, factor->keys_ ) {
|
r[i] += prod(factor->getA(j), x[*j]);
|
||||||
r[i] += prod(factor->Ab_(j), x[idx]) ;
|
|
||||||
++j ;
|
|
||||||
}
|
}
|
||||||
++i ;
|
++i ;
|
||||||
}
|
}
|
||||||
|
|
@ -246,10 +242,8 @@ void GaussianFactorGraph::transposeMultiply(const VectorValues &r, VectorValues
|
||||||
x.makeZero() ;
|
x.makeZero() ;
|
||||||
Index i = 0 ;
|
Index i = 0 ;
|
||||||
BOOST_FOREACH(const sharedFactor& factor, factors_) {
|
BOOST_FOREACH(const sharedFactor& factor, factors_) {
|
||||||
Index j = 0 ;
|
for(GaussianFactor::const_iterator j = factor->begin(); j != factor->end(); ++j) {
|
||||||
BOOST_FOREACH( const Index& idx, factor->keys_ ) {
|
x[*j] += prod(trans(factor->getA(j)), r[i]) ;
|
||||||
x[idx] += prod(trans(factor->Ab_(j)), r[i]) ;
|
|
||||||
++j ;
|
|
||||||
}
|
}
|
||||||
++i ;
|
++i ;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue