MCPcopy Create free account
hub / github.com/Singular/Singular / RC

Method RC

kernel/numeric/mpr_base.cc:1237–1406  ·  view source on GitHub ↗

mprSTICKYPROT ST_SPARSE_RC: point added

Source from the content-addressed store, hash-verified

1235// mprSTICKYPROT
1236// ST_SPARSE_RC: point added
1237int resMatrixSparse::RC( pointSet **pQ, pointSet *E, int vert, mprfloat shift[] )
1238{
1239 int i, j, k,c ;
1240 int size;
1241 bool found= true;
1242 mprfloat cd;
1243 int onum;
1244 int bucket[MAXVARS+2];
1245 setID *optSum;
1246
1247 LP->n = 1;
1248 LP->m = n + n + 1; // number of constrains
1249
1250 // fill in LP matrix
1251 for ( i= 0; i <= n; i++ )
1252 {
1253 size= pQ[i]->num;
1254 for ( k= 1; k <= size; k++ )
1255 {
1256 LP->n++;
1257
1258 // objective function, minimize
1259 LP->LiPM[1][LP->n] = - ( (mprfloat) (*pQ[i])[k]->point[pQ[i]->dim] / SCALEDOWN );
1260
1261 // lambdas sum up to 1
1262 for ( j = 0; j <= n; j++ )
1263 {
1264 if ( i==j )
1265 LP->LiPM[j+2][LP->n] = -1.0;
1266 else
1267 LP->LiPM[j+2][LP->n] = 0.0;
1268 }
1269
1270 // the points
1271 for ( j = 1; j <= n; j++ )
1272 {
1273 LP->LiPM[j+n+2][LP->n] = - ( (mprfloat) (*pQ[i])[k]->point[j] );
1274 }
1275 }
1276 }
1277
1278 for ( j = 0; j <= n; j++ ) LP->LiPM[j+2][1] = 1.0;
1279 for ( j= 1; j <= n; j++ )
1280 {
1281 LP->LiPM[j+n+2][1]= (mprfloat)(*E)[vert]->point[j] - shift[j];
1282 }
1283 LP->n--;
1284
1285 LP->LiPM[1][1] = 0.0;
1286
1287#ifdef mprDEBUG_ALL
1288 PrintLn();
1289 Print(" n= %d, LP->m=M= %d, LP->n=N= %d\n",n,LP->m,LP->n);
1290 print_mat(LP->LiPM, LP->m+1, LP->n+1);
1291#endif
1292
1293 LP->m3= LP->m;
1294

Callers

nothing calls this directly

Calls 9

print_matFunction · 0.85
print_bmatFunction · 0.85
PrintSFunction · 0.85
WerrorFunction · 0.85
WerrorSFunction · 0.85
print_expFunction · 0.85
computeMethod · 0.80
PrintLnFunction · 0.50
PrintFunction · 0.50

Tested by

no test coverage detected