ARTS 2.5.0 (git: 9ee3ac6c)
math_funcs.h
Go to the documentation of this file.
1/* Copyright (C) 2002-2012
2 Patrick Eriksson <Patrick.Eriksson@chalmers.se>
3 Stefan Buehler <sbuehler@ltu.se>
4
5 This program is free software; you can redistribute it and/or modify it
6 under the terms of the GNU General Public License as published by the
7 Free Software Foundation; either version 2, or (at your option) any
8 later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
18 USA. */
19
20/*****************************************************************************
21 *** File description
22 *****************************************************************************/
23
32#ifndef math_funcs_h
33#define math_funcs_h
34
35#include "matpackI.h"
36#include "matpackIII.h"
37
38Numeric fac(const Index n);
39
40Index integer_div(const Index& x, const Index& y);
41
43
44Index last(const ArrayOfIndex& x);
45
46void linspace(Vector& x,
47 const Numeric start,
48 const Numeric stop,
49 const Numeric step);
50
51void nlinspace(Vector& x,
52 const Numeric start,
53 const Numeric stop,
54 const Index n);
55
57 const Numeric start,
58 const Numeric stop,
59 const Index n);
60
61void nlogspace(Vector& x,
62 const Numeric start,
63 const Numeric stop,
64 const Index n);
65
67 ConstVectorView za_grid,
68 ConstVectorView aa_grid);
69
71 ConstVectorView za_grid);
72
74 ConstVectorView za_grid,
75 ConstVectorView aa_grid,
76 ConstVectorView grid_stepsize);
77
78Numeric sign(const Numeric& x);
79
80void mgd(VectorView psd,
81 const Vector& x,
82 const Numeric& n0,
83 const Numeric& mu,
84 const Numeric& la,
85 const Numeric& ga);
86
88 MatrixView jac_data,
89 const Vector& x,
90 const Numeric& n0,
91 const Numeric& mu,
92 const Numeric& la,
93 const Numeric& ga,
94 const bool& do_n0_jac,
95 const bool& do_mu_jac,
96 const bool& do_la_jac,
97 const bool& do_ga_jac);
98
115 MatrixView jac_data,
116 const Vector& x,
117 const Numeric& alpha,
118 const Numeric& beta);
119
121 Numeric x, Numeric N0, Numeric Lambda, Numeric mu, Numeric gamma);
122
123void unitl(Vector& x);
124
127
130
131void calculate_weights_linear(Vector& x, Vector& w, const Index nph);
132
134template <typename MatpackType>
135constexpr bool any_negative(const MatpackType& var) noexcept {
136 if (var.empty()) return false;
137 if (min(var) < 0) return true;
138 return false;
139}
140
141#endif // math_funcs_h
A constant view of a Matrix.
Definition: matpackI.h:1014
A constant view of a Tensor3.
Definition: matpackIII.h:132
A constant view of a Vector.
Definition: matpackI.h:489
bool empty() const ARTS_NOEXCEPT
Returns true if variable size is zero.
Definition: matpackI.cc:46
The MatrixView class.
Definition: matpackI.h:1125
The Tensor3View class.
Definition: matpackIII.h:239
The VectorView class.
Definition: matpackI.h:626
The Vector class.
Definition: matpackI.h:876
#define beta
#define min(a, b)
void linspace(Vector &x, const Numeric start, const Numeric stop, const Numeric step)
linspace
Definition: math_funcs.cc:198
void nlinspace(Vector &x, const Numeric start, const Numeric stop, const Index n)
nlinspace
Definition: math_funcs.cc:225
void unitl(Vector &x)
unitl
Definition: math_funcs.cc:661
void reshape(MatrixView X, ConstVectorView x)
reshape
Definition: math_funcs.cc:763
Numeric fac(const Index n)
fac
Definition: math_funcs.cc:63
void nlogspace(Vector &x, const Numeric start, const Numeric stop, const Index n)
nlogspace
Definition: math_funcs.cc:261
constexpr bool any_negative(const MatpackType &var) noexcept
Checks for negative values.
Definition: math_funcs.h:135
void mgd(VectorView psd, const Vector &x, const Numeric &n0, const Numeric &mu, const Numeric &la, const Numeric &ga)
Definition: math_funcs.cc:445
void delanoe_shape_with_derivative(VectorView psd, MatrixView jac_data, const Vector &x, const Numeric &alpha, const Numeric &beta)
! Shape functions for normalized PSD.
Definition: math_funcs.cc:595
void calculate_weights_linear(Vector &x, Vector &w, const Index nph)
calculate_weights_linear
Definition: math_funcs.cc:787
Numeric mod_gamma_dist(Numeric x, Numeric N0, Numeric Lambda, Numeric mu, Numeric gamma)
Generalized Modified Gamma Distribution.
Definition: math_funcs.cc:629
void flat(VectorView x, ConstMatrixView X)
flat
Definition: math_funcs.cc:681
Numeric last(ConstVectorView x)
last
Definition: math_funcs.cc:159
Index integer_div(const Index &x, const Index &y)
integer_div
Definition: math_funcs.cc:87
Numeric AngIntegrate_trapezoid(ConstMatrixView Integrand, ConstVectorView za_grid, ConstVectorView aa_grid)
AngIntegrate_trapezoid.
Definition: math_funcs.cc:290
Numeric sign(const Numeric &x)
sign
Definition: math_funcs.cc:417
void mgd_with_derivatives(VectorView psd, MatrixView jac_data, const Vector &x, const Numeric &n0, const Numeric &mu, const Numeric &la, const Numeric &ga, const bool &do_n0_jac, const bool &do_mu_jac, const bool &do_la_jac, const bool &do_ga_jac)
Definition: math_funcs.cc:515
Numeric AngIntegrate_trapezoid_opti(ConstMatrixView Integrand, ConstVectorView za_grid, ConstVectorView aa_grid, ConstVectorView grid_stepsize)
AngIntegrate_trapezoid_opti.
Definition: math_funcs.cc:334
Implementation of Matrix, Vector, and such stuff.
INDEX Index
The type to use for all integer numbers and indices.
Definition: matpack.h:39
NUMERIC Numeric
The type to use for all floating point numbers.
Definition: matpack.h:33
VectorView var(VectorView var, const Vector &y, const ArrayOfVector &ys, const Index start, const Index end_tmp)
Compute the variance of the ranged ys.
Definition: raw.cc:159
constexpr Rational start(Rational Ju, Rational Jl, Polarization type) noexcept
Gives the lowest M for a polarization type of this transition.
Definition: zeemandata.h:78
#define w