27 const short_t dim = m_boundary.dim();
56 GISMO_STATIC_ASSERT(d==2,
"gsCrossApPatch<T>::compute_impl only works for d=2 dimensions.");
62 this->preparePatch(resultBasis, coefs);
67 if ( (sz.array() < 3).all() )
69 gsWarn<<
"There where no interior control points.\n";
74 gsMatrix<T> tmp0(sz[0],2), tmp1(sz[1],2), tmp;
75 gsMatrix<T,d,d> cross;
77 for (
index_t i = 0; i!=coefs.cols(); ++i)
79 tmp0.col(0) = m_boundary[0].coefs().col(i);
80 tmp0.col(1) = m_boundary[1].coefs().col(i);
81 tmp1.col(0) = m_boundary[2].coefs().col(i);
82 tmp1.col(1) = m_boundary[3].coefs().col(i);
83 cross(0,0) = tmp0(0 ,0);
84 cross(1,0) = tmp0(sz[0]-1,0);
85 cross(0,1) = tmp0(0 ,1);
86 cross(1,1) = tmp0(sz[0]-1,1);
88 if (
math::abs(cross.determinant()) < (T)(1e-11) )
90 gsWarn <<
"Corner data is rank-deficient ("<<i<<
")\n";
93 cross.colPivHouseholderQr().solve(gsMatrix<T,2,2>::Identity())
98 tmp = tmp0 * cross.inverse() * tmp1.transpose();
Abstract base class representing a geometry map.
Definition: gsGeometry.h:92
#define short_t
Definition: gsConfig.h:35
S give(S &x)
Definition: gsMemory.h:266
#define index_t
Definition: gsConfig.h:32
void size_cwise(gsVector< index_t, s > &result) const
The number of basis functions in the direction of the k-th parameter component.
Definition: gsTensorBasis.h:441
A tensor product B-spline basis.
Definition: gsTensorBSplineBasis.h:36
#define gsWarn
Definition: gsDebug.h:50
virtual memory::unique_ptr< gsGeometry< T > > makeGeometry(gsMatrix< T > coefs) const =0
Create a gsGeometry of proper type for this basis with the given coefficient matrix.
const gsGeometry< T > & compute()
Main routine that performs the computation.
Definition: gsCrossApPatch.hpp:25
Represents a B-spline curve/function with one parameter.
Provides cross approximation parameterizations from boundary data.
Computes a parametrization based on low rank cross approximation, given a set of boundary geometries...
Definition: gsCrossApPatch.h:26
#define GISMO_ERROR(message)
Definition: gsDebug.h:118
EIGEN_STRONG_INLINE abs_expr< E > abs(const E &u)
Absolute value.
Definition: gsExpressions.h:4488
gsAsVector< T, Dynamic > asVector()
Returns the entries of the matrix resized to a n*m vector column-wise.
Definition: gsMatrix.h:240
Provides iteration over integer or numeric points in a (hyper-)cube.
Provides declaration of TensorBSplineBasis abstract interface.