Flow123d  DF_patch_fe_data_tables-6bd0dc8
Macros | Typedefs | Functions
math_fce.h File Reference


More...

#include <float.h>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define NUM_ZERO   DBL_MIN/DBL_EPSILON
 Numerical helpers. More...
 
#define EPS(value)   (value)
 
#define ZERO   EPS(1e-12)
 
#define DBL_EQ(i, j)   (fabs((i)-(j))<NUM_ZERO)
 
#define DBL_GE(i, j)   ((i)>(j)-NUM_ZERO)
 
#define DBL_LE(i, j)   ((i)<(j)+NUM_ZERO)
 
#define DBL_GT(i, j)   ((i)>(j)+NUM_ZERO)
 
#define DBL_LT(i, j)   ((i)<(j)-NUM_ZERO)
 
#define SQUARE(x)   ((x) * (x))
 Usefull math macros. More...
 
#define SGN(x)   ( ((x)>ZERO)? (1) : ( ((x)<(-ZERO))? (-1) : (0) ) )
 
#define SUBDET2(i, j, k, l)   (a[(i)][(k)]*a[(j)][(l)]-a[(i)][(l)]*a[(j)][(k)])
 
#define M_PI   3.14159265358979323846264338327950288f
 

Typedefs

typedef double SmallVec1_t[1]
 small matrix types More...
 
typedef double SmallVec2_t[2]
 
typedef double SmallVec3_t[3]
 
typedef double SmallVec4_t[4]
 
typedef SmallVec1_tSmallMtx1
 
typedef SmallVec2_tSmallMtx2
 
typedef SmallVec3_tSmallMtx3
 
typedef SmallVec4_tSmallMtx4
 

Functions

double vector_length (double[])
 
double scalar_product (double[], double[])
 
void normalize_vector (double[])
 
void scale_vector (double[], double)
 
void vector_product (double[], double[], double[])
 
void vector_difference (double[], double[], double[])
 
double Det3 (SmallMtx3 a)
 
double MatrixInverse (double *a, double *b, int size)
 
void PrintSmallMatrix (double *mtx, int size)
 

Detailed Description


 * Copyright (C) 2015 Technical University of Liberec. All rights reserved.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 3 as published by the Free Software Foundation. (http://www.gnu.org/licenses/gpl-3.0.en.html)

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

Definition in file math_fce.h.

Macro Definition Documentation

◆ DBL_EQ

#define DBL_EQ (   i,
 
)    (fabs((i)-(j))<NUM_ZERO)

Definition at line 50 of file math_fce.h.

◆ DBL_GE

#define DBL_GE (   i,
 
)    ((i)>(j)-NUM_ZERO)

Definition at line 51 of file math_fce.h.

◆ DBL_GT

#define DBL_GT (   i,
 
)    ((i)>(j)+NUM_ZERO)

Definition at line 53 of file math_fce.h.

◆ DBL_LE

#define DBL_LE (   i,
 
)    ((i)<(j)+NUM_ZERO)

Definition at line 52 of file math_fce.h.

◆ DBL_LT

#define DBL_LT (   i,
 
)    ((i)<(j)-NUM_ZERO)

Definition at line 54 of file math_fce.h.

◆ EPS

#define EPS (   value)    (value)

Definition at line 45 of file math_fce.h.

◆ M_PI

#define M_PI   3.14159265358979323846264338327950288f

Definition at line 61 of file math_fce.h.

◆ NUM_ZERO

#define NUM_ZERO   DBL_MIN/DBL_EPSILON

Numerical helpers.

Definition at line 41 of file math_fce.h.

◆ SGN

#define SGN (   x)    ( ((x)>ZERO)? (1) : ( ((x)<(-ZERO))? (-1) : (0) ) )

Definition at line 58 of file math_fce.h.

◆ SQUARE

#define SQUARE (   x)    ((x) * (x))

Usefull math macros.

Definition at line 57 of file math_fce.h.

◆ SUBDET2

#define SUBDET2 (   i,
  j,
  k,
 
)    (a[(i)][(k)]*a[(j)][(l)]-a[(i)][(l)]*a[(j)][(k)])

Definition at line 59 of file math_fce.h.

◆ ZERO

#define ZERO   EPS(1e-12)

Definition at line 48 of file math_fce.h.

Typedef Documentation

◆ SmallMtx1

Definition at line 29 of file math_fce.h.

◆ SmallMtx2

Definition at line 30 of file math_fce.h.

◆ SmallMtx3

Definition at line 31 of file math_fce.h.

◆ SmallMtx4

Definition at line 32 of file math_fce.h.

◆ SmallVec1_t

typedef double SmallVec1_t[1]

small matrix types

Definition at line 24 of file math_fce.h.

◆ SmallVec2_t

typedef double SmallVec2_t[2]

Definition at line 25 of file math_fce.h.

◆ SmallVec3_t

typedef double SmallVec3_t[3]

Definition at line 26 of file math_fce.h.

◆ SmallVec4_t

typedef double SmallVec4_t[4]

Definition at line 27 of file math_fce.h.

Function Documentation

◆ Det3()

double Det3 ( SmallMtx3  a)

Definition at line 94 of file math_fce.cc.

◆ MatrixInverse()

double MatrixInverse ( double *  a,
double *  b,
int  size 
)

Definition at line 104 of file math_fce.cc.

◆ normalize_vector()

void normalize_vector ( double  u[])

Definition at line 48 of file math_fce.cc.

◆ PrintSmallMatrix()

void PrintSmallMatrix ( double *  mtx,
int  size 
)

Definition at line 214 of file math_fce.cc.

◆ scalar_product()

double scalar_product ( double  u[],
double  v[] 
)

Definition at line 41 of file math_fce.cc.

◆ scale_vector()

void scale_vector ( double  u[],
double  k 
)

Definition at line 60 of file math_fce.cc.

◆ vector_difference()

void vector_difference ( double  u[],
double  v[],
double  x[] 
)

Definition at line 80 of file math_fce.cc.

◆ vector_length()

double vector_length ( double  v[])

Definition at line 34 of file math_fce.cc.

Here is the caller graph for this function:

◆ vector_product()

void vector_product ( double  u[],
double  v[],
double  x[] 
)

Definition at line 68 of file math_fce.cc.