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();
101 coefs.col(i) = tmp.asVector();
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.
Computes a parametrization based on low rank cross approximation, given a set of boundary geometries.
Definition gsCrossApPatch.h:27
const gsGeometry< T > & compute()
Main routine that performs the computation.
Definition gsCrossApPatch.hpp:25
Abstract base class representing a geometry map.
Definition gsGeometry.h:93
A matrix with arbitrary coefficient type and fixed or dynamic size.
Definition gsMatrix.h:41
A tensor product B-spline basis.
Definition gsTensorBSplineBasis.h:37
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 vector with arbitrary coefficient type and fixed or dynamic size.
Definition gsVector.h:37
Represents a B-spline curve/function with one parameter.
#define short_t
Definition gsConfig.h:35
#define index_t
Definition gsConfig.h:32
Provides cross approximation parameterizations from boundary data.
#define GISMO_ERROR(message)
Definition gsDebug.h:118
#define gsWarn
Definition gsDebug.h:50
Provides iteration over integer or numeric points in a (hyper-)cube.
Provides declaration of TensorBSplineBasis abstract interface.
The G+Smo namespace, containing all definitions for the library.
S give(S &x)
Definition gsMemory.h:266