ARTS 2.5.4 (git: 31ce4f0e)
test_integration.cc File Reference

Testfile for the AngIntegrate_trapezoid function from math_funcs.cc. More...

#include <sys/time.h>
#include <cmath>
#include <iostream>
#include <stdexcept>
#include "array.h"
#include "arts.h"
#include "arts_constants.h"
#include "arts_conversions.h"
#include "logic.h"
#include "math_funcs.h"
#include "matpackI.h"

Go to the source code of this file.

Functions

void init_xy (float stepsize, int frequency, Matrix &Integrand, Vector &za_grid, Vector &aa_grid)
 init_xy More...
 
void init_x (int vsize, float stepsize, int frequency, Vector &Integrand, Vector &Theta)
 init_x More...
 
Numeric AngIntegrate_trapezoid_original (MatrixView Integrand, ConstVectorView za_grid, ConstVectorView aa_grid)
 AngIntegrate_trapezoid_original. More...
 
Numeric AngIntegrate_trapezoid_opt (MatrixView Integrand, ConstVectorView za_grid, ConstVectorView aa_grid)
 AngIntegrate_trapezoid_opt. More...
 
Numeric AngIntegrate_trapezoid_fixedstep (MatrixView Integrand, ConstVectorView za_grid, ConstVectorView aa_grid, Numeric stepsize)
 AngIntegrate_trapezoid_fixedstep. More...
 
Numeric AngIntegrate_trapezoid_fixedstep_opt (MatrixView Integrand, ConstVectorView za_grid, ConstVectorView aa_grid, Numeric stepsize)
 AngIntegrate_trapezoid_fixedstep_opt. More...
 
Numeric AngIntegrate_trapezoid_fixedstep_opt2 (MatrixView Integrand, ConstVectorView za_grid, ConstVectorView aa_grid, Numeric stepsize)
 AngIntegrate_trapezoid_fixedstep_opt2. More...
 
Numeric AngIntegrate_trapezoid_original (ConstVectorView Integrand, ConstVectorView za_grid)
 AngIntegration_trapezoid_original. More...
 
Numeric AngIntegrate_trapezoid_fixedstep (ConstVectorView Integrand, ConstVectorView za_grid, Numeric stepsize)
 AngIntegration_trapezoid_original. More...
 
Numeric test_xy (int z_size, int a_size, float stepsize, int frequency)
 test_xy More...
 
Numeric test_xy_opt (int z_size, int a_size, float stepsize, int frequency)
 test_xy_opt More...
 
Numeric test_xy_fixedstep (int z_size, int a_size, float stepsize, int frequency)
 test_xy_fixedstep More...
 
Numeric test_xy_fixedstep_opt (int z_size, int a_size, float stepsize, int frequency)
 test_xy_fixedstep_opt More...
 
Numeric test_xy_fixedstep_opt2 (int z_size, int a_size, float stepsize, int frequency)
 test_xy_fixedstep_opt2 More...
 
Numeric test_AngIntegrate_trapezoid_opti (int z_size, int a_size, float stepsize, int frequency)
 test_AngIntegrate_trapezoid_opti More...
 
Numeric test_x (int vsize, float stepsize, int frequency)
 test_x More...
 
Numeric test_x_fixedstep (int vsize, int frequency)
 test_x_fixedstep More...
 
int main (int argc, char *argv[])
 

Variables

constexpr Numeric DEG2RAD =Conversion::deg2rad(1)
 
constexpr Numeric PI =Constant::pi
 

Detailed Description

Testfile for the AngIntegrate_trapezoid function from math_funcs.cc.

Author
Claas Teichmann claas.nosp@m.@sat.nosp@m..phys.nosp@m.ik.u.nosp@m.ni-br.nosp@m.emen.nosp@m..de
Date
2003/05/27

Definition in file test_integration.cc.

Function Documentation

◆ AngIntegrate_trapezoid_fixedstep() [1/2]

Numeric AngIntegrate_trapezoid_fixedstep ( ConstVectorView  Integrand,
ConstVectorView  za_grid,
Numeric  stepsize 
)

AngIntegration_trapezoid_original.

The original function from math_funcs.cc

Definition at line 441 of file test_integration.cc.

References ARTS_ASSERT, DEG2RAD, is_size(), ConstVectorView::nelem(), and PI.

◆ AngIntegrate_trapezoid_fixedstep() [2/2]

Numeric AngIntegrate_trapezoid_fixedstep ( MatrixView  Integrand,
ConstVectorView  za_grid,
ConstVectorView  aa_grid,
Numeric  stepsize 
)

AngIntegrate_trapezoid_fixedstep.

Performs an integration of a matrix over all directions defined in angular grids using the trapezoidal integration method. Here we use a fixed stepsize, e.g. 0.1

Parameters
IntegrandThe Matrix to be integrated
za_gridInput : The zenith angle grid
aa_gridInput : The azimuth angle grid
stepsizeInput : The grid stepsize
Returns
The resulting integral

Definition at line 299 of file test_integration.cc.

References ARTS_ASSERT, DEG2RAD, is_size(), and ConstVectorView::nelem().

Referenced by test_x_fixedstep(), and test_xy_fixedstep().

◆ AngIntegrate_trapezoid_fixedstep_opt()

Numeric AngIntegrate_trapezoid_fixedstep_opt ( MatrixView  Integrand,
ConstVectorView  za_grid,
ConstVectorView  aa_grid,
Numeric  stepsize 
)

AngIntegrate_trapezoid_fixedstep_opt.

Performs an integration of a matrix over all directions defined in angular grids using the trapezoidal integration method. Here we use a fixed stepsize, e.g. 0.1

Parameters
IntegrandThe Matrix to be integrated
za_gridInput : The zenith angle grid
aa_gridInput : The azimuth angle grid
stepsizeInput : The grid stepsize
Returns
The resulting integral

Definition at line 338 of file test_integration.cc.

References ARTS_ASSERT, DEG2RAD, is_size(), and ConstVectorView::nelem().

Referenced by test_xy_fixedstep_opt().

◆ AngIntegrate_trapezoid_fixedstep_opt2()

Numeric AngIntegrate_trapezoid_fixedstep_opt2 ( MatrixView  Integrand,
ConstVectorView  za_grid,
ConstVectorView  aa_grid,
Numeric  stepsize 
)

AngIntegrate_trapezoid_fixedstep_opt2.

Performs an integration of a matrix over all directions defined in angular grids using the trapezoidal integration method. Here we use a fixed stepsize, e.g. 0.1 with some more optimizations to see whether it is faster or not

Parameters
IntegrandThe Matrix to be integrated
za_gridInput : The zenith angle grid
aa_gridInput : The azimuth angle grid
stepsizeInput: The grid stepsize
Returns
The resulting integral

Definition at line 383 of file test_integration.cc.

References ARTS_ASSERT, DEG2RAD, is_size(), ConstVectorView::nelem(), and temp.

Referenced by test_xy_fixedstep_opt2().

◆ AngIntegrate_trapezoid_opt()

Numeric AngIntegrate_trapezoid_opt ( MatrixView  Integrand,
ConstVectorView  za_grid,
ConstVectorView  aa_grid 
)

AngIntegrate_trapezoid_opt.

Performs an integration of a matrix over all directions defined in angular grids using the trapezoidal integration method.

Parameters
IntegrandThe Matrix to be integrated
za_gridInput : The zenith angle grid
aa_gridInput : The azimuth angle grid
Returns
The resulting integral

Definition at line 260 of file test_integration.cc.

References ARTS_ASSERT, DEG2RAD, is_size(), and ConstVectorView::nelem().

Referenced by test_xy_opt().

◆ AngIntegrate_trapezoid_original() [1/2]

Numeric AngIntegrate_trapezoid_original ( ConstVectorView  Integrand,
ConstVectorView  za_grid 
)

AngIntegration_trapezoid_original.

The original function from math_funcs.cc

Definition at line 419 of file test_integration.cc.

References ARTS_ASSERT, DEG2RAD, is_size(), ConstVectorView::nelem(), and PI.

◆ AngIntegrate_trapezoid_original() [2/2]

Numeric AngIntegrate_trapezoid_original ( MatrixView  Integrand,
ConstVectorView  za_grid,
ConstVectorView  aa_grid 
)

AngIntegrate_trapezoid_original.

The original function from math_funcs.cc Performs an integration of a matrix over all directions defined in angular grids using the trapezoidal integration method.

Parameters
IntegrandThe Matrix to be integrated
za_gridInput : The zenith angle grid
aa_gridInput : The azimuth angle grid
Returns
The resulting integral

Definition at line 223 of file test_integration.cc.

References ARTS_ASSERT, DEG2RAD, is_size(), and ConstVectorView::nelem().

Referenced by test_x(), and test_xy().

◆ init_x()

void init_x ( int  vsize,
float  stepsize,
int  frequency,
Vector Integrand,
Vector Theta 
)

init_x

This function fills a Vector with funcition values The function is y=x

Definition at line 145 of file test_integration.cc.

References ConstVectorView::nelem().

Referenced by test_x().

◆ init_xy()

void init_xy ( float  stepsize,
int  frequency,
Matrix Integrand,
Vector za_grid,
Vector aa_grid 
)

init_xy

This function fills Matrix with funcition values The funcion is a circle around 0

Definition at line 176 of file test_integration.cc.

References ConstVectorView::nelem().

Referenced by test_AngIntegrate_trapezoid_opti(), test_xy(), test_xy_fixedstep(), test_xy_fixedstep_opt(), test_xy_fixedstep_opt2(), and test_xy_opt().

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 112 of file test_integration.cc.

References test_AngIntegrate_trapezoid_opti(), and test_xy().

◆ test_AngIntegrate_trapezoid_opti()

Numeric test_AngIntegrate_trapezoid_opti ( int  z_size,
int  a_size,
float  stepsize,
int  frequency 
)

test_AngIntegrate_trapezoid_opti

Performs an integration over a simple Function given by a Matrix uses AngIntegrate_trapezoid_opti to integrate the funcion

It uses the original arts function

Parameters
z_sizeThe size of the zenith dimension, e.g. 1801
a_sizeThe size of the azimuth dimension, e.g. 3601
stepsizeThe size of the steps, e.g. 0.1
frequencyOnly for test purposes: frequency of integral computation
Returns
The resulting integral

Definition at line 747 of file test_integration.cc.

References AngIntegrate_trapezoid_opti(), init_xy(), PI, and Zeeman::start().

Referenced by main().

◆ test_x()

Numeric test_x ( int  vsize,
float  stepsize,
int  frequency 
)

test_x

Performs an integration over a simple Function y=x given by a Vector uses AngIntegrate_trapezoid_original to integrate the funcion

Parameters
vsizeThe size of the Vetor who is integrated, e.g. 1801
stepsizeThe size of the steps, e.g. 0.1
frequencyOnly for test purposes: how often is the integral calculated
Returns
The resulting integral

Definition at line 813 of file test_integration.cc.

References AngIntegrate_trapezoid_original(), init_x(), PI, and Zeeman::start().

◆ test_x_fixedstep()

Numeric test_x_fixedstep ( int  vsize,
int  frequency 
)

test_x_fixedstep

Performs an integration over a simple Function y=x given by a Vector uses the other Integration function with constant Theta-spacing.

Parameters
vsizeThe size of the Vetor who is integrated, e.g. 1801
frequencyOnly for test purposes: how often is the integral calculated
Returns
The resulting integral

Definition at line 863 of file test_integration.cc.

References AngIntegrate_trapezoid_fixedstep(), ConstVectorView::nelem(), PI, and Zeeman::start().

◆ test_xy()

Numeric test_xy ( int  z_size,
int  a_size,
float  stepsize,
int  frequency 
)

test_xy

Performs an integration over a simple Function given by a Matrix uses AngIntegrate_trapezoid_original to integrate the funcion

Parameters
z_sizeThe size of the zenith dimension, e.g. 1801
a_sizeThe size of the azimuth dimension, e.g. 3601
stepsizeThe size of the steps, e.g. 0.1
frequencyOnly for test purposes: frequency of integral computation
Returns
The resulting integral

Definition at line 475 of file test_integration.cc.

References AngIntegrate_trapezoid_original(), init_xy(), PI, and Zeeman::start().

Referenced by main().

◆ test_xy_fixedstep()

Numeric test_xy_fixedstep ( int  z_size,
int  a_size,
float  stepsize,
int  frequency 
)

test_xy_fixedstep

Performs an integration over a simple Function given by a Matrix uses AngIntegrate_trapezoid_fixedstep to integrate the funcion

Parameters
z_sizeThe size of the zenith dimension, e.g. 1801
a_sizeThe size of the azimuth dimension, e.g. 3601
stepsizeThe size of the steps, e.g. 0.1
frequencyOnly for test purposes: frequency of integral computation
Returns
The resulting integral

Definition at line 577 of file test_integration.cc.

References AngIntegrate_trapezoid_fixedstep(), init_xy(), PI, and Zeeman::start().

◆ test_xy_fixedstep_opt()

Numeric test_xy_fixedstep_opt ( int  z_size,
int  a_size,
float  stepsize,
int  frequency 
)

test_xy_fixedstep_opt

Performs an integration over a simple Function given by a Matrix uses AngIntegrate_trapezoid_fixedstep to integrate the funcion

Parameters
z_sizeThe size of the zenith dimension, e.g. 1801
a_sizeThe size of the azimuth dimension, e.g. 3601
stepsizeThe size of the steps, e.g. 0.1
frequencyOnly for test purposes: frequency of integral computation
Returns
The resulting integral

Definition at line 633 of file test_integration.cc.

References AngIntegrate_trapezoid_fixedstep_opt(), init_xy(), PI, and Zeeman::start().

◆ test_xy_fixedstep_opt2()

Numeric test_xy_fixedstep_opt2 ( int  z_size,
int  a_size,
float  stepsize,
int  frequency 
)

test_xy_fixedstep_opt2

Performs an integration over a simple Function given by a Matrix uses AngIntegrate_trapezoid_fixedstep2 to integrate the funcion

Parameters
z_sizeThe size of the zenith dimension, e.g. 1801
a_sizeThe size of the azimuth dimension, e.g. 3601
stepsizeThe size of the steps, e.g. 0.1
frequencyOnly for test purposes: frequency of integral computation
Returns
The resulting integral

Definition at line 689 of file test_integration.cc.

References AngIntegrate_trapezoid_fixedstep_opt2(), init_xy(), PI, and Zeeman::start().

◆ test_xy_opt()

Numeric test_xy_opt ( int  z_size,
int  a_size,
float  stepsize,
int  frequency 
)

test_xy_opt

Performs an integration over a simple Function given by a Matrix uses AngIntegrate_trapezoid_opt to integrate the funcion

Parameters
z_sizeThe size of the zenith dimension, e.g. 1801
a_sizeThe size of the azimuth dimension, e.g. 3601
stepsizeThe size of the steps, e.g. 0.1
frequencyOnly for test purposes: frequency of integral computation
Returns
The resulting integral

Definition at line 526 of file test_integration.cc.

References AngIntegrate_trapezoid_opt(), init_xy(), PI, and Zeeman::start().

Variable Documentation

◆ DEG2RAD

◆ PI