remove using-namespace and fix print test

release/4.3a0
Varun Agrawal 2020-12-02 06:13:35 -05:00
parent 25b6146633
commit f7d9710543
2 changed files with 11 additions and 4 deletions

View File

@ -20,7 +20,14 @@
#include <iostream>
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 {
@ -32,7 +39,7 @@ void Cal3_S2Stereo::print(const std::string& s) const {
/* ************************************************************************* */
bool Cal3_S2Stereo::equals(const Cal3_S2Stereo& other, double tol) const {
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);
}
/* ************************************************************************* */

View File

@ -131,8 +131,8 @@ TEST(Cal3_S2, between) {
TEST(Cal3_S2, Print) {
Cal3_S2 cal(5, 5, 5, 5, 5);
std::stringstream os;
os << "{fx: " << cal.fx() << ", fy: " << cal.fy() << ", s:" << cal.skew() << ", px:" << cal.px()
<< ", py:" << cal.py() << "}";
os << "{ fx: " << cal.fx() << ", fy: " << cal.fy() << ", s: " << cal.skew()
<< ", px: " << cal.px() << ", py: " << cal.py() << " }";
EXPECT(assert_stdout_equal(os.str(), cal));
}