Jpp 19.3.0-rc.1
the software that should make you happy
Loading...
Searching...
No Matches
JMATH::JLegendre_t< JOrdinate_t > Struct Template Referenceabstract

Base class for Legendre polynome. More...

#include <JLegendre.hh>

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

Public Types

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

Public Member Functions

 JLegendre_t ()
 Default constructor.
 
 JLegendre_t (const double xmin, const double xmax)
 Constructor.
 
virtual ~JLegendre_t ()
 Virtual destructor.
 
virtual JOrdinate_t getValue (const double x) const =0
 Function value.
 
JOrdinate_t operator() (const double x) const
 Function value.
 
double getXmin () const
 Get minimal abscissa value.
 
double getXmax () const
 Get maximal abscissa value.
 
double getX (const double x) const
 Get normalised abscissa value.
 
void reset ()
 Reset.
 
void set (const double xmin, const double xmax)
 Set abscissa values.
 
template<class T >
void set (T __begin, T __end)
 Set abscissa values.
 

Protected Attributes

double xmin
 minimal abscissa
 
double xmax
 maximal abscissa
 

Friends

std::istream & operator>> (std::istream &in, JLegendre_t &object)
 Read Legendre polynome from input.
 
std::ostream & operator<< (std::ostream &out, const JLegendre_t &object)
 Write Legendre polynome to output.
 

Detailed Description

template<class JOrdinate_t>
struct JMATH::JLegendre_t< JOrdinate_t >

Base class for Legendre polynome.

Definition at line 26 of file JLegendre.hh.

Member Typedef Documentation

◆ const_iterator

template<class JOrdinate_t >
std::vector<JOrdinate_t>::const_iterator JMATH::JLegendre_t< JOrdinate_t >::const_iterator

Definition at line 29 of file JLegendre.hh.

◆ iterator

template<class JOrdinate_t >
std::vector<JOrdinate_t>::iterator JMATH::JLegendre_t< JOrdinate_t >::iterator

Definition at line 30 of file JLegendre.hh.

◆ const_reverse_iterator

template<class JOrdinate_t >
std::vector<JOrdinate_t>::const_reverse_iterator JMATH::JLegendre_t< JOrdinate_t >::const_reverse_iterator

Definition at line 31 of file JLegendre.hh.

◆ reverse_iterator

template<class JOrdinate_t >
std::vector<JOrdinate_t>::reverse_iterator JMATH::JLegendre_t< JOrdinate_t >::reverse_iterator

Definition at line 32 of file JLegendre.hh.

Constructor & Destructor Documentation

◆ JLegendre_t() [1/2]

template<class JOrdinate_t >
JMATH::JLegendre_t< JOrdinate_t >::JLegendre_t ( )
inline

Default constructor.

Definition at line 38 of file JLegendre.hh.

38 :
39 xmin(-1.0),
40 xmax(+1.0)
41 {}
double xmin
minimal abscissa
Definition JLegendre.hh:204
double xmax
maximal abscissa
Definition JLegendre.hh:205

◆ JLegendre_t() [2/2]

template<class JOrdinate_t >
JMATH::JLegendre_t< JOrdinate_t >::JLegendre_t ( const double xmin,
const double xmax )
inline

Constructor.

Parameters
xminminimal abscissa value
xmaxmaximal abscissa value

Definition at line 50 of file JLegendre.hh.

51 :
52 xmin(xmin),
53 xmax(xmax)
54 {}

◆ ~JLegendre_t()

template<class JOrdinate_t >
virtual JMATH::JLegendre_t< JOrdinate_t >::~JLegendre_t ( )
inlinevirtual

Virtual destructor.

Definition at line 60 of file JLegendre.hh.

61 {}

Member Function Documentation

◆ getValue()

template<class JOrdinate_t >
virtual JOrdinate_t JMATH::JLegendre_t< JOrdinate_t >::getValue ( const double x) const
pure virtual

Function value.

Parameters
xabscissa value
Returns
function value

Implemented in JMATH::JLegendre< JOrdinate_t,(size_t) -1 >, and JMATH::JLegendre< JQuaternion3D,(size_t) -1 >.

◆ operator()()

template<class JOrdinate_t >
JOrdinate_t JMATH::JLegendre_t< JOrdinate_t >::operator() ( const double x) const
inline

Function value.

Parameters
xabscissa value
Returns
function value

Definition at line 79 of file JLegendre.hh.

80 {
81 return this->getValue(x);
82 }
virtual JOrdinate_t getValue(const double x) const =0
Function value.

◆ getXmin()

template<class JOrdinate_t >
double JMATH::JLegendre_t< JOrdinate_t >::getXmin ( ) const
inline

Get minimal abscissa value.

Returns
minimal abscissa value

Definition at line 90 of file JLegendre.hh.

91 {
92 return xmin;
93 }

◆ getXmax()

template<class JOrdinate_t >
double JMATH::JLegendre_t< JOrdinate_t >::getXmax ( ) const
inline

Get maximal abscissa value.

Returns
maximal abscissa value

Definition at line 101 of file JLegendre.hh.

102 {
103 return xmax;
104 }

◆ getX()

template<class JOrdinate_t >
double JMATH::JLegendre_t< JOrdinate_t >::getX ( const double x) const
inline

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 }

◆ reset()

template<class JOrdinate_t >
void JMATH::JLegendre_t< JOrdinate_t >::reset ( )
inline

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< JOrdinate_t >::iterator iterator
Definition JLegendre.hh:30

◆ set() [1/2]

template<class JOrdinate_t >
void JMATH::JLegendre_t< JOrdinate_t >::set ( const double xmin,
const double xmax )
inline

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 }

◆ set() [2/2]

template<class JOrdinate_t >
template<class T >
void JMATH::JLegendre_t< JOrdinate_t >::set ( T __begin,
T __end )
inline

Set abscissa values.

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

  • double first; // which conforms with std::pair.
Parameters
__beginbegin of data
__endend of data

Definition at line 155 of file JLegendre.hh.

156 {
157 this->xmin = std::numeric_limits<double>::max();
158 this->xmax = std::numeric_limits<double>::lowest();
159
160 for (T i = __begin; i != __end; ++i) {
161 if (i->first < this->xmin) { this->xmin = i->first; }
162 if (i->first > this->xmax) { this->xmax = i->first; }
163 }
164 }

Friends And Related Symbol Documentation

◆ operator>>

template<class JOrdinate_t >
std::istream & operator>> ( std::istream & in,
JLegendre_t< JOrdinate_t > & object )
friend

Read Legendre polynome from input.

Parameters
ininput stream
objectLegendre polynome
Returns
input stream

Definition at line 174 of file JLegendre.hh.

175 {
176 object.clear();
177
178 for (JOrdinate_t x; in >> x; ) {
179 object.push_back(x);
180 }
181
182 return in;
183 }

◆ operator<<

template<class JOrdinate_t >
std::ostream & operator<< ( std::ostream & out,
const JLegendre_t< JOrdinate_t > & object )
friend

Write Legendre polynome to output.

Parameters
outoutput stream
objectLegendre polynome
Returns
output stream

Definition at line 193 of file JLegendre.hh.

194 {
195 for (typename JLegendre_t::const_iterator i = object.begin(); i != object.end(); ++i) {
196 out << ' ' << *i;
197 }
198
199 return out;
200 }
std::vector< JOrdinate_t >::const_iterator const_iterator
Definition JLegendre.hh:29

Member Data Documentation

◆ xmin

template<class JOrdinate_t >
double JMATH::JLegendre_t< JOrdinate_t >::xmin
protected

minimal abscissa

Definition at line 204 of file JLegendre.hh.

◆ xmax

template<class JOrdinate_t >
double JMATH::JLegendre_t< JOrdinate_t >::xmax
protected

maximal abscissa

Definition at line 205 of file JLegendre.hh.


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