1 #ifndef _FMATVEC_FUNCTION_H_
2 #define _FMATVEC_FUNCTION_H_
4 #include <fmatvec/fmatvec.h>
5 #include <fmatvec/atom.h>
31 template<
typename Shape>
37 template<
typename Shape>
43 template<
typename Type,
typename RowShape,
typename ColShape>
55 enum { size1=0, size2=0 };
61 enum { size1=1, size2=1 };
65 template<
typename Shape,
typename AT>
67 enum { size1=0, size2=1 };
71 template<
typename Shape,
typename AT>
73 enum { size1=1, size2=0 };
77 template<
int N,
typename AT>
79 enum { size1=N, size2=1 };
83 template<
int N,
typename AT>
85 enum { size1=1, size2=N };
89 template<
typename Storage,
int N,
int M,
typename AT>
91 enum { size1=N, size2=M };
95 template<
typename Storage,
int N,
typename ColShape,
typename AT>
97 enum { size1=N, size2=0 };
101 template<
typename Storage,
typename RowShape,
int M,
typename AT>
103 enum { size1=0, size2=M };
110 template<
typename Dep,
typename Indep>
118 template<
typename Dep>
128 template<
typename IndepVecShape>
138 template<
typename DepVecShape,
typename IndepVecShape>
153 template<
typename DepMatShape>
172 template<
typename DepMatShape,
typename IndepVecShape>
187 template<
typename Sig>
191 template<
typename Ret,
typename Arg>
198 throw std::runtime_error(
"getArgSize must be overloaded by derived class.");
202 virtual Ret operator()(
const Arg &arg)=0;
206 throw std::runtime_error(
"parDer must be overloaded by derived class.");
210 virtual Ret
dirDer(
const Arg &argDir,
const Arg &arg) {
211 throw std::runtime_error(
"dirDer must be overloaded by derived class.");
216 throw std::runtime_error(
"parDerParDer must be overloaded by derived class.");
221 throw std::runtime_error(
"parDerDirDer must be overloaded by derived class.");
230 template<
typename Ret,
typename Arg1,
typename Arg2>
237 throw std::runtime_error(
"getArg1Size must be overloaded by derived class.");
241 throw std::runtime_error(
"getArg2Size must be overloaded by derived class.");
245 virtual Ret operator()(
const Arg1 &arg1,
const Arg2 &arg2)=0;
249 throw std::runtime_error(
"parDer1 must be overloaded by derived class.");
253 virtual Ret
dirDer1(
const Arg1 &arg1Dir,
const Arg1 &arg1,
const Arg2 &arg2) {
254 throw std::runtime_error(
"dirDer1 must be overloaded by derived class.");
259 throw std::runtime_error(
"parDer2 must be overloaded by derived class.");
263 virtual Ret
dirDer2(
const Arg2 &arg2Dir,
const Arg1 &arg1,
const Arg2 &arg2) {
264 throw std::runtime_error(
"dirDer2 must be overloaded by derived class.");
269 throw std::runtime_error(
"parDer1ParDer1 must be overloaded by derived class.");
274 throw std::runtime_error(
"parDer1DirDer1 must be overloaded by derived class.");
279 throw std::runtime_error(
"parDer2ParDer2 must be overloaded by derived class.");
284 throw std::runtime_error(
"parDer2DirDer2 must be overloaded by derived class.");
289 throw std::runtime_error(
"parDer1ParDer2 must be overloaded by derived class.");
294 throw std::runtime_error(
"parDer1DirDer2 must be overloaded by derived class.");
299 throw std::runtime_error(
"parDer2ParDer1 must be overloaded by derived class.");
304 throw std::runtime_error(
"parDer2DirDer1 must be overloaded by derived class.");
virtual Der< Ret, Arg1 >::type parDer1(const Arg1 &arg1, const Arg2 &arg2)
First derivative: partial derivative of the function value with respect to the first argument...
Definition: function.h:248
virtual Size< Arg >::type getArgSize() const
Return the size of first argument.
Definition: function.h:197
This is the basic matrix class for arbitrary matrices.
Definition: matrix.h:56
virtual Der< typename Der< Ret, Arg1 >::type, Arg1 >::type parDer1ParDer1(const Arg1 &arg1, const Arg2 &arg2)
Second derivative: partial derivative of parDer1 with respect to the first argument.
Definition: function.h:268
virtual Der< typename Der< Ret, Arg2 >::type, Arg1 >::type parDer2ParDer1(const Arg1 &arg1, const Arg2 &arg2)
Second mixed derivative: partial derivative of parDer2 with respect to the first argument.
Definition: function.h:298
virtual Der< Ret, Arg2 >::type parDer2DirDer1(const Arg1 &arg1Dir, const Arg1 &arg1, const Arg2 &arg2)
Second mixed derivative: directional derivative of parDer2 with respect to the first argument...
Definition: function.h:303
virtual Der< Ret, Arg >::type parDerDirDer(const Arg &argDir, const Arg &arg)
Second derivative: directional derivative of parDer with respect to the argument. ...
Definition: function.h:220
virtual Der< Ret, Arg2 >::type parDer2DirDer2(const Arg2 &arg2Dir, const Arg1 &arg1, const Arg2 &arg2)
Second derivative: directional derivative of parDer2 with respect to the first argument.
Definition: function.h:283
virtual Ret dirDer(const Arg &argDir, const Arg &arg)
First derivative: directional derivative of the function value with respect to the argument...
Definition: function.h:210
Shape class for rotation matrices.
Definition: types.h:124
Definition: function.h:188
Definition: function.h:13
Definition: function.h:111
virtual Der< Ret, Arg1 >::type parDer1DirDer2(const Arg2 &arg2Dir, const Arg1 &arg1, const Arg2 &arg2)
Second mixed derivative: directional derivative of parDer1 with respect to the second argument...
Definition: function.h:293
virtual Ret dirDer2(const Arg2 &arg2Dir, const Arg1 &arg1, const Arg2 &arg2)
First derivative: directional derivative of the function value with respect to the second argument...
Definition: function.h:263
virtual Size< Arg2 >::type getArg2Size() const
Return the size of first argument.
Definition: function.h:240
virtual Der< typename Der< Ret, Arg2 >::type, Arg2 >::type parDer2ParDer2(const Arg1 &arg1, const Arg2 &arg2)
Second derivative: partial derivative of parDer2 with respect to the first argument.
Definition: function.h:278
virtual bool constParDer() const
Returns true, if the partial derivative of the function value with respect to the argument...
Definition: function.h:226
virtual Ret dirDer1(const Arg1 &arg1Dir, const Arg1 &arg1, const Arg2 &arg2)
First derivative: directional derivative of the function value with respect to the first argument...
Definition: function.h:253
virtual Der< typename Der< Ret, Arg1 >::type, Arg2 >::type parDer1ParDer2(const Arg1 &arg1, const Arg2 &arg2)
Second mixed derivative: partial derivative of parDer1 with respect to the second argument...
Definition: function.h:288
virtual Der< Ret, Arg2 >::type parDer2(const Arg1 &arg1, const Arg2 &arg2)
First derivative: partial derivative of the function value with respect to the second argument...
Definition: function.h:258
virtual Size< Arg1 >::type getArg1Size() const
Return the size of first argument.
Definition: function.h:236
virtual bool constParDer2() const
Returns true, if the partial derivative of the function value with respect to the second argument...
Definition: function.h:313
virtual Der< Ret, Arg1 >::type parDer1DirDer1(const Arg1 &arg1Dir, const Arg1 &arg1, const Arg2 &arg2)
Second derivative: directional derivative of parDer1 with respect to the first argument.
Definition: function.h:273
virtual Der< Ret, Arg >::type parDer(const Arg &arg)
First derivative: partial derivative of the function value with respect to the argument.
Definition: function.h:205
virtual Der< typename Der< Ret, Arg >::type, Arg >::type parDerParDer(const Arg &arg)
Second derivative: partial derivative of parDer with respect to the argument.
Definition: function.h:215
Definition: function.h:54
Definition: function.h:20
virtual bool constParDer1() const
Returns true, if the partial derivative of the function value with respect to the first argument...
Definition: function.h:309