10 result.resize(1,m_p+1);
12 for(
int j = 0; j<=m_p;++j)
22 result.resize(m_p+1,u.cols());
52 result.resize(m_p+1,u.cols());
53 for (
int i=0;i<=m_p;++i)
56 evalSingle_into(i,u,res);
57 for(
int j=0;j<u.cols();++j)
67 result.resize(m_p+1,u.cols());
68 for (
int i=0;i<=m_p;++i)
71 derivSingle_into(i,u,res);
72 for(
int j=0;j<u.cols();++j)
82 result.resize(m_p+1,u.cols());
83 for(
int i=0;i<=m_p;i++)
86 deriv2Single_into(i,u,res);
87 for(
int j=0;j<u.cols();j++)
97 result.resize((n+1)*(m_p + 2),u.cols());
98 for (
int i=0;i<=m_p+1;++i)
101 evalAllDersSingle_into(i,u,n,res);
102 for(
int j=0;j<u.cols();++j)
104 for(
int k=0;k<n+1;k++)
106 result(i*(n+1)+k,j)=res(1,j);
115 result.resize(n+1, u.cols() );
117 for(
int order = 0;order<n+1;order++)
120 evalDerSingle_into(i,u,order,res);
121 for(
int j=0;j<u.cols();j++)
122 result(order,j)=res(0,j);
129 result.resize(1, u.cols() );
133 T fact = _getFactor(i);
134 std::vector<int> vec(m_p-n);
135 for(
int k = 0; k<=m_p-n-1;k++) vec[k]=k;
139 std::vector<real_t> mults(u.cols());
140 for(
int j=0;j<u.cols();j++)
143 for(
int k = 0; k<=m_p-n-1;k++)
146 if(index>=static_cast<int>(i))
148 mults[j]*=(u(0,j)-m_breaks[index]);
150 result(0,j)+=mults[j];
153 while(_nextPoint(vec, m_p));
154 for(
int j=0;j<u.cols();j++)
157 result(0,j)/=(fact/std::pow(2,n-1));
162 else if(n==this->degree())
164 T fact = _getFactor(i);
165 for(
int j=0;j<u.cols();j++)
168 result(0,j)=m_p*std::pow(2,n-1)/fact;
170 result(0,j)=m_p/fact;
175 for(
int j=0;j<u.cols();j++)
183 T old_length = m_end-m_start;
184 for(
unsigned i=0;i<m_breaks.size();i++)
186 m_breaks[i]=(m_breaks[i]-m_start)/old_length;
195 int basis_size = m_breaks.size();
196 result.resize(basis_size, basis_size);
198 for(
int i = 0; i < basis_size; i++)
200 T fact = _getFactor(i);
201 for(
int j = 0; j < basis_size-1; j++)
203 std::vector<int> vec(m_p-j);
204 for(
int k = 0; k<m_p-j;k++)
212 for(
int k = 0; k<m_p-j;k++)
217 prod*=m_breaks[index];
221 while(_nextPoint(vec,basis_size-1));
224 result(i,basis_size-1)=1;
226 for(
int j = basis_size-1; j >= 0; j--)
228 result(i,j) *= sign / fact;
232 result.transposeInPlace();
238 std::vector<T> breaks = m_breaks;
239 int basis_size = breaks.size();
240 result.resize(basis_size, basis_size);
242 int n=this->degree();
243 for(
int j = 0; j < basis_size; j++)
245 for(
int i = 0; i <= j; i++)
250 result.transposeInPlace();
256 int n=vec.size(), changed=-1, i = 0;
257 for(
int j = n-1 ; j>=0 ; j--)
268 for(
int j=changed;j<n-1;++j)
Z binomial(const Z n, const Z r)
Computes the binomial expansion coefficient binomial(n,r)
Definition: gsCombinatorics.h:69
void _getTransformationLagrangeMonomial(gsMatrix< T > &result) const
Definition: gsLagrangeBasis.hpp:193
void evalAllDers_into(const gsMatrix< T > &u, int n, gsMatrix< T > &result) const
Evaluate the nonzero basis functions and their derivatives up to order n at points u into result...
Definition: gsLagrangeBasis.hpp:95
bool _nextPoint(std::vector< int > &vec, int end) const
Definition: gsLagrangeBasis.hpp:254
#define index_t
Definition: gsConfig.h:32
void eval_into(const gsMatrix< T > &u, gsMatrix< T > &result) const
Evaluates the non-zero basis functions at value u.
Definition: gsLagrangeBasis.hpp:50
void active_into(const gsMatrix< T > &u, gsMatrix< index_t > &result) const
Returns the indices of active (non zero) basis functions at points (columns of) u, as a list of indices, in result.
Definition: gsLagrangeBasis.hpp:20
A vector with arbitrary coefficient type and fixed or dynamic size.
Definition: gsVector.h:35
void deriv_into(const gsMatrix< T > &u, gsMatrix< T > &result) const
Evaluates the (partial) derivatives of non-zero basis functions at (the columns of) u...
Definition: gsLagrangeBasis.hpp:65
void anchors_into(gsMatrix< T > &result) const
Returns the anchors (greville points) of the basis.
Definition: gsLagrangeBasis.hpp:8
Struct which represents a certain side of a box.
Definition: gsBoundary.h:84
gsMatrix< T > supportInterval(index_t dir) const
Returns an interval that contains the parameter values in direction \ dir.
Definition: gsLagrangeBasis.hpp:33
void evalDerSingle_into(index_t i, const gsMatrix< T > &u, int n, gsMatrix< T > &result) const
Evaluate the (partial) derivative(s) of order n the i-th basis function at points u into result...
Definition: gsLagrangeBasis.hpp:127
void deriv2_into(const gsMatrix< T > &u, gsMatrix< T > &result) const
Evaluates the (partial) derivatives of the nonzero basis functions at points u into result...
Definition: gsLagrangeBasis.hpp:80
void _getTransformationMonomialBezier(gsMatrix< T > &result) const
Definition: gsLagrangeBasis.hpp:236
A univariate Lagrange basis.
Definition: gsLagrangeBasis.h:16
void reparameterizeToZeroOne()
Changes the basis so the curve is defined in the interval [0,1].
Definition: gsLagrangeBasis.hpp:181
A basis represents a family of scalar basis functions defined over a common parameter domain...
Definition: gsBasis.h:78
void evalAllDersSingle_into(index_t i, const gsMatrix< T > &u, int n, gsMatrix< T > &result) const
Evaluate the basis function i and its derivatives up to order n at points u into result.
Definition: gsLagrangeBasis.hpp:113