25 std::map<std::pair<int, int>,
int> coord2idx;
26 for(
int i = 0; i < szInc; ++i) {
27 int u =
static_cast<int>(
points(i, 0) *
order + .5);
28 int v =
static_cast<int>(
points(i, 1) *
order + .5);
29 coord2idx[std::make_pair(u, v)] = i;
34 for(
int i = 0; i < szComp - szInc; ++i) {
35 double xi = pts(szInc + i, 0);
36 double eta = pts(szInc + i, 1);
37 int u =
static_cast<int>(xi *
order + .5);
38 int v =
static_cast<int>(eta *
order + .5);
40 coefficients(i, coord2idx[std::make_pair(u + v, 0)]) = xi;
42 coefficients(i, coord2idx[std::make_pair(n - v, v)]) = xi;
43 coefficients(i, coord2idx[std::make_pair(u, n - u)]) = eta;
45 coefficients(i, coord2idx[std::make_pair(0, u + v)]) = eta;
46 coefficients(i, coord2idx[std::make_pair(0, v)]) = 1 - xi - eta;
47 coefficients(i, coord2idx[std::make_pair(0, 0)]) = -(1 - xi - eta);
48 coefficients(i, coord2idx[std::make_pair(u, 0)]) = 1 - xi - eta;
58 completeBasis(nullptr), polyBasis(nullptr)
88 for(
int i = 0; i < szInc; ++i) {
105 for(
int k = 0; k < sf.
size1(); ++k) {
106 for(
int i = 0; i < szInc; ++i) {
124 for(
int k = 0; k < dfm.
size1(); ++k) {
125 for(
int i = 0; i < szInc; ++i) {
140 double cgrads[1331][3];
143 for(
int i = 0; i < szInc; ++i) {
144 grads[i][0] = cgrads[i][0];
145 grads[i][1] = cgrads[i][1];
146 grads[i][2] = cgrads[i][2];
148 grads[i][0] = cgrads[szInc + j][0] *
coefficients(j, i);
149 grads[i][1] = cgrads[szInc + j][1] *
coefficients(j, i);
150 grads[i][2] = cgrads[szInc + j][2] *
coefficients(j, i);
157 double hess[][3][3])
const
162 double chess[1331][3][3];
165 for(
int i = 0; i < szInc; ++i) {
166 for(
int k = 0; k < 3; ++k) {
167 for(
int l = 0; l < 3; ++l) { hess[i][k][l] = chess[i][k][l]; }
170 for(
int k = 0; k < 3; ++k) {
171 for(
int l = 0; l < 3; ++l) {
172 hess[i][k][l] = chess[szInc + j][k][l] *
coefficients(j, i);
181 double third[][3][3][3])
const
186 double cthird[1331][3][3][3];
189 for(
int i = 0; i < szInc; ++i) {
190 for(
int k = 0; k < 3; ++k) {
191 for(
int l = 0; l < 3; ++l) {
192 for(
int m = 0; m < 3; ++m) { third[i][k][l][m] = cthird[i][k][l][m]; }
196 for(
int k = 0; k < 3; ++k) {
197 for(
int l = 0; l < 3; ++l) {
198 for(
int m = 0; m < 3; ++m) {