Include : varie.
This commit is contained in:
+3
-2
@@ -1,7 +1,7 @@
|
||||
//----------------------------------------------------------------------------
|
||||
// EgalTech 2013-2013
|
||||
// EgalTech 2013-2014
|
||||
//----------------------------------------------------------------------------
|
||||
// File : EgkGeoCollection.h Data : 17.12.13 Versione : 1.4l1
|
||||
// File : EgkGeoCollection.h Data : 10.01.14 Versione : 1.5a2
|
||||
// Contenuto : Raccolte di oggetti geometrici.
|
||||
//
|
||||
//
|
||||
@@ -15,6 +15,7 @@
|
||||
|
||||
#include "/EgtDev/Include/EGkPoint3d.h"
|
||||
#include "/EgtDev/Include/EGkCurvePointDiffGeom.h"
|
||||
#include "/EgtDev/Include/ENkNumCollection.h"
|
||||
#include <vector>
|
||||
#include <list>
|
||||
|
||||
|
||||
+28
-20
@@ -13,13 +13,21 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
//----------------------- Macro per import/export ----------------------------
|
||||
#undef ENK_EXPORT
|
||||
#if defined( I_AM_ENK) // da definirsi solo nella DLL
|
||||
#define ENK_EXPORT __declspec( dllexport)
|
||||
#else
|
||||
#define ENK_EXPORT __declspec( dllimport)
|
||||
#endif
|
||||
|
||||
//---------------------------Include------------------------------------------
|
||||
#include <math.h>
|
||||
#include <float.h>
|
||||
|
||||
|
||||
//---------------------------- Class Complex ---------------------------------
|
||||
class Complex
|
||||
class ENK_EXPORT Complex
|
||||
{
|
||||
public :
|
||||
Complex( double x, double y) : re( x), im( x) {}
|
||||
@@ -45,23 +53,23 @@ class Complex
|
||||
} ;
|
||||
|
||||
//------------------------------ Functions -----------------------------------
|
||||
Complex sqrt( Complex& cVal) ;
|
||||
Complex log( Complex& cVal) ;
|
||||
Complex exp( Complex & cVal) ;
|
||||
Complex cosh( Complex& cVal) ;
|
||||
Complex sinh( Complex& cVal) ;
|
||||
Complex tanh( Complex& cVal) ;
|
||||
Complex cos( Complex& cVal) ;
|
||||
Complex isin( Complex& cVal) ;
|
||||
Complex sin( Complex& cVal) ;
|
||||
Complex itan( Complex& cVal) ;
|
||||
Complex tan( Complex& cVal) ;
|
||||
Complex acosh( Complex& cVal) ;
|
||||
Complex asinh( Complex& cVal) ;
|
||||
Complex atanh( Complex& cVal) ;
|
||||
Complex acos( Complex& cVal) ;
|
||||
Complex asin( Complex& cVal) ;
|
||||
Complex atan( Complex& cVal) ;
|
||||
ENK_EXPORT Complex sqrt( Complex& cVal) ;
|
||||
ENK_EXPORT Complex log( Complex& cVal) ;
|
||||
ENK_EXPORT Complex exp( Complex & cVal) ;
|
||||
ENK_EXPORT Complex cosh( Complex& cVal) ;
|
||||
ENK_EXPORT Complex sinh( Complex& cVal) ;
|
||||
ENK_EXPORT Complex tanh( Complex& cVal) ;
|
||||
ENK_EXPORT Complex cos( Complex& cVal) ;
|
||||
ENK_EXPORT Complex isin( Complex& cVal) ;
|
||||
ENK_EXPORT Complex sin( Complex& cVal) ;
|
||||
ENK_EXPORT Complex itan( Complex& cVal) ;
|
||||
ENK_EXPORT Complex tan( Complex& cVal) ;
|
||||
ENK_EXPORT Complex acosh( Complex& cVal) ;
|
||||
ENK_EXPORT Complex asinh( Complex& cVal) ;
|
||||
ENK_EXPORT Complex atanh( Complex& cVal) ;
|
||||
ENK_EXPORT Complex acos( Complex& cVal) ;
|
||||
ENK_EXPORT Complex asin( Complex& cVal) ;
|
||||
ENK_EXPORT Complex atan( Complex& cVal) ;
|
||||
|
||||
|
||||
//------------------------------ Functions inline -----------------------------------
|
||||
@@ -312,7 +320,7 @@ itimes( Complex& cVal)
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// right shift.............
|
||||
// right shift
|
||||
inline Complex
|
||||
operator >>( Complex& cVal, int n)
|
||||
{
|
||||
@@ -326,7 +334,7 @@ operator >>( Complex& cVal, int n)
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// left shift..............
|
||||
// left shift
|
||||
inline Complex
|
||||
operator <<( Complex& cVal, int n)
|
||||
{
|
||||
|
||||
+4
-4
@@ -19,13 +19,13 @@ class ILogger ;
|
||||
//----------------------- Macro per import/export ----------------------------
|
||||
#undef ENK_EXPORT
|
||||
#if defined( I_AM_ENK) // da definirsi solo nella DLL
|
||||
#define EGK_EXPORT __declspec( dllexport)
|
||||
#define ENK_EXPORT __declspec( dllexport)
|
||||
#else
|
||||
#define EGK_EXPORT __declspec( dllimport)
|
||||
#define ENK_EXPORT __declspec( dllimport)
|
||||
#endif
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// restituisce la versione della Dll (stringa del tipo 1.4a5)
|
||||
EGK_EXPORT const char* GetENkVersion( void) ;
|
||||
ENK_EXPORT const char* GetENkVersion( void) ;
|
||||
// permette di impostare il logger per la Dll
|
||||
EGK_EXPORT void SetENkLogger( ILogger* pLogger) ;
|
||||
ENK_EXPORT void SetENkLogger( ILogger* pLogger) ;
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
//----------------------------------------------------------------------------
|
||||
// EgalTech 2013-2014
|
||||
//----------------------------------------------------------------------------
|
||||
// File : ENkNumCollection.h Data : 17.12.13 Versione : 1.4l1
|
||||
// Contenuto : Raccolte di oggetti numerici.
|
||||
//
|
||||
//
|
||||
//
|
||||
// Modifiche : 17.12.13 DS Creazione modulo.
|
||||
//
|
||||
//
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "/EgtDev/Include/ENkComplex.h"
|
||||
#include <vector>
|
||||
#include <list>
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// Raccolte di double
|
||||
typedef std::vector<double> DBLVECTOR ; // vettore di double
|
||||
typedef std::list<double> DBLLIST ; // lista di double
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// Raccolte di Complex
|
||||
typedef std::vector<Complex> CPLXVECTOR ; // vettore di Complex
|
||||
typedef std::list<Complex> CPLXLIST ; // lista di Complex
|
||||
+181
@@ -0,0 +1,181 @@
|
||||
//----------------------------------------------------------------------------
|
||||
// EgalTech 2013-2014
|
||||
//----------------------------------------------------------------------------
|
||||
// File : ENkPolynomial.h Data : 12.01.14 Versione : 1.5a2
|
||||
// Contenuto : Funzioni per polinomi.
|
||||
//
|
||||
//
|
||||
//
|
||||
// Modifiche : 12.01.14 DS Creazione modulo.
|
||||
//
|
||||
//
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
#pragma once
|
||||
|
||||
//----------------------- Macro per import/export ----------------------------
|
||||
#undef ENK_EXPORT
|
||||
#if defined( I_AM_ENK) // da definirsi solo nella DLL
|
||||
#define ENK_EXPORT __declspec( dllexport)
|
||||
#else
|
||||
#define ENK_EXPORT __declspec( dllimport)
|
||||
#endif
|
||||
|
||||
//---------------------------Include------------------------------------------
|
||||
#include "/EgtDev/Include/ENkNumCollection.h"
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
class Polynomial
|
||||
{
|
||||
public :
|
||||
ENK_EXPORT Polynomial( void) : m_nDegree( -1) {}
|
||||
ENK_EXPORT bool SetDegree( int nDegree) ;
|
||||
ENK_EXPORT bool SetCoeff( int nPower, double dC) ;
|
||||
ENK_EXPORT bool Set( int nDegree, const DBLVECTOR& vC) ;
|
||||
ENK_EXPORT bool SetToConstant( double dC) ;
|
||||
ENK_EXPORT const Polynomial& operator =( const Polynomial& polS)
|
||||
{ if ( &polS != this) {
|
||||
SetDegree( polS.m_nDegree) ;
|
||||
for ( int i = 0 ; i <= m_nDegree ; ++ i)
|
||||
m_Coeff[i] = polS.m_Coeff[i] ;}
|
||||
return *this ; }
|
||||
|
||||
public :
|
||||
ENK_EXPORT int GetDegree( void) const { return m_nDegree ; }
|
||||
ENK_EXPORT double GetCoeff( int nPower) const
|
||||
{ if ( nPower < 0 || nPower > m_nDegree)
|
||||
return 0 ;
|
||||
return m_Coeff[nPower] ; }
|
||||
ENK_EXPORT const Polynomial& operator +=( const Polynomial& polP) ;
|
||||
ENK_EXPORT const Polynomial& operator -=( const Polynomial& polP) ;
|
||||
ENK_EXPORT const Polynomial& operator *=( const Polynomial& polP) ;
|
||||
ENK_EXPORT void Derive( void) ;
|
||||
ENK_EXPORT void Derive( const Polynomial& polP) ;
|
||||
ENK_EXPORT void AdjustDegree( void) ;
|
||||
ENK_EXPORT double Evaluate( double dVal) ;
|
||||
ENK_EXPORT int FindRoots( DBLVECTOR& vdRoot) ;
|
||||
|
||||
private :
|
||||
bool EnsureDegree( int nDegree) ;
|
||||
|
||||
private :
|
||||
int m_nDegree ;
|
||||
DBLVECTOR m_Coeff ;
|
||||
} ;
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// Somma
|
||||
//----------------------------------------------------------------------------
|
||||
inline Polynomial
|
||||
operator+( const Polynomial& polP1, const Polynomial& polP2)
|
||||
{
|
||||
Polynomial polSumm = polP1 ;
|
||||
polSumm += polP2 ;
|
||||
return polSumm ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// Differenza
|
||||
//----------------------------------------------------------------------------
|
||||
inline Polynomial
|
||||
operator-( const Polynomial& polP1, const Polynomial& polP2)
|
||||
{
|
||||
Polynomial polDiff = polP1 ;
|
||||
polDiff -= polP2 ;
|
||||
return polDiff ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// Moltiplicazione
|
||||
//----------------------------------------------------------------------------
|
||||
inline Polynomial
|
||||
operator*( const Polynomial& polP1, const Polynomial& polP2)
|
||||
{
|
||||
Polynomial polMul = polP1 ;
|
||||
polMul *= polP2 ;
|
||||
return polMul ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// Filtro sulle radici
|
||||
//----------------------------------------------------------------------------
|
||||
ENK_EXPORT int FilterMultipleAndOutOfRangeRoots( DBLVECTOR& vRoots, double dMin, double dMax, double dEps) ;
|
||||
|
||||
|
||||
|
||||
#if 0
|
||||
//----------------------------------------------------------------------------
|
||||
void
|
||||
PolynomialSumm( DBLVECTOR& vSou1, DBLVECTOR& vSou2, DBLVECTOR& vSumm)
|
||||
{
|
||||
int nDeg1 = vSou1.size() - 1 ;
|
||||
int nDeg2 = vSou2.size() - 1 ;
|
||||
int nMin = (( nDeg1 <= nDeg2) ? nDeg1 : nDeg2) ;
|
||||
int nMax = (( nDeg1 >= nDeg2) ? nDeg1 : nDeg2) ;
|
||||
vSumm.clear() ;
|
||||
vSumm.reserve( nMax + 1) ;
|
||||
for ( int i = 0 ; i < nMin ; ++ i)
|
||||
vSumm.push_back( vSou1[i] + vSou2[i]) ;
|
||||
if ( nDeg1 > nDeg2) {
|
||||
for ( int i = nMin ; i < nDeg1 ; ++ i)
|
||||
vSumm.push_back( vSou1[i]) ;
|
||||
}
|
||||
else if ( nDeg1 < nDeg2) {
|
||||
for ( int i = nMin ; i < nDeg2 ; ++ i)
|
||||
vSumm.push_back( vSou2[i]) ;
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
void
|
||||
PolynomialDiff( DBLVECTOR& vSou1, DBLVECTOR& vSou2, DBLVECTOR& vSumm)
|
||||
{
|
||||
int nDeg1 = vSou1.size() - 1 ;
|
||||
int nDeg2 = vSou2.size() - 1 ;
|
||||
int nMin = (( nDeg1 <= nDeg2) ? nDeg1 : nDeg2) ;
|
||||
int nMax = (( nDeg1 >= nDeg2) ? nDeg1 : nDeg2) ;
|
||||
vSumm.clear() ;
|
||||
vSumm.reserve( nMax + 1) ;
|
||||
for ( int i = 0 ; i < nMin ; ++ i)
|
||||
vSumm.push_back( vSou1[i] - vSou2[i]) ;
|
||||
if ( nDeg1 > nDeg2) {
|
||||
for ( int i = nMin ; i < nDeg1 ; ++ i)
|
||||
vSumm.push_back( vSou1[i]) ;
|
||||
}
|
||||
else if ( nDeg1 < nDeg2) {
|
||||
for ( int i = nMin ; i < nDeg2 ; ++ i)
|
||||
vSumm.push_back( - vSou2[i]) ;
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
void
|
||||
PolynomialMult( DBLVECTOR& vSou1, DBLVECTOR& vSou2, DBLVECTOR& vMult)
|
||||
{
|
||||
int nDeg1 = vSou1.size() - 1 ;
|
||||
int nDeg2 = vSou2.size() - 1 ;
|
||||
int nDim = nDeg1 + nDeg2 + 1 ;
|
||||
vMult.clear() ;
|
||||
vMult.reserve( nDim) ;
|
||||
for ( int i = 0 ; i < nDim ; ++ i)
|
||||
vMult.push_back( 0) ;
|
||||
for ( int i = 0 ; i <= nDeg1 ; ++ i) {
|
||||
for ( int j = 0 ; j <= nDeg2 ; ++ j)
|
||||
vMult[i+j] += vSou1[i] * vSou2[j] ;
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
void
|
||||
PolynomialDerive( DBLVECTOR& vSou, DBLVECTOR& vDer)
|
||||
{
|
||||
int nDeg = vSou.size() - 1 ;
|
||||
vDer.clear() ;
|
||||
vDer.reserve( nDeg) ;
|
||||
for ( int i = 0 ; i < nDeg ; ++ i)
|
||||
vDer.push_back( ( i + 1) * vSou[i+1]) ;
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,7 +1,7 @@
|
||||
//----------------------------------------------------------------------------
|
||||
// EgalTech 2013-2014
|
||||
//----------------------------------------------------------------------------
|
||||
// File : ENkPolynomialZeros.h Data : 08.01.14 Versione : 1.5a1
|
||||
// File : ENkPolynomialRoots.h Data : 08.01.14 Versione : 1.5a1
|
||||
// Contenuto : Dichiarazione di funzioni per il calcolo degli zeri di polinomi.
|
||||
//
|
||||
//
|
||||
@@ -16,23 +16,23 @@
|
||||
//----------------------- Macro per import/export ----------------------------
|
||||
#undef ENK_EXPORT
|
||||
#if defined( I_AM_ENK) // da definirsi solo nella DLL
|
||||
#define EGK_EXPORT __declspec( dllexport)
|
||||
#define ENK_EXPORT __declspec( dllexport)
|
||||
#else
|
||||
#define EGK_EXPORT __declspec( dllimport)
|
||||
#define ENK_EXPORT __declspec( dllimport)
|
||||
#endif
|
||||
|
||||
//---------------------------Include------------------------------------------
|
||||
#include "\EgtDev\Include\ENkComplex.h"
|
||||
#include "\EgtDev\Include\ENkNumCollection.h"
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// Calcola gli zeri di un polinomio a coefficienti reali
|
||||
// nDegree = grado
|
||||
// adPoly = array (dimensioni nDegree + 1) dei coefficienti (dal grado più basso al più alto)
|
||||
// adRoot = array degli zeri
|
||||
// vdPoly = vector (dimensioni nDegree + 1) dei coefficienti (dal grado più basso al più alto)
|
||||
// vdRoot = vector degli zeri
|
||||
// pnIter = numero di iterazioni
|
||||
// valore di ritorno = numero di zeri trovati
|
||||
EGK_EXPORT int PolynomialZeros( int nDegree, double adPoly[], double adRoot[], int* pnIter = NULL) ;
|
||||
ENK_EXPORT int PolynomialRoots( int nDegree, DBLVECTOR& vdPoly, DBLVECTOR& vdRoot, int* pnIter = NULL) ;
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// Calcola gli zeri di un polinomio a coefficienti complessi
|
||||
@@ -41,4 +41,4 @@ EGK_EXPORT int PolynomialZeros( int nDegree, double adPoly[], double adRoot[], i
|
||||
// acRoot = array degli zeri
|
||||
// pnIter = numero di iterazioni
|
||||
// valore di ritorno = numero di zeri trovati
|
||||
EGK_EXPORT int PolynomialZeros( int nDegree, Complex acPoly[], Complex acRoot[], int* pnIter = NULL) ;
|
||||
ENK_EXPORT int PolynomialRoots( int nDegree, CPLXVECTOR& vcPoly, CPLXVECTOR& vcRoot, int* pnIter = NULL) ;
|
||||
@@ -30,6 +30,7 @@ class __declspec( novtable) ICurveBezier : public ICurve
|
||||
virtual const Point3d& GetControlPoint( int nInd, bool* pbOk = NULL) const = 0 ;
|
||||
virtual double GetControlWeight( int nInd, bool* pbOk = NULL) const = 0 ;
|
||||
virtual bool GetControlPolygonLength( double& dLen) const = 0 ;
|
||||
virtual int GetSingularParam( double& dPar) const = 0 ;
|
||||
} ;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@ class __declspec( novtable) ICmdParser
|
||||
{
|
||||
public :
|
||||
virtual ~ICmdParser( void) {}
|
||||
virtual bool Init( std::string sCmdFile, ICmdExecutor* pCmdExec, ILogger* pLogger) = 0 ;
|
||||
virtual bool Init( std::string sCmdFile, ICmdExecutor* pCmdExec, ILogger* pLogger, int nLev = 0) = 0 ;
|
||||
virtual bool Run( void) = 0 ;
|
||||
} ;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user