24 "The two boxes must be subset of Rn for the same n (same number of rows)");
26 "The two boxes must be described by the lower and upper corner, the matrices must have two columns");
28 const index_t dim = box1.rows();
29 const gsVector<T> size1 = box1.col(1) - box1.col(0);
30 const gsVector<T> size2 = box2.col(1) - box2.col(0);
31 m_mat.setZero(dim,dim);
35 const T ratio = size1[i]==0 ? (T)(1) : size2(dir[i])/size1[i];
36 m_mat(dir(i),i) = o[i] ? ratio : -ratio;
37 m_trans(dir(i)) = o[i] ? box2(dir[i],0) : box2(dir[i],1);
39 m_trans -= m_mat * box1.col(0);
45 : m_mat(mat), m_trans(trans)
48 "Incompatible linear map and translation in affine map");
66 result = (m_mat*u).colwise()+m_trans;
67 for (
index_t k=0; k!=result.rows(); k++)
68 result.row(k) = result.row(k).cwiseMax(m_box2(k,0)).cwiseMin(m_box2(k,1));
78 result=temp.row(comp);
84 result.resize(m_mat.rows()* m_mat.cols(), u.cols());
89 for (
index_t col=0;col<m_mat.cols();++col)
91 result.block(m_mat.rows()*col,0,m_mat.rows(),1)=m_mat.col(col);
93 for (
index_t col=1; col<result.cols();++col)
95 result.col(col)=result.col(0);
102 const index_t rows = domainDim()*domainDim()*targetDim();
103 result.setZero(rows,u.cols());
#define short_t
Definition: gsConfig.h:35
#define index_t
Definition: gsConfig.h:32
#define GISMO_ASSERT(cond, message)
Definition: gsDebug.h:89
virtual short_t targetDim() const
Dimension of the target space.
Definition: gsAffineFunction.hpp:58
virtual void deriv_into(const gsMatrix< T > &u, gsMatrix< T > &result) const
Evaluate derivatives of the function at points u into result.
Definition: gsAffineFunction.hpp:82
virtual void deriv2_into(const gsMatrix< T > &u, gsMatrix< T > &result) const
Evaluate second derivatives of the function at points u into result.
Definition: gsAffineFunction.hpp:100
virtual void eval_component_into(const gsMatrix< T > &u, const index_t comp, gsMatrix< T > &result) const
Evaluate the function for component comp in the target dimension at points u into result...
Definition: gsAffineFunction.hpp:72
gsAffineFunction(const gsAffineFunction &other)
copy constructor
Definition: gsAffineFunction.h:45
virtual short_t domainDim() const
Dimension of the (source) domain.
Definition: gsAffineFunction.hpp:52
virtual void eval_into(const gsMatrix< T > &u, gsMatrix< T > &result) const
Evaluate the function at points u into result.
Definition: gsAffineFunction.hpp:64