3 #ifndef __u_base_math_hpp
4 #define __u_base_math_hpp
7 #include <u_message.hpp>
9 #include <mix/u_message.hpp>
23 static bool gauss(
const std::vector< std::vector<double> > &LN,
24 const std::vector<double> &P,
25 std::vector<double> &x);
30 double x2,
double y2,
double z2,
31 double x3,
double y3,
double z3);
35 static void fiazr2xyz(
double f,
double az,
double r,
double &px,
double &py,
double &pz);
39 static void xyz2fiazr(
double px,
double py,
double pz,
double &f,
double &az,
double &r);
43 static double scalarMul(
double x1,
double y1,
double z1,
44 double x2,
double y2,
double z2);
48 static void matrix4x4Mul(
const double (&m1)[4][4],
const double (&m2)[4][4],
double (&m3)[4][4],
49 bool tr1 =
false,
bool tr2 =
false);
52 static void matrix2vec4x4Mul(
const double (&m)[4][4],
const double (&u)[4],
double (&v)[4],
56 static void vec2matrix4x4Mul(
const double (&u)[4],
const double (&m)[4][4],
double (&v)[4],
61 static void getLineCoeffs(
double x1,
double y1,
double x2,
double y2,
62 double &k,
double &b);
65 static int solveSquareEq(
double a,
double b,
double c,
double &x1,
double &x2);
69 static bool isNAN(
const T &t)
73 static bool isInf(
const T &t)
76 (std::numeric_limits<T>::has_infinity) &&
77 (t == std::numeric_limits<T>::infinity() ||
78 t == -std::numeric_limits<T>::infinity());
98 virtual double calc(
double x) = 0;
131 static int num_eq_solve;
148 {
zmin = zmn; zmax = zmx;}
162 #endif //__u_base_math_hpp
double cur_func
Definition: u_base_math.hpp:129
void solve(UEqAbstractFunction *func)
static void matrix4x4Mul(const double(&m1)[4][4], const double(&m2)[4][4], double(&m3)[4][4], bool tr1=false, bool tr2=false)
static int solveSquareEq(double a, double b, double c, double &x1, double &x2)
virtual ~UEqAbstractFunction()
Definition: u_base_math.hpp:95
static bool gauss(const std::vector< std::vector< double > > &LN, const std::vector< double > &P, std::vector< double > &x)
Definition: u_base_math.hpp:16
static double m_d_prec
Definition: u_base_math.hpp:84
static void getLineCoeffs(double x1, double y1, double x2, double y2, double &k, double &b)
void setRanges(double zmn, double zmx)
Definition: u_base_math.hpp:147
int itn_max
Definition: u_base_math.hpp:156
static void xyz2fiazr(double px, double py, double pz, double &f, double &az, double &r)
virtual ~UEqAbstractSolve()
Definition: u_base_math.hpp:110
virtual double calc(double x)=0
static double scalarMul(double x1, double y1, double z1, double x2, double y2, double z2)
static double compositionMul(double x1, double y1, double z1, double x2, double y2, double z2, double x3, double y3, double z3)
Definition: u_base_math.hpp:136
static void fiazr2xyz(double f, double az, double r, double &px, double &py, double &pz)
static void matrix2vec4x4Mul(const double(&m)[4][4], const double(&u)[4], double(&v)[4], bool tr=false)
virtual void solve(UEqAbstractFunction *func)=0
void setMaxItersNum(int n)
Definition: u_base_math.hpp:151
Definition: u_base_math.hpp:103
static void vec2matrix4x4Mul(const double(&u)[4], const double(&m)[4][4], double(&v)[4], bool tr=false)
Definition: u_base_math.hpp:88
double zmin
Definition: u_base_math.hpp:159
virtual double getFunc()
Definition: u_base_math.hpp:120
virtual double getRoot()
Definition: u_base_math.hpp:116
double cur_root
Definition: u_base_math.hpp:126