29 #ifndef SCIMATH_SPARSEDIFF_H
30 #define SCIMATH_SPARSEDIFF_H
33 #include <casacore/casa/aips.h>
34 #include <casacore/scimath/Mathematics/AutoDiff.h>
35 #include <casacore/scimath/Mathematics/SparseDiffRep.h>
36 #include <casacore/casa/vector.h>
45 template <
class T>
class SparseDiff;
360 const vector<pair<uInt, T> > &
grad()
const {
return rep_p->grad_p; }
361 vector<pair<uInt, T> > &
grad() {
return rep_p->grad_p; }
368 return rep_p->grad_p[which]; }
393 #ifndef CASACORE_NO_AUTO_TEMPLATES
394 #include <casacore/scimath/Mathematics/SparseDiff.tcc>
static Bool ltSort(pair< uInt, T > &lhs, pair< uInt, T > &rhs)
Sort criterium.
void sort()
Sort derivative list; cater for doubles and zeroes.
SparseDiffRep< T > * theRep()
Returns the pointer to the structure of value and derivatives.
vector< pair< uInt, T > > & grad()
void operator*=(const SparseDiff< T > &other)
Assignment operators.
SparseDiff(const T &v, const uInt n)
A function f(x0,x1,...,xn,...) with a value of v.
SparseDiff(const T &v, const uInt n, const T &der)
A function f(x0,x1,...,xn,...) with a value of v.
void operator/=(const SparseDiff< T > &other)
uInt nDerivatives() const
Return total number of derivatives.
void operator+=(const SparseDiff< T > &other)
SparseDiff< T > & operator=(const pair< uInt, T > &der)
Assignment operator.
SparseDiff< T > & operator=(const SparseDiff< T > &other)
Assign one to another (deep copy)
void operator-=(const SparseDiff< T > &other)
pair< uInt, T > & derivative(uInt which)
Returns a specific derivative.
SparseDiff()
Construct a constant with a value of zero.
SparseDiff< T > & operator=(const T &v)
Assignment operator.
T & value()
Returns the value of the function.
SparseDiff(const AutoDiff< T > &other)
Construct from an AutoDiff.
SparseDiff< T > & operator=(const vector< pair< uInt, T > > &der)
Assignment operator.
void operator-=(const T other)
const value_type & const_reference
const vector< pair< uInt, T > > & grad() const
SparseDiffRep< T > * rep_p
Value representation.
const pair< uInt, T > & derivative(uInt which) const
SparseDiff< T > & operator=(const AutoDiff< T > &other)
Assign from an Autodiff.
vector< pair< uInt, T > > & derivatives() const
Returns a vector of the derivatives of a SparseDiff.
SparseDiff(const T &v)
Construct a constant with a value of v.
AutoDiff< T > toAutoDiff(uInt n) const
Convert to an AutoDiff of length n
Bool isConstant() const
Is it a constant, i.e., with zero derivatives?
SparseDiff(const SparseDiff< T > &other)
Construct one from another (deep copy)
void operator+=(const T other)
const SparseDiffRep< T > * theRep() const
void operator/=(const T other)
const value_type * const_iterator
void operator*=(const T other)
void derivatives(vector< pair< uInt, T > > &res) const
this file contains all the compiler specific defines
bool Bool
Define the standard types used by Casacore.