Page MenuHomec4science

exponential.hh
No OneTemporary

File Metadata

Created
Sun, May 12, 04:50

exponential.hh

/**
* @file
*
* @author Lucas Frérot <lucas.frerot@epfl.ch>
*
* @section LICENSE
*
* Copyright (©) 2018 EPFL (Ecole Polytechnique Fédérale de
* Lausanne) Laboratory (LSMS - Laboratoire de Simulation en Mécanique des
* Solides)
*
* Expolit is free software: you can redistribute it and/or modify it under the
* terms of 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.
*
* Expolit 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 Lesser General Public License for
* more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Tamaas. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef EXPONENTIAL_HH
#define EXPONENTIAL_HH
#include "types.hh"
#include <cmath>
#include <ostream>
namespace expolit {
template <typename T>
struct Exponential : public Expression<Exponential<T>> {
auto operator()(const typename T::value_type& z) const {
return std::exp(expression(z));
}
Exponential(const T& expression) : expression(expression) {}
const T& expression;
};
template <typename T>
std::ostream& operator<<(std::ostream& os, const Exponential<T>& e) {
os << "exp(" << e.expression << ")";
return os;
}
} // namespace expolit
#endif

Event Timeline