use streams instead of printf

release/4.3a0
Varun Agrawal 2021-01-19 15:22:41 -05:00
parent 654995e073
commit 6f6588457b
1 changed files with 4 additions and 4 deletions

View File

@ -33,9 +33,9 @@
#pragma once #pragma once
#include <boost/shared_ptr.hpp>
#include <boost/concept_check.hpp> #include <boost/concept_check.hpp>
#include <stdio.h> #include <boost/shared_ptr.hpp>
#include <iostream>
#include <string> #include <string>
#define GTSAM_PRINT(x)((x).print(#x)) #define GTSAM_PRINT(x)((x).print(#x))
@ -72,10 +72,10 @@ namespace gtsam {
}; // \ Testable }; // \ Testable
inline void print(float v, const std::string& s = "") { inline void print(float v, const std::string& s = "") {
printf("%s%f\n",s.c_str(),v); std::cout << (s == "" ? s : s + " ") << v << std::endl;
} }
inline void print(double v, const std::string& s = "") { inline void print(double v, const std::string& s = "") {
printf("%s%lf\n",s.c_str(),v); std::cout << (s == "" ? s : s + " ") << v << std::endl;
} }
/** Call equal on the object */ /** Call equal on the object */