Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
math.ipp File Reference
#include "Math/math.h"

Go to the source code of this file.

Namespaces

namespace  ph
 The root for all renderer implementations.
 
namespace  ph::math
 Math functions and utilities.
 

Functions

template<typename T , std::size_t N>
ph::math::summation (const std::array< T, N > &values, T initialValue=0)
 Sum all values within a container together.
 
template<typename T >
ph::math::summation (const std::vector< T > &values, T initialValue=0)
 
template<typename T , std::size_t EXTENT = std::dynamic_extent>
ph::math::summation (TSpanView< T, EXTENT > values, T initialValue=0)
 
template<typename T , std::size_t N>
ph::math::product (const std::array< T, N > &values, T initialValue=1)
 Multiplies all values within a container together.
 
template<typename T >
ph::math::product (const std::vector< T > &values, T initialValue=1)
 
template<typename T , std::size_t EXTENT = std::dynamic_extent>
ph::math::product (TSpanView< T, EXTENT > values, T initialValue=1)
 
template<typename T , std::size_t N>
ph::math::length (const std::array< T, N > &vec)
 Treating input values as a vector and calculates its length.
 
template<typename T >
ph::math::length (const std::vector< T > &vec)
 
template<typename T , std::size_t EXTENT = std::dynamic_extent>
ph::math::length (TSpanView< T, EXTENT > vec)
 
template<typename T , std::size_t N>
ph::math::length_squared (const std::array< T, N > &vec)
 Treating input values as a vector and calculates its squared length.
 
template<typename T >
ph::math::length_squared (const std::vector< T > &vec)
 
template<typename T , std::size_t EXTENT = std::dynamic_extent>
ph::math::length_squared (TSpanView< T, EXTENT > vec)
 
template<typename T , std::size_t N>
ph::math::p_norm (const std::array< T, N > &vec)
 Treating input values as a vector and calculates its p-norm.
 
template<typename T >
ph::math::p_norm (const std::vector< T > &vec)
 
template<std::size_t P, typename T , std::size_t EXTENT = std::dynamic_extent>
ph::math::p_norm (TSpanView< T, EXTENT > vec)
 
template<typename T , std::size_t N>
void ph::math::normalize (std::array< T, N > &vec)
 Treating input values as a vector and normalize it. Notice that normalizing a integer typed vector will result in 0-vector most of the time.
 
template<typename T >
void ph::math::normalize (std::vector< T > &vec)
 
template<typename T , std::size_t EXTENT = std::dynamic_extent>
void ph::math::normalize (TSpan< T, EXTENT > vec)
 
template<typename T , std::size_t N>
ph::math::dot_product (const std::array< T, N > &vecA, const std::array< T, N > &vecB)
 Treating input values as vectors and calculates their dot product.
 
template<typename T >
ph::math::dot_product (const std::vector< T > &vecA, const std::vector< T > &vecB)
 
template<typename T , std::size_t EXTENT = std::dynamic_extent>
ph::math::dot_product (TSpanView< T, EXTENT > vecA, TSpanView< T, EXTENT > vecB)