Re: [ojAlgo-user] IntegerSolver issue
Mathematics, linear algebra and optimisation
Brought to you by:
apete
From: Simon G. <si...@ya...> - 2012-07-23 18:03:49
|
I have read de javadoc for ExpressionsBasedModel, my problem is when I try to build the ExpressionsBasedModel in the same way as in the example in http://ojalgo.cvs.sourceforge.net/viewvc/ojalgo/TestProj/src/org/ojalgo/optimisation/integer/ using: ExpressionsBasedModel ebm=new ExpressionsBasedModel(tmpVariables); (tmpVariables is of the type Variable[]) I get an error saying ExpressionsBasedModel is abstract and cannot be instantiated... SG ________________________________ From: Anders Peterson <an...@op...> To: ojAlgo ojAlgo <oja...@li...> Sent: Friday, July 20, 2012 7:03 AM Subject: Re: [ojAlgo-user] IntegerSolver issue You're not the first to ask about ExpressionsBasedModel. That means you should be able to find something useful in the list archives. http://sourceforge.net/mailarchive/forum.php?forum_name=ojalgo-user http://sourceforge.net/search/?group_id=79000&type_of_search=mlists ...and/or you can look at the junit tests for the integer solver: http://ojalgo.cvs.sourceforge.net/viewvc/ojalgo/TestProj/src/org/ojalgo/optimisation/integer/ Did you read the javadoc for ExpressionsBasedModel and Expression? http://ojalgo.org/generated/org/ojalgo/optimisation/ExpressionsBasedModel.html http://ojalgo.org/generated/org/ojalgo/optimisation/Expression.html /Anders On 19 jul 2012, at 23:19, Simon Greaves wrote: > Hi, my name is Simon > I'm trying to use the integer solver in OjAlgo, but I don't understand how to use it. The builder seems to require an ExpressionsBasedModel, which in itself requires a Variable vector. Can you help me out with this? Or point me to an example or documentation regarding this? > > I'm solving > > min -[X]T[P] / [C]T[X] > and [C]T[X] <= maxCost > > Where [X] is an integer vector > [P] is a vector of real values > [C] is a vector of real values > maxCost is a real value > > That is, I want X to maximize [X]T[P] and minimize [C]T[X] while remaining under maxCost > > > > > > > I've used the Quadratic solver before, this is how I used it: > > final QuadraticSolver.Builder tmpBuilder = new QuadraticSolver.Builder(tmpQ, tmpC).equalities(tmpAE, tmpBE).inequalities(tmpAI, tmpBI); > final QuadraticSolver tmpSolver = tmpBuilder.build(); > final OptimisationSolver.Result tmpResult = tmpSolver.solve(); > final BasicMatrix tmpSolution = tmpResult.getSolution(); > > Where I built the MatrixStore objects using: > final MatrixStore<Double> tmpQ = PrimitiveDenseStore.FACTORY.copy(Q); > for example... > > > Thanks a lot for any help! > > S > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/_______________________________________________ > ojAlgo-user mailing list > ojA...@li... > https://lists.sourceforge.net/lists/listinfo/ojalgo-user ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ ojAlgo-user mailing list ojA...@li... https://lists.sourceforge.net/lists/listinfo/ojalgo-user |