ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
Classes | Macros | Functions
math_integral_test.cpp File Reference
#include "../math_integral.h"
#include "gtest/gtest.h"
#include <math.h>
#include <fstream>
#include <iostream>
#include "source_base/constants.h"
Include dependency graph for math_integral_test.cpp:

Classes

class  SimpsonIntegralSinx
 
class  SimpsonIntegralITF
 
class  SimpsonIntegralExp
 

Macros

#define doublethreshold   1e-12
 

Functions

void sinspace (double start, double end, const int nums, double *xv, double *h)
 
 TEST_F (SimpsonIntegralSinx, Constructor)
 
 TEST_F (SimpsonIntegralSinx, SimpsonIntegralRab)
 
 TEST_F (SimpsonIntegralSinx, SimpsonIntegralDr)
 
 TEST_F (SimpsonIntegralSinx, SimpsonIntegral0toall)
 
 TEST_F (SimpsonIntegralSinx, SimpsonIntegralAlltoinf)
 
 TEST_F (SimpsonIntegralSinx, UniformGridOdd)
 
 TEST_F (SimpsonIntegralSinx, UniformGridEven)
 
 TEST_F (SimpsonIntegralSinx, LogGridOdd)
 
 TEST_F (SimpsonIntegralSinx, LogGridEven)
 
 TEST_F (SimpsonIntegralSinx, FourPoints)
 
 TEST_F (SimpsonIntegralSinx, ThreePoints)
 
 TEST_F (SimpsonIntegralITF, UniformGridOdd)
 
 TEST_F (SimpsonIntegralITF, SinGridOdd)
 
 TEST_F (SimpsonIntegralExp, UniformGridOdd)
 
 TEST_F (SimpsonIntegralExp, SinGridOdd)
 

Macro Definition Documentation

◆ doublethreshold

#define doublethreshold   1e-12

Function Documentation

◆ sinspace()

void sinspace ( double  start,
double  end,
const int  nums,
double *  xv,
double *  h 
)

Tested functions:

  • function Simpson_Integral with rab as input
  • function Simpson_Integral with dr as input
  • function Simpson_Integral_0toall
  • function Simpson_Integral_alltoinf
  • function Simpson_Integral with f(x) = sin(x)
  • function Simpson_Integral with f(x) = 1 / (1 + x^2)
  • function Simpson_Integral with f(x) = exp(x)
Here is the caller graph for this function:

◆ TEST_F() [1/15]

TEST_F ( SimpsonIntegralExp  ,
SinGridOdd   
)
Here is the call graph for this function:

◆ TEST_F() [2/15]

TEST_F ( SimpsonIntegralExp  ,
UniformGridOdd   
)
Here is the call graph for this function:

◆ TEST_F() [3/15]

TEST_F ( SimpsonIntegralITF  ,
SinGridOdd   
)
Here is the call graph for this function:

◆ TEST_F() [4/15]

TEST_F ( SimpsonIntegralITF  ,
UniformGridOdd   
)
Here is the call graph for this function:

◆ TEST_F() [5/15]

TEST_F ( SimpsonIntegralSinx  ,
Constructor   
)

◆ TEST_F() [6/15]

TEST_F ( SimpsonIntegralSinx  ,
FourPoints   
)

This test checks whether "simpson" yields the exact integral for a cubic polynomial sampled by four points. This case is handled by Simpson's 3/8 rule and should be exact.

Here is the call graph for this function:

◆ TEST_F() [7/15]

TEST_F ( SimpsonIntegralSinx  ,
LogGridEven   
)
Here is the call graph for this function:

◆ TEST_F() [8/15]

TEST_F ( SimpsonIntegralSinx  ,
LogGridOdd   
)
Here is the call graph for this function:

◆ TEST_F() [9/15]

TEST_F ( SimpsonIntegralSinx  ,
SimpsonIntegral0toall   
)
Here is the call graph for this function:

◆ TEST_F() [10/15]

TEST_F ( SimpsonIntegralSinx  ,
SimpsonIntegralAlltoinf   
)
Here is the call graph for this function:

◆ TEST_F() [11/15]

TEST_F ( SimpsonIntegralSinx  ,
SimpsonIntegralDr   
)
Here is the call graph for this function:

◆ TEST_F() [12/15]

TEST_F ( SimpsonIntegralSinx  ,
SimpsonIntegralRab   
)
Here is the call graph for this function:

◆ TEST_F() [13/15]

TEST_F ( SimpsonIntegralSinx  ,
ThreePoints   
)

This test checks whether "simpson" yields the exact integral for a quadratic polynomial sampled by three points.

Here is the call graph for this function:

◆ TEST_F() [14/15]

TEST_F ( SimpsonIntegralSinx  ,
UniformGridEven   
)
Here is the call graph for this function:

◆ TEST_F() [15/15]

TEST_F ( SimpsonIntegralSinx  ,
UniformGridOdd   
)
Here is the call graph for this function: