Memosa-FVM  0.2
PC.h File Reference
#include "NumType.h"
#include "misc.h"
#include "PCSet.h"
Include dependency graph for PC.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Initializer< X, T_iterator >
 
struct  Factorial< N >
 
struct  Factorial< 0 >
 
class  PC< ORDER, DIM >
 
struct  ArrayScalarTraits< PC< ORDER, DIM > >
 

Macros

#define PC_RELATIONAL_OPS(opname, _op_)
 
#define PC_BINARY_OP(opname, _op_)
 

Functions

PCSet * createPCSet (const int order, const int dim)
 
 PC_BINARY_OP (operator+,+=)
 
 PC_BINARY_OP (operator-,-=)
 
 PC_BINARY_OP (operator*,*=)
 
 PC_BINARY_OP (operator/,/=)
 
template<int ORDER, int DIM>
PC< ORDER, DIM > operator+ (const PC< ORDER, DIM > &a)
 
template<int ORDER, int DIM>
PC< ORDER, DIM > operator- (const PC< ORDER, DIM > &a)
 
template<int ORDER, int DIM>
PC< ORDER, DIM > fabs (const PC< ORDER, DIM > &a)
 
template<int ORDER, int DIM>
ostream & operator<< (ostream &os, const PC< ORDER, DIM > &a)
 
template<int ORDER, int DIM>
PC< ORDER, DIM > sqrt (const PC< ORDER, DIM > &a)
 
template<int ORDER, int DIM>
double stdDev (const PC< ORDER, DIM > &a)
 

Macro Definition Documentation

#define PC_BINARY_OP (   opname,
  _op_ 
)
Value:
template<int ORDER, int DIM> \
PC<ORDER,DIM> opname(const PC<ORDER,DIM>& a, const PC<ORDER,DIM>& b) \
{ \
return PC<ORDER,DIM>(a) _op_ b; \
} \
template<int ORDER, int DIM> \
PC<ORDER,DIM> opname(const PC<ORDER,DIM>& a, const double& b) \
{ \
return PC<ORDER,DIM>(a) _op_ b; \
} \
template<int ORDER, int DIM> \
PC<ORDER,DIM> opname(const double& a, const PC<ORDER,DIM>& b) \
{ \
return PC<ORDER,DIM>(a) _op_ b; \
} \
Definition: PC.h:61

Definition at line 303 of file PC.h.

#define PC_RELATIONAL_OPS (   opname,
  _op_ 
)
Value:
bool opname(const PC& o) const \
{ \
return (_data[0] _op_ o._data[0]); \
} \
bool opname(const double& o) const \
{ \
return (_data[0] _op_ o); \
}
Definition: PC.h:61

Definition at line 191 of file PC.h.

Function Documentation

PCSet* createPCSet ( const int  order,
const int  dim 
)

Definition at line 9 of file PC.cpp.

10 {
11  PCSet *pc = new PCSet(order,dim,"HG");
12 
13  cout << "The number of PC terms in an expansion is "
14  << pc->GetNumberPCTerms() << endl;
15 
16 
17  pc->SetTaylorTolerance(1.e-15);
18  return pc;
19 }
template<int ORDER, int DIM>
PC<ORDER,DIM> fabs ( const PC< ORDER, DIM > &  a)

Definition at line 339 of file PC.h.

References PC< ORDER, DIM >::_data, and PC< ORDER, DIM >::fabs().

340 {
341  PC<ORDER,DIM> x(a);
342  x._data[0]=fabs(a._data[0]);
343  return x;
344 }
Definition: PC.h:61
PC< ORDER, DIM > fabs(const PC< ORDER, DIM > &a)
Definition: PC.h:339
double _data[N]
Definition: PC.h:293
template<int ORDER, int DIM>
PC<ORDER,DIM> operator+ ( const PC< ORDER, DIM > &  a)

Definition at line 326 of file PC.h.

327 {
328  return a;
329 }
template<int ORDER, int DIM>
PC<ORDER,DIM> operator- ( const PC< ORDER, DIM > &  a)

Definition at line 332 of file PC.h.

333 {
334  PC<ORDER,DIM> z;
335  return z-a;
336 }
Definition: PC.h:61
template<int ORDER, int DIM>
ostream& operator<< ( ostream &  os,
const PC< ORDER, DIM > &  a 
)
inline

Definition at line 347 of file PC.h.

References PC< ORDER, DIM >::print().

348 {
349  a.print(os);
350  return os;
351 }
void print(ostream &os) const
Definition: PC.h:210
PC_BINARY_OP ( operator+  ,
 
)
PC_BINARY_OP ( operator-  ,
 
)
PC_BINARY_OP ( operator*  ,
 
)
PC_BINARY_OP ( operator/  ,
 
)
template<int ORDER, int DIM>
PC<ORDER,DIM> sqrt ( const PC< ORDER, DIM > &  a)

Definition at line 355 of file PC.h.

References PC< ORDER, DIM >::_data.

356 {
357  PC<ORDER,DIM> r;
358  PC<ORDER,DIM>::_pcSet->RPow(a._data,r._data,0.5);
359  return r;
360 }
Definition: PC.h:61
double _data[N]
Definition: PC.h:293
template<int ORDER, int DIM>
double stdDev ( const PC< ORDER, DIM > &  a)

Definition at line 363 of file PC.h.

References PC< ORDER, DIM >::_data.

Referenced by main().

364 {
365  return PC<ORDER,DIM>::_pcSet->StDv(a._data);
366 }
Definition: PC.h:61
double _data[N]
Definition: PC.h:293