Commit Graph

23 Commits

Author SHA1 Message Date
czeidler cf5eb5dda1 Add a LinearSpec listener interface. 2012-09-01 16:31:14 +12:00
Alex Wilson c8b24e3eb5 Fix BALMLayout archiving issues.
SharedSolver was archiving too many constraints, partly because of
multiple typos, also because it archived some which were just artifacts
of the layout process. These extra constraints are created when the
layout calls SetRange() on the left/top/right/bottom tabs during layout.

* LinearSpec/ActiveSetSolver had to be adjusted to get access to the
  constraints added by the SetRange() calls.
* BALM::TabBase was adjusted to avoid a segfault during unarchiving,
  caused by an unitialized member.
* ALMFriendLayoutTest was adjusted to include a more obvious custom
  constraint for testing.
2012-05-03 08:45:44 +12:00
Alex Wilson 419fe0b8ae Introduce SharedSolver class to improve BALMLayout's friend feature. 2012-05-03 08:45:02 +12:00
Alex Wilson 7c3800078e Make LinearProgramming::LinearSpec BReferenceable. 2012-05-03 08:44:53 +12:00
Clemens Zeidler ef93b55df4 - Areas with same tabs are put in a column/row automtically. Move preferred size constraint from Area to the column/row. This avoids a "spring" effect of the
quadratic solver if multiple Areas are in the same column/row.
- Replace GetString by ToString.
- some clean up



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40941 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-03-14 00:24:12 +00:00
Clemens Zeidler 8286779101 Make kp_solve interface work again.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40384 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-02-08 09:01:11 +00:00
Clemens Zeidler a0ad88e002 Fix min/ max calculation by removing all soft constraints before doing so. Smaller fixes.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40297 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-01-26 22:06:02 +00:00
Clemens Zeidler 7583db5a1e Add an alternative solver to lp_solve. The solver based on Ingo's active set solver but is able to handle arbitrary hard and soft constraints. The advantage to lp_solve is that the active set solver can optimize variable in respect to a quadratic objective function. This makes it possible to minimise the quadratic derivation to a desired value e.g. \Sum_i(x_i - x_{i,pref})^2 -> min.
The solver part has been refactored in this way that both solver can be used with the same layout specifications. The active set solver is default now; the performance is not as good as lp_solve, though.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40285 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-01-25 04:59:40 +00:00
Clemens Zeidler f108cdbfab Merge all linear programming types in one file an rename them.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39832 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-13 19:23:33 +00:00
Clemens Zeidler 5440f6fee3 Refactor the linear programming class to use a minimal solver interface class and implement the interface for lp_solve. As a result lp_solve is not visible to the outside any more. This interface could be used to use other solvers as well. Rename operator constants to no clash with lp_solve constants.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39829 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-13 18:41:58 +00:00
Clemens Zeidler 067f47a3ee Move lp_solve dependency completely into LinearSpec. Clean up and some more memory allocation checks.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39681 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-11-30 02:08:10 +00:00
Clemens Zeidler c2f0a314a0 Rename ReplaceObjectiveFunction to SwapObjectiveFunction I think this makes it more clear that the old function is not deleted.
Cleanup Jamfile.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38960 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-10-13 05:44:52 +00:00
Clemens Zeidler fc691d7de2 - Remove lp_solve dependencies form Variable class and put everything into LinearSpec. As a side effect Variable management is a bit more consistence now. We want to replace lp_solve soon so it will be easier to replace it just in LinearSpec.
- Update copyrights.
- Lot of small things related to the Variable refactoring.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38892 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-10-05 20:15:55 +00:00
Clemens Zeidler cad0c434c7 Refactor LinearSpec a bit, make it more difficult to leak the objective function.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38888 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-10-04 22:27:02 +00:00
Clemens Zeidler cd88ee006d More cleanup and BList -> BObjectList.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38742 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-09-20 06:26:32 +00:00
Clemens Zeidler 601eded950 - Hide constraint header in Area file.
- Start to replace BList with BObjectList.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38741 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-09-20 06:09:19 +00:00
Clemens Zeidler 4403274117 Some clean up (not complete).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38736 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-09-20 04:23:27 +00:00
Clemens Zeidler 416aca7ac9 Fix some memory leaks.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38735 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-09-20 03:45:04 +00:00
Stephan Aßmus b8ec67f491 * Simplified and optimized a lot the "ToString()" debugging facilities.
* *::Index() is now const, thanks to the BList improvements.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34521 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-06 13:14:45 +00:00
Axel Dörfler 676ef01ba7 * Applied patch by Hong Yul Yang to update linprog.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33609 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-16 12:13:07 +00:00
Ingo Weinhold 5bced18eab ALM/linprog patch by Christof Lutteroth:
* Got rid of class ObjFunctionSummand. Both the constraint summands and
  the objective function summands are now stored using class Summand.
* Some method names are more BeOS compliant now: SetX instead of ChangeX.
* linprog test code now uses new AddConstraint methods.
* CalculateMinSize and CalculateMaxSize did not free the memory they
  allocated.
* Removed inappropriate setter and getter methods.
* Memory allocated in class Constraint is freed now.
* Other small changes.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24351 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-03-10 21:43:32 +00:00
Ingo Weinhold 0306945545 Patch by Christof Lutteroth:
* copyright headers for the files of the libraries linprog and alm
* new class Summand for representing summands in a linear constraint
* merged class SoftConstraint into class Constraint; Constraint now
  supports both soft and hard constraint functionality
* new AddConstraint methods in class LinearSpec for directly setting
  constraints with 1 to 4 summands
* code cleanups by using aforementioned AddConstraint methods
* a new very simple test application for alm
* some style corrections


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24108 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-25 01:54:05 +00:00
Ingo Weinhold a101e99aad Added libalm.so and its dependency liblinprog.so. libalm.so provides a
BLayout implementation (BALMLayout) using the Auckland Layout Model
(ALM). The original ALM was implemented by Christof Lutteroth, the
Haiku/C++ version by James Kim.
The code needs some review, but the test programs seem to work fine.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23889 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-06 10:51:44 +00:00