Changes between Version 2 and Version 3 of WikiStart
 Timestamp:
 May 4, 2015 4:30:39 PM (5 years ago)
Legend:
 Unmodified
 Added
 Removed
 Modified

WikiStart
v2 v3 1 1 = Welcome to Rehearse, algebraic modeling library in C±± = 2 2 3 Trac is a '''minimalistic''' approach to '''webbased''' management of4 '''software projects'''. Its goal is to simplify effective tracking and handling of software issues, enhancements and overall progress.5 3 6 All aspects of Trac have been designed with the single goal to 7 '''help developers write great software''' while '''staying out of the way''' 8 and imposing as little as possible on a team's established process and 9 culture. 4 == Introduction == 5 6 Rehearse is a C++ library designed to describe linear optimization problems programmatically. 10 7 11 As all Wiki pages, this page is editable, this means that you can 12 modify the contents of this page simply by using your 13 webbrowser. Simply click on the "Edit this page" link at the bottom 14 of the page. WikiFormatting will give you a detailed description of 15 available Wiki formatting commands. 8 9 You can describe linear objectives and constraints using native C++ algebraic expressions, in a similar way you write a mathematical model on a paper. 16 10 17 "[wiki:TracAdmin tracadmin] ''yourenvdir'' initenv" created 18 a new Trac environment, containing a default set of wiki pages and some sample 19 data. This newly created environment also contains20 [wiki:TracGuide documentation] to help you get started with your project. 11 12 === Usage : === 13 14 First declare your variables : 21 15 22 You can use [wiki:TracAdmin tracadmin] to configure 23 [http://trac.edgewall.org/ Trac] to better fit your project, especially in 24 regard to ''components'', ''versions'' and ''milestones''. 16 {{{#!c++ 17 CelNumVar x1; 18 CelNumVar x2; 19 }}} 20 That's it! Now you are ready to use them in algebraic expressions. 21 22 23 For example, to set the objective : 24 25 {{{model.setObjective ( 7 * x1 + 9 * x2 );}}} 26 and to add constraints : 27 28 {{{ 29 model.addConstraint( 1 * x1 + x2 == 18 ); 30 model.addConstraint( x2 <= 14 ); 31 model.addConstraint( 2 * x1 + 3 * x2 <= 50 ); 32 33 }}} 34 Then the solver will try to find values for {{{x1}}} and {{{x2}}} which give the biggest value for {{{7*x1 + 9*x2}}}, subject to constraints we described. 35 36 37 The complete example: 38 39 {{{ 40 void exemple1(){ 41 OsiClpSolverInterface solver; 42 CelModel model(solver); 43 44 CelNumVar x1; 45 CelNumVar x2; 46 47 model.setObjective ( 7 * x1 + 9 * x2 ); 48 49 model.addConstraint( 1 * x1 + x2 == 18 ); 50 model.addConstraint( x2 <= 14 ); 51 model.addConstraint( 2 * x1 + 3 * x2 <= 50 ); 52 53 solver.setObjSense(1.0); 54 model.builderToSolver(); 55 solver.setLogLevel(0); 56 solver.initialSolve(); 57 58 printf("Solution for x1 : %g\n", model.getSolutionValue(x1)); 59 printf("Solution for x2 : %g\n", model.getSolutionValue(x2)); 60 printf("Solution objective value = : %g\n", solver.getObjValue()); 61 62 } 63 }}} 25 64 26 65 27 TracGuide is a good place to start. 66 == Getting started == 67 You can obtain Rehearse source code from [https://github.com/coinor/Rehearse github]. 28 68 29 Enjoy! [[BR]] 30 ''The Trac Team'' 69 The following commands may be used to obtain and build Rehearse from the source code using git: 70 1. {{{ git clone https://github.com/coinor/Rehearse.git coinRehearse }}} 71 1. {{{ cd coinRehearse }}} 72 1. {{{ ./download_dependencies.sh }}} 73 1. {{{ ./configure }}} 74 1. {{{ make }}} 75 1. {{{ make test }}} 76 1. {{{ make install }}} 31 77 32 == Starting Points ==33 78 34 * TracGuide  Builtin Documentation 35 * [http://trac.edgewall.org/ The Trac project]  Trac Open Source Project 36 * [http://trac.edgewall.org/wiki/TracFaq Trac FAQ]  Frequently Asked Questions 37 * TracSupport  Trac Support 79 == Mailing list == 80 To join the Rehearse mailing list, register at 81 http://list.coinor.org/mailman/listinfo/Rehearse 38 82 39 For a complete list of local wiki pages, see TitleIndex. 83 To send a mail to the list use rehearse@list.coinor.org 84 85 == Reporting a bug == 86 You can use the Rehearseticket mailing list to report a bug or suggest a new feature : 87 http://list.coinor.org/mailman/listinfo/Rehearsetickets 88 89 or create a new ticket directly by following [http://projects.coinor.org/Rehearse/newticket this link] 90 91 == Documentation == 92 * [https://github.com/coinor/Rehearse the github README page provides general explanation] 93 * [https://github.com/coinor/Rehearse/blob/master/Rehearse/tests/testRehearse.cpp the test file provides a few examples] 94 95 96 97 98