Jpp  18.2.0-rc.1
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Protected Attributes | Private Member Functions | Friends | List of all members
JMATH::JLegendre< JQuaternion3D, N > Struct Template Reference

Template specialisation for function evaluation of Legendre polynome of quaternions for defined number of degrees. More...

#include <JEigen3D.hh>

Inheritance diagram for JMATH::JLegendre< JQuaternion3D, N >:
JMATH::JLegendre< JQuaternion3D,(size_t)-1 > JMATH::JLegendre_t< JQuaternion3D > std::vector< JQuaternion3D >

Public Types

typedef std::vector
< JQuaternion3D >
::const_iterator 
const_iterator
 
typedef std::vector
< JQuaternion3D >::iterator 
iterator
 
typedef std::vector
< JQuaternion3D >
::const_reverse_iterator 
const_reverse_iterator
 
typedef std::vector
< JQuaternion3D >
::reverse_iterator 
reverse_iterator
 

Public Member Functions

 JLegendre ()
 Default constructor. More...
 
 JLegendre (const double xmin, const double xmax)
 Constructor. More...
 
template<class T >
 JLegendre (T __begin, T __end)
 Constructor. More...
 
template<class T >
void set (T __begin, T __end)
 Set Legendre polynome of quaternions. More...
 
template<class T >
void set (T __begin, T __not, T __end)
 Set Legendre polynome of quaternions. More...
 
virtual JQuaternion3D getValue (const double x) const override
 Function value. More...
 
JQuaternion3D operator() (const double x) const
 Function value. More...
 
double getXmin () const
 Get minimal abscissa value. More...
 
double getXmax () const
 Get maximal abscissa value. More...
 
double getX (const double x) const
 Get normalised abscissa value. More...
 
void reset ()
 Reset. More...
 
void set (const double xmin, const double xmax)
 Set abscissa values. More...
 

Protected Attributes

double xmin
 minimal abscissa More...
 
double xmax
 maximal abscissa More...
 

Private Member Functions

void clear ()
 
void resize ()
 
void erase ()
 
void push_back ()
 
void pop_back ()
 

Friends

std::istream & operator>> (std::istream &in, JLegendre &object)
 Read Legendre polynome from input. More...
 

Detailed Description

template<size_t N>
struct JMATH::JLegendre< JQuaternion3D, N >

Template specialisation for function evaluation of Legendre polynome of quaternions for defined number of degrees.

Definition at line 257 of file JEigen3D.hh.

Member Typedef Documentation

Definition at line 29 of file JLegendre.hh.

Definition at line 30 of file JLegendre.hh.

Definition at line 31 of file JLegendre.hh.

Definition at line 32 of file JLegendre.hh.

Constructor & Destructor Documentation

template<size_t N>
JMATH::JLegendre< JQuaternion3D, N >::JLegendre ( )
inline

Default constructor.

Definition at line 266 of file JEigen3D.hh.

267  {
269  }
then usage $script< input file >[option[primary[working directory]]] nWhere option can be N
Definition: JMuonPostfit.sh:40
template<size_t N>
JMATH::JLegendre< JQuaternion3D, N >::JLegendre ( const double  xmin,
const double  xmax 
)
inline

Constructor.

Parameters
xminminimal abscissa value
xmaxmaximal abscissa value

Definition at line 278 of file JEigen3D.hh.

280  {
282  this->set(xmin, xmax);
283  }
void set(T __begin, T __end)
Set Legendre polynome of quaternions.
Definition: JEigen3D.hh:319
double xmax
maximal abscissa
Definition: JLegendre.hh:205
then usage $script< input file >[option[primary[working directory]]] nWhere option can be N
Definition: JMuonPostfit.sh:40
double xmin
minimal abscissa
Definition: JLegendre.hh:204
template<size_t N>
template<class T >
JMATH::JLegendre< JQuaternion3D, N >::JLegendre ( T  __begin,
T  __end 
)
inline

Constructor.

The template argument T refers to an iterator of a data structure which should have the following data members:

  • double first; // abscissa
  • JQuaternion3D second; // ordinate

which conforms with std::pair.

Parameters
__beginbegin of data
__endend of data

Definition at line 299 of file JEigen3D.hh.

300  {
302  this->set(__begin, __end);
303  }
void set(T __begin, T __end)
Set Legendre polynome of quaternions.
Definition: JEigen3D.hh:319
then usage $script< input file >[option[primary[working directory]]] nWhere option can be N
Definition: JMuonPostfit.sh:40

Member Function Documentation

template<size_t N>
template<class T >
void JMATH::JLegendre< JQuaternion3D, N >::set ( T  __begin,
T  __end 
)
inline

Set Legendre polynome of quaternions.

The template argument T refers to an iterator of a data structure which should have the following data members:

  • double first; // abscissa
  • JQuaternion3D second; // ordinate

which conforms with std::pair.

Parameters
__beginbegin of data
__endend of data

Definition at line 319 of file JEigen3D.hh.

320  {
321  this->set(__begin, __end, __end);
322  }
void set(T __begin, T __end)
Set Legendre polynome of quaternions.
Definition: JEigen3D.hh:319
template<size_t N>
template<class T >
void JMATH::JLegendre< JQuaternion3D, N >::set ( T  __begin,
T  __not,
T  __end 
)
inline

Set Legendre polynome of quaternions.

The template argument T refers to an iterator of a data structure which should have the following data members:

  • double first; // abscissa
  • JQuaternion3D second; // ordinate

which conforms with std::pair.

Parameters
__beginbegin of data
__notnot in data
__endend of data

Definition at line 339 of file JEigen3D.hh.

340  {
341  // factor to be applied as power to eigen value obtained with JAverage when degree larger than zero.
342 
343  static const double factor = 1.0 / (PI * 45.0 / 180.0);
344 
345  for (size_t n = 0; n != N + 1; ++n) {
346  (*this)[n] = JQuaternion3D();
347  }
348 
349  this->xmin = std::numeric_limits<double>::max();
350  this->xmax = std::numeric_limits<double>::lowest();
351 
352  for (T i = __begin; i != __end; ++i) {
353  if (i != __not) {
354  if (i->first < this->xmin) { this->xmin = i->first; }
355  if (i->first > this->xmax) { this->xmax = i->first; }
356  }
357  }
358 
359  for (size_t n = 0; n != N + 1; ++n) {
360 
361  JAverage<JQuaternion3D> Q;
362 
363  for (T i = __begin; i != __end; ++i) {
364 
365  if (i != __not) {
366  const double x = i->first;
367  const JQuaternion3D& y = i->second;
368  const double z = this->getX(x);
369  const double w = legendre(n, z);
370  const JQuaternion3D q = this->getValue(x).getConjugate() * y;
371 
372  Q.put(q, w);
373  }
374  }
375 
376  (*this)[n] = Q;
377 
378  if (n != 0) {
379  (*this)[n].pow(factor);
380  }
381  }
382  }
data_type w[N+1][M+1]
Definition: JPolint.hh:778
virtual JQuaternion3D getValue(const double x) const override
Function value.
Definition: JEigen3D.hh:239
Q(UTCMax_s-UTCMin_s)-livetime_s
JQuaternion3D getConjugate() const
Get conjugate of this quaternion.
then usage $script< detector file >< detectorfile > nIf the range of floors is the first detector file is aligned to the second before the comparison nIn this
double xmax
maximal abscissa
Definition: JLegendre.hh:205
const int n
Definition: JPolint.hh:697
do set_variable OUTPUT_DIRECTORY $WORKDIR T
static const double PI
Mathematical constants.
Data structure for unit quaternion in three dimensions.
then usage $script< input file >[option[primary[working directory]]] nWhere option can be N
Definition: JMuonPostfit.sh:40
double xmin
minimal abscissa
Definition: JLegendre.hh:204
double legendre(const size_t n, const double x)
Legendre polynome.
double getX(const double x) const
Get normalised abscissa value.
Definition: JLegendre.hh:113
template<size_t N>
void JMATH::JLegendre< JQuaternion3D, N >::clear ( )
private
template<size_t N>
void JMATH::JLegendre< JQuaternion3D, N >::resize ( )
private
template<size_t N>
void JMATH::JLegendre< JQuaternion3D, N >::erase ( )
private
template<size_t N>
void JMATH::JLegendre< JQuaternion3D, N >::push_back ( )
private
template<size_t N>
void JMATH::JLegendre< JQuaternion3D, N >::pop_back ( )
private
virtual JQuaternion3D JMATH::JLegendre< JQuaternion3D,(size_t)-1 >::getValue ( const double  x) const
inlineoverridevirtualinherited

Function value.

Parameters
xabscissa value
Returns
function value

Implements JMATH::JLegendre_t< JQuaternion3D >.

Definition at line 239 of file JEigen3D.hh.

240  {
241  const double z = this->getX(x);
242  JQuaternion3D y = zero;
243 
244  for (size_t n = 0; n != this->size(); ++n) {
245  y *= pow((*this)[n], legendre(n,z));
246  }
247 
248  return y.normalise();
249  }
static const JZero zero
Function object to assign zero value.
Definition: JZero.hh:105
const int n
Definition: JPolint.hh:697
T pow(const T &x, const double y)
Power .
Definition: JMath.hh:97
Data structure for unit quaternion in three dimensions.
double legendre(const size_t n, const double x)
Legendre polynome.
JQuaternion3D & normalise()
Normalise quaternion.
double getX(const double x) const
Get normalised abscissa value.
Definition: JLegendre.hh:113
JQuaternion3D JMATH::JLegendre_t< JQuaternion3D >::operator() ( const double  x) const
inlineinherited

Function value.

Parameters
xabscissa value
Returns
function value

Definition at line 79 of file JLegendre.hh.

80  {
81  return this->getValue(x);
82  }
virtual JQuaternion3D getValue(const double x) const =0
Function value.
double JMATH::JLegendre_t< JQuaternion3D >::getXmin ( ) const
inlineinherited

Get minimal abscissa value.

Returns
minimal abscissa value

Definition at line 90 of file JLegendre.hh.

91  {
92  return xmin;
93  }
double xmin
minimal abscissa
Definition: JLegendre.hh:204
double JMATH::JLegendre_t< JQuaternion3D >::getXmax ( ) const
inlineinherited

Get maximal abscissa value.

Returns
maximal abscissa value

Definition at line 101 of file JLegendre.hh.

102  {
103  return xmax;
104  }
double xmax
maximal abscissa
Definition: JLegendre.hh:205
double JMATH::JLegendre_t< JQuaternion3D >::getX ( const double  x) const
inlineinherited

Get normalised abscissa value.

Parameters
xabscissa value
Returns
normalised abscissa value

Definition at line 113 of file JLegendre.hh.

114  {
115  return 2.0 * (x - xmin) / (xmax - xmin) - 1.0;
116  }
double xmax
maximal abscissa
Definition: JLegendre.hh:205
double xmin
minimal abscissa
Definition: JLegendre.hh:204
void JMATH::JLegendre_t< JQuaternion3D >::reset ( )
inlineinherited

Reset.

Definition at line 122 of file JLegendre.hh.

123  {
124  for (iterator i = this->begin(); i != this->end(); ++i) {
125  *i = zero;
126  }
127  }
static const JZero zero
Function object to assign zero value.
Definition: JZero.hh:105
std::vector< JQuaternion3D >::iterator iterator
Definition: JLegendre.hh:30
void JMATH::JLegendre_t< JQuaternion3D >::set ( const double  xmin,
const double  xmax 
)
inlineinherited

Set abscissa values.

Parameters
xminminimal abscissa value
xmaxmaximal abscissa value

Definition at line 136 of file JLegendre.hh.

138  {
139  this->xmin = xmin;
140  this->xmax = xmax;
141  }
double xmax
maximal abscissa
Definition: JLegendre.hh:205
double xmin
minimal abscissa
Definition: JLegendre.hh:204

Friends And Related Function Documentation

template<size_t N>
std::istream& operator>> ( std::istream &  in,
JLegendre< JQuaternion3D, N > &  object 
)
friend

Read Legendre polynome from input.

Parameters
ininput stream
objectLegendre polynome
Returns
input stream

Definition at line 392 of file JEigen3D.hh.

393  {
394  for (typename JLegendre::iterator i = object.begin(); i != object.end(); ++i) {
395  in >> *i;
396  }
397 
398  return in;
399  }
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
Definition: JCanberra.sh:46

Member Data Documentation

double JMATH::JLegendre_t< JQuaternion3D >::xmin
protectedinherited

minimal abscissa

Definition at line 204 of file JLegendre.hh.

double JMATH::JLegendre_t< JQuaternion3D >::xmax
protectedinherited

maximal abscissa

Definition at line 205 of file JLegendre.hh.


The documentation for this struct was generated from the following file: