Skip to content

Commit

Permalink
move reordering function to wrappers module
Browse files Browse the repository at this point in the history
  • Loading branch information
Expander authored and Expander committed Jun 5, 2014
1 parent 0de1959 commit 2b4e759
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 10 additions & 0 deletions src/wrappers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,16 @@ double MaxRelDiff(const Eigen::ArrayBase<Derived>& a,
return MaxRelDiff(a.matrix(), b.matrix());
}

template <typename DerivedArray, typename DerivedMatrix>
void move_to(unsigned idx, double mass, Eigen::ArrayBase<DerivedArray>& v,
Eigen::MatrixBase<DerivedMatrix>& z)
{
const unsigned pos = closest_index(mass, v);

v.row(idx).swap(v.row(pos));
z.row(idx).swap(z.row(pos));
}

template <typename Base, typename Exponent>
double Power(Base base, Exponent exp)
{
Expand Down
10 changes: 0 additions & 10 deletions test/test_goldstones.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,6 @@

using namespace flexiblesusy;

template <typename DerivedArray, typename DerivedMatrix>
void move_to(unsigned idx, double mass, Eigen::ArrayBase<DerivedArray>& v,
Eigen::MatrixBase<DerivedMatrix>& z)
{
const unsigned pos = closest_index(mass, v);

v.row(idx).swap(v.row(pos));
z.row(idx).swap(z.row(pos));
}

BOOST_AUTO_TEST_CASE( test_reordering )
{
const double mvz = 90.;
Expand Down

0 comments on commit 2b4e759

Please sign in to comment.