Commit 868a0b3a authored by jcarpent's avatar jcarpent Committed by Joseph Mirabel
Browse files

[Print] Remove reference in the returning type to avoid some memory problem

parent 28576691
//
// Copyright (c) 2017 CNRS
// Copyright (c) 2017-2018 CNRS
// Author: Joseph Mirabel
//
//
......@@ -44,7 +44,8 @@ namespace hpp {
/// \cond
HPP_PINOCCHIO_DLLAPI long& getpythonformat (std::ostream& o);
template <bool OneLine, bool PythonStyle, bool Vector> struct eigen_format { static const Eigen::IOFormat& run(); };
template <bool OneLine, bool PythonStyle, bool Vector>
struct HPP_PINOCCHIO_DLLAPI eigen_format { static const Eigen::IOFormat run(); };
template <typename T, int Option> struct PrettyPrint {
const T& value;
......
// Copyright (c) 2017, Joseph Mirabel
// Copyright (c) 2017-2018, Joseph Mirabel
// Authors: Joseph Mirabel (joseph.mirabel@laas.fr)
//
// This file is part of hpp-pinocchio.
......@@ -54,10 +54,10 @@ namespace hpp {
OneLine = ((Option & OutputFormatBits) == OneLineOutput),
Condensed = ((Option & OutputFormatBits) == CondensedOutput)
};
static const Eigen::IOFormat& mfmt_py = eigen_format< OneLine || Condensed, true , false>::run();
static const Eigen::IOFormat& vfmt_py = eigen_format< OneLine || Condensed, true , true >::run();
static const Eigen::IOFormat& mfmt_raw = eigen_format< OneLine || Condensed, false, false>::run();
static const Eigen::IOFormat& vfmt_raw = eigen_format< OneLine || Condensed, false, true >::run();
static const Eigen::IOFormat mfmt_py = eigen_format< OneLine || Condensed, true , false>::run();
static const Eigen::IOFormat vfmt_py = eigen_format< OneLine || Condensed, true , true >::run();
static const Eigen::IOFormat mfmt_raw = eigen_format< OneLine || Condensed, false, false>::run();
static const Eigen::IOFormat vfmt_raw = eigen_format< OneLine || Condensed, false, true >::run();
bool use_py_fmt = (getpythonformat(os) != 0);
const Eigen::IOFormat& mfmt = (use_py_fmt ? mfmt_py : mfmt_raw);
const Eigen::IOFormat& vfmt = (use_py_fmt ? vfmt_py : vfmt_raw);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment