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

Function loSimplex

Singular/ipshell.cc:4564–4648  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4562}
4563
4564BOOLEAN loSimplex( leftv res, leftv args )
4565{
4566 if ( !(rField_is_long_R(currRing)) )
4567 {
4568 WerrorS("Ground field not implemented!");
4569 return TRUE;
4570 }
4571
4572 simplex * LP;
4573 matrix m;
4574
4575 leftv v= args;
4576 if ( v->Typ() != MATRIX_CMD ) // 1: matrix
4577 return TRUE;
4578 else
4579 m= (matrix)(v->CopyD());
4580
4581 LP = new simplex(MATROWS(m),MATCOLS(m));
4582 LP->mapFromMatrix(m);
4583
4584 v= v->next;
4585 if ( v->Typ() != INT_CMD ) // 2: m = number of constraints
4586 return TRUE;
4587 else
4588 LP->m= (int)(long)(v->Data());
4589
4590 v= v->next;
4591 if ( v->Typ() != INT_CMD ) // 3: n = number of variables
4592 return TRUE;
4593 else
4594 LP->n= (int)(long)(v->Data());
4595
4596 v= v->next;
4597 if ( v->Typ() != INT_CMD ) // 4: m1 = number of <= constraints
4598 return TRUE;
4599 else
4600 LP->m1= (int)(long)(v->Data());
4601
4602 v= v->next;
4603 if ( v->Typ() != INT_CMD ) // 5: m2 = number of >= constraints
4604 return TRUE;
4605 else
4606 LP->m2= (int)(long)(v->Data());
4607
4608 v= v->next;
4609 if ( v->Typ() != INT_CMD ) // 6: m3 = number of == constraints
4610 return TRUE;
4611 else
4612 LP->m3= (int)(long)(v->Data());
4613
4614#ifdef mprDEBUG_PROT
4615 Print("m (constraints) %d\n",LP->m);
4616 Print("n (columns) %d\n",LP->n);
4617 Print("m1 (<=) %d\n",LP->m1);
4618 Print("m2 (>=) %d\n",LP->m2);
4619 Print("m3 (==) %d\n",LP->m3);
4620#endif
4621

Callers

nothing calls this directly

Calls 12

rField_is_long_RFunction · 0.85
WerrorSFunction · 0.85
mapFromMatrixMethod · 0.80
computeMethod · 0.80
mapToMatrixMethod · 0.80
posvToIVMethod · 0.80
zrovToIVMethod · 0.80
PrintFunction · 0.50
TypMethod · 0.45
CopyDMethod · 0.45
DataMethod · 0.45
InitMethod · 0.45

Tested by

no test coverage detected