MOre bloat reduction and header ordering.

release/4.3a0
alexhagiopol 2015-03-02 20:19:59 -05:00
parent 952cd48d4a
commit d8468567b2
8 changed files with 50 additions and 27 deletions

View File

@ -19,14 +19,14 @@
#pragma once
#include <gtsam/base/FastDefaultAllocator.h>
#include <set>
#include <iostream>
#include <string>
#include <cmath>
#include <boost/mpl/has_xxx.hpp>
#include <boost/utility/enable_if.hpp>
#include <boost/serialization/nvp.hpp>
#include <boost/serialization/set.hpp>
#include <set>
#include <iostream>
#include <string>
#include <cmath>
BOOST_MPL_HAS_XXX_TRAIT_DEF(print)

View File

@ -20,6 +20,8 @@
#include <gtsam/base/timing.h>
#include <gtsam/base/Vector.h>
#include <gtsam/base/FastList.h>
#include <gtsam/3rdparty/Eigen/Eigen/SVD>
#include <gtsam/3rdparty/Eigen/Eigen/LU>
#include <boost/foreach.hpp>
#include <boost/tuple/tuple.hpp>
@ -32,9 +34,6 @@
#include <fstream>
#include <limits>
#include <gtsam/3rdparty/Eigen/Eigen/SVD>
#include <gtsam/3rdparty/Eigen/Eigen/LU>
using namespace std;
namespace gtsam {
@ -183,6 +182,7 @@ void transposeMultiplyAdd(double alpha, const Matrix& A, const Vector& e, SubVec
}
/* ************************************************************************* */
//3 argument call
void print(const Matrix& A, const string &s, ostream& stream) {
size_t m = A.rows(), n = A.cols();
@ -201,6 +201,12 @@ void print(const Matrix& A, const string &s, ostream& stream) {
stream << "];" << endl;
}
/* ************************************************************************* */
//1 or 2 argument call
void print(const Matrix& A, const string &s){
print(A, s, cout);
}
/* ************************************************************************* */
void save(const Matrix& A, const string &s, const string& filename) {
fstream stream(filename.c_str(), fstream::out | fstream::app);

View File

@ -22,12 +22,12 @@
#pragma once
#include <gtsam/base/Vector.h>
#include <boost/format.hpp>
#include <boost/tuple/tuple.hpp>
#include <boost/math/special_functions/fpclassify.hpp>
#include <gtsam/3rdparty/Eigen/Eigen/Core>
#include <gtsam/3rdparty/Eigen/Eigen/Cholesky>
#include <gtsam/3rdparty/Eigen/Eigen/LU>
#include <boost/format.hpp>
#include <boost/tuple/tuple.hpp>
/**
@ -201,9 +201,14 @@ inline MATRIX prod(const MATRIX& A, const MATRIX&B) {
}
/**
* print a matrix
* print without optional string, must specify cout yourself
*/
GTSAM_EXPORT void print(const Matrix& A, const std::string& s = "", std::ostream& stream = std::cout);
GTSAM_EXPORT void print(const Matrix& A, const std::string& s, std::ostream& stream);
/**
* print with optional string to cout
*/
GTSAM_EXPORT void print(const Matrix& A, const std::string& s = "");
/**
* save a matrix to file, which can be loaded by matlab

View File

@ -18,9 +18,10 @@
#pragma once
#include <memory>
#include <boost/serialization/assume_abstract.hpp>
#include <gtsam/base/Vector.h>
#include <boost/serialization/assume_abstract.hpp>
#include <memory>
namespace gtsam {

View File

@ -16,20 +16,18 @@
* @author Frank Dellaert
*/
#include <gtsam/base/Vector.h>
#include <boost/foreach.hpp>
#include <boost/optional.hpp>
#include <stdexcept>
#include <cstdarg>
#include <limits>
#include <fstream>
#include <sstream>
#include <iomanip>
#include <cmath>
#include <stdexcept>
#include <boost/foreach.hpp>
#include <boost/optional.hpp>
#include <cstdio>
#include <vector>
#include <gtsam/base/Vector.h>
using namespace std;
@ -55,6 +53,7 @@ Vector delta(size_t n, size_t i, double value) {
}
/* ************************************************************************* */
//3 argument call
void print(const Vector& v, const string& s, ostream& stream) {
size_t n = v.size();
@ -65,6 +64,12 @@ void print(const Vector& v, const string& s, ostream& stream) {
stream << "];" << endl;
}
/* ************************************************************************* */
//1 or 2 argument call
void print(const Vector& v, const string& s) {
print(v, s, cout);
}
/* ************************************************************************* */
void save(const Vector& v, const string &s, const string& filename) {
fstream stream(filename.c_str(), fstream::out | fstream::app);

View File

@ -20,10 +20,11 @@
#pragma once
#include <list>
#include <gtsam/global_includes.h>
#include <gtsam/3rdparty/Eigen/Eigen/Core>
#include <iostream>
#include <iosfwd>
#include <list>
namespace gtsam {
// Vector is just a typedef of the Eigen dynamic vector type
@ -95,9 +96,14 @@ GTSAM_EXPORT bool zero(const Vector& v);
inline size_t dim(const Vector& v) { return v.size(); }
/**
* print with optional string
* print without optional string, must specify cout yourself
*/
GTSAM_EXPORT void print(const Vector& v, const std::string& s = "", std::ostream& stream = std::cout);
GTSAM_EXPORT void print(const Vector& v, const std::string& s, std::ostream& stream);
/**
* print with optional string to cout
*/
GTSAM_EXPORT void print(const Vector& v, const std::string& s = "");
/**
* save a vector to file, which can be loaded by matlab

View File

@ -17,9 +17,9 @@
* @addtogroup base
*/
#include <boost/lexical_cast.hpp>
#include <gtsam/base/types.h>
#include <gtsam/inference/Symbol.h>
#include <boost/lexical_cast.hpp>
namespace gtsam {

View File

@ -21,12 +21,12 @@
#include <gtsam/dllexport.h>
#include <gtsam/config.h>
#include <cstddef>
#include <string>
#include <ostream>
#include <boost/function/function1.hpp>
#include <boost/range/concepts.hpp>
#include <boost/optional.hpp>
#include <cstddef>
#include <string>
#include <ostream>
#ifdef GTSAM_USE_TBB
#include <tbb/task_scheduler_init.h>