示例#1
0
文件: Errors.cpp 项目: DForger/gtsam
/* ************************************************************************* */
double dot(const Errors& a, const Errors& b) {
#ifndef NDEBUG
  size_t m = a.size();
  if (b.size()!=m)
    throw(std::invalid_argument("Errors::dot: incompatible sizes"));
#endif
  double result = 0.0;
  Errors::const_iterator it = b.begin();
  BOOST_FOREACH(const Vector& ai, a)
    result += gtsam::dot(ai, *(it++));
  return result;
}
示例#2
0
文件: Errors.cpp 项目: DForger/gtsam
/* ************************************************************************* */
Errors Errors::operator-(const Errors& b) const {
#ifndef NDEBUG
  size_t m = size();
  if (b.size()!=m)
    throw(std::invalid_argument("Errors::operator-: incompatible sizes"));
#endif
  Errors result;
  Errors::const_iterator it = b.begin();
  BOOST_FOREACH(const Vector& ai, *this)
    result.push_back(ai - *(it++));
  return result;
}
示例#3
0
 /* ************************************************************************* */
 void GaussianFactorGraph::multiplyInPlace(const VectorValues& x, Errors& e) const {
   multiplyInPlace(x, e.begin());
 }
示例#4
0
文件: Errors.cpp 项目: DForger/gtsam
bool Errors::equals(const Errors& expected, double tol) const {
  if( size() != expected.size() ) return false;
  return equal(begin(),end(),expected.begin(),equalsVector(tol));
}
示例#5
0
文件: Errors.cpp 项目: DForger/gtsam
void axpy<Errors,Errors>(double alpha, const Errors& x, Errors& y) {
  Errors::const_iterator it = x.begin();
  BOOST_FOREACH(Vector& yi, y)
    axpy(alpha,*(it++),yi);
}