DryChem 1.0.0
A generic, compile-time C++ toolbox with no dependencies for the modern computational chemistry project.
Loading...
Searching...
No Matches
CppUtils::Math::details Namespace Reference

Classes

struct  LinearLeastSquaresResult
 
struct  QuadraticLeastSquaresResult
 

Functions

template<std::size_t N, typename ContainerX, typename ContainerY = ContainerX, typename = std::enable_if_t<std::conjunction_v<std::is_default_constructible<typename ContainerX::value_type>, std::is_default_constructible<typename ContainerY::value_type>>>>
constexpr auto nPointStencilMethod (const ContainerX &x, const ContainerY &y)
 

Function Documentation

◆ nPointStencilMethod()

template<std::size_t N, typename ContainerX, typename ContainerY = ContainerX, typename = std::enable_if_t<std::conjunction_v<std::is_default_constructible<typename ContainerX::value_type>, std::is_default_constructible<typename ContainerY::value_type>>>>
auto CppUtils::Math::details::nPointStencilMethod ( const ContainerX & x,
const ContainerY & y )
constexpr

A function taking the derivative (by numerical methods) of a given function y with respect to x. Each of the functions, x and y, are represeted by containers.

Template Parameters
N- The nPointStencilMethod to use (5, 7, or 9)
ContainerX- A container for a default constructible type x
ContainerY- A container for a default constructible type y
Parameters
x- The x values to use
y- The y values to use
Returns
A vector of equal size to the input containers with default values for the beginning and end of the vector depending on the method used
Exceptions
CppUtils::Math::InputSizeMismatchIf the sizes of the two containers don't match, we will throw an exception

Referenced by CppUtils::Math::fivePointStencilMethod(), CppUtils::Math::ninePointStencilMethod(), and CppUtils::Math::sevenPointStencilMethod().