Formatting, and moved print to cpp.
parent
ea0e16caf5
commit
6e23d61221
|
@ -6,11 +6,17 @@
|
||||||
|
|
||||||
#include "Point2.h"
|
#include "Point2.h"
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
namespace gtsam {
|
namespace gtsam {
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
bool assert_equal(const Point2& p, const Point2& q, double tol) {
|
void Point2::print(const string& s) const {
|
||||||
|
cout << s << "(" << x_ << ", " << y_ << ")" << endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ************************************************************************* */
|
||||||
|
bool assert_equal(const Point2& p, const Point2& q, double tol) {
|
||||||
if (fabs(p.x() - q.x()) < tol && fabs(p.y() - q.y()) < tol) return true;
|
if (fabs(p.x() - q.x()) < tol && fabs(p.y() - q.y()) < tol) return true;
|
||||||
printf("not equal:\n");
|
printf("not equal:\n");
|
||||||
p.print("p = ");
|
p.print("p = ");
|
||||||
|
|
|
@ -50,9 +50,7 @@ namespace gtsam {
|
||||||
inline Point2 operator - (const Point2& q) const {return Point2(x_-q.x_,y_-q.y_);}
|
inline Point2 operator - (const Point2& q) const {return Point2(x_-q.x_,y_-q.y_);}
|
||||||
|
|
||||||
/** print with optional string */
|
/** print with optional string */
|
||||||
void print(const std::string& s = "") const {
|
void print(const std::string& s = "") const;
|
||||||
std::cout << s << "(" << x_ << ", " << y_ << ")" << std::endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** distance between two points */
|
/** distance between two points */
|
||||||
double dist(const Point2& p2) const {
|
double dist(const Point2& p2) const {
|
||||||
|
|
Loading…
Reference in New Issue