Open PaperOpt
OpenPaperOpt/utilities.h File Reference
#include <stdio.h>
#include <string>
#include <vector>
#include <complex>
#include <stdarg.h>
#include <functional>
#include <algorithm>
#include <math.h>
#include "V3.h"
#include <time.h>
#include <stdlib.h>
#include <iostream>
Include dependency graph for utilities.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  AutoDelete< C >
class  AutoDeleteV< C >
class  StdExcept
class  SimpleDist< numbins >
class  SubdivPatch
class  SubdivEnv
class  fiberData
struct  compare_x< _Tx, _Ty >
struct  compare_y< _Tx, _Ty >
class  TreeNode
class  FiberSample

Namespaces

namespace  p3d

Defines

#define MIN(a, b)   (((a)<=(b))?(a):(b))
#define MAX(a, b)   (((a)>=(b))?(a):(b))
#define ABS(a)   (((a) < 0) ? -(a) : (a))
#define FLT_QNAN   0xffc00000
#define DATA_MOVE(data, dist)   (data)=(double*)(((char*)(data))+(dist))
#define DATA_ADD(data, dist)   ((double*)(((char*)(data))+(dist)))
#define SIMVOL_FLAG_ANGLE   0x0001
#define SIMVOL_FLAG_CURL   0x0002
#define SIMVOL_FLAG_POS   0x0004
#define SIMVOL_FLAG_POS3D   0x0008
#define SEGT_ROTZ   0x0001
#define EPS   2.220446049250313e-016
#define INF   1e48
#define PI   3.1415926535897932384626433832795
#define R2_IM1   2147483563
#define R2_IM2   2147483399
#define R2_AM   (1.0/R2_IM1)
#define R2_IMM1   (R2_IM1-1)
#define R2_IA1   40014
#define R2_IA2   40692
#define R2_IQ1   53668
#define R2_IQ2   52774
#define R2_IR1   12211
#define R2_IR2   3791
#define R2_NTAB   32
#define R2_NDIV   (1+R2_IMM1/R2_NTAB)
#define R2_EPS   1.2e-7
#define R2_RNMX   (1.0-R2_EPS)

Typedefs

typedef SimpleDist< 13 > ZDist
typedef vector< fiberDatafsamples
typedef fsamples::iterator fsamplesiter
typedef std::complex< double > complex_LC

Functions

int p3d::GenerateCurlVector (double len, double rad, double formfac, int numSegs, double *angles, int packetsLow=25, int packetsHig=35)
int InitialiseGenerateRandom (void)
double GenerateRandom (void)
double square (complex_LC a)
double grMax (double n1, double n2)
double grMin (double n1, double n2)
int CalcQ (const std::complex< double > n1, const std::complex< double > n2, const V3< double > wp_lmn_local, const V3< double > wp_lmn_new, double *Qss, double *Qsp, double *Qps, double *Qpp)
int MicroScattering2 (V3< double > &wp_lmn_local, V3< double > &wp_pol_local, double wp_s_local, double wp_p_local, complex_LC refr_i, complex_LC refr_t, V2< float > rms, double lambda, double &reflfactor)
complex< double > cmplxasin (complex< double > z)

Variables

const double THICKNESS_LIMIT = 1e-4

Define Documentation

#define ABS (   a)    (((a) < 0) ? -(a) : (a))

Give the the absolute value

#define DATA_ADD (   data,
  dist 
)    ((double*)(((char*)(data))+(dist)))
#define DATA_MOVE (   data,
  dist 
)    (data)=(double*)(((char*)(data))+(dist))
#define EPS   2.220446049250313e-016
#define FLT_QNAN   0xffc00000

define an invalid value for float type

#define INF   1e48
#define MAX (   a,
 
)    (((a)>=(b))?(a):(b))

Calculate maximum value between two values

#define MIN (   a,
 
)    (((a)<=(b))?(a):(b))

Calculate minimum value between two values

#define PI   3.1415926535897932384626433832795
#define R2_AM   (1.0/R2_IM1)
#define R2_EPS   1.2e-7
#define R2_IA1   40014
#define R2_IA2   40692
#define R2_IM1   2147483563
#define R2_IM2   2147483399
#define R2_IMM1   (R2_IM1-1)
#define R2_IQ1   53668
#define R2_IQ2   52774
#define R2_IR1   12211
#define R2_IR2   3791
#define R2_NDIV   (1+R2_IMM1/R2_NTAB)
#define R2_NTAB   32
#define R2_RNMX   (1.0-R2_EPS)
#define SEGT_ROTZ   0x0001
#define SIMVOL_FLAG_ANGLE   0x0001
#define SIMVOL_FLAG_CURL   0x0002
#define SIMVOL_FLAG_POS   0x0004
#define SIMVOL_FLAG_POS3D   0x0008

Typedef Documentation

typedef std::complex<double> complex_LC
typedef vector<fiberData> fsamples
typedef fsamples::iterator fsamplesiter
typedef SimpleDist<13> ZDist

Function Documentation

int CalcQ ( const std::complex< double >  n1,
const std::complex< double >  n2,
const V3< double >  wp_lmn_local,
const V3< double >  wp_lmn_new,
double *  Qss,
double *  Qsp,
double *  Qps,
double *  Qpp 
)

Here is the call graph for this function:

Here is the caller graph for this function:

complex<double> cmplxasin ( complex< double >  z)

Here is the caller graph for this function:

double GenerateRandom ( void  ) [inline]

random generator and use the rand_idum as random seed which is initialized by the inline function InitialiseGenerateRandom

Here is the caller graph for this function:

double grMax ( double  n1,
double  n2 
) [inline]
double grMin ( double  n1,
double  n2 
) [inline]
int InitialiseGenerateRandom ( void  ) [inline]

initialize the seed of the random generator

Here is the caller graph for this function:

int MicroScattering2 ( V3< double > &  wp_lmn_local,
V3< double > &  wp_pol_local,
double  wp_s_local,
double  wp_p_local,
complex_LC  refr_i,
complex_LC  refr_t,
V2< float >  rms,
double  lambda,
double &  reflfactor 
)

Here is the call graph for this function:

Here is the caller graph for this function:

double square ( complex_LC  a) [inline]

Here is the caller graph for this function:


Variable Documentation

const double THICKNESS_LIMIT = 1e-4