OPAL (Object Oriented Parallel Accelerator Library) 2022.1
OPAL
|
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... | |
LinearFun & | operator= (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... | |
LinearFun & | operator+= (const LinearFun &y) |
Add and assign. More... | |
LinearFun & | operator-= (const LinearFun &y) |
Subtract and assign. More... | |
LinearFun & | operator*= (const LinearFun &y) |
Multiply and assign. More... | |
LinearFun & | operator/= (const LinearFun &y) |
Approximate division and assignation. More... | |
LinearFun & | operator+= (const T &y) |
Add constant and assign. More... | |
LinearFun & | operator-= (const T &y) |
Subtract constant and assign. More... | |
LinearFun & | operator*= (const T &y) |
Multiply by constant and assign. More... | |
LinearFun & | operator/= (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... | |
T | 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 | |
T | data [N+1] |
Representation. More... | |
Linear function in N variables of type T.
Definition at line 39 of file LinearFun.h.
LinearFun< T, N >::LinearFun |
Default constructor.
Definition at line 39 of file LinearFun.hpp.
LinearFun< T, N >::LinearFun | ( | const T & | rhs | ) |
Conversion.
Definition at line 45 of file LinearFun.hpp.
LinearFun< T, N >::LinearFun | ( | int | rhs | ) |
Conversion.
Definition at line 52 of file LinearFun.hpp.
References Attrib::Legacy::Distribution::T.
Evaluate LinearFun at point.
Definition at line 239 of file LinearFun.hpp.
References Attrib::Legacy::Distribution::T.
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>>().
const T LinearFun< T, N >::getCoefficient | ( | int | index | ) | const |
Get coefficient.
Definition at line 67 of file LinearFun.hpp.
References Attrib::Legacy::Distribution::T.
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/=().
Make variable.
Definition at line 91 of file LinearFun.hpp.
References LinearFun< T, N >::data, and Attrib::Legacy::Distribution::T.
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/().
|
inline |
Inequality operator.
Definition at line 199 of file LinearFun.hpp.
|
inline |
Inequality with constant.
Definition at line 205 of file LinearFun.hpp.
LinearFun< T, N > & LinearFun< T, N >::operator*= | ( | const LinearFun< T, N > & | y | ) |
Multiply and assign.
Definition at line 128 of file LinearFun.hpp.
Multiply by constant and assign.
Definition at line 162 of file LinearFun.hpp.
Unary plus.
Definition at line 100 of file LinearFun.hpp.
Add constant and assign.
Definition at line 148 of file LinearFun.hpp.
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.
Subtract constant and assign.
Definition at line 155 of file LinearFun.hpp.
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.
Divide by constant and assign.
Definition at line 169 of file LinearFun.hpp.
References Attrib::Legacy::Distribution::T.
Convert and assign.
Definition at line 59 of file LinearFun.hpp.
Equality operator.
Definition at line 177 of file LinearFun.hpp.
References LinearFun< T, N >::data.
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.
|
inline |
Get coefficient.
Definition at line 85 of file LinearFun.hpp.
|
inline |
Get coefficient.
Definition at line 79 of file LinearFun.hpp.
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<<().
void LinearFun< T, N >::setCoefficient | ( | int | index, |
const T & | value | ||
) |
Set coefficient.
Definition at line 73 of file LinearFun.hpp.
|
private |
Representation.
Definition at line 164 of file LinearFun.h.
Referenced by LinearFun< T, N >::get(), LinearFun< T, N >::inverse(), LinearFun< T, N >::makeVariable(), LinearFun< T, N >::multiply(), LinearFun< T, N >::operator+=(), LinearFun< T, N >::operator-(), LinearFun< T, N >::operator-=(), LinearFun< T, N >::operator/=(), LinearFun< T, N >::operator==(), LinearFun< T, N >::substitute(), and LinearFun< T, N >::taylor().