GOAT (Geometrical optics application tool) 0.1
Loading...
Searching...
No Matches
goodies.h File Reference
#include <complex>
#include <vector>
#include <functional>
#include <limits>
#include <string>
#include <cctype>

Go to the source code of this file.

Namespaces

namespace  GOAT
 This class is used for the iray class. This class is intended for internal use only. It defines a plane, defined by a central position and two directional vectors.
namespace  GOAT::maths

Functions

double GOAT::maths::abs (std::complex< double > x)
 absolute value of the complex valued variable x
double GOAT::maths::findmax (std::vector< double > d, std::size_t &index)
 finds maximum in data This function finds the maximal value inside a vector
std::size_t GOAT::maths::FWHM (std::vector< double > d, std::size_t index)
 estimates the full width at half maximum of a peak around at the position inside a vector The function gives back the full width at half maximum (FWHM) by finding the first point with less than (or equal to) the half of the maximal value left and right from position index inside the vector d
double GOAT::maths::mean (std::vector< double > d)
 Calculates the mean of the data stored in d.
std::vector< double > GOAT::maths::movingAvg (std::vector< double > d, int n)
 calculates the moving average of the data Calculates the (unweighted) moving average over the data stored in d. The average will be calculated over n elements
double GOAT::maths::newton_root (std::function< double(double)> f, std::function< double(double)> df, double x0=0, double eps=std::numeric_limits< double >::min())
double GOAT::maths::sqr (double x)
 square of x
bool GOAT::maths::testnan (double x)
 tests x on NaN
std::string GOAT::maths::tl (std::string)
 Converts string into lowercase This function converts all characters in a string into lower case.