9 #include "gsLagrangeBasis.h"
26 class gsLagrangePoly :
public gsGeoTraits<1,T>::GeometryBase
30 typedef gsLagrangeBasis<T> Basis;
31 typedef typename gsGeoTraits<1,T>::GeometryBase Base;
34 typedef memory::shared_ptr< gsLagrangePoly >
Ptr;
37 typedef memory::unique_ptr< gsLagrangePoly >
uPtr;
53 "The coefficient matrix of the geometry (rows="<<this->
m_coefs.rows()<<
") does not match the number of basis functions in its basis("<< lagrange_basis->
size() <<
").");
62 T start = (*bezier_knots)[part];
63 T end = (*bezier_knots)[part+1];
66 const std::vector<T> * lagrange_breaks = lagrange_basis->
get_m_breaks();
68 for(
unsigned i = 0;i<lagrange_breaks->size();i++)
70 u(0,i)=start+(end-start)*lagrange_breaks->at(i);
72 bezier_curve.
eval_into(u,lagrange_coeffs);
76 "The coefficient matrix of the geometry (rows="<<this->
m_coefs.rows()<<
") does not match the number of basis functions in its basis("<< lagrange_basis->
size() <<
").");
87 std::ostream &
print(std::ostream &os)
const
89 os <<
"Lagrange curve of degree "<<
91 <<
" " <<
domainEnd() <<
"] with breaks ";
92 for (
typename std::vector<T>::const_iterator itr=
93 this->
basis().get_m_breaks()->begin(); itr != this->
basis().get_m_breaks()->end(); ++itr )
115 this->
basis().getTransformationLagrangeBezier(transformMat);
117 unsigned deg = this->
basis().degree();
125 this->
basis().reparameterizeToZeroOne();
gsMatrix< T > m_coefs
Coefficient matrix of size coefsSize() x geoDim()
Definition: gsGeometry.h:624
const std::vector< T > * get_m_breaks() const
Returns the breaks vector of this basis.
Definition: gsLagrangeBasis.h:325
T domainEnd() const
Returns the end value of the domain of the basis.
Definition: gsLagrangePoly.h:107
memory::shared_ptr< gsLagrangePoly > Ptr
Shared pointer for gsLagrangePoly.
Definition: gsLagrangePoly.h:34
gsBasis< T > * m_basis
Pointer to the basis of this geometry.
Definition: gsGeometry.h:627
short_t degree(short_t i) const
Degree with respect to the i-th variable. If the basis is a tensor product of (piecewise) polynomial ...
Definition: gsBSplineBasis.h:322
memory::unique_ptr< gsLagrangePoly > uPtr
Unique pointer for gsLagrangePoly.
Definition: gsLagrangePoly.h:37
S give(S &x)
Definition: gsMemory.h:266
Provides declaration of Geometry abstract interface.
#define GISMO_ASSERT(cond, message)
Definition: gsDebug.h:89
A B-spline function of one argument, with arbitrary target dimension.
Definition: gsBSpline.h:50
gsLagrangePoly(const Basis &basis, gsMatrix< T > coefs)
Construct B-Spline by basis and coefficient matrix.
Definition: gsLagrangePoly.h:43
A univariate B-spline basis.
Definition: gsBSplineBasis.h:694
The geometry class of a Lagrange Polyomial curve.
Definition: gsLagrangeBasis.h:17
GISMO_BASIS_ACCESSORS std::ostream & print(std::ostream &os) const
Prints the object as a string.
Definition: gsLagrangePoly.h:87
gsLagrangePoly()
Default empty constructor.
Definition: gsLagrangePoly.h:40
const KnotVectorType & knots(int i=0) const
Returns the knot vector of the basis.
Definition: gsBSplineBasis.h:369
gsLagrangePoly(const unsigned &p, const gsMatrix< T > &coefs, const T &u0=0, const T &u1=1)
Construct Lagrange curve by degree, coefficient matrix and domain.
Definition: gsLagrangePoly.h:47
Interface for the set of functions defined on a domain (the total number of functions in the set equa...
Definition: gsFuncData.h:23
gsBSpline< T > * transformToBezier()
Definition: gsLagrangePoly.h:112
gsLagrangePoly(const gsBSpline< T > &bezier_curve, int part)
Definition: gsLagrangePoly.h:58
T domainStart() const
Returns the starting value of the domain of the basis.
Definition: gsLagrangePoly.h:104
void reparameterizeToZeroOne()
reparameterize this curve to [0,1]
Definition: gsLagrangePoly.h:123
void eval_into(const gsMatrix< T > &u, gsMatrix< T > &result) const
Evaluate the function at points u into result.
Definition: gsGeometry.hpp:166
Class for representing a knot vector.
Definition: gsKnotVector.h:79
This is the main header file that collects wrappers of Eigen for linear algebra.
short_t size() const
Returns the number of basis functions in the basis.
Definition: gsLagrangeBasis.h:239
virtual const gsBasis< T > & basis() const =0
Returns a const reference to the basis of the geometry.
A univariate Lagrange basis.
Definition: gsLagrangeBasis.h:16
gsMatrix< T > & coefs()
Definition: gsGeometry.h:340