PageRenderTime 90ms CodeModel.GetById 44ms app.highlight 2ms RepoModel.GetById 43ms app.codeStats 0ms

/itpp/base/math/error.h

https://github.com/girror/itpp
C++ Header | 104 lines | 20 code | 20 blank | 64 comment | 0 complexity | 0b2731d7bc934590fbad8ad29fe4ba4c MD5 | raw file
  1/*!
  2 * \file
  3 * \brief Error functions - header file
  4 * \author Tony Ottosson and Adam Piatyszek
  5 *
  6 * -------------------------------------------------------------------------
  7 *
  8 * Copyright (C) 1995-2010  (see AUTHORS file for a list of contributors)
  9 *
 10 * This file is part of IT++ - a C++ library of mathematical, signal
 11 * processing, speech processing, and communications classes and functions.
 12 *
 13 * IT++ is free software: you can redistribute it and/or modify it under the
 14 * terms of the GNU General Public License as published by the Free Software
 15 * Foundation, either version 3 of the License, or (at your option) any
 16 * later version.
 17 *
 18 * IT++ is distributed in the hope that it will be useful, but WITHOUT ANY
 19 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 20 * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
 21 * details.
 22 *
 23 * You should have received a copy of the GNU General Public License along
 24 * with IT++.  If not, see <http://www.gnu.org/licenses/>.
 25 *
 26 * -------------------------------------------------------------------------
 27 */
 28
 29#ifndef ERROR_H
 30#define ERROR_H
 31
 32#include <itpp/base/help_functions.h>
 33
 34
 35namespace itpp
 36{
 37
 38//!\addtogroup errorfunc
 39//!@{
 40
 41/*!
 42 * \brief Error function for complex argument
 43 * \author Adam Piatyszek
 44 *
 45 * This function calculates a well known error function \c erf(z)
 46 * for complex \c z. The implementation is based on unofficial
 47 * implementation for Octave. Here is a part of the author's note
 48 * from original sources:
 49 *
 50 * Put together by John Smith john at arrows dot demon dot co dot uk,
 51 * using ideas by others.
 52 *
 53 * Calculate \c erf(z) for complex \c z.
 54 * Three methods are implemented; which one is used depends on z.
 55 *
 56 * The code includes some hard coded constants that are intended to
 57 * give about 14 decimal places of accuracy. This is appropriate for
 58 * 64-bit floating point numbers.
 59 */
 60std::complex<double> erf(const std::complex<double>& z);
 61
 62//! Inverse of error function
 63double erfinv(double x);
 64
 65//! Q-function
 66double Qfunc(double x);
 67
 68
 69// ----------------------------------------------------------------------
 70// functions for matrices and vectors
 71// ----------------------------------------------------------------------
 72
 73//! Error function
 74vec erf(const vec &x);
 75//! Error function
 76mat erf(const mat &x);
 77//! Error function
 78cvec erf(const cvec &x);
 79//! Error function
 80cmat erf(const cmat &x);
 81
 82//! Inverse of error function
 83vec erfinv(const vec &x);
 84//! Inverse of error function
 85mat erfinv(const mat &x);
 86
 87//! Complementary error function
 88vec erfc(const vec &x);
 89//! Complementary error function
 90mat erfc(const mat &x);
 91
 92//! Q-function
 93vec Qfunc(const vec &x);
 94//! Q-function
 95mat Qfunc(const mat &x);
 96//!@}
 97
 98} // namespace itpp
 99
100#endif // #ifndef ERROR_H
101
102
103
104