lp.dox
changeset 50 72867897fcba
parent 48 a5457a780c34
child 55 edb7d5759e0d
equal deleted inserted replaced
3:012fcce40b9b 4:7713ce582932
    63 
    63 
    64   lp.max();
    64   lp.max();
    65   lp.obj(10 * x1 + 6 * x2);
    65   lp.obj(10 * x1 + 6 * x2);
    66   lp.solve();
    66   lp.solve();
    67 
    67 
    68   cout << "Objective function value: " << lp.primal() << endl;
    68   std::cout << "Objective function value: " << lp.primal() << std::endl;
    69   cout << "x1 = " << lp.primal(x1) << endl;
    69   std::cout << "x1 = " << lp.primal(x1) << std::endl;
    70   cout << "x2 = " << lp.primal(x2) << endl;
    70   std::cout << "x2 = " << lp.primal(x2) << std::endl;
    71 \endcode
    71 \endcode
    72 
    72 
    73 \ref LpBase::Col "Lp::Col" type represents the variables in the LP problems,
    73 \ref LpBase::Col "Lp::Col" type represents the variables in the LP problems,
    74 while \ref LpBase::Row "Lp::Row" represents the constraints. The numerical
    74 while \ref LpBase::Row "Lp::Row" represents the constraints. The numerical
    75 operators can be used to form expressions from columns and dual
    75 operators can be used to form expressions from columns and dual
   108   for (ListDigraph::InArcIt a(g,src); a != INVALID; ++a) o -= f[a];
   108   for (ListDigraph::InArcIt a(g,src); a != INVALID; ++a) o -= f[a];
   109 
   109 
   110   lp.max();
   110   lp.max();
   111   lp.obj(o);
   111   lp.obj(o);
   112   lp.solve();
   112   lp.solve();
       
   113 
       
   114   std::cout << "Max flow value: " << lp.primal() << std::endl;
   113 \endcode
   115 \endcode
   114 
   116 
   115 [TRAILER]
   117 [TRAILER]
   116 */
   118 */
   117 }
   119 }