20 #ifndef _LINEAR_TRANSLATION_H_
21 #define _LINEAR_TRANSLATION_H_
23 #include "mbsim/functions/function.h"
31 typename B::DRetDArg A;
33 fmatvec::Vec3 zeros(
const typename B::DRetDArg &x) {
return fmatvec::Vec3(x.rows()); }
37 LinearTranslation(
const typename B::DRetDArg &A_,
const fmatvec::Vec3 &b_) : A(A_), b(b_) { }
38 int getArgSize()
const {
return A.cols(); }
39 fmatvec::Vec3 operator()(
const Arg &arg) {
return A*arg+b; }
40 typename B::DRetDArg parDer(
const Arg &arg) {
return A; }
41 typename B::DRetDArg parDerDirDer(
const Arg &arg1Dir,
const Arg &arg1) {
return typename B::DRetDArg(A.rows(),A.cols()); }
42 typename B::DDRetDDArg parDerParDer(
const double &arg) { THROW_MBSIMERROR(
"parDerParDer is not available for given template parameters."); }
43 bool constParDer()
const {
return true; }
44 void initializeUsingXML(xercesc::DOMElement *element) {
45 xercesc::DOMElement *e=MBXMLUtils::E(element)->getFirstElementChildNamed(MBSIM%
"translationVectors");
47 e=MBXMLUtils::E(element)->getFirstElementChildNamed(MBSIM%
"offset");
50 void setSlope(
const typename B::DRetDArg &A_) { A = A_; }
51 void setIntercept(
const fmatvec::Vec3 &b_) { b = b_; }
57 inline fmatvec::Vec3 LinearTranslation<double>::parDerParDer(
const double &arg) {
return fmatvec::Vec3(); }
Definition: planar_contour.h:31
Definition: linear_translation.h:28