Skip to content

Commit

Permalink
assume implicit unit matrix in sum of scalars and matrices
Browse files Browse the repository at this point in the history
in the expression for the beta functions
  • Loading branch information
Alexander Voigt authored and Alexander Voigt committed Dec 1, 2015
1 parent 72ca6ab commit 2672a51
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions templates/two_scale_soft_beta_.cpp.in
Expand Up @@ -26,6 +26,42 @@ namespace flexiblesusy {
#define INPUT(parameter) input.parameter
#define TRACE_STRUCT soft_traces

namespace {

template <typename Derived>
typename Eigen::MatrixBase<Derived>::PlainObject operator+(const Eigen::MatrixBase<Derived>& m, double n)
{
return m + Eigen::Matrix<double,
Eigen::MatrixBase<Derived>::RowsAtCompileTime,
Eigen::MatrixBase<Derived>::ColsAtCompileTime>::Identity() * n;
}

template <typename Derived>
typename Eigen::MatrixBase<Derived>::PlainObject operator+(double n, const Eigen::MatrixBase<Derived>& m)
{
return m + Eigen::Matrix<double,
Eigen::MatrixBase<Derived>::RowsAtCompileTime,
Eigen::MatrixBase<Derived>::ColsAtCompileTime>::Identity() * n;
}

template <typename Derived>
typename Eigen::MatrixBase<Derived>::PlainObject operator-(const Eigen::MatrixBase<Derived>& m, double n)
{
return m - Eigen::Matrix<double,
Eigen::MatrixBase<Derived>::RowsAtCompileTime,
Eigen::MatrixBase<Derived>::ColsAtCompileTime>::Identity() * n;
}

template <typename Derived>
typename Eigen::MatrixBase<Derived>::PlainObject operator-(double n, const Eigen::MatrixBase<Derived>& m)
{
return - m + Eigen::Matrix<double,
Eigen::MatrixBase<Derived>::RowsAtCompileTime,
Eigen::MatrixBase<Derived>::ColsAtCompileTime>::Identity() * n;
}

} // anonymous namespace

/**
* Calculates the one-loop beta function of @parameterName@.
*
Expand Down

0 comments on commit 2672a51

Please sign in to comment.