OPAL (Object Oriented Parallel Accelerator Library) 2022.1
OPAL
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
LinearFun< T, N > Class Template Reference

Linear function in N variables of type T. More...

#include <LinearFun.h>

Public Member Functions

 LinearFun ()
 Default constructor. More...
 
 LinearFun (const T &)
 Conversion. More...
 
 LinearFun (int)
 Conversion. More...
 
LinearFunoperator= (const T &y)
 Convert and assign. More...
 
const T getCoefficient (int index) const
 Get coefficient. More...
 
void setCoefficient (int index, const T &value)
 Set coefficient. More...
 
const T operator[] (int index) const
 Get coefficient. More...
 
T & operator[] (int index)
 Get coefficient. More...
 
LinearFun operator+ () const
 Unary plus. More...
 
LinearFun operator- () const
 Unary minus. More...
 
LinearFunoperator+= (const LinearFun &y)
 Add and assign. More...
 
LinearFunoperator-= (const LinearFun &y)
 Subtract and assign. More...
 
LinearFunoperator*= (const LinearFun &y)
 Multiply and assign. More...
 
LinearFunoperator/= (const LinearFun &y)
 Approximate division and assignation. More...
 
LinearFunoperator+= (const T &y)
 Add constant and assign. More...
 
LinearFunoperator-= (const T &y)
 Subtract constant and assign. More...
 
LinearFunoperator*= (const T &y)
 Multiply by constant and assign. More...
 
LinearFunoperator/= (const T &y)
 Divide by constant and assign. More...
 
bool operator== (const LinearFun &y) const
 Equality operator. More...
 
bool operator== (const T &y) const
 Equality with constant. More...
 
bool operator!= (const LinearFun &y) const
 Inequality operator. More...
 
bool operator!= (const T &y) const
 Inequality with constant. More...
 
LinearFun inverse () const
 Approximate reciprocal value 1/(*this). More...
 
LinearFun multiply (const LinearFun &y) const
 Multiplication truncated to order one. More...
 
evaluate (const FVector< T, N > &) const
 Evaluate LinearFun at point. More...
 
LinearFun< T, N > substitute (const LinearMap< T, N > &m) const
 Substitute. More...
 
LinearFun< T, N > substitute (const FMatrix< T, N, N > &M) const
 Substitute. More...
 
LinearFun taylor (const T series[2]) const
 Taylor series. More...
 
std::istream & get (std::istream &is)
 Read LinearFun on the stream [b]is[/b]. More...
 
std::ostream & put (std::ostream &os) const
 Write LinearFun on the stream [b]os[/b]. More...
 

Static Public Member Functions

static LinearFun makeVariable (int var)
 Make variable. More...
 

Private Attributes

data [N+1]
 Representation. More...
 

Detailed Description

template<class T, int N>
class LinearFun< T, N >

Linear function in N variables of type T.

Definition at line 39 of file LinearFun.h.

Constructor & Destructor Documentation

◆ LinearFun() [1/3]

template<class T , int N>
LinearFun< T, N >::LinearFun

Default constructor.

Definition at line 39 of file LinearFun.hpp.

◆ LinearFun() [2/3]

template<class T , int N>
LinearFun< T, N >::LinearFun ( const T &  rhs)

Conversion.

Definition at line 45 of file LinearFun.hpp.

◆ LinearFun() [3/3]

template<class T , int N>
LinearFun< T, N >::LinearFun ( int  rhs)

Conversion.

Definition at line 52 of file LinearFun.hpp.

References Attrib::Legacy::Distribution::T.

Member Function Documentation

◆ evaluate()

template<class T , int N>
T LinearFun< T, N >::evaluate ( const FVector< T, N > &  rhs) const

Evaluate LinearFun at point.

Definition at line 239 of file LinearFun.hpp.

References Attrib::Legacy::Distribution::T.

◆ get()

template<class T , int N>
std::istream & LinearFun< T, N >::get ( std::istream &  is)

Read LinearFun on the stream [b]is[/b].

Definition at line 290 of file LinearFun.hpp.

References LinearFun< T, N >::data, and Attrib::Legacy::Distribution::T.

Referenced by operator>>().

◆ getCoefficient()

template<class T , int N>
const T LinearFun< T, N >::getCoefficient ( int  index) const

Get coefficient.

Definition at line 67 of file LinearFun.hpp.

References Attrib::Legacy::Distribution::T.

◆ inverse()

template<class T , int N>
LinearFun< T, N > LinearFun< T, N >::inverse

Approximate reciprocal value 1/(*this).

Definition at line 211 of file LinearFun.hpp.

References LinearFun< T, N >::data, and Attrib::Legacy::Distribution::T.

Referenced by operator/(), and LinearMap< T, N >::operator/=().

◆ makeVariable()

template<class T , int N>
LinearFun< T, N > LinearFun< T, N >::makeVariable ( int  var)
static

Make variable.

Definition at line 91 of file LinearFun.hpp.

References LinearFun< T, N >::data, and Attrib::Legacy::Distribution::T.

◆ multiply()

template<class T , int N>
LinearFun< T, N > LinearFun< T, N >::multiply ( const LinearFun< T, N > &  y) const

Multiplication truncated to order one.

Definition at line 226 of file LinearFun.hpp.

References LinearFun< T, N >::data.

Referenced by operator*(), and operator/().

◆ operator!=() [1/2]

template<class T , int N>
bool LinearFun< T, N >::operator!= ( const LinearFun< T, N > &  y) const
inline

Inequality operator.

Definition at line 199 of file LinearFun.hpp.

◆ operator!=() [2/2]

template<class T , int N>
bool LinearFun< T, N >::operator!= ( const T &  y) const
inline

Inequality with constant.

Definition at line 205 of file LinearFun.hpp.

◆ operator*=() [1/2]

template<class T , int N>
LinearFun< T, N > & LinearFun< T, N >::operator*= ( const LinearFun< T, N > &  y)

Multiply and assign.

Definition at line 128 of file LinearFun.hpp.

◆ operator*=() [2/2]

template<class T , int N>
LinearFun< T, N > & LinearFun< T, N >::operator*= ( const T &  y)

Multiply by constant and assign.

Definition at line 162 of file LinearFun.hpp.

◆ operator+()

template<class T , int N>
LinearFun< T, N > LinearFun< T, N >::operator+
inline

Unary plus.

Definition at line 100 of file LinearFun.hpp.

◆ operator+=() [1/2]

template<class T , int N>
LinearFun< T, N > & LinearFun< T, N >::operator+= ( const LinearFun< T, N > &  y)

Add and assign.

Definition at line 114 of file LinearFun.hpp.

References LinearFun< T, N >::data.

◆ operator+=() [2/2]

template<class T , int N>
LinearFun< T, N > & LinearFun< T, N >::operator+= ( const T &  y)
inline

Add constant and assign.

Definition at line 148 of file LinearFun.hpp.

◆ operator-()

template<class T , int N>
LinearFun< T, N > LinearFun< T, N >::operator-

Unary minus.

Definition at line 106 of file LinearFun.hpp.

References LinearFun< T, N >::data.

◆ operator-=() [1/2]

template<class T , int N>
LinearFun< T, N > & LinearFun< T, N >::operator-= ( const LinearFun< T, N > &  y)

Subtract and assign.

Definition at line 121 of file LinearFun.hpp.

References LinearFun< T, N >::data.

◆ operator-=() [2/2]

template<class T , int N>
LinearFun< T, N > & LinearFun< T, N >::operator-= ( const T &  y)
inline

Subtract constant and assign.

Definition at line 155 of file LinearFun.hpp.

◆ operator/=() [1/2]

template<class T , int N>
LinearFun< T, N > & LinearFun< T, N >::operator/= ( const LinearFun< T, N > &  y)

Approximate division and assignation.

Definition at line 134 of file LinearFun.hpp.

References LinearFun< T, N >::data, and Attrib::Legacy::Distribution::T.

◆ operator/=() [2/2]

template<class T , int N>
LinearFun< T, N > & LinearFun< T, N >::operator/= ( const T &  y)

Divide by constant and assign.

Definition at line 169 of file LinearFun.hpp.

References Attrib::Legacy::Distribution::T.

◆ operator=()

template<class T , int N>
LinearFun< T, N > & LinearFun< T, N >::operator= ( const T &  y)

Convert and assign.

Definition at line 59 of file LinearFun.hpp.

◆ operator==() [1/2]

template<class T , int N>
bool LinearFun< T, N >::operator== ( const LinearFun< T, N > &  y) const

Equality operator.

Definition at line 177 of file LinearFun.hpp.

References LinearFun< T, N >::data.

◆ operator==() [2/2]

template<class T , int N>
bool LinearFun< T, N >::operator== ( const T &  y) const

Equality with constant.

Definition at line 187 of file LinearFun.hpp.

References Attrib::Legacy::Distribution::T.

◆ operator[]() [1/2]

template<class T , int N>
T & LinearFun< T, N >::operator[] ( int  index)
inline

Get coefficient.

Definition at line 85 of file LinearFun.hpp.

◆ operator[]() [2/2]

template<class T , int N>
const T LinearFun< T, N >::operator[] ( int  index) const
inline

Get coefficient.

Definition at line 79 of file LinearFun.hpp.

◆ put()

template<class T , int N>
std::ostream & LinearFun< T, N >::put ( std::ostream &  os) const

Write LinearFun on the stream [b]os[/b].

Definition at line 343 of file LinearFun.hpp.

References endl(), Inform::precision(), Inform::setf(), and Attrib::Legacy::Distribution::T.

Referenced by operator<<().

Here is the call graph for this function:

◆ setCoefficient()

template<class T , int N>
void LinearFun< T, N >::setCoefficient ( int  index,
const T &  value 
)

Set coefficient.

Definition at line 73 of file LinearFun.hpp.

◆ substitute() [1/2]

template<class T , int N>
LinearFun< T, N > LinearFun< T, N >::substitute ( const FMatrix< T, N, N > &  M) const

Substitute.

Definition at line 247 of file LinearFun.hpp.

References LinearFun< T, N >::data.

◆ substitute() [2/2]

template<class T , int N>
LinearFun< T, N > LinearFun< T, N >::substitute ( const LinearMap< T, N > &  m) const

Substitute.

Definition at line 262 of file LinearFun.hpp.

References LinearFun< T, N >::data.

◆ taylor()

template<class T , int N>
LinearFun< T, N > LinearFun< T, N >::taylor ( const T  series[2]) const

Taylor series.

Definition at line 277 of file LinearFun.hpp.

References LinearFun< T, N >::data.

Member Data Documentation

◆ data

template<class T , int N>
T LinearFun< T, N >::data[N+1]
private

The documentation for this class was generated from the following files: