fermisurfer  2.0.0
fermisurfer
Functions
basic_math.cpp File Reference

Mathematical operations used in various step. More...

#include <cmath>
#include <omp.h>
Include dependency graph for basic_math.cpp:

Go to the source code of this file.

Functions

int modulo (int i, int n)
 Work as Modulo function of fortran. More...
 
GLfloat solve3 (GLfloat a[3][3], GLfloat b[3])
 Solve linear system. More...
 
void eigsort (int n, GLfloat *key, int *swap)
 Simple sort. More...
 
void normal_vec (GLfloat in1[3], GLfloat in2[3], GLfloat in3[3], GLfloat out[3])
 Calculate normal vector from corners of triangle. More...
 
int get_thread ()
 OpenMP wrapper, get the number of threads. More...
 

Detailed Description

Mathematical operations used in various step.

Definition in file basic_math.cpp.

Function Documentation

◆ eigsort()

void eigsort ( int  n,
GLfloat *  key,
int *  swap 
)

Simple sort.

Parameters
[in]n[in] the number of components
[in]key[in] Variables to be sorted [n].
[out]swap[out] Order of index (sorted)

Definition at line 88 of file basic_math.cpp.

Referenced by bragg_vector(), calc_nodeline(), calc_section(), and equator().

Here is the caller graph for this function:

◆ get_thread()

int get_thread ( )

OpenMP wrapper, get the number of threads.

Returns
the number of threads

Definition at line 139 of file basic_math.cpp.

Referenced by calc_nodeline(), calc_section(), equator(), and max_and_min().

Here is the caller graph for this function:

◆ modulo()

int modulo ( int  i,
int  n 
)

Work as Modulo function of fortran.

Returns
Modulated value
Parameters
[in]i[in]
[in]n[in]

Definition at line 46 of file basic_math.cpp.

Referenced by interpol_energy(), and read_file().

Here is the caller graph for this function:

◆ normal_vec()

void normal_vec ( GLfloat  in1[3],
GLfloat  in2[3],
GLfloat  in3[3],
GLfloat  out[3] 
)

Calculate normal vector from corners of triangle.

Parameters
[in]in1[in] Corner 1
[in]in2[in] Corner 2
[in]in3[in] Corner 3
[out]out[out] The normal vector

Definition at line 114 of file basic_math.cpp.

◆ solve3()

GLfloat solve3 ( GLfloat  a[3][3],
GLfloat  b[3] 
)

Solve linear system.

Returns
Determinant
Parameters
[in]a[in] Matix
[in,out]b[in,out] Right hand side vector

Definition at line 58 of file basic_math.cpp.

Referenced by allocate_griddata(), bragg_vert(), and bragg_vert2d().

Here is the caller graph for this function: