Cleaned up printing of Rot3
parent
f7141f4333
commit
0e42a96294
|
|
@ -32,7 +32,8 @@ namespace gtsam {
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
void Rot3::print(const std::string& s) const {
|
void Rot3::print(const std::string& s) const {
|
||||||
gtsam::print((Matrix)matrix(), s);
|
cout << (s.empty() ? "R: " : s + " ");
|
||||||
|
gtsam::print((Matrix)matrix());
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
|
|
@ -222,7 +223,7 @@ pair<Matrix3, Vector3> RQ(const Matrix3& A) {
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
ostream &operator<<(ostream &os, const Rot3& R) {
|
ostream &operator<<(ostream &os, const Rot3& R) {
|
||||||
os << R.matrix().format(matlab) << endl;
|
os << R.matrix().format(matlab);
|
||||||
return os;
|
return os;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -254,7 +254,7 @@ namespace gtsam {
|
||||||
/// @{
|
/// @{
|
||||||
|
|
||||||
/** print */
|
/** print */
|
||||||
void print(const std::string& s="R") const;
|
void print(const std::string& s="") const;
|
||||||
|
|
||||||
/** equals with an tolerance */
|
/** equals with an tolerance */
|
||||||
bool equals(const Rot3& p, double tol = 1e-9) const;
|
bool equals(const Rot3& p, double tol = 1e-9) const;
|
||||||
|
|
|
||||||
|
|
@ -608,7 +608,7 @@ TEST( Rot3, stream)
|
||||||
Rot3 R;
|
Rot3 R;
|
||||||
std::ostringstream os;
|
std::ostringstream os;
|
||||||
os << R;
|
os << R;
|
||||||
string expected = "[\n\t1, 0, 0;\n\t0, 1, 0;\n\t0, 0, 1\n]\n";
|
string expected = "[\n\t1, 0, 0;\n\t0, 1, 0;\n\t0, 0, 1\n]";
|
||||||
EXPECT(os.str() == expected);
|
EXPECT(os.str() == expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue