remove using-namespace and fix print test
parent
25b6146633
commit
f7d9710543
|
@ -20,7 +20,14 @@
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
namespace gtsam {
|
namespace gtsam {
|
||||||
using namespace std;
|
|
||||||
|
/* ************************************************************************* */
|
||||||
|
std::ostream& operator<<(std::ostream& os, const Cal3_S2Stereo& cal) {
|
||||||
|
os << "{ fx: " << cal.fx() << ", fy: " << cal.fy() << ", s: " << cal.skew()
|
||||||
|
<< ", px: " << cal.px() << ", py: " << cal.py()
|
||||||
|
<< ", b: " << cal.baseline() << " }";
|
||||||
|
return os;
|
||||||
|
}
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
void Cal3_S2Stereo::print(const std::string& s) const {
|
void Cal3_S2Stereo::print(const std::string& s) const {
|
||||||
|
@ -32,7 +39,7 @@ void Cal3_S2Stereo::print(const std::string& s) const {
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
bool Cal3_S2Stereo::equals(const Cal3_S2Stereo& other, double tol) const {
|
bool Cal3_S2Stereo::equals(const Cal3_S2Stereo& other, double tol) const {
|
||||||
const Cal3_S2* base = dynamic_cast<const Cal3_S2*>(&other);
|
const Cal3_S2* base = dynamic_cast<const Cal3_S2*>(&other);
|
||||||
return Cal3_S2::equals(*base, tol) && (std::fabs(b_ - other.baseline()) < tol);
|
return (Cal3_S2::equals(*base, tol) && std::fabs(b_ - other.baseline()) < tol);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
|
|
|
@ -131,8 +131,8 @@ TEST(Cal3_S2, between) {
|
||||||
TEST(Cal3_S2, Print) {
|
TEST(Cal3_S2, Print) {
|
||||||
Cal3_S2 cal(5, 5, 5, 5, 5);
|
Cal3_S2 cal(5, 5, 5, 5, 5);
|
||||||
std::stringstream os;
|
std::stringstream os;
|
||||||
os << "{fx: " << cal.fx() << ", fy: " << cal.fy() << ", s:" << cal.skew() << ", px:" << cal.px()
|
os << "{ fx: " << cal.fx() << ", fy: " << cal.fy() << ", s: " << cal.skew()
|
||||||
<< ", py:" << cal.py() << "}";
|
<< ", px: " << cal.px() << ", py: " << cal.py() << " }";
|
||||||
|
|
||||||
EXPECT(assert_stdout_equal(os.str(), cal));
|
EXPECT(assert_stdout_equal(os.str(), cal));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue