Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions src/libPMacc/include/math/vector/math_functor/abs.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
/**
* Copyright 2013 Heiko Burau, Rene Widera
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please update the year

*
* This file is part of libPMacc.
*
* libPMacc is free software: you can redistribute it and/or modify
* it under the terms of of either the GNU General Public License or
* the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* libPMacc is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License and the GNU Lesser General Public License
* for more details.
*
* You should have received a copy of the GNU General Public License
* and the GNU Lesser General Public License along with libPMacc.
* If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef MATH_FUNCTOR_ABS_HPP
#define MATH_FUNCTOR_ABS_HPP
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use #pragma once



#include "types.h"
#include "lambda/Expression.hpp"

namespace PMacc
{
namespace math
{
namespace math_functor
{

struct Abs
{
template<typename Type>
HDINLINE
Type operator()(const Type& x) const
{
return abs(x);
}
};

lambda::Expression<lambda::exprTypes::terminal, mpl::vector<Abs> > _abs;

} // math_vector
} // math

namespace result_of
{

template<typename Type>
struct Functor<PMacc::math::math_functor::Abs, Type>
{
typedef Type type;
};

} // result_of

} // PMacc

#endif // MATH_FUNCTOR_ABS_HPP