Changes between Version 2 and Version 3 of WikiStart


Ignore:
Timestamp:
May 4, 2015 4:30:39 PM (5 years ago)
Author:
onurcel
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • WikiStart

    v2 v3  
    11= Welcome to Rehearse, algebraic modeling library in C±± =
    22
    3 Trac is a '''minimalistic''' approach to '''web-based''' management of
    4 '''software projects'''. Its goal is to simplify effective tracking and handling of software issues, enhancements and overall progress.
    53
    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 
     6Rehearse is a C++ library designed to describe linear optimization problems programmatically.
    107
    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 web-browser. 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 
     9You can describe linear objectives and constraints using native C++ algebraic expressions, in a similar way you write a mathematical model on a paper.
    1610
    17 "[wiki:TracAdmin trac-admin] ''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 contains
    20 [wiki:TracGuide documentation] to help you get started with your project.
     11 
     12=== Usage : ===
     13
     14First declare your variables :
    2115
    22 You can use [wiki:TracAdmin trac-admin] 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 }}}
     20That's it! Now you are ready to use them in algebraic expressions.
     21
     22 
     23For example, to set the objective :
     24
     25 {{{model.setObjective ( 7 * x1 + 9 * x2 );}}}
     26and 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 }}}
     34Then 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 
     37The 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 }}}
    2564
    2665
    27 TracGuide is a good place to start.
     66== Getting started ==
     67You can obtain Rehearse source code from  [https://github.com/coin-or/Rehearse github]. 
    2868
    29 Enjoy! [[BR]]
    30 ''The Trac Team''
     69The following commands may be used to obtain and build Rehearse from the source code using git:
     70 1. {{{ git clone https://github.com/coin-or/Rehearse.git coin-Rehearse }}}
     71 1. {{{ cd coin-Rehearse }}}
     72 1. {{{ ./download_dependencies.sh }}}
     73 1. {{{ ./configure }}}
     74 1. {{{ make }}}
     75 1. {{{ make test }}}
     76 1. {{{ make install }}}
    3177
    32 == Starting Points ==
    3378
    34  * TracGuide --  Built-in 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 ==
     80To join the Rehearse mailing list, register at 
     81    http://list.coin-or.org/mailman/listinfo/Rehearse
    3882
    39 For a complete list of local wiki pages, see TitleIndex.
     83To send a mail to the list use rehearse@list.coin-or.org
     84
     85== Reporting a bug ==
     86You can use the Rehearse-ticket mailing list to report a bug or suggest a new feature :
     87        http://list.coin-or.org/mailman/listinfo/Rehearse-tickets
     88
     89or create a new ticket directly by following [http://projects.coin-or.org/Rehearse/newticket this link]
     90
     91== Documentation ==
     92 * [https://github.com/coin-or/Rehearse the github README page provides general explanation]
     93 * [https://github.com/coin-or/Rehearse/blob/master/Rehearse/tests/testRehearse.cpp the test file provides a few examples]
     94
     95
     96
     97
     98