Skip to content

Commit

Permalink
revert aligned_allocator on vector<VectorXd> for Eigen < 3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
ahundt committed Feb 22, 2017
1 parent d49b182 commit 0cbf171
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions binding/python/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -474,9 +474,9 @@ def build_qp(tasks):
'tasks::qp::SpringJoint', 'vector')
tasks.add_container('std::vector<Eigen::Vector3d, Eigen::aligned_allocator<Eigen::Vector3d> >', 'Eigen::Vector3d', 'vector')
tasks.add_container('std::vector<Eigen::Matrix3d, Eigen::aligned_allocator<Eigen::Matrix3d> >', 'Eigen::Matrix3d', 'vector')
tasks.add_container('std::vector<Eigen::VectorXd, Eigen::aligned_allocator<Eigen::VectorXd> >', 'Eigen::VectorXd', 'vector')
tasks.add_container('std::vector<Eigen::VectorXd>', 'Eigen::VectorXd', 'vector')
tasks.add_container('std::vector<std::vector<Eigen::VectorXd> , Eigen::aligned_allocator<std::vector<Eigen::VectorXd> > >',
'std::vector<Eigen::VectorXd, Eigen::aligned_allocator<Eigen::VectorXd> >', 'vector')
'std::vector<Eigen::VectorXd>', 'vector')


# QPSolver
Expand Down
8 changes: 4 additions & 4 deletions src/Bounds.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,16 +100,16 @@ struct TorqueBound
struct PolyTorqueBound
{
PolyTorqueBound() {}
PolyTorqueBound(std::vector<std::vector<Eigen::VectorXd>, Eigen::aligned_allocator<std::vector<Eigen::VectorXd>> > lPTB,
std::vector<std::vector<Eigen::VectorXd>, Eigen::aligned_allocator<std::vector<Eigen::VectorXd>> > uPTB):
PolyTorqueBound(std::vector<std::vector<Eigen::VectorXd>> lPTB,
std::vector<std::vector<Eigen::VectorXd>> uPTB):
lPolyTorqueBound(std::move(lPTB)),
uPolyTorqueBound(std::move(uPTB))
{ }

/// \f$ \underline{\tau}(q) \f$
std::vector<std::vector<Eigen::VectorXd>, Eigen::aligned_allocator<std::vector<Eigen::VectorXd>> > lPolyTorqueBound;
std::vector<std::vector<Eigen::VectorXd>> lPolyTorqueBound;
/// \f$ \overline{\tau}(q) \f$
std::vector<std::vector<Eigen::VectorXd>, Eigen::aligned_allocator<std::vector<Eigen::VectorXd>> > uPolyTorqueBound;
std::vector<std::vector<Eigen::VectorXd>> uPolyTorqueBound;
};


Expand Down
4 changes: 2 additions & 2 deletions src/QPMotionConstr.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ class TASKS_DLLAPI MotionConstrCommon : public ConstraintFunction<GenInequality>
std::vector<Eigen::Vector3d, Eigen::aligned_allocator<Eigen::Vector3d> > points;
// BEWARE generator are minus to avoid one multiplication by -1 in the
// update method
std::vector<Eigen::Matrix<double, 3, Eigen::Dynamic> , Eigen::aligned_allocator<Eigen::Matrix<double, 3, Eigen::Dynamic> > > minusGenerators;
std::vector<Eigen::Matrix<double, 3, Eigen::Dynamic> > minusGenerators;

public:
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
Expand Down Expand Up @@ -235,7 +235,7 @@ class TASKS_DLLAPI MotionPolyConstr : public MotionConstrCommon
const SolverData& data);

protected:
std::vector<Eigen::VectorXd, Eigen::aligned_allocator<Eigen::VectorXd> > torqueL_, torqueU_;
std::vector<Eigen::VectorXd> torqueL_, torqueU_;
std::vector<int> jointIndex_;
public:
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
Expand Down
4 changes: 2 additions & 2 deletions tests/QPSolverTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -730,8 +730,8 @@ BOOST_AUTO_TEST_CASE(QPTorqueLimitsTest)
Eigen::VectorXd null;
lpoly << -30, 1.;
upoly << 30, 1.;
std::vector<std::vector<Eigen::VectorXd> , Eigen::aligned_allocator<std::vector<Eigen::VectorXd> > > lBoundPoly = {{null}, {lpoly}, {lpoly}, {lpoly}};
std::vector<std::vector<Eigen::VectorXd> , Eigen::aligned_allocator<std::vector<Eigen::VectorXd> > > uBoundPoly = {{null}, {upoly}, {upoly}, {upoly}};
std::vector<std::vector<Eigen::VectorXd>> lBoundPoly = {{null}, {lpoly}, {lpoly}, {lpoly}};
std::vector<std::vector<Eigen::VectorXd>> uBoundPoly = {{null}, {upoly}, {upoly}, {upoly}};
qp::MotionPolyConstr motionPolyCstr(mbs, 0, {lBoundPoly, uBoundPoly});

motionPolyCstr.addToSolver(solver);
Expand Down
10 changes: 5 additions & 5 deletions tests/TasksTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
template<typename Task>
struct TanAccel
{
Eigen::VectorXd tanAcc(Task& task, const std::vector<Eigen::VectorXd, Eigen::aligned_allocator<Eigen::VectorXd> >& alphaD)
Eigen::VectorXd tanAcc(Task& task, const std::vector<Eigen::VectorXd>& alphaD)
{
return Eigen::VectorXd(task.jac()*alphaD[0]);
}
Expand All @@ -58,7 +58,7 @@ struct MRTanAccel
tanAccV(taskDim)
{}

Eigen::VectorXd tanAcc(Task& task, const std::vector<Eigen::VectorXd, Eigen::aligned_allocator<Eigen::VectorXd> >& alphaD)
Eigen::VectorXd tanAcc(Task& task, const std::vector<Eigen::VectorXd>& alphaD)
{
tanAccV.setZero();
for(std::size_t i = 0; i < alphaD.size(); ++i)
Expand Down Expand Up @@ -322,9 +322,9 @@ void testTaskNumDiff(const std::vector<rbd::MultiBody>& mbs,

std::vector<MultiBodyConfig> mbcsPost(mbcs), mbcsCur(mbcs);

std::vector<Eigen::VectorXd, Eigen::aligned_allocator<Eigen::VectorXd> > q(mbs.size());
std::vector<Eigen::VectorXd, Eigen::aligned_allocator<Eigen::VectorXd> > alpha(mbs.size());
std::vector<Eigen::VectorXd, Eigen::aligned_allocator<Eigen::VectorXd> > alphaD(mbs.size());
std::vector<Eigen::VectorXd> q(mbs.size());
std::vector<Eigen::VectorXd> alpha(mbs.size());
std::vector<Eigen::VectorXd> alphaD(mbs.size());

for(int i = 0; i < nrIter; ++i)
{
Expand Down

0 comments on commit 0cbf171

Please sign in to comment.